From 8e563d86c4c503c638e50c82af4019973f60bdc5 Mon Sep 17 00:00:00 2001 From: Puranam V G Tejaswi Date: Mon, 30 Nov 2020 21:01:16 +0530 Subject: [PATCH] msm: kgsl: Allocate user_ctxt_record based on preemption feature flag Allocation of memory to user_ctxt_record is done based on adreno_device flag. If a context is created when preemption is disabled, the memory to user_ctxt_record is not allocated. Now if we enable preemption, through the sysfs knob, the device flag is again set. We may try to access user_ctxt_record in preemption_pre_ibsubmit(). So allocate memory to user_ctxt_record based on the preemption feature flag instead of preemption device flag. Change-Id: I947ef5a1bfbd8bff471427fae60d7fcd507b85a2 Signed-off-by: Puranam V G Tejaswi Signed-off-by: Harshitha Sai Neelati --- drivers/gpu/msm/adreno_a6xx_preempt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/msm/adreno_a6xx_preempt.c b/drivers/gpu/msm/adreno_a6xx_preempt.c index 22431a4a90b8..fefb7ad80ecf 100644 --- a/drivers/gpu/msm/adreno_a6xx_preempt.c +++ b/drivers/gpu/msm/adreno_a6xx_preempt.c @@ -720,7 +720,7 @@ int a6xx_preemption_context_init(struct kgsl_context *context) struct adreno_device *adreno_dev = ADRENO_DEVICE(device); uint64_t flags = 0; - if (!adreno_is_preemption_enabled(adreno_dev)) + if (!ADRENO_FEATURE(adreno_dev, ADRENO_PREEMPTION)) return 0; if (context->flags & KGSL_CONTEXT_SECURE)