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

Commit 3888497f 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: Force all command level context switches to the GPU"

parents 5677b1e2 ce4a8c89
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -452,7 +452,7 @@ void adreno_drawctxt_detach(struct kgsl_context *context)
	struct adreno_device *adreno_dev;
	struct adreno_context *drawctxt;
	struct adreno_ringbuffer *rb;
	int ret, count, i;
	int ret = 0, count, i;
	struct kgsl_cmdbatch *list[ADRENO_CONTEXT_CMDQUEUE_SIZE];

	if (context == NULL)
@@ -567,7 +567,7 @@ void adreno_drawctxt_destroy(struct kgsl_context *context)
 * @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)
 * @flags: Control flags for the switch
 *
 * Switch the current draw context in given RB
 */
@@ -597,8 +597,7 @@ int adreno_drawctxt_switch(struct adreno_device *adreno_dev,
	if (drawctxt != NULL && kgsl_context_detached(&drawctxt->base))
		return -ENOENT;

	trace_adreno_drawctxt_switch(rb,
		drawctxt, flags);
	trace_adreno_drawctxt_switch(rb, drawctxt);

	/* Get a refcount to the new instance */
	if (drawctxt) {
@@ -610,7 +609,7 @@ int adreno_drawctxt_switch(struct adreno_device *adreno_dev,
		 /* No context - set the default pagetable and thats it. */
		new_pt = device->mmu.defaultpagetable;
	}
	ret = adreno_ringbuffer_set_pt_ctx(rb, new_pt, drawctxt);
	ret = adreno_ringbuffer_set_pt_ctx(rb, new_pt, drawctxt, flags);
	if (ret)
		return ret;

+3 −0
Original line number Diff line number Diff line
@@ -104,6 +104,9 @@ enum adreno_context_priv {
	ADRENO_CONTEXT_SKIP_CMD,
};

/* Flags for adreno_drawctxt_switch() */
#define ADRENO_CONTEXT_SWITCH_FORCE_GPU BIT(0)

struct kgsl_context *adreno_drawctxt_create(struct kgsl_device_private *,
			uint32_t *flags);

+4 −2
Original line number Diff line number Diff line
@@ -847,7 +847,8 @@ int adreno_iommu_init(struct adreno_device *adreno_dev)
 */
int adreno_iommu_set_pt_ctx(struct adreno_ringbuffer *rb,
			struct kgsl_pagetable *new_pt,
			struct adreno_context *drawctxt)
			struct adreno_context *drawctxt,
			unsigned long flags)
{
	struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
@@ -858,7 +859,8 @@ int adreno_iommu_set_pt_ctx(struct adreno_ringbuffer *rb,
	if (rb->drawctxt_active)
		cur_pt = rb->drawctxt_active->base.proc_priv->pagetable;

	cpu_path = _ctx_switch_use_cpu_path(adreno_dev, new_pt, rb);
	cpu_path = !(flags & ADRENO_CONTEXT_SWITCH_FORCE_GPU) &&
		_ctx_switch_use_cpu_path(adreno_dev, new_pt, rb);

	/* Pagetable switch */
	if (new_pt != cur_pt) {
+4 −2
Original line number Diff line number Diff line
@@ -17,7 +17,8 @@
#ifdef CONFIG_MSM_KGSL_IOMMU
int adreno_iommu_set_pt_ctx(struct adreno_ringbuffer *rb,
			struct kgsl_pagetable *new_pt,
			struct adreno_context *drawctxt);
			struct adreno_context *drawctxt,
			unsigned long flags);

int adreno_iommu_init(struct adreno_device *adreno_dev);

@@ -33,7 +34,8 @@ static inline int adreno_iommu_init(struct adreno_device *adreno_dev)

static inline int adreno_iommu_set_pt_ctx(struct adreno_ringbuffer *rb,
			struct kgsl_pagetable *new_pt,
			struct adreno_context *drawctxt)
			struct adreno_context *drawctxt,
			unsigned long flags)
{
	return 0;
}
+3 −1
Original line number Diff line number Diff line
@@ -992,7 +992,9 @@ int adreno_ringbuffer_submitcmd(struct adreno_device *adreno_dev,
	*cmds++ = cp_packet(adreno_dev, CP_NOP, 1);
	*cmds++ = KGSL_END_OF_IB_IDENTIFIER;

	ret = adreno_drawctxt_switch(adreno_dev, rb, drawctxt, cmdbatch->flags);
	/* Context switches commands should *always* be on the GPU */
	ret = adreno_drawctxt_switch(adreno_dev, rb, drawctxt,
		ADRENO_CONTEXT_SWITCH_FORCE_GPU);

	/*
	 * In the unlikely event of an error in the drawctxt switch,
Loading