aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-08-05 05:14:22 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2016-08-05 05:54:42 -0400
commitdeeb1519b65a92ca06c8e8554a92df0fdb4d5dea (patch)
tree8a8a464b76cc6000dbfb79cdf5fe3b3e53e0c401
parent9ad3676148511d6af72be6f3638e361fd86e1f7b (diff)
drm/i915: Document and reject invalid tiling modes
Through the GTT interface to the fence registers, we can only handle linear, X and Y tiling. The more esoteric tiling patterns are ignored. Document that the tiling ABI only supports upto Y tiling, and reject any attempts to set a tiling mode other than NONE, X or Y. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1470388464-28458-17-git-send-email-chris@chris-wilson.co.uk
-rw-r--r--drivers/gpu/drm/i915/i915_gem_tiling.c3
-rw-r--r--include/uapi/drm/i915_drm.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index c0e01333bddf..6817f69947d9 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -68,6 +68,9 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)
68 if (tiling_mode == I915_TILING_NONE) 68 if (tiling_mode == I915_TILING_NONE)
69 return true; 69 return true;
70 70
71 if (tiling_mode > I915_TILING_LAST)
72 return false;
73
71 if (IS_GEN2(dev) || 74 if (IS_GEN2(dev) ||
72 (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev))) 75 (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev)))
73 tile_width = 128; 76 tile_width = 128;
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 0f292733cffc..452629de7a57 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -926,6 +926,7 @@ struct drm_i915_gem_caching {
926#define I915_TILING_NONE 0 926#define I915_TILING_NONE 0
927#define I915_TILING_X 1 927#define I915_TILING_X 1
928#define I915_TILING_Y 2 928#define I915_TILING_Y 2
929#define I915_TILING_LAST I915_TILING_Y
929 930
930#define I915_BIT_6_SWIZZLE_NONE 0 931#define I915_BIT_6_SWIZZLE_NONE 0
931#define I915_BIT_6_SWIZZLE_9 1 932#define I915_BIT_6_SWIZZLE_9 1