[PATCH 47/76] drm/amd/dal: remove dal_adapter_service_should_optimize

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tony Cheng <tony.cheng@xxxxxxx>

- remove runtime_flags.  only flag used is SKIP_POWER_DOWN_ON_RESUME and = 1 for all platform
- remove optimization_feature.  optimization are default behavior

Signed-off-by: Tony Cheng <tony.cheng at amd.com>
Acked-by: Harry Wentland <harry.wentland at amd.com>
---
 drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c      |  5 --
 .../gpu/drm/amd/dal/dc/adapter/adapter_service.c   | 56 ----------------------
 .../amd/dal/dc/asic_capability/asic_capability.c   |  1 -
 drivers/gpu/drm/amd/dal/dc/core/dc.c               |  1 -
 drivers/gpu/drm/amd/dal/dc/dc_types.h              | 26 ----------
 drivers/gpu/drm/amd/dal/dc/dce/dce_link_encoder.c  |  6 +--
 .../amd/dal/include/adapter_service_interface.h    |  3 --
 .../amd/dal/include/asic_capability_interface.h    |  1 -
 .../drm/amd/dal/include/grph_object_ctrl_defs.h    | 30 ------------
 9 files changed, 2 insertions(+), 127 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c
index f667620e30e9..9a65b978d07a 100644
--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c
@@ -280,11 +280,6 @@ int amdgpu_dm_init(struct amdgpu_device *adev)
 	/* TODO: initialize init_data.asic_id.vram_type here!!!! */
 	init_data.asic_id.atombios_base_address =
 		adev->mode_info.atom_context->bios;
-	init_data.asic_id.runtime_flags.flags.bits.SKIP_POWER_DOWN_ON_RESUME = 1;
-
-	if ((adev->asic_type == CHIP_CARRIZO) ||
-	    (adev->asic_type == CHIP_STONEY))
-		init_data.asic_id.runtime_flags.flags.bits.GNB_WAKEUP_SUPPORTED = 1;
 
 	init_data.driver = adev;
 
diff --git a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
index 6034c7416ac0..a6e0763c21e5 100644
--- a/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
+++ b/drivers/gpu/drm/amd/dal/dc/adapter/adapter_service.c
@@ -627,12 +627,6 @@ void dal_adapter_service_destroy(
 	*as = NULL;
 }
 
-struct dal_asic_runtime_flags dal_adapter_service_get_asic_runtime_flags(
-		struct adapter_service *as)
-{
-	return as->asic_cap->runtime_flags;
-}
-
 /*
  * dal_adapter_service_get_feature_value
  *
@@ -688,53 +682,3 @@ bool dal_adapter_service_get_feature_value(struct adapter_service *as,
 	return true;
 }
 
-/*
- * dal_adapter_service_should_optimize
- *
- * @brief Reports whether driver settings allow requested optimization
- *
- * @param
- * as: adapter service handler
- * feature: for which optimization is validated
- *
- * @return
- * true if requested feature can be optimized
- */
-bool dal_adapter_service_should_optimize(
-		struct adapter_service *as, enum optimization_feature feature)
-{
-	uint32_t supported_optimization = 0;
-	struct dal_asic_runtime_flags flags;
-	struct dc_bios *bp = as->ctx->dc_bios;
-
-	if (!dal_adapter_service_get_feature_value(as, FEATURE_OPTIMIZATION,
-			&supported_optimization, sizeof(uint32_t)))
-		return false;
-
-	/* Retrieve ASIC runtime flags */
-	flags = dal_adapter_service_get_asic_runtime_flags(as);
-
-	/* Check runtime flags against different optimization features */
-	switch (feature) {
-	case OF_SKIP_HW_PROGRAMMING_ON_ENABLED_EMBEDDED_DISPLAY:
-		if (!flags.flags.bits.OPTIMIZED_DISPLAY_PROGRAMMING_ON_BOOT)
-			return false;
-		break;
-
-	case OF_SKIP_RESET_OF_ALL_HW_ON_S3RESUME:
-		if (bp->integrated_info == NULL ||
-				!flags.flags.bits.SKIP_POWER_DOWN_ON_RESUME)
-			return false;
-		break;
-	case OF_SKIP_POWER_DOWN_INACTIVE_ENCODER:
-		if (!dal_adapter_service_get_asic_runtime_flags(as).flags.bits.
-			SKIP_POWER_DOWN_ON_RESUME)
-			return false;
-		break;
-	default:
-		break;
-	}
-
-	return (supported_optimization & feature) != 0;
-}
-
diff --git a/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c b/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c
index 5d50455ca0d8..89dd74675ba9 100644
--- a/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c
+++ b/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c
@@ -54,7 +54,6 @@ static bool construct(
 	memset(cap->data, 0, sizeof(cap->data));
 
 	/* ASIC data */
-	cap->runtime_flags = init->runtime_flags;
 	cap->data[ASIC_DATA_MAX_UNDERSCAN_PERCENTAGE] = 10;
 	cap->data[ASIC_DATA_VIEWPORT_PIXEL_GRANULARITY] = 4;
 	cap->data[ASIC_DATA_DOWNSCALE_LIMIT] = 200;
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index d7721c218017..4e1a9383ebcb 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -181,7 +181,6 @@ static struct adapter_service *create_as(
 	init_data.hw_init_data.fake_paths_num = init->asic_id.fake_paths_num;
 	init_data.hw_init_data.feature_flags = init->asic_id.feature_flags;
 	init_data.hw_init_data.hw_internal_rev = init->asic_id.hw_internal_rev;
-	init_data.hw_init_data.runtime_flags = init->asic_id.runtime_flags;
 	init_data.hw_init_data.vram_width = init->asic_id.vram_width;
 	init_data.hw_init_data.vram_type = init->asic_id.vram_type;
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dc_types.h b/drivers/gpu/drm/amd/dal/dc/dc_types.h
index 933fa668da1b..fb8d094429bc 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_types.h
@@ -61,31 +61,6 @@ enum dce_environment {
 #define IS_DIAG_DC(dce_environment) \
 	(IS_FPGA_MAXIMUS_DC(dce_environment) || (dce_environment == DCE_ENV_DIAG))
 
-/********************************/
-/*
- * ASIC Runtime Flags
- */
-struct dal_asic_runtime_flags {
-	union {
-		uint32_t raw;
-		struct {
-			uint32_t EMULATE_REPLUG_ON_CAP_CHANGE:1;
-			uint32_t SUPPORT_XRBIAS:1;
-			uint32_t SKIP_POWER_DOWN_ON_RESUME:1;
-			uint32_t FULL_DETECT_ON_RESUME:1;
-			uint32_t GSL_FRAMELOCK:1;
-			uint32_t NO_LOW_BPP_MODES:1;
-			uint32_t BLOCK_ON_INITIAL_DETECTION:1;
-			uint32_t OPTIMIZED_DISPLAY_PROGRAMMING_ON_BOOT:1;
-			uint32_t DRIVER_CONTROLLED_BRIGHTNESS:1;
-			uint32_t MODIFIABLE_FRAME_DURATION:1;
-			uint32_t MIRACAST_SUPPORTED:1;
-			uint32_t CONNECTED_STANDBY_SUPPORTED:1;
-			uint32_t GNB_WAKEUP_SUPPORTED:1;
-		} bits;
-	} flags;
-};
-
 struct hw_asic_id {
 	uint32_t chip_id;
 	uint32_t chip_family;
@@ -94,7 +69,6 @@ struct hw_asic_id {
 	uint32_t vram_type;
 	uint32_t vram_width;
 	uint32_t feature_flags;
-	struct dal_asic_runtime_flags runtime_flags;
 	uint32_t fake_paths_num;
 	void *atombios_base_address;
 };
diff --git a/drivers/gpu/drm/amd/dal/dc/dce/dce_link_encoder.c b/drivers/gpu/drm/amd/dal/dc/dce/dce_link_encoder.c
index 1002187b0063..88a775b7c1fb 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce/dce_link_encoder.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce/dce_link_encoder.c
@@ -1359,10 +1359,8 @@ void dce110_link_encoder_disable_output(
 	struct bp_transmitter_control cntl = { 0 };
 	enum bp_result result;
 
-	if (!is_dig_enabled(enc110) && enc110->base.adapter_service &&
-		dal_adapter_service_should_optimize(
-			enc110->base.adapter_service,
-			OF_SKIP_POWER_DOWN_INACTIVE_ENCODER)) {
+	if (!is_dig_enabled(enc110)) {
+		/* OF_SKIP_POWER_DOWN_INACTIVE_ENCODER */
 		return;
 	}
 	/* Power-down RX and disable GPU PHY should be paired.
diff --git a/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h b/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
index 4cc9c6272a06..a88c94d0ef45 100644
--- a/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
+++ b/drivers/gpu/drm/amd/dal/include/adapter_service_interface.h
@@ -328,9 +328,6 @@ bool dal_adapter_service_get_feature_value(struct adapter_service *as,
 	void *data,
 	uint32_t size);
 
-struct dal_asic_runtime_flags dal_adapter_service_get_asic_runtime_flags(
-	struct adapter_service *as);
-
 /* Reports whether driver settings allow requested optimization */
 bool dal_adapter_service_should_optimize(
 		struct adapter_service *as, enum optimization_feature feature);
diff --git a/drivers/gpu/drm/amd/dal/include/asic_capability_interface.h b/drivers/gpu/drm/amd/dal/include/asic_capability_interface.h
index b5335d188c3a..57cc72fdc560 100644
--- a/drivers/gpu/drm/amd/dal/include/asic_capability_interface.h
+++ b/drivers/gpu/drm/amd/dal/include/asic_capability_interface.h
@@ -38,7 +38,6 @@ struct asic_capability {
 	struct asic_caps caps;
 	struct asic_stereo_3d_caps stereo_3d_caps;
 	struct asic_bugs bugs;
-	struct dal_asic_runtime_flags runtime_flags;
 	uint32_t data[ASIC_DATA_MAX_NUMBER];
 };
 
diff --git a/drivers/gpu/drm/amd/dal/include/grph_object_ctrl_defs.h b/drivers/gpu/drm/amd/dal/include/grph_object_ctrl_defs.h
index 10909c33d66e..9c0bf6521dd9 100644
--- a/drivers/gpu/drm/amd/dal/include/grph_object_ctrl_defs.h
+++ b/drivers/gpu/drm/amd/dal/include/grph_object_ctrl_defs.h
@@ -381,36 +381,6 @@ struct bios_event_info {
 	bool backlight_changed;
 };
 
-/* Bitvector and bitfields of possible optimizations
- #IMPORTANT# Keep bitfields match bitvector! */
-enum optimization_feature {
-	/* Don't do HW programming on panels that were enabled by VBIOS */
-	OF_SKIP_HW_PROGRAMMING_ON_ENABLED_EMBEDDED_DISPLAY = 0x1,
-	OF_SKIP_RESET_OF_ALL_HW_ON_S3RESUME = 0x2,
-	OF_SKIP_HW_RESET_OF_EMBEDDED_DISPLAY_ON_S3RESUME = 0x4,
-	OF_SKIP_POWER_UP_VBIOS_ENABLED_ENCODER = 0x8,
-	/* Do not turn off VCC while powering down on boot or resume */
-	OF_KEEP_VCC_DURING_POWER_DOWN_ON_BOOT_OR_RESUME = 0x10,
-	/* Do not turn off VCC while performing SetMode */
-	OF_KEEP_VCC_DURING_SET_MODE = 0x20,
-	OF_DO_NOT_WAIT_FOR_HPD_LOW = 0x40,
-	OF_SKIP_POWER_DOWN_INACTIVE_ENCODER = 0x80
-};
-
-/* Bitvector and bitfields of performance measurements
- #IMPORTANT# Keep bitfields match bitvector! */
-
-enum {
-	PERF_MEASURE_POWERCODE_OFFSET = 0x0,
-	PERF_MEASURE_POWER_CODE_MASK = 0xFF,
-	PERF_MEASURE_POWER_STATE_OFFSET = 8,
-	PERF_MEASURE_POWER_STATE_MASK = 0x000FF00,
-	PERF_MEASURE_PREV_POWER_STATE_OFFSET = 16,
-	PERF_MEASURE_PREV_POWER_STATE_MASK = 0x00FF0000,
-	PERF_MEASURE_DISPLAY_INDEX_OFFSET = 24,
-	PERF_MEASURE_DISPLAY_INDEX_MASK = 0xFF000000
-};
-
 enum {
 	HDMI_PIXEL_CLOCK_IN_KHZ_297 = 297000,
 	TMDS_PIXEL_CLOCK_IN_KHZ_165 = 165000
-- 
2.10.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux