From patchwork Mon Apr 26 21:19:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Clifton X-Patchwork-Id: 95205 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3QLJm62000416 for ; Mon, 26 Apr 2010 21:20:24 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 530F29EAF2 for ; Mon, 26 Apr 2010 14:19:48 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from ppsw-33.csi.cam.ac.uk (ppsw-33.csi.cam.ac.uk [131.111.8.133]) by gabe.freedesktop.org (Postfix) with ESMTP id 3515B9E754 for ; Mon, 26 Apr 2010 14:19:40 -0700 (PDT) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from 81-5-163-105.dsl.eclipse.net.uk ([81.5.163.105]:48140 helo=localhost.localdomain) by ppsw-33.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:465) with esmtpsa (LOGIN:pcjc2) (TLSv1:DHE-RSA-AES256-SHA:256) id 1O6ViN-0003KJ-AV (Exim 4.70) (return-path ); Mon, 26 Apr 2010 22:19:39 +0100 From: Peter Clifton To: "intel-gfx @ lists . freedesktop . org" Date: Mon, 26 Apr 2010 22:19:23 +0100 Message-Id: <1272316763-28332-1-git-send-email-pcjc2@cam.ac.uk> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1272292191.25350.53.camel@atropine.boston.devel.redhat.com> References: <1272292191.25350.53.camel@atropine.boston.devel.redhat.com> Subject: [Intel-gfx] [PATCH] drm/intel: Set 8-bit gamma mode for the palette X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 26 Apr 2010 21:20:24 +0000 (UTC) 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]);