Commit f755e227 authored by Chris Wilson's avatar Chris Wilson Committed by Rob Clark

drm/msm: Remove call to reservation_object_test_signaled_rcu before wait

Since fence_wait_timeout_reservation_object_wait_timeout_rcu() with a
timeout of 0 becomes reservation_object_test_signaled_rcu(), we do not
need to handle such conversion in the caller. The only challenge are
those callers that wish to differentiate the error code between the
nonblocking busy check and potentially blocking wait.

v2: 9 is only 0 in German.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 5f6f5e08
...@@ -584,18 +584,16 @@ int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout) ...@@ -584,18 +584,16 @@ int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout)
{ {
struct msm_gem_object *msm_obj = to_msm_bo(obj); struct msm_gem_object *msm_obj = to_msm_bo(obj);
bool write = !!(op & MSM_PREP_WRITE); bool write = !!(op & MSM_PREP_WRITE);
unsigned long remain =
if (op & MSM_PREP_NOSYNC) { op & MSM_PREP_NOSYNC ? 0 : timeout_to_jiffies(timeout);
if (!reservation_object_test_signaled_rcu(msm_obj->resv, write)) long ret;
return -EBUSY;
} else { ret = reservation_object_wait_timeout_rcu(msm_obj->resv, write,
int ret; true, remain);
if (ret == 0)
ret = reservation_object_wait_timeout_rcu(msm_obj->resv, write, return remain == 0 ? -EBUSY : -ETIMEDOUT;
true, timeout_to_jiffies(timeout)); else if (ret < 0)
if (ret <= 0) return ret;
return ret == 0 ? -ETIMEDOUT : ret;
}
/* TODO cache maintenance */ /* TODO cache maintenance */
......
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