Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jouni Högander" <jouni.hogander@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: ville.syrjala@linux.intel.com,
	"Jouni Högander" <jouni.hogander@intel.com>
Subject: [PATCH 2/2] drm/i915/display: Fix Panel Replay vblank enable workaround
Date: Mon, 30 Sep 2024 09:47:52 +0300	[thread overview]
Message-ID: <20240930064752.1602148-2-jouni.hogander@intel.com> (raw)
In-Reply-To: <20240930064752.1602148-1-jouni.hogander@intel.com>

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(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c
index d71f4b0ee7357..728605b99e77e 100644
--- a/drivers/gpu/drm/i915/display/intel_display_irq.c
+++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
@@ -1388,7 +1388,7 @@ int bdw_enable_vblank(struct drm_crtc *_crtc)
 	if (gen11_dsi_configure_te(crtc, true))
 		return 0;
 
-	if (display->irq.vblank_wa_pipes++ == 0 && crtc->block_dc_for_vblank)
+	if (crtc->block_dc_for_vblank && display->irq.vblank_wa_pipes++ == 0)
 		schedule_work(&display->irq.vblank_dc_work);
 
 	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
@@ -1468,7 +1468,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_pipes == 0 && crtc->block_dc_for_vblank)
+	if (crtc->block_dc_for_vblank && --display->irq.vblank_wa_pipes == 0)
 		schedule_work(&display->irq.vblank_dc_work);
 }
 
-- 
2.34.1


  reply	other threads:[~2024-09-30  6:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30  6:47 [PATCH 1/2] drm/i915/display: Add own counter for Panel Replay vblank workaround Jouni Högander
2024-09-30  6:47 ` Jouni Högander [this message]
2024-09-30  8:04 ` Jani Nikula
2024-09-30  9:28 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/2] " Patchwork
2024-09-30  9:38 ` ✓ Fi.CI.BAT: success " Patchwork
2024-09-30 13:26 ` ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240930064752.1602148-2-jouni.hogander@intel.com \
    --to=jouni.hogander@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox