From patchwork Mon Apr 26 22:24:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Clifton X-Patchwork-Id: 95224 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 o3QMP80D014276 for ; Mon, 26 Apr 2010 22:25:43 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 638169EB75 for ; Mon, 26 Apr 2010 15:25:08 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from ppsw-32.csi.cam.ac.uk (ppsw-32.csi.cam.ac.uk [131.111.8.132]) by gabe.freedesktop.org (Postfix) with ESMTP id 764879E75E for ; Mon, 26 Apr 2010 15:24:28 -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]:42309 helo=localhost.localdomain) by ppsw-32.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:465) with esmtpsa (LOGIN:pcjc2) (TLSv1:DHE-RSA-AES256-SHA:256) id 1O6Wj5-0002Vp-As (Exim 4.70) (return-path ); Mon, 26 Apr 2010 23:24:27 +0100 From: Peter Clifton To: "intel-gfx@lists.freedesktop.org" Date: Mon, 26 Apr 2010 23:24:16 +0100 Message-Id: <1272320658-2157-1-git-send-email-pcjc2@cam.ac.uk> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1272320445.23864.4.camel@pcjc2lap> References: <1272320445.23864.4.camel@pcjc2lap> Subject: [Intel-gfx] [PATCH 1/3] drm/intel: Store full 16 bits of colors passed to gamma LUT 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 22:25:52 +0000 (UTC) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 006e5a5..456f738 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3452,9 +3452,9 @@ void intel_crtc_load_lut(struct drm_crtc *crtc) for (i = 0; i < 256; i++) { I915_WRITE(pal_reg + 4 * i, - (intel_crtc->lut_r[i] << 16) | - (intel_crtc->lut_g[i] << 8) | - intel_crtc->lut_b[i]); + ((intel_crtc->lut_r[i] >> 8) << 16) | + ((intel_crtc->lut_g[i] >> 8) << 8) | + (intel_crtc->lut_b[i] >> 8)); } } @@ -3609,9 +3609,9 @@ void intel_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, { struct intel_crtc *intel_crtc = to_intel_crtc(crtc); - intel_crtc->lut_r[regno] = red >> 8; - intel_crtc->lut_g[regno] = green >> 8; - intel_crtc->lut_b[regno] = blue >> 8; + intel_crtc->lut_r[regno] = red; + intel_crtc->lut_g[regno] = green; + intel_crtc->lut_b[regno] = blue; } void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, @@ -3619,9 +3619,9 @@ void intel_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, { struct intel_crtc *intel_crtc = to_intel_crtc(crtc); - *red = intel_crtc->lut_r[regno] << 8; - *green = intel_crtc->lut_g[regno] << 8; - *blue = intel_crtc->lut_b[regno] << 8; + *red = intel_crtc->lut_r[regno]; + *green = intel_crtc->lut_g[regno]; + *blue = intel_crtc->lut_b[regno]; } static void intel_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, @@ -3634,9 +3634,9 @@ static void intel_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, return; for (i = 0; i < 256; i++) { - intel_crtc->lut_r[i] = red[i] >> 8; - intel_crtc->lut_g[i] = green[i] >> 8; - intel_crtc->lut_b[i] = blue[i] >> 8; + intel_crtc->lut_r[i] = red[i]; + intel_crtc->lut_g[i] = green[i]; + intel_crtc->lut_b[i] = blue[i]; } intel_crtc_load_lut(crtc); @@ -4294,9 +4294,9 @@ static void intel_crtc_init(struct drm_device *dev, int pipe) intel_crtc->pipe = pipe; intel_crtc->plane = pipe; for (i = 0; i < 256; i++) { - intel_crtc->lut_r[i] = i; - intel_crtc->lut_g[i] = i; - intel_crtc->lut_b[i] = i; + intel_crtc->lut_r[i] = i << 8 | i; + intel_crtc->lut_g[i] = i << 8 | i; + intel_crtc->lut_b[i] = i << 8 | i; } /* Swap pipes & planes for FBC on pre-965 */ diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 3dcf5cc..6f09806 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -143,7 +143,7 @@ struct intel_crtc { enum plane plane; struct drm_gem_object *cursor_bo; uint32_t cursor_addr; - u8 lut_r[256], lut_g[256], lut_b[256]; + u16 lut_r[256], lut_g[256], lut_b[256]; int dpms_mode; bool busy; /* is scanout buffer being updated frequently? */ struct timer_list idle_timer;