Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arun R Murthy <arun.r.murthy@intel.com>
To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org
Cc: Arun R Murthy <arun.r.murthy@intel.com>
Subject: [PATCHv3 5/6] drm/i915/histogram: histogram delay counter doesnt reset
Date: Thu, 19 Sep 2024 19:01:39 +0530	[thread overview]
Message-ID: <20240919133140.1372663-6-arun.r.murthy@intel.com> (raw)
In-Reply-To: <20240919133140.1372663-1-arun.r.murthy@intel.com>

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

Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
---
 drivers/gpu/drm/i915/display/intel_histogram.c  | 17 +++++++++++++++++
 .../gpu/drm/i915/display/intel_histogram_reg.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 d1af64f2a6ac..6529a59ca6b6 100644
--- a/drivers/gpu/drm/i915/display/intel_histogram.c
+++ b/drivers/gpu/drm/i915/display/intel_histogram.c
@@ -74,6 +74,11 @@ static void intel_histogram_handle_int_work(struct work_struct *work)
 	struct intel_display *display = to_intel_display(intel_crtc);
 	char *histogram_event[] = {"HISTOGRAM=1", NULL};
 
+	/* Wa: 14014889975 */
+	if (IS_DISPLAY_VER(display, 12, 13))
+		intel_de_rmw(display, 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
@@ -94,6 +99,12 @@ static void intel_histogram_handle_int_work(struct work_struct *work)
 				"sending HISTOGRAM event failed\n");
 	}
 
+	/* Wa: 14014889975 */
+	if (IS_DISPLAY_VER(display, 12, 13))
+		/* Write the value read from DPST_CTL to DPST_CTL.Interrupt Delay Counter(bit 23:16) */
+		intel_de_write(display, DPST_CTL(intel_crtc->pipe), intel_de_read(display,
+			       DPST_CTL(intel_crtc->pipe)) | DPST_CTL_RESTORE);
+
 	/* Enable histogram interrupt */
 	intel_de_rmw(display, DPST_GUARD(intel_crtc->pipe), DPST_GUARD_HIST_INT_EN,
 		     DPST_GUARD_HIST_INT_EN);
@@ -245,6 +256,12 @@ int intel_histogram_set_iet_lut(struct intel_crtc *intel_crtc, u32 *data)
 		return -EINVAL;
 	}
 
+	/* Wa: 14014889975 */
+	if (IS_DISPLAY_VER(display, 12, 13))
+		/* Write the value read from DPST_CTL to DPST_CTL.Interrupt Delay Counter(bit 23:16) */
+		intel_de_write(display, DPST_CTL(intel_crtc->pipe), intel_de_read(display,
+			       DPST_CTL(intel_crtc->pipe)) | DPST_CTL_RESTORE);
+
 	/*
 	 * Set DPST_CTL Bin Reg function select to IE
 	 * Set DPST_CTL Bin Register Index to 0
diff --git a/drivers/gpu/drm/i915/display/intel_histogram_reg.h b/drivers/gpu/drm/i915/display/intel_histogram_reg.h
index ed8f22aa8e75..ac392ed47463 100644
--- a/drivers/gpu/drm/i915/display/intel_histogram_reg.h
+++ b/drivers/gpu/drm/i915/display/intel_histogram_reg.h
@@ -16,6 +16,7 @@
 #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-09-19 13:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-19 13:31 [PATCH 0/6] Display Global Histogram Arun R Murthy
2024-09-19 13:31 ` [PATCHv3 1/6] drm/i915/histogram: Add support for histogram Arun R Murthy
2024-09-25  5:32   ` Kandpal, Suraj
2024-09-25  6:00     ` Murthy, Arun R
2024-09-25  6:04     ` Kandpal, Suraj
2024-09-25 10:09       ` Murthy, Arun R
2024-09-19 13:31 ` [PATCHv3 2/6] drm/xe: Add histogram support to Xe builds Arun R Murthy
2024-09-25  5:33   ` Kandpal, Suraj
2024-09-19 13:31 ` [PATCHv3 3/6] drm/i915/histogram: histogram interrupt handling Arun R Murthy
2024-09-19 13:31 ` [PATCHv3 4/6] drm/i915/histogram: Add crtc properties for global histogram Arun R Murthy
2024-09-19 13:31 ` Arun R Murthy [this message]
2024-09-25  5:37   ` [PATCHv3 5/6] drm/i915/histogram: histogram delay counter doesnt reset Kandpal, Suraj
2024-09-19 13:31 ` [PATCHv3 6/6] drm/i915/histogram: Histogram changes for Display 20+ Arun R Murthy
2024-09-25  9:01   ` Jani Nikula
2024-09-25 10:21     ` Murthy, Arun R
2024-09-25 11:13       ` Jani Nikula
2024-09-25 12:13         ` Murthy, Arun R
2024-09-25 12:59           ` Jani Nikula
2024-09-19 13:48 ` ✓ CI.Patch_applied: success for Display Global Histogram Patchwork
2024-09-19 13:48 ` ✗ CI.checkpatch: warning " Patchwork
2024-09-19 13:49 ` ✓ CI.KUnit: success " Patchwork
2024-09-19 14:07 ` ✓ CI.Build: " Patchwork
2024-09-19 14:09 ` ✗ CI.Hooks: failure " Patchwork
2024-09-19 14:11 ` ✗ CI.checksparse: warning " Patchwork
2024-09-19 14:40 ` ✗ CI.BAT: failure " Patchwork
2024-09-19 20:20 ` ✗ CI.FULL: " 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=20240919133140.1372663-6-arun.r.murthy@intel.com \
    --to=arun.r.murthy@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@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