]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/radeon: fix r100_copy_blit for large BOs
authorPavel Ondračka <pavel.ondracka@gmail.com>
Wed, 10 Jun 2026 08:32:45 +0000 (10:32 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 17 Jun 2026 22:19:00 +0000 (18:19 -0400)
commitf896e86273dbbebb5eac966b4a201b5c62a02e9a
treec5bb903ff696230dbe1f0e0c69f003198b3a1f3e
parent8e792f018e10e68f488f279fbd4f38009a2e066d
drm/radeon: fix r100_copy_blit for large BOs

r100_copy_blit() copies BOs as 1024-pixel-wide ARGB8888 blits, so one
GPU page becomes one blit row. Large copies are split into chunks of at
most 8191 rows.

The kernel register header names the packet coordinate dwords SRC_Y_X
and DST_Y_X. In the BITBLT_MULTI description in
R5xx_Acceleration_v1.5.pdf docs, these correspond to [SRC_X1 | SRC_Y1]
and [DST_X1 | DST_Y1], which are signed 13-bit coordinates in the
-8192..8191 range. The old code kept SRC/DST_PITCH_OFFSET at the BO base
and used SRC_Y_X/DST_Y_X as the chunk address, so large BO moves could
exceed that coordinate range.

Compute per-chunk SRC/DST_PITCH_OFFSET bases and emit zero source and
destination coordinates. r100_copy_blit() already packs
SRC/DST_PITCH_OFFSET as pitch plus base offset, so large chunk addresses
belong there rather than in the coordinate fields.

This fixes Prison Architect corruption with 4096x4096 mipped textures
after they are evicted to GTT under memory pressure on RV530.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/6716
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 87be26aee76239c6da03e599f238a426897f78ad)
Cc: stable@vger.kernel.org
drivers/gpu/drm/radeon/r100.c