Skip to content

Commit

Permalink
drm/v3d: add multiple syncobjs support
Browse files Browse the repository at this point in the history
Using the generic extension from the previous patch, a specific multisync
extension enables more than one in/out binary syncobj per job submission.
Arrays of syncobjs are set in struct drm_v3d_multisync, that also cares
of determining the stage for sync (wait deps) according to the job
queue.

v2:
- subclass the generic extension struct (Daniel)
- simplify adding dependency conditions to make understandable (Iago)

v3:
- fix conditions to consider single or multiples in/out_syncs (Iago)
- remove irrelevant comment (Iago)

Signed-off-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ffd8b2e3dd2e0c686db441a0c0a4a0181ff85328.1633016479.git.mwen@igalia.com
  • Loading branch information
Melissa Wen authored and Melissa Wen committed Oct 4, 2021
1 parent bb3425e commit e4165ae
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 32 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/v3d/v3d_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ static int v3d_get_param_ioctl(struct drm_device *dev, void *data,
case DRM_V3D_PARAM_SUPPORTS_PERFMON:
args->value = (v3d->ver >= 40);
return 0;
case DRM_V3D_PARAM_SUPPORTS_MULTISYNC_EXT:
args->value = 1;
return 0;
default:
DRM_DEBUG("Unknown parameter %d\n", args->param);
return -EINVAL;
Expand Down Expand Up @@ -135,9 +138,8 @@ v3d_postclose(struct drm_device *dev, struct drm_file *file)
struct v3d_file_priv *v3d_priv = file->driver_priv;
enum v3d_queue q;

for (q = 0; q < V3D_MAX_QUEUES; q++) {
for (q = 0; q < V3D_MAX_QUEUES; q++)
drm_sched_entity_destroy(&v3d_priv->sched_entity[q]);
}

v3d_perfmon_close_file(v3d_priv);
kfree(v3d_priv);
Expand Down
24 changes: 15 additions & 9 deletions drivers/gpu/drm/v3d/v3d_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ struct reset_control;

#define GMP_GRANULARITY (128 * 1024)

/* Enum for each of the V3D queues. */
enum v3d_queue {
V3D_BIN,
V3D_RENDER,
V3D_TFU,
V3D_CSD,
V3D_CACHE_CLEAN,
};

#define V3D_MAX_QUEUES (V3D_CACHE_CLEAN + 1)

struct v3d_queue_state {
Expand Down Expand Up @@ -294,6 +285,21 @@ struct v3d_csd_job {
struct drm_v3d_submit_csd args;
};

struct v3d_submit_outsync {
struct drm_syncobj *syncobj;
};

struct v3d_submit_ext {
u32 flags;
u32 wait_stage;

u32 in_sync_count;
u64 in_syncs;

u32 out_sync_count;
struct v3d_submit_outsync *out_syncs;
};

/**
* __wait_for - magic wait macro
*
Expand Down
Loading

0 comments on commit e4165ae

Please sign in to comment.