mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 20:40:09 +01:00
winsys/amdgpu: fix radeon_surf::macro_tile_index for imported textures
Maybe this is why SDMA has been broken for many amdgpu users?
SDMA is the only block which is used with imported textures and relies
on this variable. DB also uses it, but it doesn't get imported textures,
so it's unaffected.
I do get SDMA failures on Tonga before this patch if R600_DEBUG=testdma
is changed to use imported textures.
Cc: 11.2 12.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 6ec3b2a4b1)
[Emil Velikov: resolve trivial conflicts - SI support does not exist in
branch]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Conflicts:
src/gallium/winsys/amdgpu/drm/amdgpu_surface.c
This commit is contained in:
parent
20008a9fb8
commit
ac3abe534b
1 changed files with 17 additions and 0 deletions
|
|
@ -253,6 +253,20 @@ static int compute_level(struct amdgpu_winsys *ws,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static unsigned cik_get_macro_tile_index(struct radeon_surf *surf)
|
||||
{
|
||||
unsigned index, tileb;
|
||||
|
||||
tileb = 8 * 8 * surf->bpe;
|
||||
tileb = MIN2(surf->tile_split, tileb);
|
||||
|
||||
for (index = 0; tileb > 64; index++)
|
||||
tileb >>= 1;
|
||||
|
||||
assert(index < 16);
|
||||
return index;
|
||||
}
|
||||
|
||||
static int amdgpu_surface_init(struct radeon_winsys *rws,
|
||||
struct radeon_surf *surf)
|
||||
{
|
||||
|
|
@ -381,6 +395,9 @@ static int amdgpu_surface_init(struct radeon_winsys *rws,
|
|||
AddrSurfInfoIn.tileIndex = 10; /* 2D displayable */
|
||||
else
|
||||
AddrSurfInfoIn.tileIndex = 14; /* 2D non-displayable */
|
||||
|
||||
/* Addrlib doesn't set this if tileIndex is forced like above. */
|
||||
AddrSurfInfoOut.macroModeIndex = cik_get_macro_tile_index(surf);
|
||||
}
|
||||
|
||||
surf->bo_size = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue