[i-g-t,v3,10/21] lib/igt_vc4: Add helper for checking T-tiling support on plane

Submitted by Paul Kocialkowski on Jan. 11, 2019, 9:05 a.m.

Details

Message ID 20190111090532.19235-11-paul.kocialkowski@bootlin.com
State New
Series "Chamelium VC4 plane fuzzy testing, with SAND and T-tiled mode"
Headers show

Commit Message

Paul Kocialkowski Jan. 11, 2019, 9:05 a.m.
This introduces a convenience helper for checking whether a plane
supports T-tiling for a given format.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
 lib/igt_vc4.h | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/igt_vc4.h b/lib/igt_vc4.h
index d5c529bbccda..ee7af737ade9 100644
--- a/lib/igt_vc4.h
+++ b/lib/igt_vc4.h
@@ -24,6 +24,15 @@ 
 #ifndef IGT_VC4_H
 #define IGT_VC4_H
 
+#include "igt_kms.h"
+
+static inline bool igt_vc4_plane_supports_t_tiling(igt_plane_t *plane,
+						   uint32_t format)
+{
+	return igt_plane_has_format_mod(plane, format,
+					DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED);
+}
+
 uint32_t igt_vc4_get_cleared_bo(int fd, size_t size, uint32_t clearval);
 int igt_vc4_create_bo(int fd, size_t size);
 void *igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot);

Comments

Maxime Ripard Jan. 11, 2019, 3:11 p.m.
On Fri, Jan 11, 2019 at 10:05:21AM +0100, Paul Kocialkowski wrote:
> This introduces a convenience helper for checking whether a plane
> supports T-tiling for a given format.
> 
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>

Maxime
Lyude Paul Jan. 15, 2019, 9:49 p.m.
Reviewed-by: Lyude Paul <lyude@redhat.com>

On Fri, 2019-01-11 at 10:05 +0100, Paul Kocialkowski wrote:
> This introduces a convenience helper for checking whether a plane
> supports T-tiling for a given format.
> 
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
>  lib/igt_vc4.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/lib/igt_vc4.h b/lib/igt_vc4.h
> index d5c529bbccda..ee7af737ade9 100644
> --- a/lib/igt_vc4.h
> +++ b/lib/igt_vc4.h
> @@ -24,6 +24,15 @@
>  #ifndef IGT_VC4_H
>  #define IGT_VC4_H
>  
> +#include "igt_kms.h"
> +
> +static inline bool igt_vc4_plane_supports_t_tiling(igt_plane_t *plane,
> +						   uint32_t format)
> +{
> +	return igt_plane_has_format_mod(plane, format,
> +					DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED);
> +}
> +
>  uint32_t igt_vc4_get_cleared_bo(int fd, size_t size, uint32_t clearval);
>  int igt_vc4_create_bo(int fd, size_t size);
>  void *igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned
> prot);