drm/i915: Reduce the time we hold struct mutex in sprite update_plane code
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 1 Oct 2013 15:02:12 +0000 (18:02 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 10 Oct 2013 10:46:59 +0000 (12:46 +0200)
commit82284b6becdbef6d8cd3fb43e8698510833a5129
tree0faad5d402b1603df8877cd2ef56ed4953f17699
parent03c5b25f6efd8190dab133eeecf1c0dae307dea8
drm/i915: Reduce the time we hold struct mutex in sprite update_plane code

We used to call the entire intel specific update_plane hook while
holding struct_mutex. Actually we only need to hold struct_mutex while
pinning/unpinning the obj. The plane state itself is protected by the
kms locks, and as the object is pinned we can dig out the offset and
tiling information from it without fearing that it would change
underneath us.

So now we don't need to drop and reacquire the lock around the
wait_for_vblank. Also we will need another wait_for_vblank in the IVB
specific update_plane hook, and this way we don't need to worry about
struct_mutex there either.

Also move the intel_plane->obj=NULL assignment outside strut_mutex in
disable_plane to make it clear that it's not protected by struct_mutex.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_sprite.c