summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/radeon/drm/radeon_drm_surface.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-04-02 13:33:38 -0400
committerMarge Bot <eric+marge@anholt.net>2021-04-12 20:53:45 +0000
commit48dbdc62bf8611c60a7c27ece9b7c5ba11212e46 (patch)
treefa40116608977e275b7c2038816731f8e4a01c39 /src/gallium/winsys/radeon/drm/radeon_drm_surface.c
parentbbda20bf292ba9c74966a311b40d92dcfe019a0b (diff)
ac/surface: change legacy_surf_level::offset to 32-bit offset_256B shifted by 8
Images are always aligned to 256B (enforced by register and descriptor fields) and limited to 40-bit addresses. This saves some space. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10083>
Diffstat (limited to 'src/gallium/winsys/radeon/drm/radeon_drm_surface.c')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_surface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_surface.c b/src/gallium/winsys/radeon/drm/radeon_drm_surface.c
index 505bb89751b..00961ea1d7e 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_surface.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_surface.c
@@ -67,7 +67,7 @@ static void surf_level_winsys_to_drm(struct radeon_surface_level *level_drm,
const struct legacy_surf_level *level_ws,
unsigned bpe)
{
- level_drm->offset = level_ws->offset;
+ level_drm->offset = (uint64_t)level_ws->offset_256B * 256;
level_drm->slice_size = (uint64_t)level_ws->slice_size_dw * 4;
level_drm->nblk_x = level_ws->nblk_x;
level_drm->nblk_y = level_ws->nblk_y;
@@ -79,7 +79,7 @@ static void surf_level_drm_to_winsys(struct legacy_surf_level *level_ws,
const struct radeon_surface_level *level_drm,
unsigned bpe)
{
- level_ws->offset = level_drm->offset;
+ level_ws->offset_256B = level_drm->offset / 256;
level_ws->slice_size_dw = level_drm->slice_size / 4;
level_ws->nblk_x = level_drm->nblk_x;
level_ws->nblk_y = level_drm->nblk_y;