drm/i915: Disable C3 when enabling vblank interrupts on i945gm
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 22 Mar 2019 18:08:03 +0000 (20:08 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 25 Mar 2019 06:38:20 +0000 (08:38 +0200)
commitd938da6b132a2d6addeba4c57a67ec3c07824843
tree93c7179576ce470f52eb88be34e62a2c3bbdbfae
parent57b1c4460dc46a00f6ec439f3f11d670736b0209
drm/i915: Disable C3 when enabling vblank interrupts on i945gm

The AGPBUSY thing doesn't work on i945gm anymore. This means
the gmch is incapable of waking the CPU from C3 when an interrupt
is generated. The interrupts just get postponed indefinitely until
something wakes up the CPU. This is rather annoying for vblank
interrupts as we are unable to maintain a steady framerate
unless the machine is sufficiently loaded to stay out of C3.

To combat this let's use pm_qos to prevent C3 whenever vblank
interrupts are enabled. To maintain reasonable amount of powersaving
we will attempt to limit this to C3 only while leaving C1 and C2
enabled.

v2: Use READ_ONCE() (Chris)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30364
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190322180804.3300-1-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_irq.c