Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Speed up DMC firmware loading

Currently we're doing:

1. acquire lock
2. write word to hardware
3. release lock
4. repeat from 1

to load the DMC firmware. Due to the cost of acquiring/releasing a lock,
and the size of the DMC firmware, this slows down DMC loading a lot.

This patch simply acquires the lock, writes the entire firmware,
then releases the lock. Testing shows resume speedups
in the order of 10ms on platforms with DMC firmware (GEN9+).

v2: Per feedback from Chris & Ville there's no need to do the whole
forcewake dance, so lose that bit (Chris, Ville)

v3: Actually send the new version of the patch...

v4: Don't acquire the uncore lock. Disable preempt. (Chris)

Signed-off-by: David Weinehall <david.weinehall@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170905131050.11655-1-david.weinehall@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

authored by

David Weinehall and committed by
Chris Wilson
dff457d7 3bc31a7f

+7 -1
+7 -1
drivers/gpu/drm/i915/intel_csr.c
··· 252 252 } 253 253 254 254 fw_size = dev_priv->csr.dmc_fw_size; 255 + assert_rpm_wakelock_held(dev_priv); 256 + 257 + preempt_disable(); 258 + 255 259 for (i = 0; i < fw_size; i++) 256 - I915_WRITE(CSR_PROGRAM(i), payload[i]); 260 + I915_WRITE_FW(CSR_PROGRAM(i), payload[i]); 261 + 262 + preempt_enable(); 257 263 258 264 for (i = 0; i < dev_priv->csr.mmio_count; i++) { 259 265 I915_WRITE(dev_priv->csr.mmioaddr[i],