pvr: remove implicit sync support
This is the legacy way of doing synchronisation and is no longer necessary now that the DMA_BUF_IOCTL_EXPORT_SYNC_FILE / DMA_BUF_IOCTL_IMPORT_SYNC_FILE ioctls exist, which the wsi code is already making use of. Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19293>
This commit is contained in:
@@ -1507,8 +1507,6 @@ pvr_render_job_ws_fragment_state_init(struct pvr_render_ctx *ctx,
|
|||||||
static void pvr_render_job_ws_submit_info_init(
|
static void pvr_render_job_ws_submit_info_init(
|
||||||
struct pvr_render_ctx *ctx,
|
struct pvr_render_ctx *ctx,
|
||||||
struct pvr_render_job *job,
|
struct pvr_render_job *job,
|
||||||
const struct pvr_winsys_job_bo *bos,
|
|
||||||
uint32_t bo_count,
|
|
||||||
struct vk_sync *barrier_geom,
|
struct vk_sync *barrier_geom,
|
||||||
struct vk_sync *barrier_frag,
|
struct vk_sync *barrier_frag,
|
||||||
struct vk_sync **waits,
|
struct vk_sync **waits,
|
||||||
@@ -1526,9 +1524,6 @@ static void pvr_render_job_ws_submit_info_init(
|
|||||||
|
|
||||||
submit_info->run_frag = job->run_frag;
|
submit_info->run_frag = job->run_frag;
|
||||||
|
|
||||||
submit_info->bos = bos;
|
|
||||||
submit_info->bo_count = bo_count;
|
|
||||||
|
|
||||||
submit_info->barrier_geom = barrier_geom;
|
submit_info->barrier_geom = barrier_geom;
|
||||||
submit_info->barrier_frag = barrier_frag;
|
submit_info->barrier_frag = barrier_frag;
|
||||||
|
|
||||||
@@ -1536,8 +1531,6 @@ static void pvr_render_job_ws_submit_info_init(
|
|||||||
submit_info->wait_count = wait_count;
|
submit_info->wait_count = wait_count;
|
||||||
submit_info->stage_flags = stage_flags;
|
submit_info->stage_flags = stage_flags;
|
||||||
|
|
||||||
/* FIXME: add WSI image bos. */
|
|
||||||
|
|
||||||
pvr_render_job_ws_geometry_state_init(ctx, job, &submit_info->geometry);
|
pvr_render_job_ws_geometry_state_init(ctx, job, &submit_info->geometry);
|
||||||
pvr_render_job_ws_fragment_state_init(ctx, job, &submit_info->fragment);
|
pvr_render_job_ws_fragment_state_init(ctx, job, &submit_info->fragment);
|
||||||
|
|
||||||
@@ -1547,8 +1540,6 @@ static void pvr_render_job_ws_submit_info_init(
|
|||||||
|
|
||||||
VkResult pvr_render_job_submit(struct pvr_render_ctx *ctx,
|
VkResult pvr_render_job_submit(struct pvr_render_ctx *ctx,
|
||||||
struct pvr_render_job *job,
|
struct pvr_render_job *job,
|
||||||
const struct pvr_winsys_job_bo *bos,
|
|
||||||
uint32_t bo_count,
|
|
||||||
struct vk_sync *barrier_geom,
|
struct vk_sync *barrier_geom,
|
||||||
struct vk_sync *barrier_frag,
|
struct vk_sync *barrier_frag,
|
||||||
struct vk_sync **waits,
|
struct vk_sync **waits,
|
||||||
@@ -1564,8 +1555,6 @@ VkResult pvr_render_job_submit(struct pvr_render_ctx *ctx,
|
|||||||
|
|
||||||
pvr_render_job_ws_submit_info_init(ctx,
|
pvr_render_job_ws_submit_info_init(ctx,
|
||||||
job,
|
job,
|
||||||
bos,
|
|
||||||
bo_count,
|
|
||||||
barrier_geom,
|
barrier_geom,
|
||||||
barrier_frag,
|
barrier_frag,
|
||||||
waits,
|
waits,
|
||||||
|
@@ -36,7 +36,6 @@ struct pvr_device;
|
|||||||
struct pvr_free_list;
|
struct pvr_free_list;
|
||||||
struct pvr_render_ctx;
|
struct pvr_render_ctx;
|
||||||
struct pvr_rt_dataset;
|
struct pvr_rt_dataset;
|
||||||
struct pvr_winsys_job_bo;
|
|
||||||
struct vk_sync;
|
struct vk_sync;
|
||||||
|
|
||||||
/* FIXME: Turn 'struct pvr_sub_cmd' into 'struct pvr_job' and change 'struct
|
/* FIXME: Turn 'struct pvr_sub_cmd' into 'struct pvr_job' and change 'struct
|
||||||
@@ -118,8 +117,6 @@ void pvr_render_target_dataset_destroy(struct pvr_rt_dataset *dataset);
|
|||||||
|
|
||||||
VkResult pvr_render_job_submit(struct pvr_render_ctx *ctx,
|
VkResult pvr_render_job_submit(struct pvr_render_ctx *ctx,
|
||||||
struct pvr_render_job *job,
|
struct pvr_render_job *job,
|
||||||
const struct pvr_winsys_job_bo *bos,
|
|
||||||
uint32_t bo_count,
|
|
||||||
struct vk_sync *barrier_geom,
|
struct vk_sync *barrier_geom,
|
||||||
struct vk_sync *barrier_frag,
|
struct vk_sync *barrier_frag,
|
||||||
struct vk_sync **waits,
|
struct vk_sync **waits,
|
||||||
|
@@ -208,22 +208,15 @@ pvr_process_graphics_cmd(struct pvr_device *device,
|
|||||||
const struct pvr_framebuffer *framebuffer = sub_cmd->framebuffer;
|
const struct pvr_framebuffer *framebuffer = sub_cmd->framebuffer;
|
||||||
struct vk_sync *sync_geom;
|
struct vk_sync *sync_geom;
|
||||||
struct vk_sync *sync_frag;
|
struct vk_sync *sync_frag;
|
||||||
uint32_t bo_count = 0;
|
|
||||||
VkResult result;
|
VkResult result;
|
||||||
|
|
||||||
STACK_ARRAY(struct pvr_winsys_job_bo, bos, framebuffer->attachment_count);
|
|
||||||
if (!bos)
|
|
||||||
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
|
|
||||||
|
|
||||||
result = vk_sync_create(&device->vk,
|
result = vk_sync_create(&device->vk,
|
||||||
&device->pdevice->ws->syncobj_type,
|
&device->pdevice->ws->syncobj_type,
|
||||||
0U,
|
0U,
|
||||||
0UL,
|
0UL,
|
||||||
&sync_geom);
|
&sync_geom);
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS)
|
||||||
STACK_ARRAY_FINISH(bos);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
|
||||||
|
|
||||||
result = vk_sync_create(&device->vk,
|
result = vk_sync_create(&device->vk,
|
||||||
&device->pdevice->ws->syncobj_type,
|
&device->pdevice->ws->syncobj_type,
|
||||||
@@ -232,7 +225,6 @@ pvr_process_graphics_cmd(struct pvr_device *device,
|
|||||||
&sync_frag);
|
&sync_frag);
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS) {
|
||||||
vk_sync_destroy(&device->vk, sync_geom);
|
vk_sync_destroy(&device->vk, sync_geom);
|
||||||
STACK_ARRAY_FINISH(bos);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,23 +236,8 @@ pvr_process_graphics_cmd(struct pvr_device *device,
|
|||||||
if (sub_cmd->job.run_frag && framebuffer->layers > 1)
|
if (sub_cmd->job.run_frag && framebuffer->layers > 1)
|
||||||
pvr_finishme("Split job submission for framebuffers with > 1 layers");
|
pvr_finishme("Split job submission for framebuffers with > 1 layers");
|
||||||
|
|
||||||
/* Get any imported buffers used in framebuffer attachments. */
|
|
||||||
for (uint32_t i = 0U; i < framebuffer->attachment_count; i++) {
|
|
||||||
const struct pvr_image *image =
|
|
||||||
vk_to_pvr_image(framebuffer->attachments[i]->vk.image);
|
|
||||||
|
|
||||||
if (!image->vma->bo->is_imported)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
bos[bo_count].bo = image->vma->bo;
|
|
||||||
bos[bo_count].flags = PVR_WINSYS_JOB_BO_FLAG_WRITE;
|
|
||||||
bo_count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = pvr_render_job_submit(queue->gfx_ctx,
|
result = pvr_render_job_submit(queue->gfx_ctx,
|
||||||
&sub_cmd->job,
|
&sub_cmd->job,
|
||||||
bos,
|
|
||||||
bo_count,
|
|
||||||
barrier_geom,
|
barrier_geom,
|
||||||
barrier_frag,
|
barrier_frag,
|
||||||
waits,
|
waits,
|
||||||
@@ -268,7 +245,6 @@ pvr_process_graphics_cmd(struct pvr_device *device,
|
|||||||
stage_flags,
|
stage_flags,
|
||||||
sync_geom,
|
sync_geom,
|
||||||
sync_frag);
|
sync_frag);
|
||||||
STACK_ARRAY_FINISH(bos);
|
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS) {
|
||||||
vk_sync_destroy(&device->vk, sync_geom);
|
vk_sync_destroy(&device->vk, sync_geom);
|
||||||
vk_sync_destroy(&device->vk, sync_frag);
|
vk_sync_destroy(&device->vk, sync_frag);
|
||||||
|
@@ -323,14 +323,6 @@ struct pvr_winsys_compute_submit_info {
|
|||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PVR_WINSYS_JOB_BO_FLAG_WRITE BITFIELD_BIT(0U)
|
|
||||||
|
|
||||||
struct pvr_winsys_job_bo {
|
|
||||||
struct pvr_winsys_bo *bo;
|
|
||||||
/* Must be 0 or a combination of PVR_WINSYS_JOB_BO_FLAG_* flags. */
|
|
||||||
uint32_t flags;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define PVR_WINSYS_GEOM_FLAG_FIRST_GEOMETRY BITFIELD_BIT(0U)
|
#define PVR_WINSYS_GEOM_FLAG_FIRST_GEOMETRY BITFIELD_BIT(0U)
|
||||||
#define PVR_WINSYS_GEOM_FLAG_LAST_GEOMETRY BITFIELD_BIT(1U)
|
#define PVR_WINSYS_GEOM_FLAG_LAST_GEOMETRY BITFIELD_BIT(1U)
|
||||||
#define PVR_WINSYS_GEOM_FLAG_SINGLE_CORE BITFIELD_BIT(2U)
|
#define PVR_WINSYS_GEOM_FLAG_SINGLE_CORE BITFIELD_BIT(2U)
|
||||||
@@ -347,9 +339,6 @@ struct pvr_winsys_render_submit_info {
|
|||||||
uint32_t frame_num;
|
uint32_t frame_num;
|
||||||
uint32_t job_num;
|
uint32_t job_num;
|
||||||
|
|
||||||
uint32_t bo_count;
|
|
||||||
const struct pvr_winsys_job_bo *bos;
|
|
||||||
|
|
||||||
/* FIXME: should this be flags instead? */
|
/* FIXME: should this be flags instead? */
|
||||||
bool run_frag;
|
bool run_frag;
|
||||||
|
|
||||||
|
@@ -539,10 +539,6 @@ VkResult pvr_srv_winsys_render_submit(
|
|||||||
to_pvr_srv_winsys_render_ctx(ctx);
|
to_pvr_srv_winsys_render_ctx(ctx);
|
||||||
const struct pvr_srv_winsys *srv_ws = to_pvr_srv_winsys(ctx->ws);
|
const struct pvr_srv_winsys *srv_ws = to_pvr_srv_winsys(ctx->ws);
|
||||||
|
|
||||||
uint32_t sync_pmr_flags[PVR_SRV_SYNC_MAX] = { 0U };
|
|
||||||
void *sync_pmrs[PVR_SRV_SYNC_MAX] = { NULL };
|
|
||||||
uint32_t sync_pmr_count;
|
|
||||||
|
|
||||||
struct pvr_srv_sync *srv_signal_sync_geom;
|
struct pvr_srv_sync *srv_signal_sync_geom;
|
||||||
struct pvr_srv_sync *srv_signal_sync_frag;
|
struct pvr_srv_sync *srv_signal_sync_frag;
|
||||||
|
|
||||||
@@ -617,28 +613,6 @@ VkResult pvr_srv_winsys_render_submit(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (submit_info->bo_count <= ARRAY_SIZE(sync_pmrs)) {
|
|
||||||
sync_pmr_count = submit_info->bo_count;
|
|
||||||
} else {
|
|
||||||
mesa_logw("Too many bos to synchronize access to (ignoring %zu bos)\n",
|
|
||||||
submit_info->bo_count - ARRAY_SIZE(sync_pmrs));
|
|
||||||
sync_pmr_count = ARRAY_SIZE(sync_pmrs);
|
|
||||||
}
|
|
||||||
|
|
||||||
STATIC_ASSERT(ARRAY_SIZE(sync_pmrs) == ARRAY_SIZE(sync_pmr_flags));
|
|
||||||
assert(sync_pmr_count <= ARRAY_SIZE(sync_pmrs));
|
|
||||||
for (uint32_t i = 0; i < sync_pmr_count; i++) {
|
|
||||||
const struct pvr_winsys_job_bo *job_bo = &submit_info->bos[i];
|
|
||||||
const struct pvr_srv_winsys_bo *srv_bo = to_pvr_srv_winsys_bo(job_bo->bo);
|
|
||||||
|
|
||||||
sync_pmrs[i] = srv_bo->pmr;
|
|
||||||
|
|
||||||
if (job_bo->flags & PVR_WINSYS_JOB_BO_FLAG_WRITE)
|
|
||||||
sync_pmr_flags[i] = PVR_BUFFER_FLAG_WRITE;
|
|
||||||
else
|
|
||||||
sync_pmr_flags[i] = PVR_BUFFER_FLAG_READ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The 1.14 PowerVR Services KM driver doesn't add a sync dependency to the
|
/* The 1.14 PowerVR Services KM driver doesn't add a sync dependency to the
|
||||||
* fragment phase on the geometry phase for us. This makes it
|
* fragment phase on the geometry phase for us. This makes it
|
||||||
* necessary to use a sync prim for this purpose. This requires that we pass
|
* necessary to use a sync prim for this purpose. This requires that we pass
|
||||||
@@ -696,9 +670,9 @@ VkResult pvr_srv_winsys_render_submit(
|
|||||||
NULL,
|
NULL,
|
||||||
/* Currently no support for PRs. */
|
/* Currently no support for PRs. */
|
||||||
NULL,
|
NULL,
|
||||||
sync_pmr_count,
|
0,
|
||||||
sync_pmr_count ? sync_pmr_flags : NULL,
|
NULL,
|
||||||
sync_pmr_count ? sync_pmrs : NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
@@ -276,7 +276,6 @@ VkResult pvr_srv_winsys_transfer_submit(
|
|||||||
(uint8_t **)cmds_ptr_arr,
|
(uint8_t **)cmds_ptr_arr,
|
||||||
cmd_flags,
|
cmd_flags,
|
||||||
job_num,
|
job_num,
|
||||||
/* TODO: Add sync PMR support. */
|
|
||||||
0U,
|
0U,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
Reference in New Issue
Block a user