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

Commit 1f266270 authored by Tarun Karra's avatar Tarun Karra
Browse files

msm: kgsl: Modify dispatcher to accept generic objects



Currently dispatcher accepts kgsl_cmdbatch object. This object
is a superset of all the types of objects dispatcher accepts.
Split kgsl_cmdbatch object to SYNC and IB/MARKER objects and
structure the code to make it easier for new type of objects
to be added to the dispatcher queue.

CRs-Fixed: 1054354
Change-Id: I2d482d1081ce6fdb7925243c88ce00ea6b864efe
Signed-off-by: default avatarTarun Karra <tkarra@codeaurora.org>
parent 2811b6d6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@

/* Include the master list of GPU cores that are supported */
#include "adreno-gpulist.h"
#include "adreno_dispatch.h"

#undef MODULE_PARAM_PREFIX
#define MODULE_PARAM_PREFIX "adreno."
@@ -2813,7 +2814,7 @@ static const struct kgsl_functable adreno_functable = {
	.getproperty_compat = adreno_getproperty_compat,
	.waittimestamp = adreno_waittimestamp,
	.readtimestamp = adreno_readtimestamp,
	.issueibcmds = adreno_ringbuffer_issueibcmds,
	.queue_cmds = adreno_dispatcher_queue_cmds,
	.ioctl = adreno_ioctl,
	.compat_ioctl = adreno_compat_ioctl,
	.power_stats = adreno_power_stats,
+2 −2
Original line number Diff line number Diff line
@@ -776,7 +776,7 @@ struct adreno_gpudev {
 * @KGSL_FT_REPLAY: Replay the faulting command
 * @KGSL_FT_SKIPIB: Skip the faulting indirect buffer
 * @KGSL_FT_SKIPFRAME: Skip the frame containing the faulting IB
 * @KGSL_FT_DISABLE: Tells the dispatcher to disable FT for the drawobj
 * @KGSL_FT_DISABLE: Tells the dispatcher to disable FT for the command obj
 * @KGSL_FT_TEMP_DISABLE: Disables FT for all commands
 * @KGSL_FT_THROTTLE: Disable the context if it faults too often
 * @KGSL_FT_SKIPCMD: Skip the command containing the faulting IB
@@ -793,7 +793,7 @@ enum kgsl_ft_policy_bits {
	/* KGSL_FT_MAX_BITS is used to calculate the mask */
	KGSL_FT_MAX_BITS,
	/* Internal bits - set during GFT */
	/* Skip the PM dump on replayed drawobjs */
	/* Skip the PM dump on replayed command obj's */
	KGSL_FT_SKIP_PMDUMP = 31,
};

+35 −23
Original line number Diff line number Diff line
@@ -155,10 +155,10 @@ struct flag_entry {

static const struct flag_entry drawobj_flags[] = {KGSL_DRAWOBJ_FLAGS};

static const struct flag_entry drawobj_priv[] = {
	{ DRAWOBJ_FLAG_SKIP, "skip"},
	{ DRAWOBJ_FLAG_FORCE_PREAMBLE, "force_preamble"},
	{ DRAWOBJ_FLAG_WFI, "wait_for_idle" },
static const struct flag_entry cmdobj_priv[] = {
	{ CMDOBJ_SKIP, "skip"},
	{ CMDOBJ_FORCE_PREAMBLE, "force_preamble"},
	{ CMDOBJ_WFI, "wait_for_idle" },
};

static const struct flag_entry context_flags[] = {KGSL_CONTEXT_FLAGS};
@@ -199,43 +199,55 @@ static void print_flags(struct seq_file *s, const struct flag_entry *table,
		seq_puts(s, "None");
}

static void drawobj_print(struct seq_file *s, struct kgsl_drawobj *drawobj)
static void syncobj_print(struct seq_file *s,
			struct kgsl_drawobj_sync *syncobj)
{
	struct kgsl_drawobj_sync_event *event;
	unsigned int i;

	/* print fences first, since they block this drawobj */
	seq_puts(s, " syncobj ");

	for (i = 0; i < drawobj->numsyncs; i++) {
		event = &drawobj->synclist[i];
	for (i = 0; i < syncobj->numsyncs; i++) {
		event = &syncobj->synclist[i];

		if (!kgsl_drawobj_event_pending(drawobj, i))
		if (!kgsl_drawobj_event_pending(syncobj, i))
			continue;

		/*
		 * Timestamp is 0 for KGSL_CONTEXT_SYNC, but print it anyways
		 * so that it is clear if the fence was a separate submit
		 * or part of an IB submit.
		 */
		seq_printf(s, "\t%d ", drawobj->timestamp);
		sync_event_print(s, event);
		seq_puts(s, "\n");
	}
}

	/* if this flag is set, there won't be an IB */
	if (drawobj->flags & KGSL_CONTEXT_SYNC)
		return;
static void cmdobj_print(struct seq_file *s,
			struct kgsl_drawobj_cmd *cmdobj)
{
	struct kgsl_drawobj *drawobj = DRAWOBJ(cmdobj);

	if (drawobj->type == CMDOBJ_TYPE)
		seq_puts(s, " cmdobj ");
	else
		seq_puts(s, " markerobj ");

	seq_printf(s, "\t%d: ", drawobj->timestamp);
	seq_printf(s, "\t %d ", drawobj->timestamp);

	seq_puts(s, " priv: ");
	print_flags(s, cmdobj_priv, ARRAY_SIZE(cmdobj_priv),
				cmdobj->priv);
}

static void drawobj_print(struct seq_file *s,
			struct kgsl_drawobj *drawobj)
{
	if (drawobj->type == SYNCOBJ_TYPE)
		syncobj_print(s, SYNCOBJ(drawobj));
	else if ((drawobj->type == CMDOBJ_TYPE) ||
			(drawobj->type == MARKEROBJ_TYPE))
		cmdobj_print(s, CMDOBJ(drawobj));

	seq_puts(s, " flags: ");
	print_flags(s, drawobj_flags, ARRAY_SIZE(drawobj_flags),
		    drawobj->flags);

	seq_puts(s, " priv: ");
	print_flags(s, drawobj_priv, ARRAY_SIZE(drawobj_priv),
		    drawobj->priv);

	seq_puts(s, "\n");
}

+533 −366

File changed.

Preview size limit exceeded, changes collapsed.

+5 −5
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ enum adreno_dispatcher_starve_timer_states {

/**
 * struct adreno_dispatcher_drawqueue - List of commands for a RB level
 * @cmd_q: List of drawobjs submitted to dispatcher
 * @cmd_q: List of command obj's submitted to dispatcher
 * @inflight: Number of commands inflight in this q
 * @head: Head pointer to the q
 * @tail: Queues tail pointer
@@ -58,7 +58,7 @@ enum adreno_dispatcher_starve_timer_states {
 * @expires: The jiffies value at which this drawqueue has run too long
 */
struct adreno_dispatcher_drawqueue {
	struct kgsl_drawobj *cmd_q[ADRENO_DISPATCH_DRAWQUEUE_SIZE];
	struct kgsl_drawobj_cmd *cmd_q[ADRENO_DISPATCH_DRAWQUEUE_SIZE];
	unsigned int inflight;
	unsigned int head;
	unsigned int tail;
@@ -109,9 +109,9 @@ int adreno_dispatcher_idle(struct adreno_device *adreno_dev);
void adreno_dispatcher_irq_fault(struct adreno_device *adreno_dev);
void adreno_dispatcher_stop(struct adreno_device *adreno_dev);

int adreno_dispatcher_queue_cmd(struct adreno_device *adreno_dev,
		struct adreno_context *drawctxt, struct kgsl_drawobj *drawobj,
		uint32_t *timestamp);
int adreno_dispatcher_queue_cmds(struct kgsl_device_private *dev_priv,
		struct kgsl_context *context, struct kgsl_drawobj *drawobj[],
		uint32_t count, uint32_t *timestamp);

void adreno_dispatcher_schedule(struct kgsl_device *device);
void adreno_dispatcher_pause(struct adreno_device *adreno_dev);
Loading