[Mesa-dev] Wrong colors in 3D apps on big-endian systems

Christian Zigotzky chzigotzky at xenosoft.de
Fri Mar 7 02:28:16 PST 2014



On Don, 2014-03-06 at 20:06 +0100, Christian Zigotzky wrote:
> Hi Thomas,
> Hi Michel,
>
> There are any problems with false colors since Mesa 9.2 on big-endian
> (PowerPC) systems. I've figured out that the following line in
> "src/gallium/drivers/r600/evergreen_state.c" the problem is.
>
> case V_028C70_COLOR_8_8_8_8:
>
> When I comment out this case then the colors are to 99% right. But if I
> comment out the following lines then all colors are correct.
>
>      /* 32-bit buffers. */
>              //case PIPE_FORMAT_A8B8G8R8_SRGB:
>              //case PIPE_FORMAT_A8B8G8R8_UNORM:
>              case PIPE_FORMAT_A8R8G8B8_UNORM:
>              //case PIPE_FORMAT_B8G8R8A8_SRGB:
>              //case PIPE_FORMAT_B8G8R8A8_UNORM:
>              //case PIPE_FORMAT_B8G8R8X8_UNORM:
>              //case PIPE_FORMAT_R8G8B8A8_SNORM:
>              //case PIPE_FORMAT_R8G8B8A8_UNORM:
>              //case PIPE_FORMAT_R8G8B8X8_UNORM:
>              //case PIPE_FORMAT_R8G8B8X8_SNORM:
>              //case PIPE_FORMAT_R8G8B8X8_SRGB:
>              //case PIPE_FORMAT_R8G8B8X8_UINT:
>              //case PIPE_FORMAT_R8G8B8X8_SINT:
>              //case PIPE_FORMAT_R8SG8SB8UX8U_NORM:
>              //case PIPE_FORMAT_X8B8G8R8_UNORM:
>              //case PIPE_FORMAT_X8R8G8B8_UNORM:
>              //case PIPE_FORMAT_R8G8B8_UNORM:
>              //case PIPE_FORMAT_R8G8B8A8_SINT:
>              //case PIPE_FORMAT_R8G8B8A8_UINT:
>                      return V_028C70_COLOR_8_8_8_8;
>
> Neverball, Glxgears, and SuperTuxKart works fine with the right colors.
>
> Screenshots:
> http://forum.hyperion-entertainment.biz/viewtopic.php?f=35&t=2137&p=26037#p26037
>
> The patched Mesa 10.0.3 and 10.1.0 works well on Debian Sid and on
> Lubuntu 14.04.
>
> Could you patch the official Mesa, please?

That's not a proper solution.

You probably need to change some of the cases in
r600_colorformat_endian_swap(), and maybe some other code setting
endianness related register fields. Basically, the r600g driver assumes
the x8x8x8x8 formats are packed in host byte order, which used to work
because st/mesa also happened to use them like that. But now the
definition of those formats has been clarified to be byte arrays,
independent from host byte order.

You may also need the st/dri patch to use packed formats which I posted
in a revent discussion about this on the mesa-dev mailing list.

Speaking of which, you should also bring this up on the mesa-dev mailing
list again, instead of contacting individuals.


-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer





More information about the mesa-dev mailing list