[PATCH 2/8] drm/i915/display: Drop unnecessary calls to intel_panel_fixed_mode()
José Roberto de Souza
jose.souza at intel.com
Fri Mar 25 20:18:44 UTC 2022
No need to call intel_panel_fixed_mode() to get the fixed_mode then
pass it as parameter to intel_panel_compute_config() as it will
call again intel_panel_fixed_mode() over the parameter.
And for the intel_sdvo_set_output_timings_from_mode() case, we can use
the adjusted_mode as intel_panel_compute_config() will copy the fixed
mode to adjusted_mode.
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 4 +---
drivers/gpu/drm/i915/display/intel_dvo.c | 14 ++++----------
drivers/gpu/drm/i915/display/intel_sdvo.c | 4 +---
3 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 9e19165fd1758..56fc408b73746 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1799,7 +1799,6 @@ intel_dp_compute_config(struct intel_encoder *encoder,
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
- const struct drm_display_mode *fixed_mode;
enum port port = encoder->port;
struct intel_connector *intel_connector = intel_dp->attached_connector;
struct intel_digital_connector_state *intel_conn_state =
@@ -1826,8 +1825,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
else
pipe_config->has_audio = intel_conn_state->force_audio == HDMI_AUDIO_ON;
- fixed_mode = intel_panel_fixed_mode(intel_connector, adjusted_mode);
- if (intel_dp_is_edp(intel_dp) && fixed_mode) {
+ if (intel_dp_is_edp(intel_dp)) {
ret = intel_panel_compute_config(intel_connector, adjusted_mode);
if (ret)
return ret;
diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c
index d4670889d26c4..cde436e069850 100644
--- a/drivers/gpu/drm/i915/display/intel_dvo.c
+++ b/drivers/gpu/drm/i915/display/intel_dvo.c
@@ -255,11 +255,9 @@ static int intel_dvo_compute_config(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config,
struct drm_connector_state *conn_state)
{
- struct intel_dvo *intel_dvo = enc_to_dvo(encoder);
struct intel_connector *connector = to_intel_connector(conn_state->connector);
struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
- const struct drm_display_mode *fixed_mode =
- intel_panel_fixed_mode(intel_dvo->attached_connector, adjusted_mode);
+ int ret;
/*
* If we have timings from the BIOS for the panel, put them in
@@ -267,13 +265,9 @@ static int intel_dvo_compute_config(struct intel_encoder *encoder,
* with the panel scaling set up to source from the H/VDisplay
* of the original mode.
*/
- if (fixed_mode) {
- int ret;
-
- ret = intel_panel_compute_config(connector, adjusted_mode);
- if (ret)
- return ret;
- }
+ ret = intel_panel_compute_config(connector, adjusted_mode);
+ if (ret)
+ return ret;
if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)
return -EINVAL;
diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
index 328a8f20c63bf..62170f2118ada 100644
--- a/drivers/gpu/drm/i915/display/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
@@ -1331,8 +1331,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
adjusted_mode);
pipe_config->sdvo_tv_clock = true;
} else if (IS_LVDS(intel_sdvo_connector)) {
- const struct drm_display_mode *fixed_mode =
- intel_panel_fixed_mode(&intel_sdvo_connector->base, mode);
int ret;
ret = intel_panel_compute_config(&intel_sdvo_connector->base,
@@ -1340,7 +1338,7 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
if (ret)
return ret;
- if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, fixed_mode))
+ if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, adjusted_mode))
return -EINVAL;
(void) intel_sdvo_get_preferred_input_mode(intel_sdvo,
--
2.35.1
More information about the Intel-gfx-trybot
mailing list