public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH v2 2/4] lib: Export helpers to get rotation/tiling strings
Date: Tue,  6 Mar 2018 18:52:13 +0200	[thread overview]
Message-ID: <20180306165215.16490-3-imre.deak@intel.com> (raw)
In-Reply-To: <20180306165215.16490-1-imre.deak@intel.com>

This is needed for the next patch for some debug prints.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 lib/igt_fb.c  | 23 +++++++++++++++++++++++
 lib/igt_fb.h  |  1 +
 lib/igt_kms.c | 11 +++++++++--
 lib/igt_kms.h |  1 +
 4 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 7404ba7c..f3ff1db4 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1705,3 +1705,26 @@ bool igt_fb_supported_format(uint32_t drm_format)
 
 	return false;
 }
+
+/**
+ * igt_tiling_str:
+ * @tiling: tiling ID
+ *
+ * Returns:
+ * Human-readable tiling string for @tiling.
+ */
+const char *igt_tiling_str(uint64_t tiling)
+{
+	switch (tiling) {
+	case LOCAL_DRM_FORMAT_MOD_NONE:
+		return "linear";
+	case LOCAL_I915_FORMAT_MOD_X_TILED:
+		return "X-tiled";
+	case LOCAL_I915_FORMAT_MOD_Y_TILED:
+		return "Y-tiled";
+	case LOCAL_I915_FORMAT_MOD_Yf_TILED:
+		return "Yf-tiled";
+	default:
+		return "N/A";
+	}
+}
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index 023b069d..481fe107 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -163,6 +163,7 @@ uint32_t igt_bpp_depth_to_drm_format(int bpp, int depth);
 uint32_t igt_drm_format_to_bpp(uint32_t drm_format);
 const char *igt_format_str(uint32_t drm_format);
 bool igt_fb_supported_format(uint32_t drm_format);
+const char *igt_tiling_str(uint64_t tiling);
 
 #endif /* __IGT_FB_H__ */
 
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 022abfe7..1fd15453 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -3550,7 +3550,14 @@ void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane,
 	igt_plane_set_prop_value(plane, IGT_PLANE_SRC_H, IGT_FIXED(h, 0));
 }
 
-static const char *rotation_name(igt_rotation_t rotation)
+/**
+ * igt_rotation_degrees_str:
+ * @rotation: rotation degrees/reflect mask
+ *
+ * Returns:
+ * Human-readable string for the rotation degrees part in @rotation.
+ */
+const char *igt_rotation_degrees_str(igt_rotation_t rotation)
 {
 	switch (rotation & IGT_ROTATION_MASK) {
 	case IGT_ROTATION_0:
@@ -3582,7 +3589,7 @@ void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation)
 
 	LOG(display, "%s.%d: plane_set_rotation(%s)\n",
 	    kmstest_pipe_name(pipe->pipe),
-	    plane->index, rotation_name(rotation));
+	    plane->index, igt_rotation_degrees_str(rotation));
 
 	igt_plane_set_prop_value(plane, IGT_PLANE_ROTATION, rotation);
 }
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 1c46186e..40a79338 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -389,6 +389,7 @@ void igt_plane_set_fence_fd(igt_plane_t *plane, int fence_fd);
 void igt_plane_set_position(igt_plane_t *plane, int x, int y);
 void igt_plane_set_size(igt_plane_t *plane, int w, int h);
 void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation);
+const char *igt_rotation_degrees_str(igt_rotation_t rotation);
 void igt_fb_set_position(struct igt_fb *fb, igt_plane_t *plane,
 	uint32_t x, uint32_t y);
 void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane,
-- 
2.13.2

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2018-03-06 16:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-06 16:52 [igt-dev] [PATCH i-g-t v2 0/4] kms_plane: Add clipping subtests Imre Deak
2018-03-06 16:52 ` [igt-dev] [PATCH v2 1/4] kms_plane: Remove redundant modeset after CRC capture Imre Deak
2018-09-05 16:27   ` [igt-dev] [PATCH i-g-t v3 0/5] kms_plane: Add clipping subtests Gwan-gyeong Mun
2018-09-05 16:27     ` [igt-dev] [PATCH i-g-t v3 1/5] kms_plane: Remove redundant modeset after CRC capture Gwan-gyeong Mun
2018-09-05 16:27     ` [igt-dev] [PATCH i-g-t v3 2/5] lib: Export helpers to get rotation/tiling strings Gwan-gyeong Mun
2018-09-05 16:27     ` [igt-dev] [PATCH i-g-t v3 3/5] kms_plane: Split helpers creating reference FB and capturing CRC Gwan-gyeong Mun
2018-09-05 16:27     ` [igt-dev] [PATCH i-g-t v3 4/5] kms_plane: Add a helper of capturing CRC with commit style Gwan-gyeong Mun
2018-09-05 16:27     ` [igt-dev] [PATCH i-g-t v3 5/5] kms_plane: Add clipping subtests Gwan-gyeong Mun
2018-03-06 16:52 ` Imre Deak [this message]
2018-03-06 16:52 ` [igt-dev] [PATCH v2 3/4] kms_plane: Split helpers creating reference FB and capturing CRC Imre Deak
2018-03-06 16:52 ` [igt-dev] [PATCH v2 4/4] kms_plane: Add clipping subtests Imre Deak
2018-03-06 17:47 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-03-06 22:24 ` [igt-dev] ✗ Fi.CI.IGT: warning " Patchwork
2018-03-07 17:03 ` [igt-dev] [PATCH i-g-t v2 0/4] " Daniel Vetter
2018-03-07 17:29   ` Imre Deak
2018-03-07 20:44     ` Daniel Vetter
2018-03-08 12:35       ` Imre Deak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180306165215.16490-3-imre.deak@intel.com \
    --to=imre.deak@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox