xrandr: use full range for gamma table generation
authorDominik Behr <dbehr@chromium.org>
Wed, 2 Apr 2014 01:38:05 +0000 (18:38 -0700)
committerStéphane Marchesin <marcheu@chromium.org>
Wed, 30 Apr 2014 23:34:19 +0000 (16:34 -0700)
commit792f05ea20d5191425154470760e36dcf023c6e9
tree4d8b28e568d0586141e3e2439887f0818daf9dfa
parent866366d0825c3f488abd58960e4f76ae50de08d1
xrandr: use full range for gamma table generation

Calculate gamma table using full [0,65536) range and do not make any
assumptions about relation of gamma table size and significant bits.

Gamma table size has nothing to do with number of significant bits in hardware.
In particular we are dealing now with gamma table that has 17 entries and 8
bit precision, there are other GPUs with 10 bit precision and less than 256
entries using partial linear approximation. Deriving assumed gamma table
significant bits from size of gamma table leads to incorrect calculations and
loss of precision. Also XRandR specification never mentions that gamma tables
need to be power of 2.

Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
xrandr.c