mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-23 16:10:33 +01:00
isl: add ability to store buffer size in unused RENDER_SURFACE_STATE fields
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Ivan Briano <ivan.briano@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23318>
This commit is contained in:
parent
d099e47de0
commit
f1f58c3bea
3 changed files with 24 additions and 0 deletions
|
|
@ -289,6 +289,7 @@ isl_device_init(struct isl_device *dev,
|
|||
dev->info = info;
|
||||
dev->use_separate_stencil = ISL_GFX_VER(dev) >= 6;
|
||||
dev->has_bit6_swizzling = info->has_bit6_swizzle;
|
||||
dev->buffer_length_in_aux_addr = false;
|
||||
|
||||
/* The ISL_DEV macros may be defined in the CFLAGS, thus hardcoding some
|
||||
* device properties at buildtime. Verify that the macros with the device
|
||||
|
|
|
|||
|
|
@ -1301,6 +1301,18 @@ struct isl_device {
|
|||
uint32_t protected_mask;
|
||||
} mocs;
|
||||
|
||||
/* Options to configure by the driver: */
|
||||
|
||||
/**
|
||||
* Write buffer length in the upper dword of the
|
||||
* RENDER_SURFACE_STATE::AuxilliarySurfaceBaseAddress field.
|
||||
*
|
||||
* This field is unused for buffer surfaces so we can reuse it store the
|
||||
* buffer length. This is useful when you want to load a vec4 with (main
|
||||
* address, size).
|
||||
*/
|
||||
bool buffer_length_in_aux_addr;
|
||||
|
||||
void (*surf_fill_state_s)(const struct isl_device *dev, void *state,
|
||||
const struct isl_surf_fill_state_info *restrict info);
|
||||
|
||||
|
|
|
|||
|
|
@ -968,6 +968,17 @@ isl_genX(buffer_fill_state_s)(const struct isl_device *dev, void *state,
|
|||
s.MOCS = info->mocs;
|
||||
#endif
|
||||
|
||||
#if GFX_VER >= 9
|
||||
/* Store the buffer size in the upper dword of the AUX surface base
|
||||
* address. Only enabled on Gfx9+ since Gfx8 has an Atom version with only
|
||||
* 32bits of address space.
|
||||
*/
|
||||
if (dev->buffer_length_in_aux_addr)
|
||||
s.AuxiliarySurfaceBaseAddress = info->size_B << 32;
|
||||
#else
|
||||
assert(!dev->buffer_length_in_aux_addr);
|
||||
#endif
|
||||
|
||||
#if GFX_VERx10 >= 125
|
||||
/* Setting L1 caching policy to Write-back mode. */
|
||||
s.L1CacheControl = L1CC_WB;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue