Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb15d2f8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Dont crash the device if the zap shader is not found"

parents f531c0ba f4d6cb97
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2104,7 +2104,7 @@ static int a5xx_microcode_load(struct adreno_device *adreno_dev,
		ret = scm_call2(SCM_SIP_FNID(SCM_SVC_BOOT, 0xA), &desc);
		if (ret) {
			pr_err("SCM resume call failed with error %d\n", ret);
			BUG();
			return ret;
		}

	}
@@ -2113,8 +2113,9 @@ static int a5xx_microcode_load(struct adreno_device *adreno_dev,
	if (adreno_dev->gpucore->zap_name && !zap_ucode_loaded) {
		ptr = subsystem_get(adreno_dev->gpucore->zap_name);

		/* Crash the device if the zap shader cannot be loaded */
		BUG_ON(IS_ERR_OR_NULL(ptr));
		/* Return error if the zap shader cannot be loaded */
		if (IS_ERR_OR_NULL(ptr))
			return (ptr == NULL) ? -ENODEV : PTR_ERR(ptr);

		zap_ucode_loaded = 1;
	}
+6 −1
Original line number Diff line number Diff line
@@ -231,6 +231,8 @@ void adreno_drawctxt_invalidate(struct kgsl_device *device,
		struct kgsl_context *context)
{
	struct adreno_context *drawctxt = ADRENO_CONTEXT(context);
	struct kgsl_cmdbatch *inv_cmdbatchs[ADRENO_CONTEXT_CMDQUEUE_SIZE];
	int i, cmd_num = 0;

	trace_adreno_drawctxt_invalidate(drawctxt);

@@ -260,11 +262,14 @@ void adreno_drawctxt_invalidate(struct kgsl_device *device,
		kgsl_cancel_events_timestamp(device, &context->events,
			cmdbatch->timestamp);

		kgsl_cmdbatch_destroy(cmdbatch);
		inv_cmdbatchs[cmd_num++] = cmdbatch;
	}

	spin_unlock(&drawctxt->lock);

	for (; cmd_num > 0; cmd_num--)
		kgsl_cmdbatch_destroy(inv_cmdbatchs[i]);

	/* Make sure all pending events are processed or cancelled */
	kgsl_flush_event_group(device, &context->events);