anv: compute the largest GRL kernel scratch size
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Felix DeGrood <felix.j.degrood@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22179>
This commit is contained in:

committed by
Marge Bot

parent
97e64aef60
commit
546a6752ac
@@ -1000,6 +1000,9 @@ struct anv_physical_device {
|
|||||||
uint8_t device_uuid[VK_UUID_SIZE];
|
uint8_t device_uuid[VK_UUID_SIZE];
|
||||||
uint8_t rt_uuid[VK_UUID_SIZE];
|
uint8_t rt_uuid[VK_UUID_SIZE];
|
||||||
|
|
||||||
|
/* Maximum amount of scratch space used by all the GRL kernels */
|
||||||
|
uint32_t max_grl_scratch_size;
|
||||||
|
|
||||||
struct vk_sync_type sync_syncobj_type;
|
struct vk_sync_type sync_syncobj_type;
|
||||||
struct vk_sync_timeline_type sync_timeline_type;
|
struct vk_sync_timeline_type sync_timeline_type;
|
||||||
const struct vk_sync_type * sync_types[4];
|
const struct vk_sync_type * sync_types[4];
|
||||||
|
@@ -527,6 +527,7 @@ genX(init_physical_device_state)(ASSERTED struct anv_physical_device *pdevice)
|
|||||||
assert(pdevice->info.verx10 == GFX_VERx10);
|
assert(pdevice->info.verx10 == GFX_VERx10);
|
||||||
#if GFX_VERx10 >= 125 && ANV_SUPPORT_RT
|
#if GFX_VERx10 >= 125 && ANV_SUPPORT_RT
|
||||||
genX(grl_load_rt_uuid)(pdevice->rt_uuid);
|
genX(grl_load_rt_uuid)(pdevice->rt_uuid);
|
||||||
|
pdevice->max_grl_scratch_size = genX(grl_max_scratch_size)();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -44,6 +44,9 @@ genX(grl_dispatch)(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
void
|
void
|
||||||
genX(grl_load_rt_uuid)(uint8_t *out_uuid);
|
genX(grl_load_rt_uuid)(uint8_t *out_uuid);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
genX(grl_max_scratch_size)(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
@@ -90,3 +90,19 @@ genX(grl_dispatch)(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
genX(cmd_buffer_dispatch_kernel)(cmd_buffer, &ak, global_size,
|
genX(cmd_buffer_dispatch_kernel)(cmd_buffer, &ak, global_size,
|
||||||
arg_count, args);
|
arg_count, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
genX(grl_max_scratch_size)(void)
|
||||||
|
{
|
||||||
|
uint32_t scratch_size = 0;
|
||||||
|
|
||||||
|
for (uint32_t i = 0; i < GRL_CL_KERNEL_MAX; i++) {
|
||||||
|
struct brw_kernel kernel_data;
|
||||||
|
genX(grl_get_cl_kernel)(&kernel_data, i);
|
||||||
|
|
||||||
|
scratch_size = MAX2(kernel_data.prog_data.base.total_scratch,
|
||||||
|
scratch_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
return scratch_size;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user