Ticket #47863

Aos 4.x SDL problem with cpu 7447

Eröffnet am: 2023-04-15 15:56 Letztes Update: 2023-07-10 20:57

Auswertung:
Verantwortlicher:
(Keine)
Typ:
Status:
Offen
Komponente:
Meilenstein:
(Keine)
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Keine
Datei:
1
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

Problem with SDL graphics with cpu 7447 AmigaOS 4.x

The problem lies in the wrong graphics display. See attached screenshot.

There appear to be shadows and fine lines on the screen. The problem does not occur in emulation of the "G3" processor and the default one emulated by qemu. The problem occurs in random applications

*Tested application: - MickJT-MPlayer

- RunInUAE r8 beta 6 (e-uae-sdl included)

*Tested major versions on machine: x86_64 with linux:

-qemu-system-ppc-6.1.0
AOS does not boot , no graphical mode

- qemu-system-ppc-6.2.0

AOS does not boot , no graphical mode

- qemu-system-ppc-7.0.0-rc0

AOS boots correctly problem occurs

- qemu-system-ppc-7.2.0

AOS boots correctly problem occurs

- qemu-system-ppc-8.0.0-rc4

AOS boots correctly problem occurs

ARM64 Apple M1 - qemu-system-ppc-7.2.0

AOS boots correctly problem occurs

- qemu-system-ppc-8.0.0-rc4

AOS boots correctly problem occurs

*Tested AOS4: - Amiga OS 4.1 FE

problem occurs

- Amiga OS 4.1 FE Upadate1

problem occurs

- Amiga OS 4.1 FE Update 2

problem occurs

*Graphics drivers (currently only QEMU SM501 Device is emulated for AOS)

- AOS 4.1 Update 3 siliconmotion502.chip
problem occurs

- AOS 4.1 FE siliconmotion502.chip

problem occurs

* Still to be checked:

all emulated PPC G3/G4 qemu processors.I've checked, but it's better to do it with a chechlist in order not to miss something. sdl demos from Aminet or OS4depot on which the problem can occur. Preferably with source codes.

Ticket-Verlauf (3/10 Historien)

2023-04-15 15:56 Aktualisiert von: smarkusg
  • New Ticket "Aos 4.x SDL problem with cpu 7447" created
2023-04-16 20:42 Aktualisiert von: balaton
  • Details Updated
2023-04-16 21:29 Aktualisiert von: balaton
Kommentar

Looks like using -cpu 7447 (or another one that AmigaOS recognises) enables Altivec which is disabled with the defaulr 7400 cpu (despite that also would support it). This suggests the problem may be with emulating one of the Altivec instructions. Question is which one as there are many and I don't know what to look for. Your testing with different QEMU versions shows that this is not something that broke recently thus unfortunately we can't do git bisect to find it. So more testing is needed to narrow down with which apps this is happening and what are the common Altivec operations those use. I don't have a better idea to find this. Maybe if there exist some Altivec test suite that could be tried under Linux guest or MacOS on mac99 with this cpu setting that could be helpful. Or hope that testing will be done later as I've seen some talks about that on the qemu-ppc list. In summary, until we sonehow identify which Altivec op is failing we can't do much about this.

2023-04-16 22:32 Aktualisiert von: balaton
Kommentar

There's also an unmerged patch on qemu list here:

https://patchew.org/QEMU/168141244011.3026479.13697197743885252330.stgit@ltc-boston1.aus.stglabs.ibm.com/

that fixed one Altivec/VMX instruction but I think that's only relevant for PPC64. But ir references a QEMU ticket:

https://gitlab.com/qemu-project/qemu/-/issues/1536

which talks about some VMX test suito so it that can be run it may find the instruction with the bug. Sombody would look at that thogh,

2023-04-19 23:38 Aktualisiert von: balaton
Kommentar

Patch in above comment does not seem to help.

Here's video showing the problem.

I wonder if this can be specific to ARM host as both reports were from Apple silicon Macs so far.

2023-04-20 06:56 Aktualisiert von: balaton
Kommentar

Sorry, the bug was filed saying it happens on x86_64 which I've missd but now it's also confirmed on ARM and x86_64 again so it's not host CPU specific. One game that can easily reproduce it is Super Maryo Chronicles which uses SDL. I wonder if it depends on screen depth but this game only seems to run in 16 bit, it opens new screen when started from 8 bit mode. Maybe could be tested on MorphOS which also supports 24 bit mode.

Not sure I've found the same SDL sources that the game uses but the one I've found seems to use these Alrivec calls: vec_add, vec_and, vec_cmpeq, vec_dss, vec_dstst, vec_dstt, vec_ld, vec_lvsl, vec_or, vec_packpx, vec_perm, vec_sel, vec_sl, vec_splat, vec_st so problem may be with one of these. Since Altivec generally works, I'd expect the more common ones to be OK so maybe one of the rarely used ones like packpx are more suspect.

There seems to be some tests for some of these in gcc sources but I don't know how to run those.

2023-05-01 07:18 Aktualisiert von: balaton
Kommentar

After more testing now I'm not sure if this could be a bug in SDL itself and not in emulation. Some problems could be reproduced on real hardware as well and those seem to be corrected in newer SDL versions. The Super Maryo Chronicles game does not show issue on real hardware but that may be related to the display driver and can be worked around by setting 32 bpp in game options.

2023-07-07 11:39 Aktualisiert von: jmontleon
Kommentar

The intro videos in Freespace also show this problem with the 7447 CPU. With G3 they play correctly.

2023-07-10 20:57 Aktualisiert von: balaton
Kommentar

This may be an issue in SDL which has some problems with 16 bit modes when using Altivec as suggested by discussions elsewhere such as here: https://www.amigans.net/modules/newbb/viewtopic.php?post_id=140752 So if Freescape uses SDL then maybe try to update that if possible.

(Edited, 2023-07-10 20:58 Aktualisiert von: balaton)

Dateianhangliste

Bearbeiten

Please login to add comment to this ticket » Anmelden