public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Uma Shankar <uma.shankar@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: ville.syrjala@intel.com, maarten.lankhorst@intel.com
Subject: [v6 14/16] drm/i915: Enable Plane Gamma/Degamma
Date: Tue, 19 Mar 2019 14:14:22 +0530	[thread overview]
Message-ID: <1552985064-11974-15-git-send-email-uma.shankar@intel.com> (raw)
In-Reply-To: <1552985064-11974-1-git-send-email-uma.shankar@intel.com>

Update the plane gamma and degamma feature in the
plane state and eventually program to PLANE_COLOR_CTL.

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h      | 1 +
 drivers/gpu/drm/i915/intel_color.c   | 6 ++++++
 drivers/gpu/drm/i915/intel_display.c | 6 +++++-
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 019227b..7e2e746 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -6757,6 +6757,7 @@ enum {
 #define   PLANE_COLOR_CSC_MODE_YUV709_TO_RGB709		(2 << 17)
 #define   PLANE_COLOR_CSC_MODE_YUV2020_TO_RGB2020	(3 << 17)
 #define   PLANE_COLOR_CSC_MODE_RGB709_TO_RGB2020	(4 << 17)
+#define   PLANE_COLOR_PLANE_PRECSC_GAMMA_ENABLE	(1 << 14)
 #define   PLANE_COLOR_PLANE_GAMMA_DISABLE	(1 << 13)
 #define   PLANE_COLOR_ALPHA_MASK		(0x3 << 4)
 #define   PLANE_COLOR_ALPHA_DISABLE		(0 << 4)
diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
index 22790b4..aa73f88 100644
--- a/drivers/gpu/drm/i915/intel_color.c
+++ b/drivers/gpu/drm/i915/intel_color.c
@@ -769,8 +769,14 @@ static void icl_load_plane_gamma_lut(const struct drm_plane_state *state,
 /* Loads the palette/gamma unit for the CRTC on Gen11+. */
 static void icl_load_plane_luts(const struct drm_plane_state *state)
 {
+	struct intel_plane_state *plane_state =
+				to_intel_plane_state(state);
+
 	icl_load_plane_degamma_lut(state, 0);
 	icl_load_plane_gamma_lut(state, 0);
+
+	plane_state->gamma_mode |= PLANE_COLOR_PLANE_PRECSC_GAMMA_ENABLE;
+	plane_state->gamma_mode |= ~PLANE_COLOR_PLANE_GAMMA_DISABLE;
 }
 
 static void glk_load_degamma_lut(const struct intel_crtc_state *crtc_state)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2c44ce4..78d161e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3805,7 +3805,11 @@ u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
 	struct intel_plane *plane = to_intel_plane(plane_state->base.plane);
 	u32 plane_color_ctl = 0;
 
-	plane_color_ctl |= PLANE_COLOR_PLANE_GAMMA_DISABLE;
+	if (INTEL_GEN(dev_priv) <= 11)
+		plane_color_ctl |= PLANE_COLOR_PLANE_GAMMA_DISABLE;
+	else
+		plane_color_ctl |= plane_state->gamma_mode;
+
 	plane_color_ctl |= glk_plane_color_ctl_alpha(plane_state);
 
 	if (fb->format->is_yuv && !icl_is_hdr_plane(dev_priv, plane->id)) {
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-03-19  8:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19  8:44 [v6 00/16] Add Plane Color Properties Uma Shankar
2019-03-19  8:44 ` [v6 01/16] drm: Add Enhanced Gamma LUT precision structure Uma Shankar
2019-03-27 12:12   ` Lankhorst, Maarten
2019-03-28 13:49     ` Shankar, Uma
2019-03-19  8:44 ` [v6 02/16] drm: Add Plane Degamma properties Uma Shankar
2019-03-19 19:09   ` kbuild test robot
2019-03-19  8:44 ` [v6 03/16] drm: Add Plane CTM property Uma Shankar
2019-03-19 22:45   ` kbuild test robot
2019-03-19  8:44 ` [v6 04/16] drm: Add Plane Gamma properties Uma Shankar
2019-03-20  2:36   ` kbuild test robot
2019-03-19  8:44 ` [v6 05/16] drm: Define helper function for plane color enabling Uma Shankar
2019-03-19  8:44 ` [v6 06/16] drm/i915: Enable plane color features Uma Shankar
2019-03-19  8:44 ` [v6 07/16] drm/i915: Implement Plane Gamma for Bdw and Gen9 platforms Uma Shankar
2019-03-19  8:44 ` [v6 08/16] drm/i915: Load plane color luts from atomic flip Uma Shankar
2019-03-19  8:44 ` [v6 09/16] drm/i915: Add plane color capabilities Uma Shankar
2019-03-19  8:44 ` [v6 10/16] drm/i915/icl: Add ICL Plane Degamma Register definition Uma Shankar
2019-03-25 17:36   ` Matt Roper
2019-03-26 13:59     ` Shankar, Uma
2019-03-19  8:44 ` [v6 11/16] drm/i915/icl: Enable Plane Degamma Uma Shankar
2019-03-19 19:31   ` kbuild test robot
2019-03-19  8:44 ` [v6 12/16] drm/i915/icl: Add Plane Gamma Register Definitions Uma Shankar
2019-03-19  8:44 ` [v6 13/16] drm/i915/icl: Implement Plane Gamma Uma Shankar
2019-03-19  8:44 ` Uma Shankar [this message]
2019-03-19  8:44 ` [v6 15/16] drm/i915: Define Plane CSC Registers Uma Shankar
2019-03-19  8:44 ` [v6 16/16] drm/i915: Enable Plane CSC Uma Shankar
2019-03-19  9:06 ` ✗ Fi.CI.CHECKPATCH: warning for Add Plane Color Properties (rev6) Patchwork
2019-03-19  9:16 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-03-19  9:25 ` ✓ Fi.CI.BAT: success " Patchwork
2019-03-19 17:12 ` ✓ Fi.CI.IGT: " 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=1552985064-11974-15-git-send-email-uma.shankar@intel.com \
    --to=uma.shankar@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@intel.com \
    --cc=ville.syrjala@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