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

Commit 1d3faf5b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Briefly turn off interrupts to create a time domain mapping"

parents 671e6046 167dc10c
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -83,12 +83,26 @@ void adreno_ringbuffer_submit(struct adreno_ringbuffer *rb,
	 */

	if (time != NULL) {
		/*
		 * Here we are attempting to create a mapping between the
		 * GPU time domain (alwayson counter) and the CPU time domain
		 * (local_clock) by sampling both values as close together as
		 * possible. This is useful for many types of debugging and
		 * profiling. In order to make this mapping as accurate as
		 * possible, we must turn off interrupts to avoid running
		 * interrupt handlers between the two samples.
		 */
		unsigned long flags;
		local_irq_save(flags);

		if (gpudev->alwayson_counter_read != NULL)
			time->ticks = gpudev->alwayson_counter_read(adreno_dev);
		else
			time->ticks = 0;

		time->clock = local_clock();

		local_irq_restore(flags);
	}

	/* Memory barrier before informing the hardware of new commands */