From 171b72542ccbf54097079f3ffe20440d3e2c4316 Mon Sep 17 00:00:00 2001 From: Topi Pohjolainen Date: Wed, 19 Jul 2017 20:35:29 +0300 Subject: intel/isl: Add i915 to isl_tiling converter v2: s/i915_tiling_to_isl_tiling(/isl_tiling_from_i915_tiling/ Reviewed-by: Daniel Stone Reviewed-by: Jason Ekstrand Signed-off-by: Topi Pohjolainen --- src/intel/isl/isl.h | 3 +++ src/intel/isl/isl_drm.c | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'src/intel') diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h index d81df31a372..92d2ffc31a5 100644 --- a/src/intel/isl/isl.h +++ b/src/intel/isl/isl.h @@ -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); diff --git a/src/intel/isl/isl_drm.c b/src/intel/isl/isl_drm.c index b7a4997d2d0..ef80e42fdf7 100644 --- a/src/intel/isl/isl_drm.c +++ b/src/intel/isl/isl_drm.c @@ -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, -- cgit v1.2.3