I investigated video corruption on my older iMac7,1 (RV610/M74,
device ID 1002:94c8).

When the decoder was reading compressed video from system memory while
the GPU was drawing, it would corrupt video frames. Moving the input
to VRAM allowed frames to decode correctly. Disabling graphics draws
also stopped the corruption.

Here is a proposal to keep UVD buffers in VRAM for this family of
devices, as the driver already does for some other chips. The patch
covers RV610, RV620, RV630, RV635 and RV670. These chips share the
RV6xx decoder path and legacy R600 firmware, so I think they are
likely to have the same hardware requirements. Someone with the
other hardware would need to verify that.

I tested this on Debian.

I used Codex to help with the investigation, testing and patch.

Signed-off-by: Ted Bullock <[email protected]>
---
 drivers/gpu/drm/radeon/radeon_cs.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_cs.c
b/drivers/gpu/drm/radeon/radeon_cs.c
index 2db819a..9bfd3ea 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -125,11 +125,16 @@ static int radeon_cs_parser_relocs(struct
radeon_cs_parser *p)

                /* The first reloc of an UVD job is the msg and that must be in
                 * VRAM, the second reloc is the DPB and for WMV that must be in
-                * VRAM as well. Also put everything into VRAM on AGP cards and 
older
-                * IGP chips to avoid image corruptions
+                * VRAM as well. Also put everything into VRAM on RV6xx, AGP 
cards
+                * and older IGP chips to avoid image corruptions
                 */
                if (p->ring == R600_RING_TYPE_UVD_INDEX &&
                    (i <= 0 || pci_find_capability(p->rdev->pdev, 
PCI_CAP_ID_AGP) ||
+                    p->rdev->family == CHIP_RV610 ||
+                    p->rdev->family == CHIP_RV620 ||
+                    p->rdev->family == CHIP_RV630 ||
+                    p->rdev->family == CHIP_RV635 ||
+                    p->rdev->family == CHIP_RV670 ||
                     p->rdev->family == CHIP_RS780 ||
                     p->rdev->family == CHIP_RS880)) {

Reply via email to