From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org Subject: [Bug 109371] New: Textures seem to be byteswapped on big endian architectures Date: Wed, 16 Jan 2019 00:36:08 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0157681472==" Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "Nouveau" To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org --===============0157681472== Content-Type: multipart/alternative; boundary="15475989680.DAd798A.18249" Content-Transfer-Encoding: 7bit --15475989680.DAd798A.18249 Date: Wed, 16 Jan 2019 00:36:08 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D109371 Bug ID: 109371 Summary: Textures seem to be byteswapped on big endian architectures Product: Mesa Version: 18.3 Hardware: PowerPC OS: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/DRI/nouveau Assignee: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Reporter: kungfujesus06-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org QA Contact: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org When using an NV43 based GPU on a PPC64 kernel with a 64 bit userspace, it seems applications will have byte swapped textures when specified with GL_R= GBA and GL_UNSIGNED_BYTE. Matplotlib will do this when blit=3DTrue for the plot routines, and several games will have this issue. In particular, for Legacy Doom, I've found that if I swap the textures so that they are A,B,G,R just before the textures are mapped, everything is correct.=20=20 I also found that doing glPixelStorei(GL_UNPACK_BYTES, GL_TRUE) and choosing GL_UNSIGNED_INT_8_8_8_8 as the representation seemed to also remedy this. I found that the _REV variant didn't byte swap the textures back to the incor= rect ordering (this is probably a different bug). Easiest way to demonstrate the bug: svn co https://svn.code.sf.net/p/doomlegacy/svn/legacy_one/trunk doomlegacy cd doomlegacy make OS=3DLINUX make cd bin Grab this archive: https://sourceforge.net/projects/doomlegacy/files/1.47.2/doomlegacy_1.47.2_= common.zip/download, unzip it, extract legacy.wad into the bin directory Grab this archive: https://github.com/freedoom/freedoom/releases/download/v0.11.3/freedoom-0.1= 1.3.zip, extract, move freedoom1.wad into the bin directory. Then do: ./doomlegacy -iwad freedoom1.wad -opengl --=20 You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.= --15475989680.DAd798A.18249 Date: Wed, 16 Jan 2019 00:36:08 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated
Bug ID 109371
Summary Textures seem to be byteswapped on big endian architectures
Product Mesa
Version 18.3
Hardware PowerPC
OS Linux (All)
Status NEW
Severity normal
Priority medium
Component Drivers/DRI/nouveau
Assignee nouveau@lists.freedesktop.org
Reporter kungfujesus06@gmail.com
QA Contact nouveau@lists.freedesktop.org

When using an NV43 based GPU on a PPC64 kernel with a 64 bit u=
serspace, it
seems applications will have byte swapped textures when specified with GL_R=
GBA
and GL_UNSIGNED_BYTE.  Matplotlib will do this when blit=3DTrue for the plot
routines, and several games will have this issue.  In particular, for Legacy
Doom, I've found that if I swap the textures so that they are A,B,G,R just
before the textures are mapped, everything is correct.=20=20

I also found that doing glPixelStorei(GL_UNPACK_BYTES, GL_TRUE) and choosing
GL_UNSIGNED_INT_8_8_8_8 as the representation seemed to also remedy this.  I
found that the _REV variant didn't byte swap the textures back to the incor=
rect
ordering (this is probably a different bug).

Easiest way to demonstrate the bug:
svn co https://svn.code.sf.net/p/doomlegacy/svn/legacy_one/trunk doomlegacy
cd doomlegacy
make OS=3DLINUX
make
cd bin
Grab this archive:
https://sourceforge.net/projects/doomlegacy=
/files/1.47.2/doomlegacy_1.47.2_common.zip/download,
unzip it, extract legacy.wad into the bin directory
Grab this archive:
https://github.com/freedoom/freedoom/releases/download/=
v0.11.3/freedoom-0.11.3.zip,
extract, move freedoom1.wad into the bin directory.
Then do:
./doomlegacy -iwad freedoom1.wad -opengl


You are receiving this mail because:
  • You are the QA Contact for the bug.
  • You are the assignee for the bug.
= --15475989680.DAd798A.18249-- --===============0157681472== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTm91dmVhdSBt YWlsaW5nIGxpc3QKTm91dmVhdUBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9ub3V2ZWF1Cg== --===============0157681472==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org Subject: [Bug 109371] Textures seem to be byteswapped on big endian architectures Date: Wed, 16 Jan 2019 00:40:17 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0169067535==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "Nouveau" To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org --===============0169067535== Content-Type: multipart/alternative; boundary="15475992161.4c95FfE9f.21195" Content-Transfer-Encoding: 7bit --15475992161.4c95FfE9f.21195 Date: Wed, 16 Jan 2019 00:40:16 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D109371 --- Comment #1 from Ilia Mirkin --- You'd save me a bunch of effort by performing these steps yourself, and tra= cing using apitrace (https://github.com/apitrace/apitrace). Ideally record an as-short-as-possible trace, and check that it still looks bad on replay, and then xz -9 it and attach here. --=20 You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.= --15475992161.4c95FfE9f.21195 Date: Wed, 16 Jan 2019 00:40:16 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 1 on bug 10937= 1 from Ilia Mirkin
You'd save me a bunch of effort by performing these steps your=
self, and tracing
using apitrace (https://gi=
thub.com/apitrace/apitrace). Ideally record an
as-short-as-possible trace, and check that it still looks bad on replay, and
then xz -9 it and attach here.


You are receiving this mail because:
  • You are the QA Contact for the bug.
  • You are the assignee for the bug.
= --15475992161.4c95FfE9f.21195-- --===============0169067535== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTm91dmVhdSBt YWlsaW5nIGxpc3QKTm91dmVhdUBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9ub3V2ZWF1Cg== --===============0169067535==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org Subject: [Bug 109371] Textures seem to be byteswapped on big endian architectures Date: Wed, 16 Jan 2019 05:41:23 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0421831165==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "Nouveau" To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org --===============0421831165== Content-Type: multipart/alternative; boundary="15476172830.fB0b2fAc8.5970" Content-Transfer-Encoding: 7bit --15476172830.fB0b2fAc8.5970 Date: Wed, 16 Jan 2019 05:41:23 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D109371 --- Comment #2 from Adam Stylinski --- Created attachment 143138 --> https://bugs.freedesktop.org/attachment.cgi?id=3D143138&action=3Dedit Trace demoing the issue Heh, the issue is there by the time I hit the title screen. --=20 You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.= --15476172830.fB0b2fAc8.5970 Date: Wed, 16 Jan 2019 05:41:23 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 2 on bug 10937= 1 from Adam Stylinski
Created attachment 14313=
8 [details]
Trace demoing the issue

Heh, the issue is there by the time I hit the title screen.


You are receiving this mail because:
  • You are the QA Contact for the bug.
  • You are the assignee for the bug.
= --15476172830.fB0b2fAc8.5970-- --===============0421831165== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTm91dmVhdSBt YWlsaW5nIGxpc3QKTm91dmVhdUBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9ub3V2ZWF1Cg== --===============0421831165==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org Subject: [Bug 109371] Textures seem to be byteswapped on big endian architectures Date: Sat, 19 Jan 2019 20:31:58 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1758521130==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "Nouveau" To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org --===============1758521130== Content-Type: multipart/alternative; boundary="15479299180.9dd12EbD.15121" Content-Transfer-Encoding: 7bit --15479299180.9dd12EbD.15121 Date: Sat, 19 Jan 2019 20:31:58 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D109371 --- Comment #3 from Ilia Mirkin --- Unfortunately it appears that my G5 is dead. It half-booted once (died right around nfsroot load time). Then for a bit it would turn on, with fans going= but no light and no chime. Now the fans don't even turn on. So I think that's t= he end. The things I would have done: 1. Check whether the textures look OK in qapitrace's inspector 2. Look at the transfer methods being used (in nv30_transfer.c). Try commen= ting some out, although that can also lead to failures. 3. Try to create a simple program based on the apitrace which reproduces the issue, and debug it step by step, to figure out where the byteswap might be happening. A few bits of info: The GPUs are LE deep down inside. However they have BE modes which byteswap "some stuff". So like MMIO accesses, FIFO commands, etc. So they can still = be packed like integers as usual, without an extra byteswap, and the GPU will "take care of it". I don't have a clean idea of whether and how byteswapping happens between GART and VRAM, as well as in various "blit"/copy methods, w= here the byteswap would be different depending on whether it's u8, u16, or u32 datatype. This is most relevant to index buffers though, not textures. [Like let's say you're feeding the data via FIFO commands, there's an implicit byteswap there, etc.] Have a look at nv30_format.c for the supported texture formats/etc. As always, feel free to ask stuff in #nouveau. It should be noted that with a patch to apitrace (https://github.com/apitrace/apitrace/issues/601#issuecomment-455019551), t= he attached trace replays fine on both nv42 and nv34 on x86. --=20 You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.= --15479299180.9dd12EbD.15121 Date: Sat, 19 Jan 2019 20:31:58 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated

Commen= t # 3 on bug 10937= 1 from Ilia Mirkin
Unfortunately it appears that my G5 is dead. It half-booted on=
ce (died right
around nfsroot load time). Then for a bit it would turn on, with fans going=
 but
no light and no chime. Now the fans don't even turn on. So I think that's t=
he
end.

The things I would have done:

1. Check whether the textures look OK in qapitrace's inspector
2. Look at the transfer methods being used (in nv30_transfer.c). Try commen=
ting
some out, although that can also lead to failures.
3. Try to create a simple program based on the apitrace which reproduces the
issue, and debug it step by step, to figure out where the byteswap might be
happening.

A few bits of info:

The GPUs are LE deep down inside. However they have BE modes which byteswap
"some stuff". So like MMIO accesses, FIFO commands, etc. So they =
can still be
packed like integers as usual, without an extra byteswap, and the GPU will
"take care of it". I don't have a clean idea of whether and how b=
yteswapping
happens between GART and VRAM, as well as in various "blit"/copy =
methods, where
the byteswap would be different depending on whether it's u8, u16, or u32
datatype. This is most relevant to index buffers though, not textures. [Like
let's say you're feeding the data via FIFO commands, there's an implicit
byteswap there, etc.]

Have a look at nv30_format.c for the supported texture formats/etc.

As always, feel free to ask stuff in #nouveau.

It should be noted that with a patch to apitrace
(https://github.com/apitrace/apitrace/issues/601#issuecomment-45501=
9551), the
attached trace replays fine on both nv42 and nv34 on x86.


You are receiving this mail because:
  • You are the QA Contact for the bug.
  • You are the assignee for the bug.
= --15479299180.9dd12EbD.15121-- --===============1758521130== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTm91dmVhdSBt YWlsaW5nIGxpc3QKTm91dmVhdUBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9ub3V2ZWF1Cg== --===============1758521130==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org Subject: [Bug 109371] Textures seem to be byteswapped on big endian architectures Date: Wed, 18 Sep 2019 20:47:20 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2008015641==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "Nouveau" To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org --===============2008015641== Content-Type: multipart/alternative; boundary="15688396400.89AB.28023" Content-Transfer-Encoding: 7bit --15688396400.89AB.28023 Date: Wed, 18 Sep 2019 20:47:20 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated https://bugs.freedesktop.org/show_bug.cgi?id=3D109371 GitLab Migration User changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |MOVED Status|NEW |RESOLVED --- Comment #4 from GitLab Migration User --- -- 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/116= 7. --=20 You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.= --15688396400.89AB.28023 Date: Wed, 18 Sep 2019 20:47:20 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated GitLab Migration User changed bug 10937= 1
What Removed Added
Resolution --- MOVED
Status NEW RESOLVED

Commen= t # 4 on bug 10937= 1 from GitLab Migration User
-- 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/1167.
        


You are receiving this mail because:
  • You are the QA Contact for the bug.
  • You are the assignee for the bug.
= --15688396400.89AB.28023-- --===============2008015641== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTm91dmVhdSBt YWlsaW5nIGxpc3QKTm91dmVhdUBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9ub3V2ZWF1 --===============2008015641==--