Commit c57a94ff authored by Rob Clark's avatar Rob Clark

drm/msm/mdp5: rip out plane->pending tracking

It would race between userspace thread and commit worker.  Ie. vblank
irq would trigger event and userspace could begin the next atomic
update, before the commit worker had a chance to clear the pending
flag.

If we do end up needing something to prevent userspace from trying
another pageflip before getting vblank event, it should probably be
implemented as a pending_planes bitmask, similar to pending_crtcs.  See
start_atomic() and end_atomic().
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 9afe69d5
...@@ -119,13 +119,7 @@ static void mdp5_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *st ...@@ -119,13 +119,7 @@ static void mdp5_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *st
static void mdp5_complete_commit(struct msm_kms *kms, struct drm_atomic_state *state) static void mdp5_complete_commit(struct msm_kms *kms, struct drm_atomic_state *state)
{ {
int i;
struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms)); struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms));
struct drm_plane *plane;
struct drm_plane_state *plane_state;
for_each_plane_in_state(state, plane, plane_state, i)
mdp5_plane_complete_commit(plane, plane_state);
if (mdp5_kms->smp) if (mdp5_kms->smp)
mdp5_smp_complete_commit(mdp5_kms->smp, &mdp5_kms->state->smp); mdp5_smp_complete_commit(mdp5_kms->smp, &mdp5_kms->state->smp);
......
...@@ -104,8 +104,6 @@ struct mdp5_plane_state { ...@@ -104,8 +104,6 @@ struct mdp5_plane_state {
/* assigned by crtc blender */ /* assigned by crtc blender */
enum mdp_mixer_stage_id stage; enum mdp_mixer_stage_id stage;
bool pending : 1;
}; };
#define to_mdp5_plane_state(x) \ #define to_mdp5_plane_state(x) \
container_of(x, struct mdp5_plane_state, base) container_of(x, struct mdp5_plane_state, base)
...@@ -232,8 +230,6 @@ int mdp5_irq_domain_init(struct mdp5_kms *mdp5_kms); ...@@ -232,8 +230,6 @@ int mdp5_irq_domain_init(struct mdp5_kms *mdp5_kms);
void mdp5_irq_domain_fini(struct mdp5_kms *mdp5_kms); void mdp5_irq_domain_fini(struct mdp5_kms *mdp5_kms);
uint32_t mdp5_plane_get_flush(struct drm_plane *plane); uint32_t mdp5_plane_get_flush(struct drm_plane *plane);
void mdp5_plane_complete_commit(struct drm_plane *plane,
struct drm_plane_state *state);
enum mdp5_pipe mdp5_plane_pipe(struct drm_plane *plane); enum mdp5_pipe mdp5_plane_pipe(struct drm_plane *plane);
struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary); struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary);
......
...@@ -179,7 +179,6 @@ mdp5_plane_atomic_print_state(struct drm_printer *p, ...@@ -179,7 +179,6 @@ mdp5_plane_atomic_print_state(struct drm_printer *p,
drm_printf(p, "\tzpos=%u\n", pstate->zpos); drm_printf(p, "\tzpos=%u\n", pstate->zpos);
drm_printf(p, "\talpha=%u\n", pstate->alpha); drm_printf(p, "\talpha=%u\n", pstate->alpha);
drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage)); drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage));
drm_printf(p, "\tpending=%u\n", pstate->pending);
} }
static void mdp5_plane_reset(struct drm_plane *plane) static void mdp5_plane_reset(struct drm_plane *plane)
...@@ -220,8 +219,6 @@ mdp5_plane_duplicate_state(struct drm_plane *plane) ...@@ -220,8 +219,6 @@ mdp5_plane_duplicate_state(struct drm_plane *plane)
if (mdp5_state && mdp5_state->base.fb) if (mdp5_state && mdp5_state->base.fb)
drm_framebuffer_reference(mdp5_state->base.fb); drm_framebuffer_reference(mdp5_state->base.fb);
mdp5_state->pending = false;
return &mdp5_state->base; return &mdp5_state->base;
} }
...@@ -288,13 +285,6 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane, ...@@ -288,13 +285,6 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
DBG("%s: check (%d -> %d)", plane->name, DBG("%s: check (%d -> %d)", plane->name,
plane_enabled(old_state), plane_enabled(state)); plane_enabled(old_state), plane_enabled(state));
/* We don't allow faster-than-vblank updates.. if we did add this
* some day, we would need to disallow in cases where hwpipe
* changes
*/
if (WARN_ON(to_mdp5_plane_state(old_state)->pending))
return -EBUSY;
max_width = config->hw->lm.max_width << 16; max_width = config->hw->lm.max_width << 16;
max_height = config->hw->lm.max_height << 16; max_height = config->hw->lm.max_height << 16;
...@@ -370,12 +360,9 @@ static void mdp5_plane_atomic_update(struct drm_plane *plane, ...@@ -370,12 +360,9 @@ static void mdp5_plane_atomic_update(struct drm_plane *plane,
struct drm_plane_state *old_state) struct drm_plane_state *old_state)
{ {
struct drm_plane_state *state = plane->state; struct drm_plane_state *state = plane->state;
struct mdp5_plane_state *mdp5_state = to_mdp5_plane_state(state);
DBG("%s: update", plane->name); DBG("%s: update", plane->name);
mdp5_state->pending = true;
if (plane_enabled(state)) { if (plane_enabled(state)) {
int ret; int ret;
...@@ -851,15 +838,6 @@ uint32_t mdp5_plane_get_flush(struct drm_plane *plane) ...@@ -851,15 +838,6 @@ uint32_t mdp5_plane_get_flush(struct drm_plane *plane)
return pstate->hwpipe->flush_mask; return pstate->hwpipe->flush_mask;
} }
/* called after vsync in thread context */
void mdp5_plane_complete_commit(struct drm_plane *plane,
struct drm_plane_state *state)
{
struct mdp5_plane_state *pstate = to_mdp5_plane_state(plane->state);
pstate->pending = false;
}
/* initialize plane */ /* initialize plane */
struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary) struct drm_plane *mdp5_plane_init(struct drm_device *dev, bool primary)
{ {
......
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