[Bug 27222] Gamma not working in 3D on R200 and R300

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Apr 3 06:21:51 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=27222

--- Comment #7 from Ondrej Zary <linux at rainbow-software.org> 2010-04-03 06:21:51 PDT ---
Yes, it uses SDL, namely this function:

int X11_SetGammaRamp(_THIS, Uint16 *ramp)
{
        int i, ncolors;
        XColor xcmap[256];

        /* See if actually setting the gamma is supported */
        if ( SDL_Visual->class != DirectColor ) {
            SDL_SetError("Gamma correction not supported on this visual");
            return(-1);
        }

        /* Calculate the appropriate palette for the given gamma ramp */
        ncolors = SDL_Visual->map_entries;
        for ( i=0; i<ncolors; ++i ) {
                Uint8 c = (256 * i / ncolors);
                xcmap[i].pixel = SDL_MapRGB(this->screen->format, c, c, c);
                xcmap[i].red   = ramp[0*256+c];
                xcmap[i].green = ramp[1*256+c];
                xcmap[i].blue  = ramp[2*256+c];
                xcmap[i].flags = (DoRed|DoGreen|DoBlue);
        }
        XStoreColors(GFX_Display, SDL_XColorMap, xcmap, ncolors);
        XSync(GFX_Display, False);
        return(0);
}

ncolors is 256, xcmap is:
xcmap[0] .pixel=0, .red=0, .green=0, .blue=0
xcmap[1] .pixel=65793, .red=9509, .green=9509, .blue=9509
xcmap[2] .pixel=131586, .red=12079, .green=12079, .blue=12079
xcmap[3] .pixel=197379, .red=13878, .green=13878, .blue=13878
xcmap[4] .pixel=263172, .red=15163, .green=15163, .blue=15163
xcmap[5] .pixel=328965, .red=16448, .green=16448, .blue=16448
xcmap[6] .pixel=394758, .red=17733, .green=17733, .blue=17733
xcmap[7] .pixel=460551, .red=18504, .green=18504, .blue=18504
xcmap[8] .pixel=526344, .red=19532, .green=19532, .blue=19532
xcmap[9] .pixel=592137, .red=20303, .green=20303, .blue=20303
xcmap[10] .pixel=657930, .red=21074, .green=21074, .blue=21074
xcmap[11] .pixel=723723, .red=21845, .green=21845, .blue=21845
xcmap[12] .pixel=789516, .red=22359, .green=22359, .blue=22359
xcmap[13] .pixel=855309, .red=23130, .green=23130, .blue=23130
xcmap[14] .pixel=921102, .red=23644, .green=23644, .blue=23644
xcmap[15] .pixel=986895, .red=24415, .green=24415, .blue=24415
xcmap[16] .pixel=1052688, .red=24929, .green=24929, .blue=24929
xcmap[17] .pixel=1118481, .red=25443, .green=25443, .blue=25443
xcmap[18] .pixel=1184274, .red=25957, .green=25957, .blue=25957
xcmap[19] .pixel=1250067, .red=26471, .green=26471, .blue=26471
xcmap[20] .pixel=1315860, .red=26985, .green=26985, .blue=26985
xcmap[21] .pixel=1381653, .red=27242, .green=27242, .blue=27242
xcmap[22] .pixel=1447446, .red=27756, .green=27756, .blue=27756
xcmap[23] .pixel=1513239, .red=28270, .green=28270, .blue=28270
xcmap[24] .pixel=1579032, .red=28527, .green=28527, .blue=28527
xcmap[25] .pixel=1644825, .red=29041, .green=29041, .blue=29041
xcmap[26] .pixel=1710618, .red=29555, .green=29555, .blue=29555
xcmap[27] .pixel=1776411, .red=29812, .green=29812, .blue=29812
xcmap[28] .pixel=1842204, .red=30326, .green=30326, .blue=30326
xcmap[29] .pixel=1907997, .red=30583, .green=30583, .blue=30583
xcmap[30] .pixel=1973790, .red=30840, .green=30840, .blue=30840
xcmap[31] .pixel=2039583, .red=31354, .green=31354, .blue=31354
xcmap[32] .pixel=2105376, .red=31611, .green=31611, .blue=31611
xcmap[33] .pixel=2171169, .red=32125, .green=32125, .blue=32125
xcmap[34] .pixel=2236962, .red=32382, .green=32382, .blue=32382
xcmap[35] .pixel=2302755, .red=32639, .green=32639, .blue=32639
xcmap[36] .pixel=2368548, .red=32896, .green=32896, .blue=32896
xcmap[37] .pixel=2434341, .red=33410, .green=33410, .blue=33410
xcmap[38] .pixel=2500134, .red=33667, .green=33667, .blue=33667
xcmap[39] .pixel=2565927, .red=33924, .green=33924, .blue=33924
xcmap[40] .pixel=2631720, .red=34181, .green=34181, .blue=34181
xcmap[41] .pixel=2697513, .red=34438, .green=34438, .blue=34438
xcmap[42] .pixel=2763306, .red=34952, .green=34952, .blue=34952
xcmap[43] .pixel=2829099, .red=35209, .green=35209, .blue=35209
xcmap[44] .pixel=2894892, .red=35466, .green=35466, .blue=35466
xcmap[45] .pixel=2960685, .red=35723, .green=35723, .blue=35723
xcmap[46] .pixel=3026478, .red=35980, .green=35980, .blue=35980
xcmap[47] .pixel=3092271, .red=36237, .green=36237, .blue=36237
xcmap[48] .pixel=3158064, .red=36494, .green=36494, .blue=36494
xcmap[49] .pixel=3223857, .red=36751, .green=36751, .blue=36751
xcmap[50] .pixel=3289650, .red=37008, .green=37008, .blue=37008
xcmap[51] .pixel=3355443, .red=37265, .green=37265, .blue=37265
xcmap[52] .pixel=3421236, .red=37522, .green=37522, .blue=37522
xcmap[53] .pixel=3487029, .red=37779, .green=37779, .blue=37779
xcmap[54] .pixel=3552822, .red=38036, .green=38036, .blue=38036
xcmap[55] .pixel=3618615, .red=38293, .green=38293, .blue=38293
xcmap[56] .pixel=3684408, .red=38550, .green=38550, .blue=38550
xcmap[57] .pixel=3750201, .red=38807, .green=38807, .blue=38807
xcmap[58] .pixel=3815994, .red=39064, .green=39064, .blue=39064
xcmap[59] .pixel=3881787, .red=39321, .green=39321, .blue=39321
xcmap[60] .pixel=3947580, .red=39578, .green=39578, .blue=39578
xcmap[61] .pixel=4013373, .red=39578, .green=39578, .blue=39578
xcmap[62] .pixel=4079166, .red=39835, .green=39835, .blue=39835
xcmap[63] .pixel=4144959, .red=40092, .green=40092, .blue=40092
xcmap[64] .pixel=4210752, .red=40349, .green=40349, .blue=40349
xcmap[65] .pixel=4276545, .red=40606, .green=40606, .blue=40606
xcmap[66] .pixel=4342338, .red=40863, .green=40863, .blue=40863
xcmap[67] .pixel=4408131, .red=41120, .green=41120, .blue=41120
xcmap[68] .pixel=4473924, .red=41120, .green=41120, .blue=41120
xcmap[69] .pixel=4539717, .red=41377, .green=41377, .blue=41377
xcmap[70] .pixel=4605510, .red=41634, .green=41634, .blue=41634
xcmap[71] .pixel=4671303, .red=41891, .green=41891, .blue=41891
xcmap[72] .pixel=4737096, .red=42148, .green=42148, .blue=42148
xcmap[73] .pixel=4802889, .red=42405, .green=42405, .blue=42405
xcmap[74] .pixel=4868682, .red=42405, .green=42405, .blue=42405
xcmap[75] .pixel=4934475, .red=42662, .green=42662, .blue=42662
xcmap[76] .pixel=5000268, .red=42919, .green=42919, .blue=42919
xcmap[77] .pixel=5066061, .red=43176, .green=43176, .blue=43176
xcmap[78] .pixel=5131854, .red=43176, .green=43176, .blue=43176
xcmap[79] .pixel=5197647, .red=43433, .green=43433, .blue=43433
xcmap[80] .pixel=5263440, .red=43690, .green=43690, .blue=43690
xcmap[81] .pixel=5329233, .red=43947, .green=43947, .blue=43947
xcmap[82] .pixel=5395026, .red=43947, .green=43947, .blue=43947
xcmap[83] .pixel=5460819, .red=44204, .green=44204, .blue=44204
xcmap[84] .pixel=5526612, .red=44461, .green=44461, .blue=44461
xcmap[85] .pixel=5592405, .red=44718, .green=44718, .blue=44718
xcmap[86] .pixel=5658198, .red=44718, .green=44718, .blue=44718
xcmap[87] .pixel=5723991, .red=44975, .green=44975, .blue=44975
xcmap[88] .pixel=5789784, .red=45232, .green=45232, .blue=45232
xcmap[89] .pixel=5855577, .red=45232, .green=45232, .blue=45232
xcmap[90] .pixel=5921370, .red=45489, .green=45489, .blue=45489
xcmap[91] .pixel=5987163, .red=45746, .green=45746, .blue=45746
xcmap[92] .pixel=6052956, .red=45746, .green=45746, .blue=45746
xcmap[93] .pixel=6118749, .red=46003, .green=46003, .blue=46003
xcmap[94] .pixel=6184542, .red=46260, .green=46260, .blue=46260
... not sure why the output got truncated

Both XStoreColors() and XSync() calls return 1.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the xorg-driver-ati mailing list