imagination: Update allocation flags for buffers in submit job
v2 cover imagination: Update allocation flags for buffers in submit job
Update BO allocation flags to match expectation:
- Remove the CPU_ACCESS flag from BOs that are not host-accessed.
- Use DRM_PVR_BO_PM_FW_PROTECT for MList allocations.
---
Changes in v2:
- Update as per Kamil's feedback.
- Updated description to map commits are specific to Imagination.
- Spilt lib/igt change to two: Interface update and flags update.
- Link to v1: https://patch.msgid.link/[email protected]
---
Brajesh Gupta (3):
lib/igt_pvr: Update general heap allocation interface to pass flags
imagination: Skip CPU access flag for a few Render related allocations lib/igt_pvr: Pass DRM_PVR_BO_PM_FW_PROTECT flag for PM MList allocation
lib/igt_pvr.c | 33 +++++++++++++++++++-------------- lib/igt_pvr.h | 3 ++- tests/imagination/pvr_submit_jobs.c | 13 ++++++++++--- 3 files changed, 31 insertions(+), 18 deletions(-)
---
base-commit: fc75d6d7ffcb79e8a3316e80c7085460568a7670
change-id: 20261029-b4-render_update-79d0cf70eb0e
Best regards,
Signature · 1 line
Brajesh Gupta <[email protected]>
PATCH v2 1/3 lib/igt_pvr: Update general heap allocation interface to pass flags
Update igt_pvr_allocate_general() interface to pass flags for allocation.
--- lib/igt_pvr.c | 39 ++++++++++++++++++++++++------------- lib/igt_pvr.h | 3 ++- tests/imagination/pvr_submit_jobs.c | 13 ++++++++++--- 3 files changed, 37 insertions(+), 18 deletions(-)
lib/igt_pvr.c +25 -14
@@ -397,9 +397,10 @@ uint32_t igt_pvr_ioctl_create_context(int fd, enum drm_pvr_ctx_type type,switch (type) {case DRM_PVR_CTX_TYPE_RENDER : create_context_args.callstack_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, - vm_ctx_handle, -POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx_handle, +POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); create_context_args.static_context_state =to_user_pointer (init_render_context_stream); create_context_args.static_context_state_len =init_render_context_state_stream (init_render_context_stream);
@@ -673,17 +674,15 @@ struct igt_pvr_allocation *igt_pvr_allocate(int fd, uint32_t vm_ctx, size_t size* @fd: The file descriptor of the DRM device. * @vm_ctx: The virtual memory context. * @size: The size of the allocation. +* @flags: Allocation flags. * * Function to allocate and map GPU memory from the general heap. * * Returns: Pointer to the allocation structure. */ -struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size) +struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size,uint64_t flags) { -return igt_pvr_allocate (fd, vm_ctx, size, -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | -DRM_PVR_BO_BYPASS_DEVICE_CACHE , -DRM_PVR_HEAP_GENERAL ); +return igt_pvr_allocate (fd, vm_ctx, size, flags,DRM_PVR_HEAP_GENERAL ); }/**
@@ -817,11 +816,17 @@ static void igt_pvr_create_hwrt_geom_data_args(int fd, uint32_t vm_ctx, *geom_data_args) { geom_data_args->rtc_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->tpc_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->vheap_table_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->tpc_size =POWERVR_GPU_PAGE_SIZE ; geom_data_args->tpc_stride =0x1 ; }
@@ -839,11 +844,17 @@ static void igt_pvr_create_hwrt_rt_data_args(int fd, uint32_t vm_ctx, struct drm_pvr_create_hwrt_rt_data_args *rt_data_args) { rt_data_args->pm_mlist_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); rt_data_args->macrotile_array_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); rt_data_args->region_header_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); }/**
lib/igt_pvr.h +2 -1
@@ -67,7 +67,8 @@ struct igt_pvr_allocation *igt_pvr_allocate_addr(int fd, uint32_t vm_ctx, size_t uint64_t flags, uint64_t gpu_addr);struct igt_pvr_allocation *igt_pvr_allocate (int fd,uint32_t vm_ctx,size_t size,uint64_t flags,uint32_t heap_index); -struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size); +struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size, +uint64_t flags);void *igt_pvr_get_cpu_addr (int fd,struct igt_pvr_allocation *alloc);uint64_t igt_pvr_get_gpu_addr (struct igt_pvr_allocation *alloc);size_t igt_pvr_get_size (struct igt_pvr_allocation *alloc);
tests/imagination/pvr_submit_jobs.c +10 -3
@@ -52,7 +52,10 @@ static uint32_t init_compute_cmd_stream(int fd, uint32_t vm_ctx,void *cdm_stream_map;uint32_t stream_length; -struct igt_pvr_allocation *cdm_stream_alloc =igt_pvr_allocate_general (fd, vm_ctx,0x1000 ); +struct igt_pvr_allocation *cdm_stream_alloc = +igt_pvr_allocate_general (fd, vm_ctx,0x1000 , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE ); cdm_stream_gpu_addr =igt_pvr_get_gpu_addr (cdm_stream_alloc);
@@ -212,14 +215,18 @@ int igt_main() pds_buffer_base[0x20 ] =pds_inst_encode_halt (); vdm_alloc = -igt_pvr_allocate_general (fd, render_vm_ctx_handle, size); +igt_pvr_allocate_general (fd, render_vm_ctx_handle, size, +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE ); vdm_buffer =igt_pvr_get_cpu_addr (fd, vdm_alloc); size =PVR_BO_SIZE ; ppp_alloc = -igt_pvr_allocate_general (fd, render_vm_ctx_handle, size); +igt_pvr_allocate_general (fd, render_vm_ctx_handle, size, +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE ); ppp_buffer_base =igt_pvr_get_cpu_addr (fd, ppp_alloc);
Signature · 1 line
2.43.0
Re: [PATCH i-g-t v2 1/3] lib/igt_pvr: Update general heap allocation interface to pass flags
Quoted 3 lines · Brajesh Gupta
Update
igt_pvr_allocate_general()interface to pass flags for allocation.Signed-off-by Brajesh Gupta <[email protected]>
Only a minor nit below.
Quoted 11 lines
--- lib/igt_pvr.c | 39 ++++++++++++++++++++++++------------- lib/igt_pvr.h | 3 ++- tests/imagination/pvr_submit_jobs.c | 13 ++++++++++--- 3 files changed, 37 insertions(+), 18 deletions(-)lib/igt_pvr.c +0
-0
lib/igt_pvr.c uint32_t igt_pvr_ioctl_create_context(int fd, enum drm_pvr_ctx_type type, · line 400
Quoted 7 lines
lib/igt_pvr.c +1
-3@@ -397,9 +397,10 @@ uint32_t igt_pvr_ioctl_create_context(int fd, enum drm_pvr_ctx_type type,switch (type) {case DRM_PVR_CTX_TYPE_RENDER : create_context_args.callstack_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, - vm_ctx_handle, -POWERVR_GPU_PAGE_SIZE )); + igt_pvr_get_gpu_addr(igt_pvr_allocate_general(fd, vm_ctx_handle,
nit: I'd not move vm_ctx_handle.
Quoted 121 lines
lib/igt_pvr.c +24
-11+POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | + DRM_PVR_BO_BYPASS_DEVICE_CACHE)); create_context_args.static_context_state =to_user_pointer (init_render_context_stream); create_context_args.static_context_state_len =init_render_context_state_stream (init_render_context_stream);@@ -673,17 +674,15 @@ struct igt_pvr_allocation *igt_pvr_allocate(int fd, uint32_t vm_ctx, size_t size* @fd: The file descriptor of the DRM device. * @vm_ctx: The virtual memory context. * @size: The size of the allocation. +* @flags: Allocation flags. * * Function to allocate and map GPU memory from the general heap. * * Returns: Pointer to the allocation structure. */ -struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size) +struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size,uint64_t flags) { -return igt_pvr_allocate (fd, vm_ctx, size, -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | -DRM_PVR_BO_BYPASS_DEVICE_CACHE , -DRM_PVR_HEAP_GENERAL ); +return igt_pvr_allocate (fd, vm_ctx, size, flags,DRM_PVR_HEAP_GENERAL ); }/** @@ -817,11 +816,17 @@ static void igt_pvr_create_hwrt_geom_data_args(int fd, uint32_t vm_ctx, *geom_data_args) { geom_data_args->rtc_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->tpc_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->vheap_table_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->tpc_size =POWERVR_GPU_PAGE_SIZE ; geom_data_args->tpc_stride =0x1 ; }@@ -839,11 +844,17 @@ static void igt_pvr_create_hwrt_rt_data_args(int fd, uint32_t vm_ctx, struct drm_pvr_create_hwrt_rt_data_args *rt_data_args) { rt_data_args->pm_mlist_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); rt_data_args->macrotile_array_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); rt_data_args->region_header_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); }/** lib/igt_pvr.h +2
-1@@ -67,7 +67,8 @@ struct igt_pvr_allocation *igt_pvr_allocate_addr(int fd, uint32_t vm_ctx, size_t uint64_t flags, uint64_t gpu_addr);struct igt_pvr_allocation *igt_pvr_allocate (int fd,uint32_t vm_ctx,size_t size,uint64_t flags,uint32_t heap_index); -struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size); +struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size, +uint64_t flags);void *igt_pvr_get_cpu_addr (int fd,struct igt_pvr_allocation *alloc);uint64_t igt_pvr_get_gpu_addr (struct igt_pvr_allocation *alloc);size_t igt_pvr_get_size (struct igt_pvr_allocation *alloc);tests/imagination/pvr_submit_jobs.c +10
-3@@ -52,7 +52,10 @@ static uint32_t init_compute_cmd_stream(int fd, uint32_t vm_ctx,void *cdm_stream_map;uint32_t stream_length; -struct igt_pvr_allocation *cdm_stream_alloc =igt_pvr_allocate_general (fd, vm_ctx,0x1000 ); +struct igt_pvr_allocation *cdm_stream_alloc = +igt_pvr_allocate_general (fd, vm_ctx,0x1000 , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE ); cdm_stream_gpu_addr =igt_pvr_get_gpu_addr (cdm_stream_alloc);@@ -212,14 +215,18 @@ int igt_main() pds_buffer_base[0x20 ] =pds_inst_encode_halt (); vdm_alloc = -igt_pvr_allocate_general (fd, render_vm_ctx_handle, size); +igt_pvr_allocate_general (fd, render_vm_ctx_handle, size, +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE ); vdm_buffer =igt_pvr_get_cpu_addr (fd, vdm_alloc); size =PVR_BO_SIZE ; ppp_alloc = -igt_pvr_allocate_general (fd, render_vm_ctx_handle, size); +igt_pvr_allocate_general (fd, render_vm_ctx_handle, size, +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE ); ppp_buffer_base =igt_pvr_get_cpu_addr (fd, ppp_alloc);
Re: [PATCH i-g-t v2 1/3] lib/igt_pvr: Update general heap allocation interface to pass flags
Hi Luigi,
Quoted 15 lines · Luigi Santivetti
Quoted 3 lines · Brajesh Gupta
Update
igt_pvr_allocate_general()interface to pass flags for allocation.Signed-off-by Brajesh Gupta <[email protected]>Only a minor nit below.
Reviewed-by Luigi Santivetti <[email protected]>Quoted 6 lines
--- lib/igt_pvr.c | 39 ++++++++++++++++++++++++------------- lib/igt_pvr.h | 3 ++- tests/imagination/pvr_submit_jobs.c | 13 ++++++++++--- 3 files changed, 37 insertions(+), 18 deletions(-)
Quoted 15 lines
lib/igt_pvr.c uint32_t igt_pvr_ioctl_create_context(int fd, enum drm_pvr_ctx_type type, · line 400
Quoted 12 lines
lib/igt_pvr.c +1
-3@@ -397,9 +397,10 @@ uint32_t igt_pvr_ioctl_create_context(int fd, enum drm_pvr_ctx_type type,switch (type) {case DRM_PVR_CTX_TYPE_RENDER : create_context_args.callstack_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, - vm_ctx_handle, -POWERVR_GPU_PAGE_SIZE )); + igt_pvr_get_gpu_addr(igt_pvr_allocate_general(fd, vm_ctx_handle,nit: I'd not move
vm_ctx_handle.
Brajesh, please correct this, add r-b to patches were you got it and resend.
Regards,
Kamil
Quoted 122 lines
Quoted 121 lines
lib/igt_pvr.c +24
-11+POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | + DRM_PVR_BO_BYPASS_DEVICE_CACHE)); create_context_args.static_context_state =to_user_pointer (init_render_context_stream); create_context_args.static_context_state_len =init_render_context_state_stream (init_render_context_stream);@@ -673,17 +674,15 @@ struct igt_pvr_allocation *igt_pvr_allocate(int fd, uint32_t vm_ctx, size_t size* @fd: The file descriptor of the DRM device. * @vm_ctx: The virtual memory context. * @size: The size of the allocation. +* @flags: Allocation flags. * * Function to allocate and map GPU memory from the general heap. * * Returns: Pointer to the allocation structure. */ -struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size) +struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size,uint64_t flags) { -return igt_pvr_allocate (fd, vm_ctx, size, -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | -DRM_PVR_BO_BYPASS_DEVICE_CACHE , -DRM_PVR_HEAP_GENERAL ); +return igt_pvr_allocate (fd, vm_ctx, size, flags,DRM_PVR_HEAP_GENERAL ); }/** @@ -817,11 +816,17 @@ static void igt_pvr_create_hwrt_geom_data_args(int fd, uint32_t vm_ctx, *geom_data_args) { geom_data_args->rtc_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->tpc_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->vheap_table_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->tpc_size =POWERVR_GPU_PAGE_SIZE ; geom_data_args->tpc_stride =0x1 ; }@@ -839,11 +844,17 @@ static void igt_pvr_create_hwrt_rt_data_args(int fd, uint32_t vm_ctx, struct drm_pvr_create_hwrt_rt_data_args *rt_data_args) { rt_data_args->pm_mlist_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); rt_data_args->macrotile_array_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); rt_data_args->region_header_dev_addr = -igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE )); +igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE )); }/** lib/igt_pvr.h +2
-1@@ -67,7 +67,8 @@ struct igt_pvr_allocation *igt_pvr_allocate_addr(int fd, uint32_t vm_ctx, size_t uint64_t flags, uint64_t gpu_addr);struct igt_pvr_allocation *igt_pvr_allocate (int fd,uint32_t vm_ctx,size_t size,uint64_t flags,uint32_t heap_index); -struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size); +struct igt_pvr_allocation *igt_pvr_allocate_general (int fd,uint32_t vm_ctx,size_t size, +uint64_t flags);void *igt_pvr_get_cpu_addr (int fd,struct igt_pvr_allocation *alloc);uint64_t igt_pvr_get_gpu_addr (struct igt_pvr_allocation *alloc);size_t igt_pvr_get_size (struct igt_pvr_allocation *alloc);tests/imagination/pvr_submit_jobs.c +10
-3@@ -52,7 +52,10 @@ static uint32_t init_compute_cmd_stream(int fd, uint32_t vm_ctx,void *cdm_stream_map;uint32_t stream_length; -struct igt_pvr_allocation *cdm_stream_alloc =igt_pvr_allocate_general (fd, vm_ctx,0x1000 ); +struct igt_pvr_allocation *cdm_stream_alloc = +igt_pvr_allocate_general (fd, vm_ctx,0x1000 , +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE ); cdm_stream_gpu_addr =igt_pvr_get_gpu_addr (cdm_stream_alloc);@@ -212,14 +215,18 @@ int igt_main() pds_buffer_base[0x20 ] =pds_inst_encode_halt (); vdm_alloc = -igt_pvr_allocate_general (fd, render_vm_ctx_handle, size); +igt_pvr_allocate_general (fd, render_vm_ctx_handle, size, +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE ); vdm_buffer =igt_pvr_get_cpu_addr (fd, vdm_alloc); size =PVR_BO_SIZE ; ppp_alloc = -igt_pvr_allocate_general (fd, render_vm_ctx_handle, size); +igt_pvr_allocate_general (fd, render_vm_ctx_handle, size, +DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS | +DRM_PVR_BO_BYPASS_DEVICE_CACHE ); ppp_buffer_base =igt_pvr_get_cpu_addr (fd, ppp_alloc);
PATCH v2 2/3 imagination: Skip CPU access flag for a few Render related allocations
In reply to Brajesh GuptaSkip passing CPU access flag for BO's that don't need host access.
--- lib/igt_pvr.c | 7 ------- 1 file changed, 7 deletions(-)
lib/igt_pvr.c +0 -7
@@ -399,7 +399,6 @@ uint32_t igt_pvr_ioctl_create_context(int fd, enum drm_pvr_ctx_type type, create_context_args.callstack_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx_handle,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); create_context_args.static_context_state =to_user_pointer (init_render_context_stream); create_context_args.static_context_state_len =
@@ -817,15 +816,12 @@ static void igt_pvr_create_hwrt_geom_data_args(int fd, uint32_t vm_ctx, { geom_data_args->rtc_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->tpc_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->vheap_table_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->tpc_size =POWERVR_GPU_PAGE_SIZE ; geom_data_args->tpc_stride =0x1 ;
@@ -845,15 +841,12 @@ static void igt_pvr_create_hwrt_rt_data_args(int fd, uint32_t vm_ctx, { rt_data_args->pm_mlist_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); rt_data_args->macrotile_array_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); rt_data_args->region_header_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); }
Signature · 1 line
2.43.0
Re: [PATCH i-g-t v2 2/3] imagination: Skip CPU access flag for a few Render related allocations
Quoted 3 lines · Brajesh Gupta
Skip passing CPU access flag for BO's that don't need host access.
Signed-off-by Brajesh Gupta <[email protected]>
Quoted 49 lines
--- lib/igt_pvr.c | 7 ------- 1 file changed, 7 deletions(-)lib/igt_pvr.c +0
-7@@ -399,7 +399,6 @@ uint32_t igt_pvr_ioctl_create_context(int fd, enum drm_pvr_ctx_type type, create_context_args.callstack_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx_handle,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); create_context_args.static_context_state =to_user_pointer (init_render_context_stream); create_context_args.static_context_state_len =@@ -817,15 +816,12 @@ static void igt_pvr_create_hwrt_geom_data_args(int fd, uint32_t vm_ctx, { geom_data_args->rtc_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->tpc_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->vheap_table_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); geom_data_args->tpc_size =POWERVR_GPU_PAGE_SIZE ; geom_data_args->tpc_stride =0x1 ;@@ -845,15 +841,12 @@ static void igt_pvr_create_hwrt_rt_data_args(int fd, uint32_t vm_ctx, { rt_data_args->pm_mlist_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); rt_data_args->macrotile_array_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); rt_data_args->region_header_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_ALLOW_CPU_USERSPACE_ACCESS |DRM_PVR_BO_BYPASS_DEVICE_CACHE )); }
PATCH v2 3/3 lib/igt_pvr: Pass DRM_PVR_BO_PM_FW_PROTECT flag for PM MList allocation
In reply to Brajesh GuptaPass DRM_PVR_BO_PM_FW_PROTECT flag for PM MList allocation to indicate only PM/FW allowed to access the memory.
--- lib/igt_pvr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/igt_pvr.c +2 -1
@@ -841,7 +841,8 @@ static void igt_pvr_create_hwrt_rt_data_args(int fd, uint32_t vm_ctx, { rt_data_args->pm_mlist_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE , -DRM_PVR_BO_BYPASS_DEVICE_CACHE )); +DRM_PVR_BO_BYPASS_DEVICE_CACHE | +DRM_PVR_BO_PM_FW_PROTECT )); rt_data_args->macrotile_array_dev_addr =igt_pvr_get_gpu_addr (igt_pvr_allocate_general (fd, vm_ctx,POWERVR_GPU_PAGE_SIZE ,DRM_PVR_BO_BYPASS_DEVICE_CACHE ));
Signature · 1 line
2.43.0
Hi Brajesh,
Quoted 1 line · Brajesh Gupta
Update BO allocation flags to match expectation:
Sorry, what would those expectations be with respect to upstream?
I take IGT has always been broken, but nothing has really changed recently with regard to PM/FW protect?!
Perhaps it's worth adding a description of what makes (or doesn't) the flag needed in patch [3/3] commit message, especially as we expect to extend the heaps in the future I can see how easy is to generate confusion around this area. I'd suggest to describe rather precisely what it is that requires the new flag so we keep good records.
Thank you!
Quoted 29 lines
- Remove the
CPU_ACCESSflag from BOs that are not host-accessed.
- UseDRM_PVR_BO_PM_FW_PROTECTfor MList allocations.Signed-off-by Brajesh Gupta <[email protected]>---
Changes in v2:
- Update as per Kamil's feedback.
- Updated description to map commits are specific to Imagination.
- Spilt lib/igt change to two: Interface update and flags update.
- Link to v1: https://patch.msgid.link/[email protected]---
Brajesh Gupta (3):
lib/igt_pvr: Update general heap allocation interface to pass flags
imagination: Skip CPU access flag for a few Render related allocationslib/igt_pvr: PassDRM_PVR_BO_PM_FW_PROTECTflag for PM MList allocationlib/igt_pvr.c | 33 +++++++++++++++++++-------------- lib/igt_pvr.h | 3 ++- tests/imagination/pvr_submit_jobs.c | 13 ++++++++++--- 3 files changed, 31 insertions(+), 18 deletions(-)---
base-commit:fc75d6d7ffcb79e8a3316e80c7085460568a7670
change-id: 20261029-b4-render_update-79d0cf70eb0eBest regards,
Signature · 1 line
Brajesh Gupta <[email protected]>
On Thu, 2026-10-29 at 17:07 +0000, Luigi Santivetti wrote:
Hi Luigi,
Quoted 11 lines
*** NOTE: This is an internal email from Imagination Technologies ***
Hi Brajesh,
Quoted 1 line · Brajesh Gupta
Update BO allocation flags to match expectation:
Sorry, what would those expectations be with respect to upstream?
I was referring to generic expectations:
- If a BO doesn't need access from the host, then don't pass the flag CPU_ACCESS flag. It gives options to driver to adjust things when required.
- For DRM_PVR_BO_PM_FW_PROTECT flag, just following guidance to pass this flag for any BO which be accessed by either Parameter Manager and/or Firmware. Update is to pass the flag for MList in the same way it was passed for Free List allocation.
Quoted 3 lines
I take IGT has always been broken, but nothing has really changed recently with regard to PM/FW protect?!
Nothing is broken at this point and pvr_submit_test test is passing.
Quoted 7 lines
Perhaps it's worth adding a description of what makes (or doesn't) the flag needed in patch [3/3] commit message, especially as we expect to extend the heaps in the future I can see how easy is to generate confusion around this area. I'd suggest to describe rather precisely what it is that requires the new flag so we keep good records.
I think it will better to hold on patch[3] change till kernel driver adds support for PM_FW_PROTECT flag.
Thanks,
Brajesh
Quoted 32 lines
Thank you!
Quoted 29 lines
- Remove the
CPU_ACCESSflag from BOs that are not host-accessed.
- UseDRM_PVR_BO_PM_FW_PROTECTfor MList allocations.Signed-off-by Brajesh Gupta <[email protected]>---
Changes in v2:
- Update as per Kamil's feedback.
- Updated description to map commits are specific to Imagination.
- Spilt lib/igt change to two: Interface update and flags update.
- Link to v1: https://patch.msgid.link/[email protected]---
Brajesh Gupta (3):
lib/igt_pvr: Update general heap allocation interface to pass flags
imagination: Skip CPU access flag for a few Render related allocationslib/igt_pvr: PassDRM_PVR_BO_PM_FW_PROTECTflag for PM MList allocationlib/igt_pvr.c | 33 +++++++++++++++++++-------------- lib/igt_pvr.h | 3 ++- tests/imagination/pvr_submit_jobs.c | 13 ++++++++++--- 3 files changed, 31 insertions(+), 18 deletions(-)---
base-commit:fc75d6d7ffcb79e8a3316e80c7085460568a7670
change-id: 20261029-b4-render_update-79d0cf70eb0eBest regards,
--
Brajesh Gupta <[email protected]>
Hi Brajesh,
Quoted 25 lines · Brajesh Gupta
On Thu, 2026-10-29 at 17:07 +0000, Luigi Santivetti wrote:
Hi Luigi,Quoted 11 lines
*** NOTE: This is an internal email from Imagination Technologies ***
Hi Brajesh,
Quoted 1 line · Brajesh Gupta
Update BO allocation flags to match expectation:
Sorry, what would those expectations be with respect to upstream?
I was referring to generic expectations:
- If a BO doesn't need access from the host, then don't pass the flagCPU_ACCESSflag. It gives options to driver to adjust things when required.
- ForDRM_PVR_BO_PM_FW_PROTECTflag, just following guidance to pass this flag for any BO which be accessed by either Parameter Manager and/or Firmware. Update is to pass the flag for MList in the same way it was passed for Free List allocation.Quoted 3 lines
I take IGT has always been broken, but nothing has really changed recently with regard to PM/FW protect?!
Nothing is broken at this point and
pvr_submit_testtest is passing.Quoted 1 line
Quoted 9 lines
Quoted 6 lines
Perhaps it's worth adding a description of what makes (or doesn't) the flag needed in patch [3/3] commit message, especially as we expect to extend the heaps in the future I can see how easy is to generate confusion around this area. I'd suggest to describe rather precisely what it is that requires the new flag so we keep good records.
I think it will better to hold on patch[3] change till kernel driver adds support for
PM_FW_PROTECTflag.
Okay,
Thanks
Quoted 35 lines
Thanks,
BrajeshQuoted 32 lines
Thank you!
Quoted 29 lines
- Remove the
CPU_ACCESSflag from BOs that are not host-accessed.
- UseDRM_PVR_BO_PM_FW_PROTECTfor MList allocations.Signed-off-by Brajesh Gupta <[email protected]>---
Changes in v2:
- Update as per Kamil's feedback.
- Updated description to map commits are specific to Imagination.
- Spilt lib/igt change to two: Interface update and flags update.
- Link to v1: https://patch.msgid.link/[email protected]---
Brajesh Gupta (3):
lib/igt_pvr: Update general heap allocation interface to pass flags
imagination: Skip CPU access flag for a few Render related allocationslib/igt_pvr: PassDRM_PVR_BO_PM_FW_PROTECTflag for PM MList allocationlib/igt_pvr.c | 33 +++++++++++++++++++-------------- lib/igt_pvr.h | 3 ++- tests/imagination/pvr_submit_jobs.c | 13 ++++++++++--- 3 files changed, 31 insertions(+), 18 deletions(-)---
base-commit:fc75d6d7ffcb79e8a3316e80c7085460568a7670
change-id: 20261029-b4-render_update-79d0cf70eb0eBest regards,
--
Brajesh Gupta <[email protected]>