Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arun R Murthy <arun.r.murthy@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Arun R Murthy <arun.r.murthy@intel.com>
Subject: [PATCHv2 4/5] drm/i915/histogram: histogram delay counter doesnt reset
Date: Wed, 21 Aug 2024 15:53:48 +0530	[thread overview]
Message-ID: <20240821102349.3961986-5-arun.r.murthy@intel.com> (raw)
In-Reply-To: <20240821102349.3961986-1-arun.r.murthy@intel.com>

The delay counter for histogram does not reset and as a result the
histogram bin never gets updated. Woraround would be to use save and
restore histogram register.

Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
---
 drivers/gpu/drm/i915/display/intel_histogram.c | 17 +++++++++++++++++
 drivers/gpu/drm/i915/display/intel_histogram.h |  1 +
 2 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_histogram.c b/drivers/gpu/drm/i915/display/intel_histogram.c
index ad4f75607ccb..189f7ccd6df8 100644
--- a/drivers/gpu/drm/i915/display/intel_histogram.c
+++ b/drivers/gpu/drm/i915/display/intel_histogram.c
@@ -36,6 +36,11 @@ static void intel_histogram_handle_int_work(struct work_struct *work)
 	u32 dpstbin;
 	int i, try = 0;
 
+	/* Wa: 14014889975 */
+	if (IS_DISPLAY_VER(i915, 12, 13))
+		intel_de_rmw(i915, DPST_CTL(intel_crtc->pipe),
+			     DPST_CTL_RESTORE, 0);
+
 	/*
 	 * TODO: PSR to be exited while reading the Histogram data
 	 * Set DPST_CTL Bin Reg function select to TC
@@ -77,6 +82,12 @@ static void intel_histogram_handle_int_work(struct work_struct *work)
 			       histogram_event))
 		drm_err(&i915->drm, "sending HISTOGRAM event failed\n");
 
+	/* Wa: 14014889975 */
+	if (IS_DISPLAY_VER(i915, 12, 13))
+		/* Write the value read from DPST_CTL to DPST_CTL.Interrupt Delay Counter(bit 23:16) */
+		intel_de_write(i915, DPST_CTL(intel_crtc->pipe), intel_de_read(i915,
+			       DPST_CTL(intel_crtc->pipe)) | DPST_CTL_RESTORE);
+
 	/* Enable histogram interrupt */
 	intel_de_rmw(i915, DPST_GUARD(intel_crtc->pipe), DPST_GUARD_HIST_INT_EN,
 		     DPST_GUARD_HIST_INT_EN);
@@ -140,6 +151,12 @@ static int intel_histogram_enable(struct intel_crtc *intel_crtc)
 	/* Pipe Dithering should be enabled with GLOBAL_HIST */
 	intel_histogram_enable_dithering(i915, pipe);
 
+	/* Wa: 14014889975 */
+	if (IS_DISPLAY_VER(i915, 12, 13))
+		/* Write the value read from DPST_CTL to DPST_CTL.Interrupt Delay Counter(bit 23:16) */
+		intel_de_write(i915, DPST_CTL(intel_crtc->pipe), intel_de_read(i915,
+			       DPST_CTL(intel_crtc->pipe)) | DPST_CTL_RESTORE);
+
 	/*
 	 * enable DPST_CTL Histogram mode
 	 * Clear DPST_CTL Bin Reg function select to TC
diff --git a/drivers/gpu/drm/i915/display/intel_histogram.h b/drivers/gpu/drm/i915/display/intel_histogram.h
index f35ea76719d8..5e24d3c5c28b 100644
--- a/drivers/gpu/drm/i915/display/intel_histogram.h
+++ b/drivers/gpu/drm/i915/display/intel_histogram.h
@@ -20,6 +20,7 @@ enum pipe;
 #define DPST_CTL_RESTORE				REG_BIT(28)
 #define DPST_CTL_IE_MODI_TABLE_EN			REG_BIT(27)
 #define DPST_CTL_HIST_MODE				REG_BIT(24)
+#define DPST_CTL_GUARDBAND_INTERRUPT_DELAY_CNT		REG_GENMASK(23, 16)
 #define DPST_CTL_ENHANCEMENT_MODE_MASK			REG_GENMASK(14, 13)
 #define DPST_CTL_EN_MULTIPLICATIVE			REG_FIELD_PREP(DPST_CTL_ENHANCEMENT_MODE_MASK, 2)
 #define DPST_CTL_IE_TABLE_VALUE_FORMAT			REG_BIT(15)
-- 
2.25.1


  parent reply	other threads:[~2024-08-21 10:33 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 10:23 [PATCHv2 0/5] Display Global histogram Arun R Murthy
2024-08-21 10:23 ` [PATCHv2 1/5] drm/i915/display: Add support for histogram Arun R Murthy
2024-09-10 12:11   ` Kulkarni, Vandita
2024-09-12  9:08     ` Murthy, Arun R
2024-09-12 10:17       ` Kulkarni, Vandita
2024-09-15 12:47         ` Murthy, Arun R
2024-09-11  5:37   ` Kandpal, Suraj
2024-09-11  9:45     ` Kandpal, Suraj
2024-09-15  4:59     ` Murthy, Arun R
2024-09-12  9:45   ` Jani Nikula
2024-08-21 10:23 ` [PATCHv2 2/5] drm/i915/display: histogram interrupt handling Arun R Murthy
2024-09-11  5:29   ` Kulkarni, Vandita
2024-09-12  9:52     ` Murthy, Arun R
2024-09-12 10:30       ` Kulkarni, Vandita
2024-09-11 10:00   ` Kandpal, Suraj
2024-09-15 14:09     ` Murthy, Arun R
2024-09-12  9:53   ` Jani Nikula
2024-09-17 11:04     ` Murthy, Arun R
2024-08-21 10:23 ` [PATCHv2 3/5] Add crtc properties for global histogram Arun R Murthy
2024-09-03  5:24   ` Kulkarni, Vandita
2024-09-03  5:32     ` Kulkarni, Vandita
2024-09-04  5:01       ` Murthy, Arun R
2024-09-12  9:57   ` Jani Nikula
2024-09-18 10:55     ` Murthy, Arun R
2024-08-21 10:23 ` Arun R Murthy [this message]
2024-09-11 10:39   ` [PATCHv2 4/5] drm/i915/histogram: histogram delay counter doesnt reset Kandpal, Suraj
2024-09-18 16:24     ` Murthy, Arun R
2024-09-11 10:41   ` Kandpal, Suraj
2024-09-18 16:24     ` Murthy, Arun R
2024-08-21 10:23 ` [PATCHv2 5/5] drm/i915/display/histogram: Histogram changes for Display LNL+ Arun R Murthy
2024-09-10 12:20   ` Kulkarni, Vandita
2024-09-12  9:09     ` Murthy, Arun R
2024-09-11 10:50   ` Kandpal, Suraj
2024-09-19 12:59     ` Murthy, Arun R
2024-09-12  9:59   ` Jani Nikula
2024-09-19 12:59     ` Murthy, Arun R
2024-08-21 11:08 ` ✗ Fi.CI.CHECKPATCH: warning for Display Global Histogram (rev2) Patchwork
2024-08-21 11:08 ` ✗ Fi.CI.SPARSE: " 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=20240821102349.3961986-5-arun.r.murthy@intel.com \
    --to=arun.r.murthy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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