All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 6/6] drm/i915: Expose the legacy LUT via the GAMMA_LUT/GAMMA_LUT_SIZE props on gen2/3
Date: Thu, 28 Mar 2019 23:05:05 +0200	[thread overview]
Message-ID: <20190328210505.10429-7-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20190328210505.10429-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Just so we don't leave gen2/3 out in the cold let's advertize the
legacy LUT via the GAMMA_LUT/GAMMA_LUT_SIZE props. Without the
GAMMA_LUT prop we can't actually load a LUT using the atomic ioctl
(in preparation for the day of 100% atomic driver).

Supposedly some gen2/3 platforms have an interpolated 10bit gamma mode
as well. It's slightly funkier than the i965+ mode since you have to
specify the slope for the interpolation by hand. But when I tried it
I couldn't get it to work, the hardware just insisted on using the
8bit more regardless of the state of the relevant PIPECONF bit.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_pci.c    |  5 +++++
 drivers/gpu/drm/i915/intel_color.c | 13 +++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 0c5258aa13bb..0e76df27f151 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -116,6 +116,8 @@
 		[PIPE_C] = IVB_CURSOR_C_OFFSET, \
 	}
 
+#define I9XX_COLORS \
+	.color = { .gamma_lut_size = 256 }
 #define I965_COLORS \
 	.color = { .gamma_lut_size = 129, \
 		   .gamma_lut_tests = DRM_COLOR_LUT_NON_DECREASING, \
@@ -156,6 +158,7 @@
 	.has_coherent_ggtt = false, \
 	I9XX_PIPE_OFFSETS, \
 	I9XX_CURSOR_OFFSETS, \
+	I9XX_COLORS, \
 	GEN_DEFAULT_PAGE_SIZES
 
 #define I845_FEATURES \
@@ -172,6 +175,7 @@
 	.has_coherent_ggtt = false, \
 	I845_PIPE_OFFSETS, \
 	I845_CURSOR_OFFSETS, \
+	I9XX_COLORS, \
 	GEN_DEFAULT_PAGE_SIZES
 
 static const struct intel_device_info intel_i830_info = {
@@ -205,6 +209,7 @@ static const struct intel_device_info intel_i865g_info = {
 	.has_coherent_ggtt = true, \
 	I9XX_PIPE_OFFSETS, \
 	I9XX_CURSOR_OFFSETS, \
+	I9XX_COLORS, \
 	GEN_DEFAULT_PAGE_SIZES
 
 static const struct intel_device_info intel_i915g_info = {
diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
index 07d62c7cb386..fd4a65af5cc4 100644
--- a/drivers/gpu/drm/i915/intel_color.c
+++ b/drivers/gpu/drm/i915/intel_color.c
@@ -1272,12 +1272,9 @@ void intel_color_init(struct intel_crtc *crtc)
 			dev_priv->display.load_luts = ilk_load_luts;
 	}
 
-	/* Enable color management support when we have degamma and/or gamma LUT. */
-	if (INTEL_INFO(dev_priv)->color.degamma_lut_size != 0 ||
-	    INTEL_INFO(dev_priv)->color.gamma_lut_size != 0)
-		drm_crtc_enable_color_mgmt(&crtc->base,
-					   INTEL_INFO(dev_priv)->color.degamma_lut_size,
-					   INTEL_INFO(dev_priv)->color.degamma_lut_size &&
-					   INTEL_INFO(dev_priv)->color.gamma_lut_size,
-					   INTEL_INFO(dev_priv)->color.gamma_lut_size);
+	drm_crtc_enable_color_mgmt(&crtc->base,
+				   INTEL_INFO(dev_priv)->color.degamma_lut_size,
+				   INTEL_INFO(dev_priv)->color.degamma_lut_size &&
+				   INTEL_INFO(dev_priv)->color.gamma_lut_size,
+				   INTEL_INFO(dev_priv)->color.gamma_lut_size);
 }
-- 
2.19.2

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

  parent reply	other threads:[~2019-03-28 21:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 21:04 [PATCH 0/6] drm/i915: Finish the GAMMA_LUT stuff Ville Syrjala
2019-03-28 21:05 ` [PATCH 1/6] drm/i915: Extract ilk_lut_10() Ville Syrjala
2019-03-29  0:15   ` Matt Roper
2019-03-28 21:05 ` [PATCH 2/6] drm/i915: Don't use split gamma when we don't have to Ville Syrjala
2019-03-29  0:16   ` Matt Roper
2019-03-29 10:47     ` Ville Syrjälä
2019-03-29 12:25       ` Shankar, Uma
2019-03-29 13:49       ` Ville Syrjälä
2019-03-29 14:14   ` [PATCH v2 " Ville Syrjala
2019-03-28 21:05 ` [PATCH 3/6] drm/i915: Implement split/10bit gamma for ivb/hsw Ville Syrjala
2019-03-29  0:16   ` Matt Roper
2019-03-28 21:05 ` [PATCH 4/6] drm/i915: Add 10bit LUT for ilk/snb Ville Syrjala
2019-03-29  0:17   ` Matt Roper
2019-03-29 10:07   ` Maarten Lankhorst
2019-03-28 21:05 ` [PATCH 5/6] drm/i915: Add "10.6" LUT mode for i965+ Ville Syrjala
2019-04-04 23:52   ` Sripada, Radhakrishna
2019-03-28 21:05 ` Ville Syrjala [this message]
2019-04-04 16:52   ` [PATCH 6/6] drm/i915: Expose the legacy LUT via the GAMMA_LUT/GAMMA_LUT_SIZE props on gen2/3 Sripada, Radhakrishna
2019-03-28 22:06 ` ✓ Fi.CI.BAT: success for drm/i915: Finish the GAMMA_LUT stuff Patchwork
2019-03-29  8:34 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-03-29 10:57   ` Ville Syrjälä
2019-03-29 15:26 ` ✓ Fi.CI.BAT: success for drm/i915: Finish the GAMMA_LUT stuff (rev2) Patchwork
2019-03-29 19:13 ` ✗ 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=20190328210505.10429-7-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.