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

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

msm: kgsl: Re-define maximum number of cmds for hwscheduling



HFI messages are only SZ_1K bytes. From this, derive HWSCHED_MAX_NUMIBS
as the number of maximum IBs that can be in a single submission in
hwscheduling.

Change-Id: Id6d5cd2c8130479bc83f731ddd564af8c552e531
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent 8833b6fd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -6,6 +6,11 @@
#ifndef _ADRENO_A6XX_HWSCHED_HFI_H_
#define _ADRENO_A6XX_HWSCHED_HFI_H_

/* Maximum number of IBs in a submission */
#define HWSCHED_MAX_NUMIBS \
	((HFI_MAX_MSG_SIZE - offsetof(struct hfi_issue_cmd_cmd, ibs)) \
		/ sizeof(struct hfi_issue_ib))

enum mem_kind {
	/** @MEMKIND_GENERIC: Used for requesting generic memory */
	MEMKIND_GENERIC = 0,
+17 −0
Original line number Diff line number Diff line
@@ -836,6 +836,23 @@ int adreno_hwsched_queue_cmds(struct kgsl_device_private *dev_priv,
	if (!count)
		return -EINVAL;

	for (i = 0; i < count; i++) {
		struct kgsl_drawobj_cmd *cmdobj;
		struct kgsl_memobj_node *ib;
		u32 numibs = 0;

		if (drawobj[i]->type != CMDOBJ_TYPE)
			continue;

		cmdobj = CMDOBJ(drawobj[i]);

		list_for_each_entry(ib, &cmdobj->cmdlist, node)
			numibs++;

		if (numibs > HWSCHED_MAX_NUMIBS)
			return -EINVAL;
	}

	ret = _check_context_state(&drawctxt->base);
	if (ret)
		return ret;