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

Commit f436a577 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Put commands on ringbuffer 0 if premption is disabled



If preemption gets disabled at runtime due to memory constraints
then all the commands need to go on ringbuffer 0 otherwise they
will never get swapped in.

Change-Id: Ic0dedbad98c07976fb65dff252d879cc9ca813d4
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent d2db2ee1
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -1291,6 +1291,12 @@ adreno_get_rptr(struct adreno_ringbuffer *rb)
	return rb->rptr;
}

static inline bool adreno_is_preemption_enabled(
				struct adreno_device *adreno_dev)
{
	return test_bit(ADRENO_DEVICE_PREEMPTION, &adreno_dev->priv);
}

/**
 * adreno_ctx_get_rb() - Return the ringbuffer that a context should
 * use based on priority
@@ -1308,6 +1314,14 @@ static inline struct adreno_ringbuffer *adreno_ctx_get_rb(

	context = &(drawctxt->base);

	/*
	 * If preemption is disabled then everybody needs to go on the same
	 * ringbuffer
	 */

	if (!adreno_is_preemption_enabled(adreno_dev))
		return &(adreno_dev->ringbuffers[0]);

	/*
	 * Math to convert the priority field in context structure to an RB ID.
	 * Divide up the context priority based on number of ringbuffer levels.
@@ -1360,12 +1374,6 @@ void adreno_writereg64(struct adreno_device *adreno_dev,
unsigned int adreno_iommu_set_apriv(struct adreno_device *adreno_dev,
				unsigned int *cmds, int set);

static inline bool adreno_is_preemption_enabled(
				struct adreno_device *adreno_dev)
{
	return test_bit(ADRENO_DEVICE_PREEMPTION, &adreno_dev->priv);
}

static inline bool adreno_soft_fault_detect(struct adreno_device *adreno_dev)
{
	return adreno_dev->fast_hang_detect &&