drm/i915: Prevent concurrent tiling/framebuffer modifications
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 1 Mar 2017 15:41:28 +0000 (15:41 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 1 Mar 2017 17:57:17 +0000 (17:57 +0000)
commitdd689287b977597a46adf8c3de19d40212f0ea9f
tree664a82cf91a448de269dd57939cbc40ad14ceb4f
parent9aceb5c15d84d4b960f5f80fba846c753554d092
drm/i915: Prevent concurrent tiling/framebuffer modifications

Reintroduce a lock around tiling vs framebuffer creation to prevent
modification of the obj->tiling_and_stride whilst the framebuffer is
being created. Rather than use struct_mutex once again, use the
per-object lock - this will also be required in future to prevent
changing the tiling whilst submitting rendering.

Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Fixes: 24dbf51a5517 ("drm/i915: struct_mutex is not required for allocating the framebuffer")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170301154128.2841-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_object.h
drivers/gpu/drm/i915/i915_gem_shrinker.c
drivers/gpu/drm/i915/i915_gem_tiling.c
drivers/gpu/drm/i915/intel_display.c