OSDN Git Service

drm/i915: fix reset handling in the throttle ioctl
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 14 Nov 2012 16:14:06 +0000 (17:14 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 20 Jan 2013 12:11:15 +0000 (13:11 +0100)
commit308887aad14c4ecc3fc10a3c58ec42641c5e4423
treee28a0e3c75057a84c1995f92e353001e4cefd071
parent33196deddacc7790defb9a7e84659e0362d4da7a
drm/i915: fix reset handling in the throttle ioctl

While auditing the code I've noticed one place (the throttle ioctl)
which does not yet wait for the reset handler to complete and doesn't
properly decode the wedge state into -EAGAIN/-EIO. Fix this up by
calling the right helpers. This might explain the oddball "my
compositor just died in a successfull gpu reset" reports. Or maybe not, since
current mesa doesn't use this ioctl to throttle command submission.

The throttle ioctl doesn't take the struct_mutex, so to avoid busy-looping
with -EAGAIN while a reset is in process, check for errors first and wait
for the handler to complete if a reset is pending by calling
i915_gem_wait_for_error.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c