intel/isl: Add i915 to isl_tiling converter
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Wed, 19 Jul 2017 17:35:29 +0000 (20:35 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 20 Jul 2017 08:32:21 +0000 (11:32 +0300)
v2: s/i915_tiling_to_isl_tiling(/isl_tiling_from_i915_tiling/

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/isl/isl.h
src/intel/isl/isl_drm.c

index d81df31a372771c415ca6488d6b28d9db16f9aad..92d2ffc31a5336765951d4b14f364fc1410c042b 100644 (file)
@@ -1516,6 +1516,9 @@ isl_tiling_is_std_y(enum isl_tiling tiling)
 uint32_t
 isl_tiling_to_i915_tiling(enum isl_tiling tiling);
 
+enum isl_tiling 
+isl_tiling_from_i915_tiling(uint32_t tiling);
+
 const struct isl_drm_modifier_info * ATTRIBUTE_CONST
 isl_drm_modifier_get_info(uint64_t modifier);
 
index b7a4997d2d00ce1bee87928c60082a8ba2a70848..ef80e42fdf71e8af9ad6487f24c05e1abbddbe09 100644 (file)
@@ -54,6 +54,23 @@ isl_tiling_to_i915_tiling(enum isl_tiling tiling)
    unreachable("Invalid ISL tiling");
 }
 
+enum isl_tiling
+isl_tiling_from_i915_tiling(uint32_t tiling)
+{
+   switch (tiling) {
+   case I915_TILING_NONE:
+      return ISL_TILING_LINEAR;
+
+   case I915_TILING_X:
+      return ISL_TILING_X;
+
+   case I915_TILING_Y:
+      return ISL_TILING_Y0;
+   }
+
+   unreachable("Invalid i915 tiling");
+}
+
 struct isl_drm_modifier_info modifier_info[] = {
    {
       .modifier = DRM_FORMAT_MOD_NONE,