diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2017-02-26 04:44:58 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-02-26 04:44:58 -0800 |
commit | 690cee7544570f71f5b9fe368f09ec941fa06916 (patch) | |
tree | 0c2a58d67df930538d880af439574dda17f23e4c /drivers | |
parent | 39668d409906cb27a5ef2e9a86ef3b73f07eb856 (diff) | |
parent | 599407841db783818c6aa2831619446600842429 (diff) |
Merge "msm: kgsl: Don't wait for context that has not submitted"
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/msm/adreno_debugfs.c | 3 | ||||
-rw-r--r-- | drivers/gpu/msm/adreno_drawctxt.c | 10 | ||||
-rw-r--r-- | drivers/gpu/msm/adreno_ringbuffer.c | 3 | ||||
-rw-r--r-- | drivers/gpu/msm/kgsl_device.h | 6 |
4 files changed, 14 insertions, 8 deletions
diff --git a/drivers/gpu/msm/adreno_debugfs.c b/drivers/gpu/msm/adreno_debugfs.c index fffe08038bcd..5306303b8d15 100644 --- a/drivers/gpu/msm/adreno_debugfs.c +++ b/drivers/gpu/msm/adreno_debugfs.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2002,2008-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2002,2008-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -168,6 +168,7 @@ static const struct flag_entry context_flags[] = {KGSL_CONTEXT_FLAGS}; * KGSL_CONTEXT_PRIV_DEVICE_SPECIFIC so it is ok to cross the streams here. */ static const struct flag_entry context_priv[] = { + { KGSL_CONTEXT_PRIV_SUBMITTED, "submitted"}, { KGSL_CONTEXT_PRIV_DETACHED, "detached"}, { KGSL_CONTEXT_PRIV_INVALID, "invalid"}, { KGSL_CONTEXT_PRIV_PAGEFAULT, "pagefault"}, diff --git a/drivers/gpu/msm/adreno_drawctxt.c b/drivers/gpu/msm/adreno_drawctxt.c index 1cbd2ef4b6b4..21a6399ba38e 100644 --- a/drivers/gpu/msm/adreno_drawctxt.c +++ b/drivers/gpu/msm/adreno_drawctxt.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2002,2007-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2002,2007-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -217,10 +217,12 @@ static int adreno_drawctxt_wait_rb(struct adreno_device *adreno_dev, BUG_ON(!mutex_is_locked(&device->mutex)); /* - * If the context is invalid then return immediately - we may end up - * waiting for a timestamp that will never come + * If the context is invalid (OR) not submitted commands to GPU + * then return immediately - we may end up waiting for a timestamp + * that will never come */ - if (kgsl_context_invalid(context)) + if (kgsl_context_invalid(context) || + !test_bit(KGSL_CONTEXT_PRIV_SUBMITTED, &context->priv)) goto done; trace_adreno_drawctxt_wait_start(drawctxt->rb->id, context->id, diff --git a/drivers/gpu/msm/adreno_ringbuffer.c b/drivers/gpu/msm/adreno_ringbuffer.c index fc0602a60ac1..161b718b8a38 100644 --- a/drivers/gpu/msm/adreno_ringbuffer.c +++ b/drivers/gpu/msm/adreno_ringbuffer.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2002,2007-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2002,2007-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -959,6 +959,7 @@ int adreno_ringbuffer_submitcmd(struct adreno_device *adreno_dev, drawobj->timestamp, time); if (!ret) { + set_bit(KGSL_CONTEXT_PRIV_SUBMITTED, &context->priv); cmdobj->global_ts = drawctxt->internal_timestamp; /* Put the timevalues in the profiling buffer */ diff --git a/drivers/gpu/msm/kgsl_device.h b/drivers/gpu/msm/kgsl_device.h index cb7ffd51460a..0a2c39b82781 100644 --- a/drivers/gpu/msm/kgsl_device.h +++ b/drivers/gpu/msm/kgsl_device.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2002,2007-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2002,2007-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -322,6 +322,7 @@ struct kgsl_device { /** * enum bits for struct kgsl_context.priv + * @KGSL_CONTEXT_PRIV_SUBMITTED - The context has submitted commands to gpu. * @KGSL_CONTEXT_PRIV_DETACHED - The context has been destroyed by userspace * and is no longer using the gpu. * @KGSL_CONTEXT_PRIV_INVALID - The context has been destroyed by the kernel @@ -331,7 +332,8 @@ struct kgsl_device { * reserved for devices specific use. */ enum kgsl_context_priv { - KGSL_CONTEXT_PRIV_DETACHED = 0, + KGSL_CONTEXT_PRIV_SUBMITTED = 0, + KGSL_CONTEXT_PRIV_DETACHED, KGSL_CONTEXT_PRIV_INVALID, KGSL_CONTEXT_PRIV_PAGEFAULT, KGSL_CONTEXT_PRIV_DEVICE_SPECIFIC = 16, |