Subject: [PATCH] drm/radeon: make all PCI GPUs use 32 bits DMA bit mask

I wish to be personally CC'ed the answers/comments posted to the list in
response to my posting.

This patch prevents to fail r600_ring_test on ATI PCI devices
hosted on K8 or K10 platforms, this error:

> [drm:r600_ring_test [radeon]] *ERROR* radeon:
>   ring 0 test failed (scratch(0x8504)=0xCAFEDEAD)
> radeon 0000:03:00.0: disabling GPU acceleration

and this error:

> trying to bind memory to uninitialized GART !

Such PCI hardware works correctly on Intel 82801
platform, so this change may be non-optimal for them
on non-K8/K10 platforms.

Initial code was testing for GPU chip families to choose
between 40 bits or 32 bits, it looks like a better code
would be to test for platforms (PCI bridge, maybe?).

This is not enough to fix PCI GPUs on K8 (K8T800) and
K10 (nForce3), also, non-ATI Nvidia PCI GPUs are affected
by at least one other unknown bug that may be in common.

This may also prevents the uninitialized GART error to occur
when ATI AGP cards run in PCI mode. This is not a call to
disable AGP, and other bug(s) leaves AGP hardware unusable
once AGP is disabled. Also this patch uncovers some other bugs
happening when AGP cards are driven as PCI ones.

I have probably reached my skill cap with this patch in regards to
the topic. This may help specialists to investigate further by giving
them an entry point.

I have access to some not-so-old still-relevant PCI GPUs by ATI
and Nvidia (TeraScale, Tesla 1.0, both OpenGL 3.3 capable) and
some K8 and K10 computers that can be purposed for testing
patches written by others in hope to get a complete fix one day.

See related bugs for details about GPUs, host platforms, and a
a lot of details and logs about issues faced:

- https://bugs.launchpad.net/bugs/1902795
> PCI graphics broken on AMD K8/K10 platform (while it works on Intel)
> verified from Linux 4.4 to 5.10-rc1

- https://bugs.launchpad.net/bugs/1902981
> AGP GPUs driven as PCI ones (when AGP is disabled at kernel build
> time) are known to fail on K8 and K10 platforms

- https://bugs.launchpad.net/bugs/1899304
> AGP disablement leaves GPUs without working alternative
> (PCI fallback is broken), makes very-capable ATI TeraScale GPUs
> unusable

--
Thomas “illwieckz” Debesse


Attachments:
0001-drm-radeon-make-all-PCI-GPUs-use-32bits-DMA-bit-mask.patch (1.89 kB)
OpenPGP_0xE06292933E2CA275.asc (7.19 kB)
OpenPGP_signature (855.00 B)
OpenPGP digital signature
Download all attachments