diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c index 22be14c3a072b8f28124ca802315a877954839f8..1ad44646fa7cb3a179e02c3d978505e82f4325d4 100644 --- a/drivers/gpu/msm/adreno.c +++ b/drivers/gpu/msm/adreno.c @@ -310,8 +310,14 @@ static void adreno_iommu_setstate(struct kgsl_device *device, struct kgsl_context *context; struct adreno_context *adreno_ctx = NULL; - if (!adreno_dev->drawctxt_active) + /* + * If we're idle and we don't need to use the GPU to save context + * state, use the CPU instead of the GPU to reprogram the + * iommu for simplicity's sake. + */ + if (!adreno_dev->drawctxt_active || device->ftbl->isidle(device)) return kgsl_mmu_device_setstate(&device->mmu, flags); + num_iommu_units = kgsl_mmu_get_num_iommu_units(&device->mmu); context = kgsl_context_get(device, context_id);