diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2012-09-12 14:21:29 +0100 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2013-09-30 18:04:21 +0100 |
commit | 30e0710ca374eb937806ad79e20f53a222cab54a (patch) | |
tree | 28c25b99ddff353591b8e061d30b9a62c7ffd376 /lib/drmtest.c | |
parent | 9edaf7fa7364e03115edd1bc3a1e99a282fce9ce (diff) |
lib: Dump information about the supported 3D stereo formats
When dumping the details of a mode, let's add the 3D formats the mode
supports.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'lib/drmtest.c')
-rw-r--r-- | lib/drmtest.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c index 0bc1e869..7f89fd1f 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -1724,10 +1724,42 @@ struct type_name connector_type_names[] = { type_name_fn(connector_type) +#define DRM_MODE_FOR_EACH_3D_FLAG(func, sep) \ + func(DRM_MODE_FLAG_3D_FRAME_PACKING) sep \ + func(DRM_MODE_FLAG_3D_FIELD_ALTERNATIVE) sep \ + func(DRM_MODE_FLAG_3D_LINE_ALTERNATIVE) sep \ + func(DRM_MODE_FLAG_3D_SIDE_BY_SIDE_FULL) sep \ + func(DRM_MODE_FLAG_3D_L_DEPTH) sep \ + func(DRM_MODE_FLAG_3D_L_DEPTH_GFX_GFX_DEPTH) sep \ + func(DRM_MODE_FLAG_3D_TOP_AND_BOTTOM) sep \ + func(DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF) void kmstest_dump_mode(drmModeModeInfo *mode) { - printf(" %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d\n", + bool stereo_3d = mode->flags & DRMTEST_MODE_FLAG_3D_MASK; + char flags_str[32]; + +#define PRINT_S(name) "%s" +#define SEP_EMPTY +#define PRINT_FLAG(flag, str) \ + mode->flags & DRM_MODE_FLAG_3D_ ## flag ? " "str : "" + + snprintf(flags_str, sizeof(flags_str), " (3D:" + DRM_MODE_FOR_EACH_3D_FLAG(PRINT_S, SEP_EMPTY) ")", + PRINT_FLAG(FRAME_PACKING, "FP"), + PRINT_FLAG(FIELD_ALTERNATIVE, "FA"), + PRINT_FLAG(LINE_ALTERNATIVE, "LA"), + PRINT_FLAG(SIDE_BY_SIDE_FULL, "SBSF"), + PRINT_FLAG(L_DEPTH, "LD"), + PRINT_FLAG(L_DEPTH_GFX_GFX_DEPTH, "LDGFX"), + PRINT_FLAG(TOP_AND_BOTTOM, "TB"), + PRINT_FLAG(SIDE_BY_SIDE_HALF, "SBSH")); + +#undef PRINT_S +#undef SEP_EMPTY +#undef PRINT_FLAG + + printf(" %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d%s\n", mode->name, mode->vrefresh, mode->hdisplay, @@ -1740,7 +1772,8 @@ void kmstest_dump_mode(drmModeModeInfo *mode) mode->vtotal, mode->flags, mode->type, - mode->clock); + mode->clock, + stereo_3d ? flags_str : ""); fflush(stdout); } |