Commit 65cddb19 authored by Laurent Pinchart's avatar Laurent Pinchart

media: vsp1: Replace the display list internal flag with a flags field

To prepare for addition of more flags to the display list, replace the
'internal' flag field by a bitmask 'flags' field.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent ae444200
...@@ -178,7 +178,7 @@ struct vsp1_dl_cmd_pool { ...@@ -178,7 +178,7 @@ struct vsp1_dl_cmd_pool {
* @post_cmd: post command to be issued through extended dl header * @post_cmd: post command to be issued through extended dl header
* @has_chain: if true, indicates that there's a partition chain * @has_chain: if true, indicates that there's a partition chain
* @chain: entry in the display list partition chain * @chain: entry in the display list partition chain
* @internal: whether the display list is used for internal purpose * @flags: display list flags, a combination of VSP1_DL_FRAME_END_*
*/ */
struct vsp1_dl_list { struct vsp1_dl_list {
struct list_head list; struct list_head list;
...@@ -197,7 +197,7 @@ struct vsp1_dl_list { ...@@ -197,7 +197,7 @@ struct vsp1_dl_list {
bool has_chain; bool has_chain;
struct list_head chain; struct list_head chain;
bool internal; unsigned int flags;
}; };
/** /**
...@@ -861,13 +861,15 @@ static void vsp1_dl_list_commit_continuous(struct vsp1_dl_list *dl) ...@@ -861,13 +861,15 @@ static void vsp1_dl_list_commit_continuous(struct vsp1_dl_list *dl)
* *
* If a display list is already pending we simply drop it as the new * If a display list is already pending we simply drop it as the new
* display list is assumed to contain a more recent configuration. It is * display list is assumed to contain a more recent configuration. It is
* an error if the already pending list has the internal flag set, as * an error if the already pending list has the
* there is then a process waiting for that list to complete. This * VSP1_DL_FRAME_END_INTERNAL flag set, as there is then a process
* shouldn't happen as the waiting process should perform proper * waiting for that list to complete. This shouldn't happen as the
* locking, but warn just in case. * waiting process should perform proper locking, but warn just in
* case.
*/ */
if (vsp1_dl_list_hw_update_pending(dlm)) { if (vsp1_dl_list_hw_update_pending(dlm)) {
WARN_ON(dlm->pending && dlm->pending->internal); WARN_ON(dlm->pending &&
(dlm->pending->flags & VSP1_DL_FRAME_END_INTERNAL));
__vsp1_dl_list_put(dlm->pending); __vsp1_dl_list_put(dlm->pending);
dlm->pending = dl; dlm->pending = dl;
return; return;
...@@ -897,7 +899,7 @@ static void vsp1_dl_list_commit_singleshot(struct vsp1_dl_list *dl) ...@@ -897,7 +899,7 @@ static void vsp1_dl_list_commit_singleshot(struct vsp1_dl_list *dl)
dlm->active = dl; dlm->active = dl;
} }
void vsp1_dl_list_commit(struct vsp1_dl_list *dl, bool internal) void vsp1_dl_list_commit(struct vsp1_dl_list *dl, unsigned int dl_flags)
{ {
struct vsp1_dl_manager *dlm = dl->dlm; struct vsp1_dl_manager *dlm = dl->dlm;
struct vsp1_dl_list *dl_next; struct vsp1_dl_list *dl_next;
...@@ -912,7 +914,7 @@ void vsp1_dl_list_commit(struct vsp1_dl_list *dl, bool internal) ...@@ -912,7 +914,7 @@ void vsp1_dl_list_commit(struct vsp1_dl_list *dl, bool internal)
vsp1_dl_list_fill_header(dl_next, last); vsp1_dl_list_fill_header(dl_next, last);
} }
dl->internal = internal; dl->flags = dl_flags & ~VSP1_DL_FRAME_END_COMPLETED;
spin_lock_irqsave(&dlm->lock, flags); spin_lock_irqsave(&dlm->lock, flags);
...@@ -941,9 +943,10 @@ void vsp1_dl_list_commit(struct vsp1_dl_list *dl, bool internal) ...@@ -941,9 +943,10 @@ void vsp1_dl_list_commit(struct vsp1_dl_list *dl, bool internal)
* set in single-shot mode as display list processing is then not continuous and * set in single-shot mode as display list processing is then not continuous and
* races never occur. * races never occur.
* *
* The VSP1_DL_FRAME_END_INTERNAL flag indicates that the previous display list * The following flags are only supported for continuous mode.
* has completed and had been queued with the internal notification flag. *
* Internal notification is only supported for continuous mode. * The VSP1_DL_FRAME_END_INTERNAL flag indicates that the display list that just
* became active had been queued with the internal notification flag.
*/ */
unsigned int vsp1_dlm_irq_frame_end(struct vsp1_dl_manager *dlm) unsigned int vsp1_dlm_irq_frame_end(struct vsp1_dl_manager *dlm)
{ {
...@@ -986,9 +989,9 @@ unsigned int vsp1_dlm_irq_frame_end(struct vsp1_dl_manager *dlm) ...@@ -986,9 +989,9 @@ unsigned int vsp1_dlm_irq_frame_end(struct vsp1_dl_manager *dlm)
* frame end interrupt. The display list thus becomes active. * frame end interrupt. The display list thus becomes active.
*/ */
if (dlm->queued) { if (dlm->queued) {
if (dlm->queued->internal) if (dlm->queued->flags & VSP1_DL_FRAME_END_INTERNAL)
flags |= VSP1_DL_FRAME_END_INTERNAL; flags |= VSP1_DL_FRAME_END_INTERNAL;
dlm->queued->internal = false; dlm->queued->flags &= ~VSP1_DL_FRAME_END_INTERNAL;
__vsp1_dl_list_put(dlm->active); __vsp1_dl_list_put(dlm->active);
dlm->active = dlm->queued; dlm->active = dlm->queued;
......
...@@ -61,7 +61,7 @@ struct vsp1_dl_list *vsp1_dl_list_get(struct vsp1_dl_manager *dlm); ...@@ -61,7 +61,7 @@ struct vsp1_dl_list *vsp1_dl_list_get(struct vsp1_dl_manager *dlm);
void vsp1_dl_list_put(struct vsp1_dl_list *dl); void vsp1_dl_list_put(struct vsp1_dl_list *dl);
struct vsp1_dl_body *vsp1_dl_list_get_body0(struct vsp1_dl_list *dl); struct vsp1_dl_body *vsp1_dl_list_get_body0(struct vsp1_dl_list *dl);
struct vsp1_dl_ext_cmd *vsp1_dl_get_pre_cmd(struct vsp1_dl_list *dl); struct vsp1_dl_ext_cmd *vsp1_dl_get_pre_cmd(struct vsp1_dl_list *dl);
void vsp1_dl_list_commit(struct vsp1_dl_list *dl, bool internal); void vsp1_dl_list_commit(struct vsp1_dl_list *dl, unsigned int dl_flags);
struct vsp1_dl_body_pool * struct vsp1_dl_body_pool *
vsp1_dl_body_pool_create(struct vsp1_device *vsp1, unsigned int num_bodies, vsp1_dl_body_pool_create(struct vsp1_device *vsp1, unsigned int num_bodies,
......
...@@ -34,7 +34,7 @@ static void vsp1_du_pipeline_frame_end(struct vsp1_pipeline *pipe, ...@@ -34,7 +34,7 @@ static void vsp1_du_pipeline_frame_end(struct vsp1_pipeline *pipe,
unsigned int completion) unsigned int completion)
{ {
struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe); struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe);
bool complete = completion == VSP1_DL_FRAME_END_COMPLETED; bool complete = completion & VSP1_DL_FRAME_END_COMPLETED;
if (drm_pipe->du_complete) { if (drm_pipe->du_complete) {
struct vsp1_entity *uif = drm_pipe->uif; struct vsp1_entity *uif = drm_pipe->uif;
...@@ -537,6 +537,10 @@ static void vsp1_du_pipeline_configure(struct vsp1_pipeline *pipe) ...@@ -537,6 +537,10 @@ static void vsp1_du_pipeline_configure(struct vsp1_pipeline *pipe)
struct vsp1_entity *next; struct vsp1_entity *next;
struct vsp1_dl_list *dl; struct vsp1_dl_list *dl;
struct vsp1_dl_body *dlb; struct vsp1_dl_body *dlb;
unsigned int dl_flags = 0;
if (drm_pipe->force_brx_release)
dl_flags |= VSP1_DL_FRAME_END_INTERNAL;
dl = vsp1_dl_list_get(pipe->output->dlm); dl = vsp1_dl_list_get(pipe->output->dlm);
dlb = vsp1_dl_list_get_body0(dl); dlb = vsp1_dl_list_get_body0(dl);
...@@ -559,7 +563,7 @@ static void vsp1_du_pipeline_configure(struct vsp1_pipeline *pipe) ...@@ -559,7 +563,7 @@ static void vsp1_du_pipeline_configure(struct vsp1_pipeline *pipe)
vsp1_entity_configure_partition(entity, pipe, dl, dlb); vsp1_entity_configure_partition(entity, pipe, dl, dlb);
} }
vsp1_dl_list_commit(dl, drm_pipe->force_brx_release); vsp1_dl_list_commit(dl, dl_flags);
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
......
...@@ -421,7 +421,7 @@ static void vsp1_video_pipeline_run(struct vsp1_pipeline *pipe) ...@@ -421,7 +421,7 @@ static void vsp1_video_pipeline_run(struct vsp1_pipeline *pipe)
} }
/* Complete, and commit the head display list. */ /* Complete, and commit the head display list. */
vsp1_dl_list_commit(dl, false); vsp1_dl_list_commit(dl, 0);
pipe->configured = true; pipe->configured = true;
vsp1_pipeline_run(pipe); vsp1_pipeline_run(pipe);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment