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

Commit 8834ae89 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Split out the context and command batch flags



Split out the context and command batch flags into separate piles.
In reality it is more like a venn diagram with some context
exlusive bits some cmdbatch exclusive bits and some shared bits.

The object of all this is to increase the available pool of exclusive
command batch flags and keep from using up all of the context bits
too. We still have to be careful for future shared bits so not all of
the unused field is up for grabs for the command batch but we
certainly have increased our options.

Change-Id: Ic0dedbadac4a12b712c911760f83da3436550bcb
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 54f3fb1b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -580,6 +580,12 @@ struct log_field {
	{ BIT(KGSL_FT_THROTTLE), "throttle"}, \
	{ BIT(KGSL_FT_SKIPCMD), "skipcmd" }

#define ADRENO_CMDBATCH_FLAGS \
	{ KGSL_CMDBATCH_CTX_SWITCH, "CTX_SWITCH" }, \
	{ KGSL_CMDBATCH_SYNC, "SYNC" }, \
	{ KGSL_CMDBATCH_END_OF_FRAME, "EOF" }, \
	{ KGSL_CMDBATCH_PWR_CONSTRAINT, "PWR_CONSTRAINT" }

extern struct adreno_gpudev adreno_a3xx_gpudev;
extern struct adreno_gpudev adreno_a4xx_gpudev;

+5 −5
Original line number Diff line number Diff line
@@ -416,7 +416,7 @@ static int dispatcher_context_sendcmds(struct adreno_device *adreno_dev,
		 * against the burst for the context
		 */

		if (cmdbatch->flags & KGSL_CONTEXT_SYNC) {
		if (cmdbatch->flags & KGSL_CMDBATCH_SYNC) {
			kgsl_cmdbatch_destroy(cmdbatch);
			continue;
		}
@@ -610,7 +610,7 @@ static int get_timestamp(struct adreno_context *drawctxt,
		struct kgsl_cmdbatch *cmdbatch, unsigned int *timestamp)
{
	/* Synchronization commands don't get a timestamp */
	if (cmdbatch->flags & KGSL_CONTEXT_SYNC) {
	if (cmdbatch->flags & KGSL_CMDBATCH_SYNC) {
		*timestamp = 0;
		return 0;
	}
@@ -668,7 +668,7 @@ int adreno_dispatcher_queue_cmd(struct adreno_device *adreno_dev,
	 */

	if ((drawctxt->base.flags & KGSL_CONTEXT_CTX_SWITCH) ||
		(cmdbatch->flags & KGSL_CONTEXT_CTX_SWITCH))
		(cmdbatch->flags & KGSL_CMDBATCH_CTX_SWITCH))
		set_bit(CMDBATCH_FLAG_FORCE_PREAMBLE, &cmdbatch->priv);

	/* Skip this cmdbatch commands if IFH_NOP is enabled */
@@ -689,7 +689,7 @@ int adreno_dispatcher_queue_cmd(struct adreno_device *adreno_dev,
		 * for the dispatcher to continue submitting
		 */

		if (cmdbatch->flags & KGSL_CONTEXT_END_OF_FRAME) {
		if (cmdbatch->flags & KGSL_CMDBATCH_END_OF_FRAME) {
			clear_bit(ADRENO_CONTEXT_SKIP_EOF, &drawctxt->priv);

			/*
@@ -904,7 +904,7 @@ static void cmdbatch_skip_frame(struct kgsl_cmdbatch *cmdbatch,
		if (skip) {
			set_bit(CMDBATCH_FLAG_SKIP, &replay[i]->priv);

			if (replay[i]->flags & KGSL_CONTEXT_END_OF_FRAME)
			if (replay[i]->flags & KGSL_CMDBATCH_END_OF_FRAME)
				skip = 0;
		} else {
			set_bit(CMDBATCH_FLAG_FORCE_PREAMBLE, &replay[i]->priv);
+1 −1
Original line number Diff line number Diff line
@@ -1180,7 +1180,7 @@ void adreno_ringbuffer_set_constraint(struct kgsl_device *device,
	 */
	if (context->pwr_constraint.type &&
		((context->flags & KGSL_CONTEXT_PWR_CONSTRAINT) ||
			(cmdbatch->flags & KGSL_CONTEXT_PWR_CONSTRAINT))) {
			(cmdbatch->flags & KGSL_CMDBATCH_PWR_CONSTRAINT))) {

		constraint = adreno_ringbuffer_get_constraint(device, context);

+2 −4
Original line number Diff line number Diff line
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -42,9 +42,7 @@ TRACE_EVENT(adreno_cmdbatch_queued,
		"ctx=%u ts=%u queued=%u flags=%s",
			__entry->id, __entry->timestamp, __entry->queued,
			__entry->flags ? __print_flags(__entry->flags, "|",
				{ KGSL_CONTEXT_SYNC, "SYNC" },
				{ KGSL_CONTEXT_END_OF_FRAME, "EOF" })
				: "none"
				ADRENO_CMDBATCH_FLAGS) : "none"
	)
);

+5 −5
Original line number Diff line number Diff line
@@ -1874,7 +1874,7 @@ static struct kgsl_cmdbatch *kgsl_cmdbatch_create(struct kgsl_device *device,
	cmdbatch->device = device;
	cmdbatch->ibcount = (flags & KGSL_CONTEXT_SYNC) ? 0 : numibs;
	cmdbatch->context = context;
	cmdbatch->flags = flags & ~KGSL_CONTEXT_SUBMIT_IB_LIST;
	cmdbatch->flags = flags & ~KGSL_CMDBATCH_SUBMIT_IB_LIST;

	/* Add a timer to help debug sync deadlocks */
	setup_timer(&cmdbatch->timer, _kgsl_cmdbatch_timer,
@@ -1981,7 +1981,7 @@ static struct kgsl_cmdbatch *_kgsl_cmdbatch_create(struct kgsl_device *device,
		goto done;
	}

	if (!(flags & KGSL_CONTEXT_SYNC)) {
	if (!(flags & KGSL_CMDBATCH_SYNC)) {
		if (copy_from_user(cmdbatch->ibdesc, cmdlist,
			sizeof(struct kgsl_ibdesc) * numcmds)) {
			ret = -EFAULT;
@@ -2030,7 +2030,7 @@ long kgsl_ioctl_rb_issueibcmds(struct kgsl_device_private *dev_priv,
	long result = -EINVAL;

	/* The legacy functions don't support synchronization commands */
	if (param->flags & KGSL_CONTEXT_SYNC)
	if (param->flags & KGSL_CMDBATCH_SYNC)
		return -EINVAL;

	/* Get the context */
@@ -2038,7 +2038,7 @@ long kgsl_ioctl_rb_issueibcmds(struct kgsl_device_private *dev_priv,
	if (context == NULL)
		goto done;

	if (param->flags & KGSL_CONTEXT_SUBMIT_IB_LIST) {
	if (param->flags & KGSL_CMDBATCH_SUBMIT_IB_LIST) {
		/*
		 * Do a quick sanity check on the number of IBs in the
		 * submission
@@ -2089,7 +2089,7 @@ long kgsl_ioctl_submit_commands(struct kgsl_device_private *dev_priv,
	long result = -EINVAL;

	/* The number of IBs are completely ignored for sync commands */
	if (!(param->flags & KGSL_CONTEXT_SYNC)) {
	if (!(param->flags & KGSL_CMDBATCH_SYNC)) {
		if (param->numcmds == 0 || param->numcmds > KGSL_MAX_NUMIBS)
			return -EINVAL;
	} else if (param->numcmds != 0) {
Loading