diff mbox series

[v2,2/2] drm/i915/display: Fix Panel Replay vblank enable workaround

Message ID 20241009134225.1322820-2-jouni.hogander@intel.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] drm/i915/display: Add own counter for Panel Replay vblank workaround | expand

Commit Message

Hogander, Jouni Oct. 9, 2024, 1:42 p.m. UTC
Currently workaround is not applied when vblank is enabled on crtc that
needs the workaround if vblank is already enabled for another crtc that
doesn't need the workaround. Fix this by increasing counter only if crtc
needs the workaround.

Fixes: aa451abcffb5 ("drm/i915/display: Prevent DC6 while vblank is enabled for Panel Replay")
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_irq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Cavitt, Jonathan Oct. 9, 2024, 2:41 p.m. UTC | #1
-----Original Message-----
From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Jouni Högander
Sent: Wednesday, October 9, 2024 6:42 AM
To: intel-gfx@lists.freedesktop.org
Cc: ville.syrjala@linux.intel.com; jani.nikula@linux.intel.com; Hogander, Jouni <jouni.hogander@intel.com>
Subject: [PATCH v2 2/2] drm/i915/display: Fix Panel Replay vblank enable workaround
> 
> Currently workaround is not applied when vblank is enabled on crtc that
> needs the workaround if vblank is already enabled for another crtc that
> doesn't need the workaround. Fix this by increasing counter only if crtc
> needs the workaround.
> 
> Fixes: aa451abcffb5 ("drm/i915/display: Prevent DC6 while vblank is enabled for Panel Replay")
> Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

LGTM.

Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
-Jonathan Cavitt

> ---
>  drivers/gpu/drm/i915/display/intel_display_irq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c
> index 8226ea218d77..263fe3be891c 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_irq.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
> @@ -1447,7 +1447,7 @@ int bdw_enable_vblank(struct drm_crtc *_crtc)
>  	if (gen11_dsi_configure_te(crtc, true))
>  		return 0;
>  
> -	if (display->irq.vblank_wa_num_pipes++ == 0 && crtc->block_dc_for_vblank)
> +	if (crtc->block_dc_for_vblank && display->irq.vblank_wa_num_pipes++ == 0)
>  		schedule_work(&display->irq.vblank_dc_work);
>  
>  	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
> @@ -1478,7 +1478,7 @@ void bdw_disable_vblank(struct drm_crtc *_crtc)
>  	bdw_disable_pipe_irq(dev_priv, pipe, GEN8_PIPE_VBLANK);
>  	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
>  
> -	if (--display->irq.vblank_wa_num_pipes == 0 && crtc->block_dc_for_vblank)
> +	if (crtc->block_dc_for_vblank && --display->irq.vblank_wa_num_pipes == 0)
>  		schedule_work(&display->irq.vblank_dc_work);
>  }
>  
> -- 
> 2.34.1
> 
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c
index 8226ea218d77..263fe3be891c 100644
--- a/drivers/gpu/drm/i915/display/intel_display_irq.c
+++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
@@ -1447,7 +1447,7 @@  int bdw_enable_vblank(struct drm_crtc *_crtc)
 	if (gen11_dsi_configure_te(crtc, true))
 		return 0;
 
-	if (display->irq.vblank_wa_num_pipes++ == 0 && crtc->block_dc_for_vblank)
+	if (crtc->block_dc_for_vblank && display->irq.vblank_wa_num_pipes++ == 0)
 		schedule_work(&display->irq.vblank_dc_work);
 
 	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
@@ -1478,7 +1478,7 @@  void bdw_disable_vblank(struct drm_crtc *_crtc)
 	bdw_disable_pipe_irq(dev_priv, pipe, GEN8_PIPE_VBLANK);
 	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
 
-	if (--display->irq.vblank_wa_num_pipes == 0 && crtc->block_dc_for_vblank)
+	if (crtc->block_dc_for_vblank && --display->irq.vblank_wa_num_pipes == 0)
 		schedule_work(&display->irq.vblank_dc_work);
 }