summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem_tiling.c
diff options
context:
space:
mode:
authorDaniel Vetter2013-10-09 21:23:52 +0200
committerDaniel Vetter2013-10-16 22:04:52 +0200
commit80075d492f8773209e26d11d6bb13ba624ef95a4 (patch)
treed3f3c4ae6a96849e790bb0bcead6531b28f02e24 /drivers/gpu/drm/i915/i915_gem_tiling.c
parentdrm/i915: grab dev->struct_mutex around framebuffer_init (diff)
downloadkernel-qcow2-linux-80075d492f8773209e26d11d6bb13ba624ef95a4.tar.gz
kernel-qcow2-linux-80075d492f8773209e26d11d6bb13ba624ef95a4.tar.xz
kernel-qcow2-linux-80075d492f8773209e26d11d6bb13ba624ef95a4.zip
drm/i915: prevent tiling changes on framebuffer backing storage
Assuming that all framebuffer related metadata is invariant simplifies our userspace input data checking. And current userspace always first updates the tiling of an object before creating a framebuffer with it. This allows us to upconvert a check in pin_and_fence to a WARN. In the future it should also be helpful to know which buffer objects are potential scanout targets for e.g. frontbuffer rendering tracking and similar things. Note that SNA shipped for one prerelease with code which will be broken through this patch. But users shouldn't notice since it's purely an optimization and will transparently fall back to allocating a new fb. i-g-t also had offending code (now fixed), but we don't really care about breaking the test-suite. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Grumpily-reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_tiling.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_tiling.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index ac9ebe98f8b0..b13905348048 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -308,7 +308,7 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
return -EINVAL;
}
- if (obj->pin_count) {
+ if (obj->pin_count || obj->framebuffer_references) {
drm_gem_object_unreference_unlocked(&obj->base);
return -EBUSY;
}