radeonsi: add AMD_DEBUG=extra_md

When this debug flag is set, the driver sets the umd metadata for
all color textures and enables the use of extended metadata.

Extended metadata allows umr to import textures and setting these
on all color texture allows to import non-exported textures
(eg: dGPU draw surface when DRI_PRIME=1 is used).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21984>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2023-03-21 10:46:53 +01:00 committed by Marge Bot
parent 7f94b80001
commit 46d2655a18
4 changed files with 14 additions and 1 deletions

View file

@ -1368,6 +1368,8 @@ RadeonSI driver environment variables
Enable DPBB.
``dfsm``
Enable DFSM.
``extra_md``
add extra information in bo metadatas to help tools (umr)
r600 driver environment variables
---------------------------------

View file

@ -119,6 +119,8 @@ static const struct debug_named_value radeonsi_debug_options[] = {
{"nofmask", DBG(NO_FMASK), "Disable MSAA compression"},
{"nodma", DBG(NO_DMA), "Disable SDMA-copy for DRI_PRIME"},
{"extra_md", DBG(EXTRA_METADATA), "Set UMD metadata for all textures and with additional fields for umr"},
{"tmz", DBG(TMZ), "Force allocation of scanout/depth/stencil buffer as encrypted"},
{"sqtt", DBG(SQTT), "Enable SQTT"},

View file

@ -256,6 +256,8 @@ enum
DBG_NO_FMASK,
DBG_NO_DMA,
DBG_EXTRA_METADATA,
DBG_TMZ,
DBG_SQTT,

View file

@ -556,7 +556,7 @@ static void si_set_tex_bo_metadata(struct si_screen *sscreen, struct si_texture
ac_surface_compute_umd_metadata(&sscreen->info, &tex->surface,
tex->buffer.b.b.last_level + 1,
desc, &md.size_metadata, md.metadata,
false);
sscreen->debug_flags & DBG(EXTRA_METADATA));
sscreen->ws->buffer_set_metadata(sscreen->ws, tex->buffer.buf, &md, &tex->surface);
}
@ -1307,6 +1307,11 @@ si_texture_create_with_modifier(struct pipe_screen *screen,
*/
if (num_planes > 1)
plane_templ[i].bind |= PIPE_BIND_SHARED;
/* Setting metadata on suballocated buffers is impossible. So use PIPE_BIND_CUSTOM to
* request a non-suballocated buffer.
*/
if (!is_zs && sscreen->debug_flags & DBG(EXTRA_METADATA))
plane_templ[i].bind |= PIPE_BIND_CUSTOM;
if (si_init_surface(sscreen, &surface[i], &plane_templ[i], tile_mode, modifier,
false, plane_templ[i].bind & PIPE_BIND_SCANOUT,
@ -1340,6 +1345,8 @@ si_texture_create_with_modifier(struct pipe_screen *screen,
last_plane->buffer.b.b.next = &tex->buffer.b.b;
last_plane = tex;
}
if (i == 0 && !is_zs && sscreen->debug_flags & DBG(EXTRA_METADATA))
si_set_tex_bo_metadata(sscreen, tex);
}
return (struct pipe_resource *)plane0;