[Bug 29701] New: incorrect colors and gamma with 16-bit color depth

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Aug 20 06:34:58 PDT 2010


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

           Summary: incorrect colors and gamma with 16-bit color depth
           Product: xorg
           Version: unspecified
          Platform: x86 (IA32)
        OS/Version: Linux (All)
            Status: NEW
          Severity: major
          Priority: medium
         Component: Driver/Radeon
        AssignedTo: xorg-driver-ati at lists.x.org
        ReportedBy: btanastasov at yahoo.co.uk
         QAContact: xorg-team at lists.x.org


With radeon driver 6.13.0 and probably older versions in fedora 12 and 13 when
color depth in xorg.conf is set to 16-bit the picture looks rather green with
less contrast. The picture is ok with 15 or 24 bit, but not with 16 bit.
(This is without KMS. With KMS colors looks ok, but the system is not stable
with random segmentation faults of X.)

How to reproduce:
Edit /etc/X11/xorg.conf and add in Screen section:

Section "Screen"
        ...
        ...
        DefaultDepth 16
        ...
        ...


        Subsection "Display"
                Depth 24
                Modes "..." "..." "..."
        EndSubSection
EndSection

I think I've found the problem for wrong gamma. It seems that there is
different logic for 16 bit and everything else in src/radeon_crtc.c, and if
commented the colors looks ok.

{
    RADEONCrtcPrivatePtr radeon_crtc = crtc->driver_private;
    ScrnInfoPtr         pScrn = crtc->scrn;
    int i, j;

    if (0/*pScrn->depth == 16*/) {
        for (i = 0; i < 64; i++) {
            if (i <= 31) {
                for (j = 0; j < 8; j++) {
                    radeon_crtc->lut_r[i * 8 + j] = red[i] >> 6;
                    radeon_crtc->lut_b[i * 8 + j] = blue[i] >> 6;
                }
            }

            for (j = 0; j < 4; j++) {
                radeon_crtc->lut_g[i * 4 + j] = green[i] >> 6;
            }
        }
    } else {
        for (i = 0; i < 256; i++) {
            radeon_crtc->lut_r[i] = red[i] >> 6;
            radeon_crtc->lut_g[i] = green[i] >> 6;
            radeon_crtc->lut_b[i] = blue[i] >> 6;
        }
    }

    radeon_crtc_load_lut(crtc);
}

The other problem which it seems for me is related to the gamma is that opengl
programs for example glxgears are with wrong colors too on my HD4200 card and
is not fixed with disabling the "if" part.
The colors are wrong on 3 different hardwares, so I think it is not ati model
related:
- ATI 9550
- ATI X1300
- ATI HD4200


I've reported this problem in fedora bugzilla but nothing happened for 7
months.
https://bugzilla.redhat.com/show_bug.cgi?id=554967

There are attachments with Xorg.log with 16 and 24 bit depths if needed.

-- 
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