From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [Intel-gfx] [PATCH] drm/i915: Initialize drm_crtc gamma ramp Date: Fri, 28 Jun 2013 11:35:46 +0300 Message-ID: <20130628083546.GF5004@intel.com> References: <1372283075-12392-1-git-send-email-chris@chris-wilson.co.uk> <1372284295-12630-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <1372284295-12630-1-git-send-email-chris@chris-wilson.co.uk> Sender: stable-owner@vger.kernel.org To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org, stable@vger.kernel.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Jun 26, 2013 at 11:04:55PM +0100, Chris Wilson wrote: > As we initialize our own gamma LUT to sane values during initialisati= on, > we should also update the user visible gamma ramp to match our settin= gs. > And before touching the storage for the user visible gamma ramp, we a= lso > need to check for an allocation failure. >=20 > v2: set_gamma_size() returns an error code, not success/fail. Also > expand the 8bit LUT value to 16bit using bit replication. >=20 > v3: Just log the error and disable gamma user functionality if we fai= l > to allocate the ramp during initialisation. >=20 > Signed-off-by: Chris Wilson > Cc: stable@vger.kernel.org > --- > drivers/gpu/drm/i915/intel_display.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i= 915/intel_display.c > index 5988bda..22bdf16 100644 > --- a/drivers/gpu/drm/i915/intel_display.c > +++ b/drivers/gpu/drm/i915/intel_display.c > @@ -8983,11 +8983,18 @@ static void intel_crtc_init(struct drm_device= *dev, int pipe) > =20 > drm_crtc_init(dev, &intel_crtc->base, &intel_crtc_funcs); > =20 > - drm_mode_crtc_set_gamma_size(&intel_crtc->base, 256); > + if (drm_mode_crtc_set_gamma_size(&intel_crtc->base, 256)) > + DRM_ERROR("failed to allocate ramp for gamma, changing gamma table= s will be unavailable on CRTC:%d (pipe %d)\n", intel_crtc->base.base.id= , pipe); I'd prefer to use pipe_name() consistently for such things. Should avoi= d more bursts of OCD in the future :) =46or the rest of the patch: Reviewed-by: Ville Syrj=E4l=E4 > + > for (i =3D 0; i < 256; i++) { > intel_crtc->lut_r[i] =3D i; > intel_crtc->lut_g[i] =3D i; > intel_crtc->lut_b[i] =3D i; > + if (intel_crtc->base.gamma_size) { > + intel_crtc->base.gamma_store[i + 0*256] =3D i << 8 | i; > + intel_crtc->base.gamma_store[i + 1*256] =3D i << 8 | i; > + intel_crtc->base.gamma_store[i + 2*256] =3D i << 8 | i; > + } > } > =20 > /* Swap pipes & planes for FBC on pre-965 */ > --=20 > 1.8.3.1 >=20 > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx --=20 Ville Syrj=E4l=E4 Intel OTC