aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqctecmdr <qctecmdr@localhost>2019-10-30 22:00:16 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-10-30 22:00:15 -0700
commit8eae7c042875b71a52e4edf16e11e075996059da (patch)
treeb5bc734e37cc75b2a4d799b09d7b0fb1efe1f4b2
parent06aa82d28c36c60aa3a36a45c218fd3187a9de50 (diff)
parenta0970c6d76bcf573d752afde21e0e44bb8a7fcd8 (diff)
Merge "msm: kgsl: Check user generated timestamp before queuing drawobjs"LE.UM.4.1.1-02510-sa515m
-rw-r--r--drivers/gpu/msm/adreno_dispatch.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/msm/adreno_dispatch.c b/drivers/gpu/msm/adreno_dispatch.c
index e2d0298325e1..4e4be1e64cef 100644
--- a/drivers/gpu/msm/adreno_dispatch.c
+++ b/drivers/gpu/msm/adreno_dispatch.c
@@ -1396,6 +1396,22 @@ int adreno_dispatcher_queue_cmds(struct kgsl_device_private *dev_priv,
user_ts = *timestamp;
+ /*
+ * If there is only one drawobj in the array and it is of
+ * type SYNCOBJ_TYPE, skip comparing user_ts as it can be 0
+ */
+ if (!(count == 1 && drawobj[0]->type == SYNCOBJ_TYPE) &&
+ (drawctxt->base.flags & KGSL_CONTEXT_USER_GENERATED_TS)) {
+ /*
+ * User specified timestamps need to be greater than the last
+ * issued timestamp in the context
+ */
+ if (timestamp_cmp(drawctxt->timestamp, user_ts) >= 0) {
+ spin_unlock(&drawctxt->lock);
+ return -ERANGE;
+ }
+ }
+
for (i = 0; i < count; i++) {
switch (drawobj[i]->type) {