Corrupted display (radeon_accelfuncs.c)

Michel Dänzer michel at daenzer.net
Sun Dec 26 23:32:18 PST 2004


On Sun, 2004-12-26 at 23:11 +0100, Jerome Glisse wrote:
> I am not sure but i think there is a typo bug
> 
> in radeon_accel.c line 657 this should be
>     if (bpp == 2)
>     OUT_RING_REG(RADEON_RBBM_GUICNTL,   RADEON_HOST_DATA_SWAP_16BIT);
>     else if (bpp == 4)
>     OUT_RING_REG(RADEON_RBBM_GUICNTL,   RADEON_HOST_DATA_SWAP_32BIT);
>     else
>     OUT_RING_REG(RADEON_RBBM_GUICNTL,   RADEON_HOST_DATA_SWAP_NONE);
>     ADVANCE_RING();
> 
> Instead of
>     if (bpp == 2)
>     OUT_RING_REG(RADEON_RBBM_GUICNTL,   RADEON_HOST_DATA_SWAP_16BIT);
>     else if (bpp == 1)
>     OUT_RING_REG(RADEON_RBBM_GUICNTL,   RADEON_HOST_DATA_SWAP_32BIT);
>     else
>     OUT_RING_REG(RADEON_RBBM_GUICNTL,   RADEON_HOST_DATA_SWAP_NONE);
>     ADVANCE_RING();

The output of diff -u would be easier to parse...

> Or did i misunderstood bpp magic :) ?

There are several transfers to take into account:

      * CPU -> ring buffer: no change
      * ring buffer -> host data registers: converts to little endian
      * host data registers -> video RAM: no change

The idea is to swizzle the bytes in the host data registers such that
the byte order of the image data ends up being little endian in video
RAM. Either think it through or experiment. :)


> Anyway this does not fix the problem of corrupted display.

Sure, this code is only used for R[12]00 Render acceleration and XVideo
so far, hence my (still unanswered) question about whether the latter
works correctly on R300...


-- 
Earthling Michel Dänzer      |     Debian (powerpc), X and DRI developer
Libre software enthusiast    |   http://svcs.affero.net/rm.php?r=daenzer



More information about the xorg mailing list