Wrong colors with Mesa 11.1.2-1 on ubuntu MATE 16.04 PowerPC

Bug #1275042 reported by Christian Zigotzky
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mesa
New
Unknown
mesa (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Upstream report:
https://gitlab.freedesktop.org/mesa/mesa/issues/477

I've tried Mesa 9.2.2-1 and 10.0.1 on Debian Sid, Lubuntu 13.10, and on Lubuntu 14.04. Unfortunately all have issued false colors in games. They appear to be ABGR instead of RGBA, thus blue becomes green, red becomes alpha etc.

This issue affects sdl2 applications either.

The Mesa version 11.1.2-1 doesn't work either on ubuntu MATE 16.04 PowerPC.

Mesa 8.0.5-4 and Mesa 9.1.6 have no color problem.

The transitional solution is to install the old Mesa 8.0.X with "Force Version" with the Synaptic package manager on new distributions.

In my point of view, the problem is in the source file p_format.h in the directory src/gallium/include/pipe/. There is some code for translating colors for big-endian machines. The problem is, this code is only for the CPU. I mean for LLVMpipe for the CPU. The Radeon graphics cards don't need this translating code but IBM pSeries machines without graphics cards need this code. This code translates the colors in a wrong way for Radeon graphics cards. I removed this code and after compiling Mesa again, the colors are displayed correctly. I released some unofficial Mesa versions with this patch.

Downloads: http://www.supertuxkart-amiga.de/amiga/mesalib-unofficial.html

Hardware:

AmigaOne X1000 (Nemo)
PA Semi Dual-core PA6T-1682M, 1.8GHz PowerISA™ v2.04+ CPU
"Xena" 500MHz XMOS XS1-L2 124
8GB DDR2 SDRAM
XFX Radeon HD 6870, 1 GB RAM
OCZ600MXSP 600 Switching power supply
RTL 8139/8139C/8139C+ network card
TSSTcorp CDDVDW SH-224BB dvd drive
ATA ST2000DM001-9YN1 SEAGATE HD
ATA ESA 3SF1240GB HD

More information:

http://en.wikipedia.org/wiki/AmigaOne_X1000
http://www.supertuxkart-amiga.de/amiga/x1000.html

Rgds,
Christian
---
ApportVersion: 2.20-0ubuntu3
Architecture: powerpc
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: None
CurrentDesktop: MATE
DistUpgraded: Fresh install
DistroCodename: xenial
DistroRelease: Ubuntu 16.04
DistroVariant: ubuntu
ExtraDebuggingInterest: Yes
GraphicsCard:
 Advanced Micro Devices, Inc. [AMD/ATI] Barts XT [Radeon HD 6870] [1002:6738] (prog-if 00 [VGA controller])
   Subsystem: XFX Pine Group Inc. Barts XT [Radeon HD 6870] [1682:3107]
Package: libgl1-mesa-dri 11.1.2-1ubuntu1
PackageArchitecture: powerpc
ProcKernelCmdLine: root=/dev/sdb1 quiet ro splash
ProcModules: kvm_pr 91899 0 - Live 0x0000000000000000
Tags: xenial ubuntu
Uname: Linux 4.5.0-rc6_A-EON_AmigaONE_X1000_Nemo ppc64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm audio cdrom dip lpadmin plugdev sambashare sudo video
_MarkForUpload: True
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.67-1
version.libgl1-mesa-dri: libgl1-mesa-dri 11.1.2-1ubuntu1
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 11.1.2-1ubuntu1
version.xserver-xorg-core: xserver-xorg-core 2:1.17.3-2ubuntu4
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.9.2-1ubuntu1
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:7.6.1-1
version.xserver-xorg-video-intel: xserver-xorg-video-intel N/A
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.12-1

Revision history for this message
In , Christian Zigotzky (chzigotzky-xenosoft) wrote :

Hi all,

I've tried Mesa 9.2.2-1 and 10.0.0-1 on Debian Sid and Lubuntu 13.10. Unfortunately both have issued false colors in games. They appear to be ABGR instead of RGBA, thus blue becomes green, red becomes alpha etc.

Mesa 8.0.5-4 and Mesa 9.1.6 have no color problem.

The transitional solution is to install the old Mesa 8.0.X with "Force Version" with the Synaptic package manager on new distributions.

Hardware:

AmigaOne X1000 (Nemo)
PA Semi Dual-core PA6T-1682M, 1.8GHz PowerISA™ v2.04+ CPU
"Xena" 500MHz XMOS XS1-L2 124
8GB DDR2 SDRAM
HIS Radeon HD 6870, 1 GB RAM
OCZ600MXSP 600 Switching power supply
RTL 8139/8139C/8139C+ network card
TSSTcorp CDDVDW SH-224BB dvd drive
ATA ST2000DM001-9YN1 SEAGATE HD
ATA ESA 3SF1240GB HD

More information:

http://en.wikipedia.org/wiki/AmigaOne_X1000
http://www.supertuxkart-amiga.de/amiga/x1000.html

Rgds,
Christian

Revision history for this message
In , Curaga (lauri-kasanen) wrote :

More specifically, this bug is about BGRA vertex colors, GL_EXT_vertex_array_bgra, seen in SuperTuxKart math level for example.

Revision history for this message
In , Michel Dänzer (michel-daenzer) wrote :

This is probably due to commit 2151d893fbd4a4be092098170e2fbca8c35797a5 ('gallium: Fix llvmpipe on big-endian machines'). The r600g driver needs to be adapted for the changed PIPE_FORMAT_* semantics.

Revision history for this message
In , Christian Zigotzky (chzigotzky-xenosoft) wrote :

(In reply to comment #2)
> This is probably due to commit 2151d893fbd4a4be092098170e2fbca8c35797a5
> ('gallium: Fix llvmpipe on big-endian machines'). The r600g driver needs to
> be adapted for the changed PIPE_FORMAT_* semantics.

I don't know if I have correct understand your answer. Is the bug fixed?

Revision history for this message
In , Michel Dänzer (michel-daenzer) wrote :

(In reply to comment #3)
> Is the bug fixed?

Not yet. To fix it, the r600g driver needs to be adapted to changes in the way the Gallium3D infrastructure deals with big endian hosts.

Revision history for this message
In , Christian Zigotzky (chzigotzky-xenosoft) wrote :

(In reply to comment #4)
> (In reply to comment #3)
> > Is the bug fixed?
>
> Not yet. To fix it, the r600g driver needs to be adapted to changes in the
> way the Gallium3D infrastructure deals with big endian hosts.

Hi Michel,

Thanks a lot for your answer. :-) We had a problem with wrong colors in SuperTuxKart 0.8 last year. The Irrlicht guys have released a little hack for Irrlicht on Linux PPC (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=48577). They told me that is a driver bug, and that workaround costs performance and RAM. Unfortunately this workaround isn't suitable for Mesa 9.2 and higher. At this time we have to install Mesa 9.1.X and lower on new Linux distributions like Lubuntu 13.10, Debian Sid etc. It would be nice to solve this issue because we don't need the workaround in the future.

All the best,

Christian

Revision history for this message
In , Christian Zigotzky (chzigotzky-xenosoft) wrote :

Created attachment 91561
Lubuntu 13.10 PowerPC (Kernel 3.13-rc7) with the old Mesa 8.0.2

Lubuntu 13.10 PowerPC (Kernel 3.13-rc7) with the old Mesa 8.0.2. 3D acceleration works well in the fullscreen mode.

Revision history for this message
In , Christian Zigotzky (chzigotzky-xenosoft) wrote :

Created attachment 91566
glxgears has wrong colors with Mesa 10.0.1

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote :
Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote :
Revision history for this message
In , Christian Zigotzky (chzigotzky-xenosoft) wrote :

Hi All,

I've installed Mesa 10.0.2 on Debian Sid PowerPC with the following commands:

apt-get install -t experimental libgl1-mesa-dri
apt-get install -t experimental libgl1-mesa-glx
apt-get install -t experimental mesa-utils
apt-get install -t experimental libdrm-radeon1
apt-get install -t experimental xserver-xorg-video-ati
apt-get install -t experimental xserver-xorg-video-radeon

glxinfo | grep OpenGL

OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD BARTS
OpenGL core profile version string: 3.1 (Core Profile) Mesa 10.0.2
OpenGL core profile shading language version string: 1.40
OpenGL core profile context flags: (none)
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 10.0.2
OpenGL shading language version string: 1.30
OpenGL context flags: (none)

Unfortunately, the games have still wrong colors.

I've tested it with the kernel 3.11.0, 3.12.5, and 3.13.1.

Rgds,

Christian

Revision history for this message
In , Christian Zigotzky (chzigotzky-xenosoft) wrote :

The problem is the package libgl1-mesa-dri. I have installed the old package libgl1-mesa-dri 8.0.5-4 with "Force Version" with the Synaptic package manager and this has solved the problem with the wrong colors.

-- Christian

Revision history for this message
In , Oibaf (oibaf) wrote :

There are endianess patches here:
http://lists.freedesktop.org/archives/mesa-dev/2014-July/thread.html#63723

Still not applied. No idea if they properly fix this issue.

Changed in mesa:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Oibaf (oibaf) wrote :

Big-endian patches are in mesa git now. Is this still an issue?

Revision history for this message
In , Michel Dänzer (michel-daenzer) wrote :

(In reply to comment #11)
> Big-endian patches are in mesa git now. Is this still an issue?

Yes. The infrastructure changes are mostly complete now, but the hardware drivers still haven't been adapted to them.

Revision history for this message
Launchpad Janitor (janitor) wrote : Re: Wrong colors with Mesa 9.2 and Mesa 10.0 on Lubuntu 14.04 PowerPC

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mesa (Ubuntu):
status: New → Confirmed
Revision history for this message
Nate Olander (aeves-nate) wrote :

I have the same issue in Ubuntu MATE Remix 14.04.1 on an iBook G4 (mid-2005, PPC).

Revision history for this message
In , Christian Zigotzky (chzigotzky-xenosoft) wrote :

Is the r600g driver ready for the Gallium3D infrastructure of big endian hosts?

Revision history for this message
In , Alex Perez (aperez-6) wrote :

Ping. I am still experiencing problems with incorrect colors with the very latest Mesa, compiled from a fresh git checkout today.

Revision history for this message
In , Ilia Mirkin (imirkin) wrote :

(In reply to Alex Perez from comment #14)
> Ping. I am still experiencing problems with incorrect colors with the very
> latest Mesa, compiled from a fresh git checkout today.

Mesa 11.0.3+ work fine on a PPC G5 with a NV34 GPU. Haven't tested much else. I don't think this is a "core" issue anymore.

Revision history for this message
In , Jockel (joro-2013) wrote :

Allow me to add my experiences.

Whether the colors are garbled on PPC depends on the GL color format used (among probably a gazillion other parameters :-). Packed (16-bit) formats have been broken on big-endian for some time, they worked fine in mesa 10.1, in mesa 10.3 R5G5B5A1 works, R4G4B4A4 works with alpha glitches, somewhere in the 10.3 release cycle the format stuff got completely rewritten breaking pretty much all packed formats on big-endian (PPC).

Unpacked (32 bits) formats seem to be working fine.

That's on a RV280 32 bit system. No idea whether that is also valid for NV34 on 64-bit PPC, i.e. whether the problem is in core mesa or the radeon stuff.

Revision history for this message
In , Jockel (joro-2013) wrote :

Addendum: Tested on the pcsx playstation emulator (which makes the GL format selectable) and the peopsxgl plugin ported to PPC.

Revision history for this message
In , Emil-l-velikov (emil-l-velikov) wrote :

(In reply to joro-2013 from comment #16)
> Allow me to add my experiences.
>
> Whether the colors are garbled on PPC depends on the GL color format used
> (among probably a gazillion other parameters :-). Packed (16-bit) formats
> have been broken on big-endian for some time, they worked fine in mesa 10.1,
> in mesa 10.3 R5G5B5A1 works, R4G4B4A4 works with alpha glitches, somewhere
> in the 10.3 release cycle the format stuff got completely rewritten breaking
> pretty much all packed formats on big-endian (PPC).
>
> Unpacked (32 bits) formats seem to be working fine.
>
> That's on a RV280 32 bit system. No idea whether that is also valid for NV34
> on 64-bit PPC, i.e. whether the problem is in core mesa or the radeon stuff.

The report in question is (was?) about the gallium radeon driver - r600g.

On the classic radeon/r200 front there was a regression caused by commit 779cabfc7d022de8b7b9bc7fdac0caffa8646c51 (which itself fixing some BE issues, circa 11.0), which was resolved in 11.0.6 and 11.1.0. If things are still off, then I'd suggest opening separate bug report and if possible bisecting it down.

Revision history for this message
In , Jockel (joro-2013) wrote :

Actually i had already e-mailed Roland Scheideregger privately (thanking him for still giving some care to this ancient driver with BE systems although the commit didn't fix the problems :-).

I already tracked down the breakage that affects me to the (otherwise very sensible) pythonization of the format stuff around commit d4c780e052c9cc361bed5958b72b42d8151800c2 <quote>:

mesa: Add python to parse the formats CSV file
The basic concept for the format parser was taken from the format CSV
parser in gallium/auxilliary/util. However, this one has been altered in a
number of ways:

 * Removed big endian vs. little endian stuff (mesa doesn't need it)
 * Better documentation: Almost every method has a full docstring
 * An actual Swizzle class with methods for composition and inverses
 * Over-all cleaner (in my opinion) implementation and class interactions
 * A few bug fixes

</quote>

Ahhhh, the joys of optimized code-reuse :-)

Since i'm no pythonista i didn't want to wade into it and still use the 10.3 stuff. But maybe that's a hint for the r600g driver and this bug report.

Revision history for this message
In , Alex Perez (aperez-6) wrote :

Last night, I confirmed that the colors are *correct* with r300g on Big Endian (tested with an RV515), but still incorrect with r600g, as of Mesa 11.0.2. Therefore, I have changed the component for this bug from mesa core to r600.

Revision history for this message
In , Oded Gabbay (oded-gabbay) wrote :

Hi,
I posted two fixes for this to r600g driver (4b7e219 and 439b5b0).
I believe that with mesa master branch, the colors should now be mostly correct with 24-bit color.
Oded

Revision history for this message
In , Oded Gabbay (oded-gabbay) wrote :

So scrape that last comment.
The colors are correct when not using a compositor, because compositors (e.g. gnome-shell) get their info using textures, and the textures are still broken.

Revision history for this message
penalvch (penalvch) wrote : Re: Wrong colors with Mesa 9.2 and Mesa 10.0 on Lubuntu 14.04 PowerPC

Christian Zigotzky, thank you for reporting this and helping make Ubuntu better.

Could you please run the following command once from a terminal by ensuring you have the package xdiagnose installed, and that you click the Yes button for attaching additional debugging information:
apport-collect -p mesa 1275042

When reporting xorg related bugs in the future, please do so via the above method. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

Changed in mesa (Ubuntu):
importance: Undecided → Low
status: Confirmed → Incomplete
Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : BootLog.txt

apport information

tags: added: apport-collected ubuntu xenial
description: updated
Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : Dependencies.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : DpkgLog.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : GconfCompiz.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : JournalErrors.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : LightdmDisplayLog.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : LightdmGreeterLog.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : LightdmGreeterLogOld.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : LightdmLog.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : Lspci.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : Lsusb.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : ProcEnviron.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : UdevDb.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : XorgConf.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : XorgLog.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : XorgLogOld.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : Xrandr.txt

apport information

Revision history for this message
Christian Zigotzky (chzigotzky-xenosoft) wrote : xdpyinfo.txt

apport information

summary: - Wrong colors with Mesa 9.2 and Mesa 10.0 on Lubuntu 14.04 PowerPC
+ Wrong colors with Mesa 11.1.2-1 on ubuntu MATE 16.04 PowerPC
description: updated
description: updated
description: updated
description: updated
penalvch (penalvch)
tags: added: trusty
Changed in mesa (Ubuntu):
importance: Low → Medium
status: Incomplete → Triaged
tags: added: saucy
tags: added: regression-release
Revision history for this message
In , Gitlab-migration (gitlab-migration) wrote :

-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/477.

Changed in mesa:
status: Confirmed → Unknown
penalvch (penalvch)
no longer affects: mesa (Ubuntu)
affects: mesa → mesa (Ubuntu)
Changed in mesa (Ubuntu):
importance: Medium → Undecided
status: Unknown → New
importance: Undecided → Medium
status: New → Triaged
description: updated
Norbert (nrbrtx)
tags: removed: saucy trusty
Changed in mesa:
status: Unknown → New
To post a comment you must log in.