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

Commit ea24bd99 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Add the hwsched dispatcher



We need a dispatcher which can keep track of inflight submissions
so that in case of a fault, the remaining submissions can be re-
submitted after reset. Also, we need a dispatcher to hold queued
submissions until the input fences are signaled.

Change-Id: I59f5cf0fed6d443cf8a55fd0f40e3f16600d9a6f
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent a8002ec2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ msm_kgsl-y += \
	adreno_cp_parser.o \
	adreno_dispatch.o \
	adreno_drawctxt.o \
	adreno_hwsched.o \
	adreno_ioctl.o \
	adreno_perfcounter.o \
	adreno_ringbuffer.o \
+19 −3
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include "adreno_a5xx.h"
#include "adreno_a6xx.h"
#include "adreno_compat.h"
#include "adreno_hwsched.h"
#include "adreno_iommu.h"
#include "adreno_trace.h"
#include "kgsl_bus.h"
@@ -1522,10 +1523,15 @@ static void adreno_unbind(struct device *dev)

	kgsl_pwrscale_close(device);

	if (test_bit(GMU_DISPATCH, &device->gmu_core.flags))
		adreno_hwsched_dispatcher_close(adreno_dev);
	else {
		adreno_dispatcher_close(adreno_dev);

		adreno_ringbuffer_close(adreno_dev);

		adreno_fault_detect_stop(adreno_dev);
	}

	kfree(adreno_ft_regs);
	adreno_ft_regs = NULL;
@@ -3607,6 +3613,12 @@ static int adreno_queue_cmds(struct kgsl_device_private *dev_priv,
	struct kgsl_context *context, struct kgsl_drawobj *drawobj[],
	u32 count, u32 *timestamp)
{
	struct kgsl_device *device = dev_priv->device;

	if (test_bit(GMU_DISPATCH, &device->gmu_core.flags))
		return adreno_hwsched_queue_cmds(dev_priv, context, drawobj,
				count, timestamp);

	return adreno_dispatcher_queue_cmds(dev_priv, context, drawobj, count,
			timestamp);
}
@@ -3614,6 +3626,10 @@ static int adreno_queue_cmds(struct kgsl_device_private *dev_priv,
static void adreno_drawctxt_sched(struct kgsl_device *device,
		struct kgsl_context *context)
{
	if (test_bit(GMU_DISPATCH, &device->gmu_core.flags))
		return adreno_hwsched_queue_context(device,
			ADRENO_CONTEXT(context));

	adreno_dispatcher_queue_context(device, ADRENO_CONTEXT(context));
}

+6 −0
Original line number Diff line number Diff line
@@ -393,6 +393,8 @@ static int a6xx_hwsched_boot(struct adreno_device *adreno_dev)
	if (ret)
		return ret;

	adreno_hwsched_start(adreno_dev);

	mod_timer(&device->idle_timer, jiffies +
			device->pwrctrl.interval_timeout);

@@ -437,6 +439,10 @@ static int a6xx_hwsched_first_boot(struct adreno_device *adreno_dev)
	if (ret)
		return ret;

	adreno_hwsched_init(adreno_dev);

	adreno_hwsched_start(adreno_dev);

	adreno_get_bus_counters(adreno_dev);

	adreno_dev->cooperative_reset = ADRENO_FEATURE(adreno_dev,
+3 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#define _ADRENO_A6XX_HWSCHED_H_

#include "adreno_a6xx_hwsched_hfi.h"
#include "adreno_hwsched.h"

/**
 * struct a6xx_hwsched_device - Container for the a6xx hwscheduling device
@@ -16,6 +17,8 @@ struct a6xx_hwsched_device {
	struct a6xx_device a6xx_dev;
	/** @hwsched_hfi: Container for hwscheduling specific hfi resources */
	struct a6xx_hwsched_hfi hwsched_hfi;
	/** @hwsched: Container for the hardware dispatcher */
	struct adreno_hwsched hwsched;
};

/**
+13 −7
Original line number Diff line number Diff line
@@ -849,7 +849,7 @@ static int hfi_context_register(struct adreno_device *adreno_dev,

#define DISPQ_IRQ_BIT(_idx) BIT((_idx) + HFI_DSP_IRQ_BASE)

int a6xx_hwsched_submit_cmdobj(struct adreno_device *adreno_dev, u32 flags,
int a6xx_hwsched_submit_cmdobj(struct adreno_device *adreno_dev,
	struct kgsl_drawobj_cmd *cmdobj)
{
	struct a6xx_hfi *hfi = to_a6xx_hfi(adreno_dev);
@@ -868,6 +868,10 @@ int a6xx_hwsched_submit_cmdobj(struct adreno_device *adreno_dev, u32 flags,
	list_for_each_entry(ib, &cmdobj->cmdlist, node)
		numibs++;

	/* We need to dispatch a marker object but not execute it on the GPU */
	if (test_bit(CMDOBJ_SKIP, &cmdobj->priv))
		numibs = 0;

	/* Add a *issue_ib struct for each IB */
	cmd_sizebytes = sizeof(*cmd) + (sizeof(*issue_ib) * numibs);

@@ -880,10 +884,11 @@ int a6xx_hwsched_submit_cmdobj(struct adreno_device *adreno_dev, u32 flags,
			atomic_inc_return(&hfi->seqnum));

	cmd->ctxt_id = drawobj->context->id;
	cmd->flags = flags;
	cmd->flags = CTXT_FLAG_NOTIFY;
	cmd->ts = drawobj->timestamp;
	cmd->numibs = numibs;

	if (numibs) {
		issue_ib = (struct hfi_issue_ib *)&cmd[1];

		list_for_each_entry(ib, &cmdobj->cmdlist, node) {
@@ -891,6 +896,7 @@ int a6xx_hwsched_submit_cmdobj(struct adreno_device *adreno_dev, u32 flags,
			issue_ib->size = ib->size;
			issue_ib++;
		}
	}

	ret = a6xx_hfi_queue_write(adreno_dev, HFI_DSP_ID_0, (u32 *)cmd);
	if (ret)
Loading