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

Commit 4f98552f authored by Shubhraprakash Das's avatar Shubhraprakash Das
Browse files

msm: kgsl: In snapshot skip object if it is in ib list



When looking for objects to save in snapshot, check whether the
object is already tracked in the ib list first. If it is tracked
there then skip tracking the object as it is already tracked.

Change-Id: Ife408ad16b86482a12e7d9e53a243505451d7fdc
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
parent b27a57db
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -358,12 +358,29 @@ struct kgsl_snapshot_object *kgsl_snapshot_find_object(
 * @size - the size of the object (may not always be the size of the region)
 *
 * Return 1 if the object is already in the list - this can save us from
 * having to parse the sme thing over again.
 * having to parse the same thing over again. There are 2 lists that are
 * tracking objects so check for the object in both lists
*/
int kgsl_snapshot_have_object(struct kgsl_device *device, phys_addr_t ptbase,
	unsigned int gpuaddr, unsigned int size)
{
	struct kgsl_snapshot_object *obj;
	struct kgsl_snapshot_cp_obj *obj_cp;
	struct adreno_ib_object *ib_obj;
	int i;

	/* Check whether the object is tracked already in ib list */
	list_for_each_entry(obj_cp, &device->snapshot_cp_list, node) {
		if (obj_cp->ptbase != ptbase)
			continue;
		for (i = 0; i < obj_cp->ib_obj_list->num_objs; i++) {
			ib_obj = &(obj_cp->ib_obj_list->obj_list[i]);
			if ((gpuaddr >= ib_obj->gpuaddr) &&
				((gpuaddr + size) <=
				(ib_obj->gpuaddr + ib_obj->size)))
				return 1;
		}
	}

	list_for_each_entry(obj, &device->snapshot_obj_list, node) {
		if (obj->ptbase != ptbase)