We're about to make scratch surface states part of the surface state
heap. Because those are required to be in the low 26bits parts surface
state heap (we're limited in bits handed in the CFE_STATE, 3DSTATE_VS,
etc... instructions), this change splits the 32bit surface state heap
as follow:
- 8Mb of surface states for scratch
- 1Gb - 8Mb of binding tables
- 3Gb of surface states
That way all of the surfaces are located within a 4Gb region visible
from STATE_BASE_ADDRESS::SurfaceStateBaseAddress
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19727>
(cherry picked from commit
daab161535747cf5aef443e4cee46c5415662848)
"description": "frontends/va/enc: save intra_idr_period in the context",
"nominated": false,
"nomination_type": null,
- "resolution": 4,
+ "resolution": 1,
"main_sha": null,
"because_sha": null
},
const char *names[] = {
[IRIS_MEMZONE_SHADER] = "shader",
[IRIS_MEMZONE_BINDER] = "binder",
- [IRIS_MEMZONE_BINDLESS] = "scratchsurf",
+ [IRIS_MEMZONE_SCRATCH] = "scratchsurf",
[IRIS_MEMZONE_SURFACE] = "surface",
[IRIS_MEMZONE_DYNAMIC] = "dynamic",
[IRIS_MEMZONE_OTHER] = "other",
iris_memzone_for_address(uint64_t address)
{
STATIC_ASSERT(IRIS_MEMZONE_OTHER_START > IRIS_MEMZONE_DYNAMIC_START);
- STATIC_ASSERT(IRIS_MEMZONE_DYNAMIC_START > IRIS_MEMZONE_SURFACE_START);
- STATIC_ASSERT(IRIS_MEMZONE_SURFACE_START > IRIS_MEMZONE_BINDLESS_START);
- STATIC_ASSERT(IRIS_MEMZONE_BINDLESS_START > IRIS_MEMZONE_BINDER_START);
+ STATIC_ASSERT(IRIS_MEMZONE_SURFACE_START > IRIS_MEMZONE_SCRATCH_START);
+ STATIC_ASSERT(IRIS_MEMZONE_SCRATCH_START == IRIS_MEMZONE_BINDER_START);
STATIC_ASSERT(IRIS_MEMZONE_BINDER_START > IRIS_MEMZONE_SHADER_START);
+ STATIC_ASSERT(IRIS_MEMZONE_DYNAMIC_START > IRIS_MEMZONE_SURFACE_START);
STATIC_ASSERT(IRIS_BORDER_COLOR_POOL_ADDRESS == IRIS_MEMZONE_DYNAMIC_START);
if (address >= IRIS_MEMZONE_OTHER_START)
if (address >= IRIS_MEMZONE_SURFACE_START)
return IRIS_MEMZONE_SURFACE;
- if (address >= IRIS_MEMZONE_BINDLESS_START)
- return IRIS_MEMZONE_BINDLESS;
-
- if (address >= IRIS_MEMZONE_BINDER_START)
+ if (address >= (IRIS_MEMZONE_BINDER_START + IRIS_SCRATCH_ZONE_SIZE))
return IRIS_MEMZONE_BINDER;
+ if (address >= IRIS_MEMZONE_SCRATCH_START)
+ return IRIS_MEMZONE_SCRATCH;
+
return IRIS_MEMZONE_SHADER;
}
util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_SHADER],
PAGE_SIZE, _4GB_minus_1 - PAGE_SIZE);
util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_BINDER],
- IRIS_MEMZONE_BINDER_START, IRIS_BINDER_ZONE_SIZE);
- util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_BINDLESS],
- IRIS_MEMZONE_BINDLESS_START, IRIS_BINDLESS_SIZE);
+ IRIS_MEMZONE_BINDER_START + IRIS_SCRATCH_ZONE_SIZE,
+ IRIS_BINDER_ZONE_SIZE - IRIS_SCRATCH_ZONE_SIZE);
+ util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_SCRATCH],
+ IRIS_MEMZONE_SCRATCH_START, IRIS_SCRATCH_ZONE_SIZE);
util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_SURFACE],
IRIS_MEMZONE_SURFACE_START, _4GB_minus_1 -
- IRIS_BINDER_ZONE_SIZE - IRIS_BINDLESS_SIZE);
+ IRIS_BINDER_ZONE_SIZE - IRIS_SCRATCH_ZONE_SIZE);
/* Wa_2209859288: the Tigerlake PRM's workarounds volume says:
*
enum iris_memory_zone {
IRIS_MEMZONE_SHADER,
IRIS_MEMZONE_BINDER,
- IRIS_MEMZONE_BINDLESS,
+ IRIS_MEMZONE_SCRATCH,
IRIS_MEMZONE_SURFACE,
IRIS_MEMZONE_DYNAMIC,
IRIS_MEMZONE_OTHER,
/* Intentionally exclude single buffer "zones" */
#define IRIS_MEMZONE_COUNT (IRIS_MEMZONE_OTHER + 1)
-#define IRIS_BINDLESS_SIZE (8 * 1024 * 1024)
-#define IRIS_BINDER_ZONE_SIZE ((1ull << 30) - IRIS_BINDLESS_SIZE)
+#define IRIS_SCRATCH_ZONE_SIZE (8 * 1024 * 1024)
+#define IRIS_BINDER_ZONE_SIZE ((1ull << 30) - IRIS_SCRATCH_ZONE_SIZE)
#define IRIS_MEMZONE_SHADER_START (0ull * (1ull << 32))
#define IRIS_MEMZONE_BINDER_START (1ull * (1ull << 32))
-#define IRIS_MEMZONE_BINDLESS_START (IRIS_MEMZONE_BINDER_START + IRIS_BINDER_ZONE_SIZE)
-#define IRIS_MEMZONE_SURFACE_START (IRIS_MEMZONE_BINDLESS_START + IRIS_BINDLESS_SIZE)
+#define IRIS_MEMZONE_SCRATCH_START IRIS_MEMZONE_BINDER_START
+#define IRIS_MEMZONE_SURFACE_START (IRIS_MEMZONE_BINDER_START + IRIS_BINDER_ZONE_SIZE)
#define IRIS_MEMZONE_DYNAMIC_START (2ull * (1ull << 32))
#define IRIS_MEMZONE_OTHER_START (3ull * (1ull << 32))
iris_destroy_ctx_measure(ice);
u_upload_destroy(ice->state.surface_uploader);
- u_upload_destroy(ice->state.bindless_uploader);
+ u_upload_destroy(ice->state.scratch_surface_uploader);
u_upload_destroy(ice->state.dynamic_uploader);
u_upload_destroy(ice->query_buffer_uploader);
u_upload_create(ctx, 64 * 1024, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE,
IRIS_RESOURCE_FLAG_SURFACE_MEMZONE |
IRIS_RESOURCE_FLAG_DEVICE_MEM);
- ice->state.bindless_uploader =
+ ice->state.scratch_surface_uploader =
u_upload_create(ctx, 64 * 1024, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE,
- IRIS_RESOURCE_FLAG_BINDLESS_MEMZONE |
+ IRIS_RESOURCE_FLAG_SCRATCH_MEMZONE |
IRIS_RESOURCE_FLAG_DEVICE_MEM);
ice->state.dynamic_uploader =
u_upload_create(ctx, 64 * 1024, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE,
struct iris_state_ref null_fb;
struct u_upload_mgr *surface_uploader;
- struct u_upload_mgr *bindless_uploader;
+ struct u_upload_mgr *scratch_surface_uploader;
struct u_upload_mgr *dynamic_uploader;
struct iris_binder binder;
struct iris_bo *scratch_bo =
iris_get_scratch_space(ice, per_thread_scratch, MESA_SHADER_COMPUTE);
- void *map = upload_state(ice->state.bindless_uploader, ref,
+ void *map = upload_state(ice->state.scratch_surface_uploader, ref,
screen->isl_dev.ss.size, 64);
isl_buffer_fill_state(&screen->isl_dev, map,
} else if (templ->flags & IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE) {
memzone = IRIS_MEMZONE_DYNAMIC;
name = "dynamic state";
- } else if (templ->flags & IRIS_RESOURCE_FLAG_BINDLESS_MEMZONE) {
- memzone = IRIS_MEMZONE_BINDLESS;
- name = "bindless surface state";
+ } else if (templ->flags & IRIS_RESOURCE_FLAG_SCRATCH_MEMZONE) {
+ memzone = IRIS_MEMZONE_SCRATCH;
+ name = "scratch surface state";
}
unsigned flags = iris_resource_alloc_flags(screen, templ, res->aux.usage);
assert(!(templ->flags & (IRIS_RESOURCE_FLAG_SHADER_MEMZONE |
IRIS_RESOURCE_FLAG_SURFACE_MEMZONE |
IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE |
- IRIS_RESOURCE_FLAG_BINDLESS_MEMZONE)));
+ IRIS_RESOURCE_FLAG_SCRATCH_MEMZONE)));
/* Modifiers require the aux data to be in the same buffer as the main
* surface, but we combine them even when a modifier is not being used.
#define IRIS_RESOURCE_FLAG_SHADER_MEMZONE (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
#define IRIS_RESOURCE_FLAG_SURFACE_MEMZONE (PIPE_RESOURCE_FLAG_DRV_PRIV << 1)
#define IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE (PIPE_RESOURCE_FLAG_DRV_PRIV << 2)
-#define IRIS_RESOURCE_FLAG_BINDLESS_MEMZONE (PIPE_RESOURCE_FLAG_DRV_PRIV << 3)
+#define IRIS_RESOURCE_FLAG_SCRATCH_MEMZONE (PIPE_RESOURCE_FLAG_DRV_PRIV << 3)
#define IRIS_RESOURCE_FLAG_DEVICE_MEM (PIPE_RESOURCE_FLAG_DRV_PRIV << 4)
/**
false, IRIS_DOMAIN_NONE);
scratch_addr = ref->offset +
iris_resource_bo(ref->res)->address -
- IRIS_MEMZONE_BINDLESS_START;
+ IRIS_MEMZONE_SCRATCH_START;
assert((scratch_addr & 0x3f) == 0 && scratch_addr < (1 << 26));
#else
scratch_addr = scratch_bo->address;