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

Commit 81d9604b 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: Pass the rb pointer when changing current context"

parents f02365f5 135b9c91
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3076,7 +3076,7 @@ static int adreno_suspend_context(struct kgsl_device *device)

	/* switch to NULL ctxt */
	if (adreno_dev->drawctxt_active != NULL) {
		adreno_drawctxt_switch(adreno_dev, NULL, 0);
		adreno_drawctxt_switch(adreno_dev, adreno_dev->cur_rb, NULL, 0);
		status = adreno_idle(device);
	}

+9 −3
Original line number Diff line number Diff line
@@ -406,6 +406,7 @@ int adreno_drawctxt_detach(struct kgsl_context *context)
	struct kgsl_device *device;
	struct adreno_device *adreno_dev;
	struct adreno_context *drawctxt;
	struct adreno_ringbuffer *rb;
	int ret;

	if (context == NULL)
@@ -414,10 +415,11 @@ int adreno_drawctxt_detach(struct kgsl_context *context)
	device = context->device;
	adreno_dev = ADRENO_DEVICE(device);
	drawctxt = ADRENO_CONTEXT(context);
	rb = adreno_ctx_get_rb(adreno_dev, drawctxt);

	/* deactivate context */
	if (adreno_dev->drawctxt_active == drawctxt)
		adreno_drawctxt_switch(adreno_dev, NULL, 0);
		adreno_drawctxt_switch(adreno_dev, rb, NULL, 0);

	mutex_lock(&drawctxt->mutex);

@@ -548,15 +550,17 @@ static int adreno_context_restore(struct adreno_device *adreno_dev,
}

/**
 * adreno_drawctxt_switch - switch the current draw context
 * adreno_drawctxt_switch - switch the current draw context in a given RB
 * @adreno_dev - The 3D device that owns the context
 * @rb: The ringubffer pointer on which the current context is being changed
 * @drawctxt - the 3D context to switch to
 * @flags - Flags to accompany the switch (from user space)
 *
 * Switch the current draw context
 * Switch the current draw context in given RB
 */

int adreno_drawctxt_switch(struct adreno_device *adreno_dev,
				struct adreno_ringbuffer *rb,
				struct adreno_context *drawctxt,
				unsigned int flags)
{
@@ -570,6 +574,8 @@ int adreno_drawctxt_switch(struct adreno_device *adreno_dev,
	trace_adreno_drawctxt_switch(adreno_dev->drawctxt_active,
		drawctxt, flags);

	/* We always expect a valid rb */
	BUG_ON(!rb);
	/* Get a refcount to the new instance */
	if (drawctxt) {
		if (!_kgsl_context_get(&drawctxt->base))
+2 −0
Original line number Diff line number Diff line
@@ -100,7 +100,9 @@ void adreno_drawctxt_destroy(struct kgsl_context *context);
void adreno_drawctxt_sched(struct kgsl_device *device,
		struct kgsl_context *context);

struct adreno_ringbuffer;
int adreno_drawctxt_switch(struct adreno_device *adreno_dev,
				struct adreno_ringbuffer *rb,
				struct adreno_context *drawctxt,
				unsigned int flags);

+7 −4
Original line number Diff line number Diff line
@@ -911,6 +911,8 @@ adreno_ringbuffer_issuecmds(struct kgsl_device *device,
	struct adreno_ringbuffer *rb = ADRENO_CURRENT_RINGBUFFER(adreno_dev);

	flags |= KGSL_CMD_FLAGS_INTERNAL_ISSUE;
	if (drawctxt)
		rb = adreno_ctx_get_rb(adreno_dev, drawctxt);

	return adreno_ringbuffer_addcmds(rb, drawctxt, flags, cmds,
		sizedwords, 0);
@@ -1269,6 +1271,7 @@ int adreno_ringbuffer_submitcmd(struct adreno_device *adreno_dev,
	bool use_preamble = true;
	int flags = KGSL_CMD_FLAGS_NONE;
	int ret;
	struct adreno_ringbuffer *rb;

	context = cmdbatch->context;
	drawctxt = ADRENO_CONTEXT(context);
@@ -1277,6 +1280,8 @@ int adreno_ringbuffer_submitcmd(struct adreno_device *adreno_dev,
	list_for_each_entry(ib, &cmdbatch->cmdlist, node)
		numibs++;

	rb = adreno_ctx_get_rb(adreno_dev, drawctxt);

	/* process any profiling results that are available into the log_buf */
	adreno_profile_process_results(device);

@@ -1398,7 +1403,7 @@ int adreno_ringbuffer_submitcmd(struct adreno_device *adreno_dev,
	if (ret)
		goto done;

	ret = adreno_drawctxt_switch(adreno_dev, drawctxt, cmdbatch->flags);
	ret = adreno_drawctxt_switch(adreno_dev, rb, drawctxt, cmdbatch->flags);

	/*
	 * In the unlikely event of an error in the drawctxt switch,
@@ -1425,9 +1430,7 @@ int adreno_ringbuffer_submitcmd(struct adreno_device *adreno_dev,
	/* CFF stuff executed only if CFF is enabled */
	kgsl_cffdump_capture_ib_desc(device, context, cmdbatch);

	ret = adreno_ringbuffer_addcmds(ADRENO_CURRENT_RINGBUFFER(adreno_dev),
					drawctxt,
					flags,
	ret = adreno_ringbuffer_addcmds(rb, drawctxt, flags,
					&link[0], (cmds - link),
					cmdbatch->timestamp);