From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 5/7] drm/i915/display: Extract ilk_read_csc()
Date: Mon, 22 Mar 2021 20:00:06 +0530 [thread overview]
Message-ID: <20210322143008.29250-6-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20210322143008.29250-1-bhanuprakash.modem@intel.com>
For ilk+, add hw read out to create hw blob of ctm coeff values.
Cc: Swati Sharma <swati2.sharma@intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
drivers/gpu/drm/i915/display/intel_color.c | 52 ++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_color.c b/drivers/gpu/drm/i915/display/intel_color.c
index 15f97fbb77b3..877833f294bb 100644
--- a/drivers/gpu/drm/i915/display/intel_color.c
+++ b/drivers/gpu/drm/i915/display/intel_color.c
@@ -321,6 +321,54 @@ static void ilk_load_csc_matrix(const struct intel_crtc_state *crtc_state)
crtc_state->csc_mode);
}
+static struct drm_property_blob *ilk_read_csc_matrix(struct intel_crtc *crtc)
+{
+ struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
+ enum pipe pipe = crtc->pipe;
+ struct drm_property_blob *blob;
+ struct drm_color_ctm *ctm;
+ u32 temp;
+
+ blob = drm_property_create_blob(&dev_priv->drm,
+ sizeof(struct drm_color_ctm),
+ NULL);
+ if (IS_ERR(blob))
+ return NULL;
+
+ ctm = blob->data;
+
+ temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_RY_GY(pipe));
+ ctm->matrix[0] = (temp >> 16) & 0xffff;
+ ctm->matrix[1] = temp & 0xffff;
+
+ temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_BY(pipe));
+ ctm->matrix[2] = (temp >> 16) & 0xffff;
+
+ temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_RU_GU(pipe));
+ ctm->matrix[3] = (temp >> 16) & 0xffff;
+ ctm->matrix[4] = temp & 0xffff;
+
+ temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_BU(pipe));
+ ctm->matrix[5] = (temp >> 16) & 0xffff;
+
+ temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_RV_GV(pipe));
+ ctm->matrix[6] = (temp >> 16) & 0xffff;
+ ctm->matrix[7] = temp & 0xffff;
+
+ temp = intel_de_read(dev_priv, PIPE_CSC_COEFF_BV(pipe));
+ ctm->matrix[8] = (temp >> 16) & 0xffff;
+
+ return blob;
+}
+
+static void ilk_read_csc(struct intel_crtc_state *crtc_state)
+{
+ struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+
+ if (crtc_state->csc_enable)
+ crtc_state->hw.ctm = ilk_read_csc_matrix(crtc);
+}
+
static void icl_load_csc_matrix(const struct intel_crtc_state *crtc_state)
{
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
@@ -2226,13 +2274,17 @@ void intel_color_init(struct intel_crtc *crtc)
} else if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv)) {
dev_priv->display.load_luts = glk_load_luts;
dev_priv->display.read_luts = glk_read_luts;
+ dev_priv->display.read_csc = ilk_read_csc;
} else if (INTEL_GEN(dev_priv) >= 8) {
dev_priv->display.load_luts = bdw_load_luts;
+ dev_priv->display.read_csc = ilk_read_csc;
} else if (INTEL_GEN(dev_priv) >= 7) {
dev_priv->display.load_luts = ivb_load_luts;
+ dev_priv->display.read_csc = ilk_read_csc;
} else {
dev_priv->display.load_luts = ilk_load_luts;
dev_priv->display.read_luts = ilk_read_luts;
+ dev_priv->display.read_csc = ilk_read_csc;
}
}
--
2.20.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2021-03-22 6:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 14:30 [Intel-gfx] [PATCH 0/7] drm/i915: Add state checker for CSC coeff values Bhanuprakash Modem
2021-03-22 7:12 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-03-22 7:14 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-03-22 7:40 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-03-22 14:30 ` [Intel-gfx] [PATCH 1/7] drm/i915/display: Introduce vfunc read_csc() to create hw ctm Bhanuprakash Modem
2021-03-22 14:30 ` [Intel-gfx] [PATCH 2/7] drm/i915/display: Add func to compare hw/sw CSC matrix Bhanuprakash Modem
2021-03-22 14:30 ` [Intel-gfx] [PATCH 3/7] drm/i915/display: Add macro " Bhanuprakash Modem
2021-03-22 14:30 ` [Intel-gfx] [PATCH 4/7] drm/i915/display: Extract chv_read_csc() Bhanuprakash Modem
2021-03-22 16:18 ` Ville Syrjälä
2021-03-22 14:30 ` Bhanuprakash Modem [this message]
2021-03-22 16:20 ` [Intel-gfx] [PATCH 5/7] drm/i915/display: Extract ilk_read_csc() Ville Syrjälä
2021-03-22 14:30 ` [Intel-gfx] [PATCH 6/7] drm/i915/display: Extract icl_read_csc() Bhanuprakash Modem
2021-03-22 14:30 ` [Intel-gfx] [PATCH 7/7] FOR_TESTING_ONLY: Print coeffs of hw and sw CTM Bhanuprakash Modem
2021-03-22 16:19 ` [Intel-gfx] [PATCH 0/7] drm/i915: Add state checker for CSC coeff values Ville Syrjälä
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=20210322143008.29250-6-bhanuprakash.modem@intel.com \
--to=bhanuprakash.modem@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