OSDN Git Service

drm/i915: Put all non-blocking modesets onto an ordered wq
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 13 Nov 2017 13:36:22 +0000 (15:36 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 22 Dec 2017 12:29:42 +0000 (14:29 +0200)
commit757fffcfdffb6c0dd46c1b264091c36b4e5a86ae
tree94acf2d2c507449d35aa4c91bf74379cb2f5a2ad
parent6481d5ed076e69db83ca75e751ad492a6fb669a7
drm/i915: Put all non-blocking modesets onto an ordered wq

We have plenty of global registers and whatnot programmed without
any further locking by the modeset code. Currently non-bocking
modesets are allowed to execute in parallel which could corrupt
said registers.

To avoid the problem let's run all non-blocking modesets on an
ordered workqueue. We still put page flips etc. to system_unbound_wq
allowing page flips on one pipe to execute in parallel with page flips
or a modeset on a another pipe (assuming no known state is shared
between them, at which point they would have been added to the same
atomic commit and serialized that way).

Blocking modesets are already serialized with each other by
connection_mutex, and thus are safe. To serialize them with
non-blocking modesets we just flush the workqueue before executing
blocking modesets.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fixes: 94f050246b42 ("drm/i915: nonblocking commit")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171113133622.8593-1-ville.syrjala@linux.intel.com
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_display.c