[Intel-gfx] [PATCH 3/3] drm/intel: Use 10-bit palette properly, only store 129 entries

Adam Jackson ajax at redhat.com
Tue Apr 27 16:06:28 CEST 2010


On Mon, 2010-04-26 at 23:24 +0100, Peter Clifton wrote:
> ---
>  drivers/gpu/drm/i915/intel_display.c |   38 ++++++++++++++-------------------
>  drivers/gpu/drm/i915/intel_drv.h     |    2 +-
>  2 files changed, 17 insertions(+), 23 deletions(-)

Nak.

This will break DirectColor visuals in X.  DirectColor assumes that
there's a straight lookup table for each color channel.  If the red
channel of a pixel is 0 in DirectColor, then the actual red value output
will be whatever value is in the 0th slot of the gamma table.  You don't
have 256 stops in 10-bit-gamma mode, so you can't do 8 bits per channel
DirectColor.

Even for TrueColor, which is what normal people expect, this will break
gamma setup entirely.  Userspace is currently hardcoded to use a gamma
size of 256, and:

> @@ -3649,10 +3643,10 @@ static void intel_crtc_gamma_set(struct
> drm_crtc *crtc, u16 *red, u16 *green,
>         struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>         int i;
>  
> -       if (size != 256)
> +       if (size != 129)
>                 return;

This is why I said gen4 should probably only expose the 129-stop gamma
for 30bpp framebuffers in X, and then only expose TrueColor visuals.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20100427/ae128636/attachment.sig>


More information about the Intel-gfx mailing list