[Intel-gfx] [PATCH v2 1/2] drm/i915/dp: Helper for checking DDI_BUF_CTL Idle status

Imre Deak imre.deak at intel.com
Tue Jun 23 20:50:27 UTC 2020


On Tue, Jun 23, 2020 at 01:32:50PM -0700, Manasi Navare wrote:
> still dont quite get it, how is usleep_range (600, 1000) providing a fixed delay?

Not sure what you mean. udelay is busy looping, while usleep_range
sleeps instead. How to chose between udelay/usleep_range please read

Documentation/timers/timers-howto.rst

> Now if we split ino 2 functs, one for disable, for that:
> 
> if (BXT)
> 	usleep_range(600, 1000)
> else
> 	wait_for_us(check if Idle bit set)
> 
> so in both functions, for the timeout part we still use the wait_for_us helper right?

with two functions it would get:

intel_ddi_wait_for_ddi_buf_active(i915, port)
{
	if (GEN <= 9) {
		usleep_range(600, 1000);
		return;
	}

 	if (wait_for_us(!(read(BUF_CTL) & IS_IDLE), 600))
 		drm_err("Port %c: Timeout waiting for DDI BUF to get active\n", port));
}

intel_ddi_wait_for_ddi_buf_idle(i915, port)
{
	if (BXT) {
		udelay(16);
		return;
	}

 	if (wait_for_us(read(BUF_CTL) & IS_IDLE, 600))
 		drm_err("Port %c: Timeout waiting for DDI BUF to get idle\n", port));
}

--Imre


More information about the Intel-gfx mailing list