diff options
author | Jason Ekstrand <[email protected]> | 2017-06-12 17:52:41 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-07-12 21:15:46 -0700 |
commit | 5b3363e3f17db887fedc58b8e15fa8b78a14e088 (patch) | |
tree | c22ae0ff8bcddf94d0ea6475e4d1653b9f08e369 /src/intel/isl/isl_drm.c | |
parent | a668ba9c1888de1417c55b6181e287ccfaa7a6f6 (diff) |
intel/isl: Add a helper to convert tilings from ISL to i915
Reviewed-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/intel/isl/isl_drm.c')
-rw-r--r-- | src/intel/isl/isl_drm.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/intel/isl/isl_drm.c b/src/intel/isl/isl_drm.c index 8fccc40862f..b7a4997d2d0 100644 --- a/src/intel/isl/isl_drm.c +++ b/src/intel/isl/isl_drm.c @@ -25,10 +25,35 @@ #include <stdlib.h> #include <drm_fourcc.h> +#include <i915_drm.h> #include "isl.h" #include "common/gen_device_info.h" +uint32_t +isl_tiling_to_i915_tiling(enum isl_tiling tiling) +{ + switch (tiling) { + case ISL_TILING_LINEAR: + return I915_TILING_NONE; + + case ISL_TILING_X: + return I915_TILING_X; + + case ISL_TILING_Y0: + return I915_TILING_Y; + + case ISL_TILING_W: + case ISL_TILING_Yf: + case ISL_TILING_Ys: + case ISL_TILING_HIZ: + case ISL_TILING_CCS: + return I915_TILING_NONE; + } + + unreachable("Invalid ISL tiling"); +} + struct isl_drm_modifier_info modifier_info[] = { { .modifier = DRM_FORMAT_MOD_NONE, |