diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-08-12 11:04:49 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-08-12 19:36:53 +0200 |
commit | 27a19de059259ef2944f7bfd61082862e6f277e4 (patch) | |
tree | 2abdc9d5a25257ab9f9f3dfb50f8cb98e584fa0a /lib | |
parent | dd8fba44cd1759e5cffc84d47f2c9b92c1e2ae8b (diff) |
lib/igt_kms: Clean up the other _name functions/macros
And remove sprite_name, redundant and won't work due to lack of
dev_priv.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/igt_kms.c | 40 | ||||
-rw-r--r-- | lib/igt_kms.h | 13 |
2 files changed, 35 insertions, 18 deletions
diff --git a/lib/igt_kms.c b/lib/igt_kms.c index bae43eea..fec859c0 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -87,6 +87,26 @@ const char *kmstest_pipe_name(enum pipe pipe) return str[pipe]; } +/** + * kmstest_plane_name: + * @plane: display plane + * + * Returns: String represnting @pipe, e.g. "plane1". + */ +const char *kmstest_plane_name(enum igt_plane plane) +{ + static const char *names[] = { + [IGT_PLANE_1] = "plane1", + [IGT_PLANE_2] = "plane2", + [IGT_PLANE_3] = "plane3", + [IGT_PLANE_CURSOR] = "cursor", + }; + + igt_assert(plane < ARRAY_SIZE(names) && names[plane]); + + return names[plane]; +} + struct type_name { int type; const char *name; @@ -164,6 +184,12 @@ static const char *mode_stereo_name(const drmModeModeInfo *mode) } } +/** + * kmstest_dump_mode: + * @mode: libdrm mode structure + * + * Prints @mode to stdout in a huma-readable form. + */ void kmstest_dump_mode(drmModeModeInfo *mode) { const char *stereo = mode_stereo_name(mode); @@ -509,20 +535,6 @@ void kmstest_free_connector_config(struct kmstest_connector_config *config) drmModeFreeConnector(config->connector); } -const char *plane_name(enum igt_plane p) -{ - static const char *names[] = { - [IGT_PLANE_1] = "plane1", - [IGT_PLANE_2] = "plane2", - [IGT_PLANE_3] = "plane3", - [IGT_PLANE_CURSOR] = "cursor", - }; - - igt_assert(p < ARRAY_SIZE(names) && names[p]); - - return names[p]; -} - /* * A small modeset API */ diff --git a/lib/igt_kms.h b/lib/igt_kms.h index 0e15b7dd..fd6a0e5b 100644 --- a/lib/igt_kms.h +++ b/lib/igt_kms.h @@ -51,9 +51,7 @@ enum igt_plane { IGT_PLANE_CURSOR, }; -const char *plane_name(enum igt_plane p); - -#define sprite_name(p, s) ((p) * dev_priv->num_plane + (s) + 'A') +const char *kmstest_plane_name(enum igt_plane plane); enum port { PORT_A = 0, @@ -63,7 +61,14 @@ enum port { PORT_E, I915_MAX_PORTS }; -#define port_name(p) ((p) + 'A') + +/** + * kmstest_port_name: + * @port: display plane + * + * Returns: String represnting @port, e.g. "A". + */ +#define kmstest_port_name(port) ((port) + 'A') enum igt_commit_style { COMMIT_LEGACY = 0, |