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

Commit 2811b6d6 authored by Tarun Karra's avatar Tarun Karra
Browse files

msm: kgsl: Rename cmdbatch to drawobj



Rename all cmdbatch to drawobj. This forms a platform
for future changes where cmdbatch is split into different
types of drawobjs.

CRs-Fixed: 1054353
Change-Id: Ib84bee679e859db34e0d1f8a0ac70319eabddf53
Signed-off-by: default avatarTarun Karra <tkarra@codeaurora.org>
parent e4e58248
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ ccflags-y := -Idrivers/staging/android
msm_kgsl_core-y = \
	kgsl.o \
	kgsl_trace.o \
	kgsl_cmdbatch.o \
	kgsl_drawobj.o \
	kgsl_ioctl.o \
	kgsl_sharedmem.o \
	kgsl_pwrctrl.o \
+9 −9
Original line number Diff line number Diff line
@@ -1015,8 +1015,8 @@ static void _adreno_free_memories(struct adreno_device *adreno_dev)
{
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);

	if (test_bit(ADRENO_DEVICE_CMDBATCH_PROFILE, &adreno_dev->priv))
		kgsl_free_global(device, &adreno_dev->cmdbatch_profile_buffer);
	if (test_bit(ADRENO_DEVICE_DRAWOBJ_PROFILE, &adreno_dev->priv))
		kgsl_free_global(device, &adreno_dev->profile_buffer);

	/* Free local copies of firmware and other command streams */
	kfree(adreno_dev->pfp_fw);
@@ -1187,22 +1187,22 @@ static int adreno_init(struct kgsl_device *device)
	}

	/*
	 * Allocate a small chunk of memory for precise cmdbatch profiling for
	 * Allocate a small chunk of memory for precise drawobj profiling for
	 * those targets that have the always on timer
	 */

	if (!adreno_is_a3xx(adreno_dev)) {
		int r = kgsl_allocate_global(device,
			&adreno_dev->cmdbatch_profile_buffer, PAGE_SIZE,
			&adreno_dev->profile_buffer, PAGE_SIZE,
			0, 0, "alwayson");

		adreno_dev->cmdbatch_profile_index = 0;
		adreno_dev->profile_index = 0;

		if (r == 0) {
			set_bit(ADRENO_DEVICE_CMDBATCH_PROFILE,
			set_bit(ADRENO_DEVICE_DRAWOBJ_PROFILE,
				&adreno_dev->priv);
			kgsl_sharedmem_set(device,
				&adreno_dev->cmdbatch_profile_buffer, 0, 0,
				&adreno_dev->profile_buffer, 0, 0,
				PAGE_SIZE);
		}

@@ -2340,12 +2340,12 @@ int adreno_idle(struct kgsl_device *device)
 * adreno_drain() - Drain the dispatch queue
 * @device: Pointer to the KGSL device structure for the GPU
 *
 * Drain the dispatcher of existing command batches.  This halts
 * Drain the dispatcher of existing drawobjs.  This halts
 * additional commands from being issued until the gate is completed.
 */
static int adreno_drain(struct kgsl_device *device)
{
	reinit_completion(&device->cmdbatch_gate);
	reinit_completion(&device->halt_gate);

	return 0;
}
+21 −21
Original line number Diff line number Diff line
@@ -76,13 +76,13 @@
		  KGSL_CONTEXT_PREEMPT_STYLE_SHIFT)

/*
 * return the dispatcher cmdqueue in which the given cmdbatch should
 * return the dispatcher drawqueue in which the given drawobj should
 * be submitted
 */
#define ADRENO_CMDBATCH_DISPATCH_CMDQUEUE(c)	\
#define ADRENO_DRAWOBJ_DISPATCH_DRAWQUEUE(c)	\
	(&((ADRENO_CONTEXT(c->context))->rb->dispatch_q))

#define ADRENO_CMDBATCH_RB(c)			\
#define ADRENO_DRAWOBJ_RB(c)			\
	((ADRENO_CONTEXT(c->context))->rb)

/* Adreno core features */
@@ -346,8 +346,8 @@ struct adreno_gpu_core {
 * @halt: Atomic variable to check whether the GPU is currently halted
 * @ctx_d_debugfs: Context debugfs node
 * @pwrctrl_flag: Flag to hold adreno specific power attributes
 * @cmdbatch_profile_buffer: Memdesc holding the cmdbatch profiling buffer
 * @cmdbatch_profile_index: Index to store the start/stop ticks in the profiling
 * @profile_buffer: Memdesc holding the drawobj profiling buffer
 * @profile_index: Index to store the start/stop ticks in the profiling
 * buffer
 * @sp_local_gpuaddr: Base GPU virtual address for SP local memory
 * @sp_pvt_gpuaddr: Base GPU virtual address for SP private memory
@@ -404,8 +404,8 @@ struct adreno_device {
	struct dentry *ctx_d_debugfs;
	unsigned long pwrctrl_flag;

	struct kgsl_memdesc cmdbatch_profile_buffer;
	unsigned int cmdbatch_profile_index;
	struct kgsl_memdesc profile_buffer;
	unsigned int profile_index;
	uint64_t sp_local_gpuaddr;
	uint64_t sp_pvt_gpuaddr;
	const struct firmware *lm_fw;
@@ -441,7 +441,7 @@ struct adreno_device {
 * @ADRENO_DEVICE_STARTED - Set if the device start sequence is in progress
 * @ADRENO_DEVICE_FAULT - Set if the device is currently in fault (and shouldn't
 * send any more commands to the ringbuffer)
 * @ADRENO_DEVICE_CMDBATCH_PROFILE - Set if the device supports command batch
 * @ADRENO_DEVICE_DRAWOBJ_PROFILE - Set if the device supports drawobj
 * profiling via the ALWAYSON counter
 * @ADRENO_DEVICE_PREEMPTION - Turn on/off preemption
 * @ADRENO_DEVICE_SOFT_FAULT_DETECT - Set if soft fault detect is enabled
@@ -459,7 +459,7 @@ enum adreno_device_flags {
	ADRENO_DEVICE_HANG_INTR = 4,
	ADRENO_DEVICE_STARTED = 5,
	ADRENO_DEVICE_FAULT = 6,
	ADRENO_DEVICE_CMDBATCH_PROFILE = 7,
	ADRENO_DEVICE_DRAWOBJ_PROFILE = 7,
	ADRENO_DEVICE_GPU_REGULATOR_ENABLED = 8,
	ADRENO_DEVICE_PREEMPTION = 9,
	ADRENO_DEVICE_SOFT_FAULT_DETECT = 10,
@@ -469,22 +469,22 @@ enum adreno_device_flags {
};

/**
 * struct adreno_cmdbatch_profile_entry - a single command batch entry in the
 * struct adreno_drawobj_profile_entry - a single drawobj entry in the
 * kernel profiling buffer
 * @started: Number of GPU ticks at start of the command batch
 * @retired: Number of GPU ticks at the end of the command batch
 * @started: Number of GPU ticks at start of the drawobj
 * @retired: Number of GPU ticks at the end of the drawobj
 */
struct adreno_cmdbatch_profile_entry {
struct adreno_drawobj_profile_entry {
	uint64_t started;
	uint64_t retired;
};

#define ADRENO_CMDBATCH_PROFILE_COUNT \
	(PAGE_SIZE / sizeof(struct adreno_cmdbatch_profile_entry))
#define ADRENO_DRAWOBJ_PROFILE_COUNT \
	(PAGE_SIZE / sizeof(struct adreno_drawobj_profile_entry))

#define ADRENO_CMDBATCH_PROFILE_OFFSET(_index, _member) \
	 ((_index) * sizeof(struct adreno_cmdbatch_profile_entry) \
	  + offsetof(struct adreno_cmdbatch_profile_entry, _member))
#define ADRENO_DRAWOBJ_PROFILE_OFFSET(_index, _member) \
	 ((_index) * sizeof(struct adreno_drawobj_profile_entry) \
	  + offsetof(struct adreno_drawobj_profile_entry, _member))


/**
@@ -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 command batch
 * @KGSL_FT_DISABLE: Tells the dispatcher to disable FT for the drawobj
 * @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 command batches */
	/* Skip the PM dump on replayed drawobjs */
	KGSL_FT_SKIP_PMDUMP = 31,
};

@@ -882,7 +882,7 @@ int adreno_reset(struct kgsl_device *device, int fault);

void adreno_fault_skipcmd_detached(struct adreno_device *adreno_dev,
					 struct adreno_context *drawctxt,
					 struct kgsl_cmdbatch *cmdbatch);
					 struct kgsl_drawobj *drawobj);

int adreno_coresight_init(struct adreno_device *adreno_dev);

+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ static void _update_wptr(struct adreno_device *adreno_dev)
			rb->wptr);

		rb->dispatch_q.expires = jiffies +
			msecs_to_jiffies(adreno_cmdbatch_timeout);
			msecs_to_jiffies(adreno_drawobj_timeout);
	}

	spin_unlock_irqrestore(&rb->preempt_lock, flags);
+24 −24
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ typedef void (*reg_read_fill_t)(struct kgsl_device *device, int i,


static void sync_event_print(struct seq_file *s,
		struct kgsl_cmdbatch_sync_event *sync_event)
		struct kgsl_drawobj_sync_event *sync_event)
{
	switch (sync_event->type) {
	case KGSL_CMD_SYNCPOINT_TYPE_TIMESTAMP: {
@@ -153,12 +153,12 @@ struct flag_entry {
	const char *str;
};

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

static const struct flag_entry cmdbatch_priv[] = {
	{ CMDBATCH_FLAG_SKIP, "skip"},
	{ CMDBATCH_FLAG_FORCE_PREAMBLE, "force_preamble"},
	{ CMDBATCH_FLAG_WFI, "wait_for_idle" },
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 context_flags[] = {KGSL_CONTEXT_FLAGS};
@@ -199,17 +199,17 @@ static void print_flags(struct seq_file *s, const struct flag_entry *table,
		seq_puts(s, "None");
}

static void cmdbatch_print(struct seq_file *s, struct kgsl_cmdbatch *cmdbatch)
static void drawobj_print(struct seq_file *s, struct kgsl_drawobj *drawobj)
{
	struct kgsl_cmdbatch_sync_event *event;
	struct kgsl_drawobj_sync_event *event;
	unsigned int i;

	/* print fences first, since they block this cmdbatch */
	/* print fences first, since they block this drawobj */

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

		if (!kgsl_cmdbatch_event_pending(cmdbatch, i))
		if (!kgsl_drawobj_event_pending(drawobj, i))
			continue;

		/*
@@ -217,24 +217,24 @@ static void cmdbatch_print(struct seq_file *s, struct kgsl_cmdbatch *cmdbatch)
		 * so that it is clear if the fence was a separate submit
		 * or part of an IB submit.
		 */
		seq_printf(s, "\t%d ", cmdbatch->timestamp);
		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 (cmdbatch->flags & KGSL_CONTEXT_SYNC)
	if (drawobj->flags & KGSL_CONTEXT_SYNC)
		return;

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

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

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

	seq_puts(s, "\n");
}
@@ -285,13 +285,13 @@ static int ctx_print(struct seq_file *s, void *unused)
		   queued, consumed, retired,
		   drawctxt->internal_timestamp);

	seq_puts(s, "cmdqueue:\n");
	seq_puts(s, "drawqueue:\n");

	spin_lock(&drawctxt->lock);
	for (i = drawctxt->cmdqueue_head;
		i != drawctxt->cmdqueue_tail;
		i = CMDQUEUE_NEXT(i, ADRENO_CONTEXT_CMDQUEUE_SIZE))
		cmdbatch_print(s, drawctxt->cmdqueue[i]);
	for (i = drawctxt->drawqueue_head;
		i != drawctxt->drawqueue_tail;
		i = DRAWQUEUE_NEXT(i, ADRENO_CONTEXT_DRAWQUEUE_SIZE))
		drawobj_print(s, drawctxt->drawqueue[i]);
	spin_unlock(&drawctxt->lock);

	seq_puts(s, "events:\n");
Loading