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

Commit 750247f7 authored by Carter Cooper's avatar Carter Cooper Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Cleanup ringbuffer submissions to not reference the context



The context isn't needed for allocating ringbuffer space so stop passing
it around.

Change-Id: I849307b8bbfb9be76097f52ed673cacb8ef49668
Signed-off-by: default avatarCarter Cooper <ccooper@codeaurora.org>
parent eeeaaa77
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -679,7 +679,7 @@ int a3xx_rb_init(struct adreno_device *adreno_dev,
			 struct adreno_ringbuffer *rb)
{
	unsigned int *cmds;
	cmds = adreno_ringbuffer_allocspace(rb, NULL, 18);
	cmds = adreno_ringbuffer_allocspace(rb, 18);
	if (IS_ERR(cmds))
		return PTR_ERR(cmds);
	if (cmds == NULL)
+5 −10
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@ void adreno_ringbuffer_submit(struct adreno_ringbuffer *rb)

static int
adreno_ringbuffer_waitspace(struct adreno_ringbuffer *rb,
				struct adreno_context *context,
				unsigned int numcmds, int wptr_ahead)
{
	int nopcount;
@@ -140,7 +139,6 @@ adreno_ringbuffer_waitspace(struct adreno_ringbuffer *rb,
}

unsigned int *adreno_ringbuffer_allocspace(struct adreno_ringbuffer *rb,
					struct adreno_context *context,
					unsigned int numcmds)
{
	unsigned int *ptr = NULL;
@@ -155,19 +153,16 @@ unsigned int *adreno_ringbuffer_allocspace(struct adreno_ringbuffer *rb,
		/* reserve dwords for nop packet */
		if ((rb->wptr + numcmds) > (KGSL_RB_DWORDS -
				GSL_RB_NOP_SIZEDWORDS))
			ret = adreno_ringbuffer_waitspace(rb, context,
							numcmds, 1);
			ret = adreno_ringbuffer_waitspace(rb, numcmds, 1);
	} else {
		/* wptr behind rptr */
		if ((rb->wptr + numcmds) >= rptr)
			ret = adreno_ringbuffer_waitspace(rb, context,
							numcmds, 0);
			ret = adreno_ringbuffer_waitspace(rb, numcmds, 0);
		/* check for remaining space */
		/* reserve dwords for nop packet */
		if (!ret && (rb->wptr + numcmds) > (KGSL_RB_DWORDS -
				GSL_RB_NOP_SIZEDWORDS))
			ret = adreno_ringbuffer_waitspace(rb, context,
							numcmds, 1);
			ret = adreno_ringbuffer_waitspace(rb, numcmds, 1);
	}

	if (!ret) {
@@ -385,7 +380,7 @@ static int _ringbuffer_bootstrap_ucode(struct adreno_ringbuffer *rb,
	/* clear ME_HALT to start micro engine */
	adreno_writereg(adreno_dev, ADRENO_REG_CP_ME_CNTL, 0);

	cmds = adreno_ringbuffer_allocspace(rb, NULL, bootstrap_size);
	cmds = adreno_ringbuffer_allocspace(rb, bootstrap_size);
	if (IS_ERR(cmds))
		return PTR_ERR(cmds);
	if (cmds == NULL)
@@ -781,7 +776,7 @@ adreno_ringbuffer_addcmds(struct adreno_ringbuffer *rb,
	if (flags & KGSL_CMD_FLAGS_PWRON_FIXUP)
		total_sizedwords += 9;

	ringcmds = adreno_ringbuffer_allocspace(rb, drawctxt, total_sizedwords);
	ringcmds = adreno_ringbuffer_allocspace(rb, total_sizedwords);
	if (IS_ERR(ringcmds))
		return PTR_ERR(ringcmds);
	if (ringcmds == NULL)
+0 −1
Original line number Diff line number Diff line
@@ -115,7 +115,6 @@ void adreno_ringbuffer_submit(struct adreno_ringbuffer *rb);
void kgsl_cp_intrcallback(struct kgsl_device *device);

unsigned int *adreno_ringbuffer_allocspace(struct adreno_ringbuffer *rb,
						struct adreno_context *context,
						unsigned int numcmds);

void adreno_ringbuffer_read_pfp_ucode(struct kgsl_device *device);