Created attachment 82134 [details] patch The current xf86-video-ati is broken on big-endian systems. The problem is that RADEON_TILING_SURFACE isn't set on the front buffer since commits ef9bfb262db7004bef3704e5d914687e50d3fca4 and e5bd99faa3b6629a55168386d5dfa936ee4e97ae. As a result the RADEON_TILING_SWAP_32BIT and RADEON_TILING_SWAP_16BIT flags don't have any effect, and any direct access to the front buffer will not do the necessary byte swapping. The effect is blatantly obvious if you disable acceleration (option NoAccel "on"), but also happens with (EXA) acceleration enabled. With acceleration disabled, the colors are all wrong. With acceleration enabled, the background of my xterms is yellow when it should be white. The attached patch fixes this, but might reintroduce problems with page flipping as mentioned in https://bugs.freedesktop.org/show_bug.cgi?id=33738 (the bug report that seems to have triggered the removal of the RADEON_TILING_SURFACE flag for the front buffer). But only on big-endian platforms.
Have you tried completely disallowing direct CPU access to the scanout buffer instead? Seems like that should fix this problem without reintroducing the other one.
Created attachment 82197 [details] [review] patch that fixes the accelerated case
Looks like I jumped to conclusions here. For the (EXA) accelerated case, the problem is that UTS/DFS get bypassed for the "screen pixmap". That was the right thing to do when the front buffer had a surface reg allocated to it that made sure the required byte swapping was done in hardware. But now that this isn't the case anymore, all pixmaps over 8bpp need byte swapping. See the attached patch. Of course this will leave the unaccelerated case broken. In that case the RADEON_TILING_SURFACE flag really has to be set. But there should be no interference with page flipping in that case.
Patch pushed, thanks. (In reply to comment #3) > Of course this will leave the unaccelerated case broken. In that case the > RADEON_TILING_SURFACE flag really has to be set. But there should be no > interference with page flipping in that case. Right. Or, the shadow update hook could swap the bytes. Do you want to look into fixing the unaccelerated case as well?
We only need swapping for r1xx-r5xx asics. For r6xx+, the display hardware already handles the swapping.
Michel, thanks. Yes I will look at fixing the shadowfb case as well. Alex, when you say that for r6xx the display hardware already handles the swapping, are you referring to the unaccelerated case? Or are you saying my change to RADEONPrepareAccess_CS() is wrong?
(In reply to comment #6) > Alex, when you say that for r6xx the display hardware already handles the > swapping, are you referring to the unaccelerated case? Or are you saying my > change to RADEONPrepareAccess_CS() is wrong? For unaccelerated. RADEONPrepareAccess_CS() only applies to r1xx-r5xx GPUs. R6xx and newer asics have their own PrepareAccess functions.
shadowfb has been fixed now as well
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.