[Mesa-dev] [2.2/22] intel/isl: Add i915 to isl_tiling converter

Jason Ekstrand jason at jlekstrand.net
Wed Jul 19 20:24:50 UTC 2017


I don't really like the lack of isl_ prefix.  We could call it
isl_tiling_from_i915_tiling().  I don't care all that much though.

On Wed, Jul 19, 2017 at 12:48 PM, Topi Pohjolainen <
topi.pohjolainen at gmail.com> wrote:

> Suggested-by: Daniel Stone <daniels at collabora.com>
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
>  src/intel/isl/isl.h     |  3 +++
>  src/intel/isl/isl_drm.c | 17 +++++++++++++++++
>  2 files changed, 20 insertions(+)
>
> diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
> index d81df31a37..af46b6bf29 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
> +i915_tiling_to_isl_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 b7a4997d2d..b8f8e1214e 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
> +i915_tiling_to_isl_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,
> --
> 2.11.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170719/d198fdd5/attachment.html>


More information about the mesa-dev mailing list