mirror of https://gitee.com/openkylin/linux.git
drm/msm: change to uninterruptible wait in atomic commit
The atomic commit cannot easily undo and return an error once the state is swapped. Change to uninterruptible wait, and ignore the timeout error. Signed-off-by: Wentao Xu <wentaox@codeaurora.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
parent
a1c3e3e01e
commit
99fc1bc48f
|
@ -283,12 +283,8 @@ int msm_atomic_commit(struct drm_device *dev,
|
||||||
|
|
||||||
timeout = ktime_add_ms(ktime_get(), 1000);
|
timeout = ktime_add_ms(ktime_get(), 1000);
|
||||||
|
|
||||||
ret = msm_wait_fence_interruptable(dev, c->fence, &timeout);
|
/* uninterruptible wait */
|
||||||
if (ret) {
|
msm_wait_fence(dev, c->fence, &timeout, false);
|
||||||
WARN_ON(ret); // TODO unswap state back? or??
|
|
||||||
commit_destroy(c);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
complete_commit(c);
|
complete_commit(c);
|
||||||
|
|
||||||
|
|
|
@ -637,8 +637,8 @@ static void msm_debugfs_cleanup(struct drm_minor *minor)
|
||||||
* Fences:
|
* Fences:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int msm_wait_fence_interruptable(struct drm_device *dev, uint32_t fence,
|
int msm_wait_fence(struct drm_device *dev, uint32_t fence,
|
||||||
ktime_t *timeout)
|
ktime_t *timeout , bool interruptible)
|
||||||
{
|
{
|
||||||
struct msm_drm_private *priv = dev->dev_private;
|
struct msm_drm_private *priv = dev->dev_private;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -667,7 +667,12 @@ int msm_wait_fence_interruptable(struct drm_device *dev, uint32_t fence,
|
||||||
remaining_jiffies = timespec_to_jiffies(&ts);
|
remaining_jiffies = timespec_to_jiffies(&ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = wait_event_interruptible_timeout(priv->fence_event,
|
if (interruptible)
|
||||||
|
ret = wait_event_interruptible_timeout(priv->fence_event,
|
||||||
|
fence_completed(dev, fence),
|
||||||
|
remaining_jiffies);
|
||||||
|
else
|
||||||
|
ret = wait_event_timeout(priv->fence_event,
|
||||||
fence_completed(dev, fence),
|
fence_completed(dev, fence),
|
||||||
remaining_jiffies);
|
remaining_jiffies);
|
||||||
|
|
||||||
|
@ -853,7 +858,7 @@ static int msm_ioctl_wait_fence(struct drm_device *dev, void *data,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return msm_wait_fence_interruptable(dev, args->fence, &timeout);
|
return msm_wait_fence(dev, args->fence, &timeout, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct drm_ioctl_desc msm_ioctls[] = {
|
static const struct drm_ioctl_desc msm_ioctls[] = {
|
||||||
|
|
|
@ -164,8 +164,8 @@ int msm_atomic_commit(struct drm_device *dev,
|
||||||
|
|
||||||
int msm_register_mmu(struct drm_device *dev, struct msm_mmu *mmu);
|
int msm_register_mmu(struct drm_device *dev, struct msm_mmu *mmu);
|
||||||
|
|
||||||
int msm_wait_fence_interruptable(struct drm_device *dev, uint32_t fence,
|
int msm_wait_fence(struct drm_device *dev, uint32_t fence,
|
||||||
ktime_t *timeout);
|
ktime_t *timeout, bool interruptible);
|
||||||
int msm_queue_fence_cb(struct drm_device *dev,
|
int msm_queue_fence_cb(struct drm_device *dev,
|
||||||
struct msm_fence_cb *cb, uint32_t fence);
|
struct msm_fence_cb *cb, uint32_t fence);
|
||||||
void msm_update_fence(struct drm_device *dev, uint32_t fence);
|
void msm_update_fence(struct drm_device *dev, uint32_t fence);
|
||||||
|
|
|
@ -460,7 +460,7 @@ int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout)
|
||||||
if (op & MSM_PREP_NOSYNC)
|
if (op & MSM_PREP_NOSYNC)
|
||||||
timeout = NULL;
|
timeout = NULL;
|
||||||
|
|
||||||
ret = msm_wait_fence_interruptable(dev, fence, timeout);
|
ret = msm_wait_fence(dev, fence, timeout, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO cache maintenance */
|
/* TODO cache maintenance */
|
||||||
|
|
Loading…
Reference in New Issue