[PATCH 2/3] xrandr: fix gamma == 1.0 && sigbits != 8

Yang Zhao yang at yangman.ca
Wed Aug 15 09:36:58 PDT 2012


On 13 August 2012 16:25, Andy Ritger <aritger at nvidia.com> wrote:
> The gamma-correction lookup table managed through XRR[GS]etCrtcGamma is
> 2^n in size, where 'n' is the number of significant bits in the X Color.
> ...
>  xrandr.c |   15 +++++++++++----
>  1 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/xrandr.c b/xrandr.c
> index 75ed2ee..5709ded 100644
> --- a/xrandr.c
> +++ b/xrandr.c
...
> @@ -1366,21 +1373,21 @@ set_gamma(void)
>
>         for (i = 0; i < size; i++) {
>             if (gammaRed == 1.0 && output->brightness == 1.0)
> -               gamma->red[i] = (i << 8) + i;
> +               gamma->red[i] = (i << shift);
>             else
>                 gamma->red[i] = dmin(pow((double)i/(double)(size - 1),
>                                          gammaRed) * output->brightness,
>                                      1.0) * 65535.0;
>...

At first glance it looks like you are making changes here that are
then changed again in patch 3/3. If this is the case, please consider
squashing them together so it's easier to review.

-- 
Yang Zhao
http://yangman.ca


More information about the xorg-devel mailing list