diff mbox series

[3/3] drm/i915: Replace the HAS_DDI() in intel_crtc_scanline_offset() with specific platform checks

Message ID 20250207215406.19348-4-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Fix scanline_offset for LNL+/BMG+ | expand

Commit Message

Ville Syrjala Feb. 7, 2025, 9:54 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The HDMI vs. not scanline offset stuff no longer applies to the
latest platforms, so using HAS_DDI() is a bit confusing. Replace
with a more specific set of conditions.

Also let's just deal with the platform types in the if ladder
itself, and handle the HDMI vs. not within the specific branch
for those platforms.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_vblank.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Hogander, Jouni Feb. 20, 2025, 9:58 a.m. UTC | #1
On Fri, 2025-02-07 at 23:54 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The HDMI vs. not scanline offset stuff no longer applies to the
> latest platforms, so using HAS_DDI() is a bit confusing. Replace
> with a more specific set of conditions.
> 
> Also let's just deal with the platform types in the if ladder
> itself, and handle the HDMI vs. not within the specific branch
> for those platforms.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_vblank.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c
> b/drivers/gpu/drm/i915/display/intel_vblank.c
> index dd928d890e3a..139fa5deba80 100644
> --- a/drivers/gpu/drm/i915/display/intel_vblank.c
> +++ b/drivers/gpu/drm/i915/display/intel_vblank.c
> @@ -224,8 +224,9 @@ int intel_crtc_scanline_offset(const struct
> intel_crtc_state *crtc_state)
>  	 */
>  	if (DISPLAY_VER(display) >= 20 || display-
> >platform.battlemage)
>  		return 1;
> -	else if (HAS_DDI(display) && intel_crtc_has_type(crtc_state,
> INTEL_OUTPUT_HDMI))
> -		return 2;
> +	else if (DISPLAY_VER(display) >= 9 ||
> +		 display->platform.broadwell || display-
> >platform.haswell)
> +		return intel_crtc_has_type(crtc_state,
> INTEL_OUTPUT_HDMI) ? 2 : 1;
>  	else if (DISPLAY_VER(display) >= 3)
>  		return 1;
>  	else
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c
index dd928d890e3a..139fa5deba80 100644
--- a/drivers/gpu/drm/i915/display/intel_vblank.c
+++ b/drivers/gpu/drm/i915/display/intel_vblank.c
@@ -224,8 +224,9 @@  int intel_crtc_scanline_offset(const struct intel_crtc_state *crtc_state)
 	 */
 	if (DISPLAY_VER(display) >= 20 || display->platform.battlemage)
 		return 1;
-	else if (HAS_DDI(display) && intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI))
-		return 2;
+	else if (DISPLAY_VER(display) >= 9 ||
+		 display->platform.broadwell || display->platform.haswell)
+		return intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI) ? 2 : 1;
 	else if (DISPLAY_VER(display) >= 3)
 		return 1;
 	else