summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2016-05-11 09:37:41 -0600
committerCarter Cooper <ccooper@codeaurora.org>2016-07-20 15:19:33 -0600
commit091839e4c39c195c05836c7dac23fa14465d751d (patch)
treeadcae5c1647d8b520a35c9d495c59b25978d803e /drivers/gpu
parente6814f052b954bfe311b2d42b5b61f79cd153f34 (diff)
msm: kgsl: Allow a draw context to skip snapshot
Some test applications intentionally generate a GPU fault for various reasons. Because a GPU fault generates a snapshot and snapshots are persistent until they are pulled, running the test application may take up the snapshot slot and prevent a real fault from being captured and debugged. This flag allows the draw context to intentionally avoid generating a snapshot. CRs-Fixed: 1009190 Change-Id: Ic0dedbad8476c308a13572d999540b243d97eabc Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/msm/adreno_dispatch.c33
-rw-r--r--drivers/gpu/msm/adreno_drawctxt.c3
2 files changed, 24 insertions, 12 deletions
diff --git a/drivers/gpu/msm/adreno_dispatch.c b/drivers/gpu/msm/adreno_dispatch.c
index fe92a5d30d90..ac3805800691 100644
--- a/drivers/gpu/msm/adreno_dispatch.c
+++ b/drivers/gpu/msm/adreno_dispatch.c
@@ -1699,6 +1699,27 @@ replay:
kfree(replay);
}
+static void do_header_and_snapshot(struct kgsl_device *device,
+ struct adreno_ringbuffer *rb, struct kgsl_cmdbatch *cmdbatch)
+{
+ /* Always dump the snapshot on a non-cmdbatch failure */
+ if (cmdbatch == NULL) {
+ adreno_fault_header(device, rb, NULL);
+ kgsl_device_snapshot(device, NULL);
+ return;
+ }
+
+ /* Skip everything if the PMDUMP flag is set */
+ if (test_bit(KGSL_FT_SKIP_PMDUMP, &cmdbatch->fault_policy))
+ return;
+
+ /* Print the fault header */
+ adreno_fault_header(device, rb, cmdbatch);
+
+ if (!(cmdbatch->context->flags & KGSL_CONTEXT_NO_SNAPSHOT))
+ kgsl_device_snapshot(device, cmdbatch->context);
+}
+
static int dispatcher_do_fault(struct adreno_device *adreno_dev)
{
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
@@ -1788,17 +1809,7 @@ static int dispatcher_do_fault(struct adreno_device *adreno_dev)
adreno_readreg64(adreno_dev, ADRENO_REG_CP_IB1_BASE,
ADRENO_REG_CP_IB1_BASE_HI, &base);
- /*
- * Dump the snapshot information if this is the first
- * detected fault for the oldest active command batch
- */
-
- if (cmdbatch == NULL ||
- !test_bit(KGSL_FT_SKIP_PMDUMP, &cmdbatch->fault_policy)) {
- adreno_fault_header(device, hung_rb, cmdbatch);
- kgsl_device_snapshot(device,
- cmdbatch ? cmdbatch->context : NULL);
- }
+ do_header_and_snapshot(device, hung_rb, cmdbatch);
/* Terminate the stalled transaction and resume the IOMMU */
if (fault & ADRENO_IOMMU_PAGE_FAULT)
diff --git a/drivers/gpu/msm/adreno_drawctxt.c b/drivers/gpu/msm/adreno_drawctxt.c
index 54ae1f022367..ca7add52edc8 100644
--- a/drivers/gpu/msm/adreno_drawctxt.c
+++ b/drivers/gpu/msm/adreno_drawctxt.c
@@ -346,7 +346,8 @@ adreno_drawctxt_create(struct kgsl_device_private *dev_priv,
KGSL_CONTEXT_PWR_CONSTRAINT |
KGSL_CONTEXT_IFH_NOP |
KGSL_CONTEXT_SECURE |
- KGSL_CONTEXT_PREEMPT_STYLE_MASK);
+ KGSL_CONTEXT_PREEMPT_STYLE_MASK |
+ KGSL_CONTEXT_NO_SNAPSHOT);
/* Check for errors before trying to initialize */