Merge "disp: msm: fix re-entry problem for msm_atomic_commit"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
c0a6abefe7
@@ -28,6 +28,7 @@ struct msm_commit {
|
|||||||
struct drm_device *dev;
|
struct drm_device *dev;
|
||||||
struct drm_atomic_state *state;
|
struct drm_atomic_state *state;
|
||||||
uint32_t crtc_mask;
|
uint32_t crtc_mask;
|
||||||
|
uint32_t plane_mask;
|
||||||
bool nonblock;
|
bool nonblock;
|
||||||
struct kthread_work commit_work;
|
struct kthread_work commit_work;
|
||||||
};
|
};
|
||||||
@@ -104,11 +105,13 @@ static void commit_destroy(struct msm_commit *c)
|
|||||||
{
|
{
|
||||||
struct msm_drm_private *priv = c->dev->dev_private;
|
struct msm_drm_private *priv = c->dev->dev_private;
|
||||||
uint32_t crtc_mask = c->crtc_mask;
|
uint32_t crtc_mask = c->crtc_mask;
|
||||||
|
uint32_t plane_mask = c->plane_mask;
|
||||||
|
|
||||||
/* End_atomic */
|
/* End_atomic */
|
||||||
spin_lock(&priv->pending_crtcs_event.lock);
|
spin_lock(&priv->pending_crtcs_event.lock);
|
||||||
DBG("end: %08x", crtc_mask);
|
DBG("end: %08x", crtc_mask);
|
||||||
priv->pending_crtcs &= ~crtc_mask;
|
priv->pending_crtcs &= ~crtc_mask;
|
||||||
|
priv->pending_planes &= ~plane_mask;
|
||||||
wake_up_all_locked(&priv->pending_crtcs_event);
|
wake_up_all_locked(&priv->pending_crtcs_event);
|
||||||
spin_unlock(&priv->pending_crtcs_event.lock);
|
spin_unlock(&priv->pending_crtcs_event.lock);
|
||||||
|
|
||||||
@@ -715,6 +718,7 @@ int msm_atomic_commit(struct drm_device *dev,
|
|||||||
|
|
||||||
drm_atomic_set_fence_for_plane(new_plane_state, fence);
|
drm_atomic_set_fence_for_plane(new_plane_state, fence);
|
||||||
}
|
}
|
||||||
|
c->plane_mask |= (1 << drm_plane_index(plane));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -725,10 +729,12 @@ int msm_atomic_commit(struct drm_device *dev,
|
|||||||
/* Start Atomic */
|
/* Start Atomic */
|
||||||
spin_lock(&priv->pending_crtcs_event.lock);
|
spin_lock(&priv->pending_crtcs_event.lock);
|
||||||
ret = wait_event_interruptible_locked(priv->pending_crtcs_event,
|
ret = wait_event_interruptible_locked(priv->pending_crtcs_event,
|
||||||
!(priv->pending_crtcs & c->crtc_mask));
|
!(priv->pending_crtcs & c->crtc_mask) &&
|
||||||
|
!(priv->pending_planes & c->plane_mask));
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
DBG("start: %08x", c->crtc_mask);
|
DBG("start: %08x", c->crtc_mask);
|
||||||
priv->pending_crtcs |= c->crtc_mask;
|
priv->pending_crtcs |= c->crtc_mask;
|
||||||
|
priv->pending_planes |= c->plane_mask;
|
||||||
}
|
}
|
||||||
spin_unlock(&priv->pending_crtcs_event.lock);
|
spin_unlock(&priv->pending_crtcs_event.lock);
|
||||||
|
|
||||||
|
@@ -631,6 +631,7 @@ struct msm_drm_private {
|
|||||||
|
|
||||||
/* crtcs pending async atomic updates: */
|
/* crtcs pending async atomic updates: */
|
||||||
uint32_t pending_crtcs;
|
uint32_t pending_crtcs;
|
||||||
|
uint32_t pending_planes;
|
||||||
wait_queue_head_t pending_crtcs_event;
|
wait_queue_head_t pending_crtcs_event;
|
||||||
|
|
||||||
unsigned int num_planes;
|
unsigned int num_planes;
|
||||||
|
Reference in New Issue
Block a user