[Intel-gfx] [PATCH 5/5] drm/i915: Boost DMA qos whilst performing uninterruptible waits for the GPU

Chris Wilson chris at chris-wilson.co.uk
Fri Jul 5 00:07:11 CEST 2013


If we are forced to do an uninterruptible wait for a result from the
GPU, boost the qos of DMA operations to minimise the latency and
minimise the amount of time spent waiting for the operation whilst
uninterruptible.

This shaves a modicum of time off waiting for GPU operations to
complete before performing a MMIO flip, for example.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index f532a01..f5da4a0 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1013,14 +1013,22 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
 	 i915_reset_in_progress(&dev_priv->gpu_error) || \
 	 reset_counter != atomic_read(&dev_priv->gpu_error.reset_counter))
 	do {
-		if (interruptible)
+		if (interruptible) {
 			end = wait_event_interruptible_timeout(ring->irq_queue,
 							       EXIT_COND,
 							       timeout_jiffies);
-		else
+		} else {
+			struct pm_qos_request qos;
+
+			memset(&qos, 0, sizeof(qos));
+			pm_qos_add_request(&qos, PM_QOS_CPU_DMA_LATENCY, 0);
+
 			end = wait_event_timeout(ring->irq_queue, EXIT_COND,
 						 timeout_jiffies);
 
+			pm_qos_remove_request(&qos);
+		}
+
 		/* We need to check whether any gpu reset happened in between
 		 * the caller grabbing the seqno and now ... */
 		if (reset_counter != atomic_read(&dev_priv->gpu_error.reset_counter))
-- 
1.8.3.2




More information about the Intel-gfx mailing list