[PATCH v2] xrandr: display gamma and brightness

Matthias Hopf mhopf at suse.de
Tue Jan 19 02:48:19 PST 2010


On Jan 18, 10 12:56:50 -0800, Yang Zhao wrote:
> > @@ -1225,25 +1311,25 @@ set_gamma(void)
> >
> >     for (i = 0; i < size; i++) {
> >         if (output->gamma.red == 1.0 && output->brightness == 1.0)
> > -           gamma->red[i] = i << 8;
> > +           gamma->red[i] = (i << 8) + i;
> >         else
> >             gamma->red[i] = dmin(pow((double)i/(double)(size - 1),
> > -                       (double)output->gamma.red) * (double)(size - 1)
> > -                       * (double)output->brightness * 256, 65535.0);
> > +                                    output->gamma.red) * output->brightness,
> > +                                1.0) * 65535.0;
> > ...
>
> These changes weren't part of the original patch, and seems to subtly
> change the semantics of setting the gamma correction curve.  Included
> by accident?

I don't think so. This changes 8->16 bit conversion from
00->0000..ff->ff00 to 00->0000..ff->ffff.
This looks better to me, as we're getting closer to full brightness, and
improves reliability during backconversion.

However, I'd love to see this as a separate commit :-)

Thanks

Matthias

-- 
Matthias Hopf <mhopf at suse.de>      __        __   __
Maxfeldstr. 5 / 90409 Nuernberg   (_   | |  (_   |__          mat at mshopf.de
Phone +49-911-74053-715           __)  |_|  __)  |__  R & D   www.mshopf.de


More information about the xorg-devel mailing list