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

Commit c995302a authored by Shubhraprakash Das's avatar Shubhraprakash Das
Browse files

msm: kgsl: Process null flag and assign new ID for set draw state



If no flags are set in a set draw state packet then that is
an indication to load the state in the packet for the first
time. This situation was not handled corectly while parsing
the set draw state packet, fix this. Also, when saving set
draw commands save it with a new ID defined specifically for
this packet sequence.

Change-Id: I21ff0edf64ad92f62e4caa3e3e825415ba1b5a37
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
parent e1e5c4cc
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ static int load_state_unit_sizes[7][2] = {
static int adreno_ib_find_objs(struct kgsl_device *device,
				phys_addr_t ptbase,
				unsigned int gpuaddr, unsigned int dwords,
				int obj_type,
				struct adreno_ib_object_list *ib_obj_list);

static int ib_parse_set_draw_state(struct kgsl_device *device,
@@ -450,6 +451,7 @@ static int ib_parse_draw_indx(struct kgsl_device *device, unsigned int *pkt,
			adreno_ib_find_objs(device, ptbase,
			ib_parse_vars->set_draw_groups[i].cmd_stream_addr,
			ib_parse_vars->set_draw_groups[i].cmd_stream_dwords,
			SNAPSHOT_GPU_OBJECT_DRAW,
			ib_obj_list);
		if (ret)
			break;
@@ -595,7 +597,7 @@ static int ib_parse_set_draw_state(struct kgsl_device *device,
	 * loop counter by 2 always
	 */
	for (i = 1; i <= size; i += 2) {
		grp_id = ptr[i] & 0x1F000000 >> 24;
		grp_id = (ptr[i] & 0x1F000000) >> 24;
		/* take action based on flags */
		flags = (ptr[i] & 0x000F0000) >> 16;
		/* Disable all groups */
@@ -612,8 +614,12 @@ static int ib_parse_set_draw_state(struct kgsl_device *device,
						cmd_stream_dwords = 0;
			continue;
		}
		/* dirty flag */
		if (flags & 0x1) {
		/*
		 * dirty flag or no flags both mean we need to load it for
		 * next draw. No flags is used when the group is activated
		 * or initialized for the first time in the IB
		 */
		if (flags & 0x1 || !flags) {
			ib_parse_vars->set_draw_groups[grp_id].
				cmd_stream_dwords = ptr[i] & 0x0000FFFF;
			ib_parse_vars->set_draw_groups[grp_id].
@@ -624,6 +630,7 @@ static int ib_parse_set_draw_state(struct kgsl_device *device,
		if (flags & 0x8) {
			ret = adreno_ib_find_objs(device, ptbase,
				ptr[i + 1], (ptr[i] & 0x0000FFFF),
				SNAPSHOT_GPU_OBJECT_IB,
				ib_obj_list);
			if (ret)
				break;
@@ -639,6 +646,7 @@ static int ib_parse_set_draw_state(struct kgsl_device *device,
 * objects in it
 * @gpuaddr: The gpu address of the IB
 * @dwords: Size of ib in dwords
 * @obj_type: The object type can be either an IB or a draw state sequence
 * @ib_obj_list: The list in which the IB and the objects in it are added.
 *
 * Finds all IB objects in a given IB and puts then in a list. Can be called
@@ -648,6 +656,7 @@ static int ib_parse_set_draw_state(struct kgsl_device *device,
static int adreno_ib_find_objs(struct kgsl_device *device,
				phys_addr_t ptbase,
				unsigned int gpuaddr, unsigned int dwords,
				int obj_type,
				struct adreno_ib_object_list *ib_obj_list)
{
	int ret = 0;
@@ -680,7 +689,7 @@ static int adreno_ib_find_objs(struct kgsl_device *device,
	memset(&ib_parse_vars, 0, sizeof(struct ib_parser_variables));

	ret = adreno_ib_add_range(device, ptbase, gpuaddr, dwords << 2,
				SNAPSHOT_GPU_OBJECT_IB, ib_obj_list);
				obj_type, ib_obj_list);
	if (ret)
		goto done;

@@ -707,6 +716,7 @@ static int adreno_ib_find_objs(struct kgsl_device *device,
				ret = adreno_ib_find_objs(
						device, ptbase,
						gpuaddrib2, size,
						SNAPSHOT_GPU_OBJECT_IB,
						ib_obj_list);
				if (ret < 0)
					goto done;
@@ -784,7 +794,7 @@ int adreno_ib_create_object_list(struct kgsl_device *device,
	}

	ret = adreno_ib_find_objs(device, ptbase, gpuaddr, dwords,
		ib_obj_list);
		SNAPSHOT_GPU_OBJECT_IB, ib_obj_list);

	if (ret)
		adreno_ib_destroy_obj_list(ib_obj_list);
+1 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ struct kgsl_snapshot_debugbus {
#define SNAPSHOT_GPU_OBJECT_SHADER  1
#define SNAPSHOT_GPU_OBJECT_IB      2
#define SNAPSHOT_GPU_OBJECT_GENERIC 3
#define SNAPSHOT_GPU_OBJECT_DRAW    4

struct kgsl_snapshot_gpu_object {
	int type;      /* Type of GPU object */