All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Clifton <pcjc2@cam.ac.uk>
To: "intel-gfx @ lists . freedesktop . org"
	<intel-gfx@lists.freedesktop.org>
Subject: [PATCH] drm/intel: Set 8-bit gamma mode for the palette
Date: Mon, 26 Apr 2010 22:19:23 +0100	[thread overview]
Message-ID: <1272316763-28332-1-git-send-email-pcjc2@cam.ac.uk> (raw)
In-Reply-To: <1272292191.25350.53.camel@atropine.boston.devel.redhat.com>

We're programming an 8-bit palette, so ensure we set the hardware
up appropriately. Also, rename the palreg variable pal_reg for more
consistency with the rest of this file.
---
 drivers/gpu/drm/i915/intel_display.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4e5e688..006e5a5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3430,7 +3430,10 @@ void intel_crtc_load_lut(struct drm_crtc *crtc)
 	struct drm_device *dev = crtc->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-	int palreg = (intel_crtc->pipe == 0) ? PALETTE_A : PALETTE_B;
+	int pipe = intel_crtc->pipe;
+	int pal_reg = (pipe == 0) ? PALETTE_A : PALETTE_B;
+	int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF;
+	int pipeconf = I915_READ(pipeconf_reg);
 	int i;
 
 	/* The clocks have to be on to load the palette. */
@@ -3439,11 +3442,16 @@ void intel_crtc_load_lut(struct drm_crtc *crtc)
 
 	/* use legacy palette for Ironlake */
 	if (IS_IRONLAKE(dev))
-		palreg = (intel_crtc->pipe == 0) ? LGC_PALETTE_A :
-						   LGC_PALETTE_B;
+		pal_reg = (intel_crtc->pipe == 0) ? LGC_PALETTE_A :
+						    LGC_PALETTE_B;
+
+	/* Switch to 8-bit gamma mode */
+	pipeconf &= ~PIPEACONF_GAMMA;
+	I915_WRITE(pipeconf_reg, pipeconf);
+	I915_READ(pipeconf_reg);
 
 	for (i = 0; i < 256; i++) {
-		I915_WRITE(palreg + 4 * i,
+		I915_WRITE(pal_reg + 4 * i,
 			   (intel_crtc->lut_r[i] << 16) |
 			   (intel_crtc->lut_g[i] << 8) |
 			   intel_crtc->lut_b[i]);
-- 
1.7.0.4

  reply	other threads:[~2010-04-26 21:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-24 16:25 8-bit vs. 10-bit palette mode, and LVDS dithering Peter Clifton
2010-04-26 14:29 ` Adam Jackson
2010-04-26 21:19   ` Peter Clifton [this message]
2010-04-27 13:53     ` [PATCH] drm/intel: Set 8-bit gamma mode for the palette Adam Jackson
2010-04-26 22:22   ` 8-bit vs. 10-bit palette mode, and LVDS dithering Peter Clifton
2010-04-26 22:24     ` [PATCH 1/3] drm/intel: Store full 16 bits of colors passed to gamma LUT Peter Clifton
2010-04-26 22:24     ` [PATCH 2/3] drm/intel: Attempt to use 10-bit gamma palette mode Peter Clifton
2010-04-27  1:09       ` Andrew Lutomirski
2010-04-27  6:44         ` Peter Clifton
2010-04-26 22:24     ` [PATCH 3/3] drm/intel: Use 10-bit palette properly, only store 129 entries Peter Clifton
2010-04-27 14:06       ` Adam Jackson

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=1272316763-28332-1-git-send-email-pcjc2@cam.ac.uk \
    --to=pcjc2@cam.ac.uk \
    --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.