diff mbox

[1/2] lib: Dump information about the supported 3D stereo formats

Message ID 1348771328-3655-1-git-send-email-damien.lespiau@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Damien Lespiau Sept. 27, 2012, 6:42 p.m. UTC
From: Damien Lespiau <damien.lespiau@intel.com>

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>
---
 lib/drmtest.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Comments

Rodrigo Vivi Sept. 29, 2012, 12:45 a.m. UTC | #1
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Tested-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>

On Thu, Sep 27, 2012 at 3:42 PM, Damien Lespiau
<damien.lespiau@gmail.com> wrote:
> From: Damien Lespiau <damien.lespiau@intel.com>
>
> 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>
> ---
>  lib/drmtest.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index 8df9797..4d5a67c 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -812,7 +812,15 @@ unsigned int kmstest_create_fb(int fd, int width, int height, int bpp,
>
>  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 & DRM_MODE_FLAG_3D_MASK;
> +       char flags_str[32];
> +
> +       snprintf(flags_str, sizeof(flags_str), " (3D:%s%s%s)",
> +                mode->flags & DRM_MODE_FLAG_3D_TOP_BOTTOM ? " TB": "",
> +                mode->flags & DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF ? " SBSH": "",
> +                mode->flags & DRM_MODE_FLAG_3D_FRAME_PACKING ? " FP": "");
> +
> +       printf("  %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d%s\n",
>                mode->name,
>                mode->vrefresh,
>                mode->hdisplay,
> @@ -825,7 +833,8 @@ void kmstest_dump_mode(drmModeModeInfo *mode)
>                mode->vtotal,
>                mode->flags,
>                mode->type,
> -              mode->clock);
> +              mode->clock,
> +              stereo_3d ? flags_str : "");
>         fflush(stdout);
>  }
>
> --
> 1.7.11.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 8df9797..4d5a67c 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -812,7 +812,15 @@  unsigned int kmstest_create_fb(int fd, int width, int height, int bpp,
 
 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 & DRM_MODE_FLAG_3D_MASK;
+	char flags_str[32];
+
+	snprintf(flags_str, sizeof(flags_str), " (3D:%s%s%s)",
+		 mode->flags & DRM_MODE_FLAG_3D_TOP_BOTTOM ? " TB": "",
+		 mode->flags & DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF ? " SBSH": "",
+		 mode->flags & DRM_MODE_FLAG_3D_FRAME_PACKING ? " FP": "");
+
+	printf("  %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d%s\n",
 	       mode->name,
 	       mode->vrefresh,
 	       mode->hdisplay,
@@ -825,7 +833,8 @@  void kmstest_dump_mode(drmModeModeInfo *mode)
 	       mode->vtotal,
 	       mode->flags,
 	       mode->type,
-	       mode->clock);
+	       mode->clock,
+	       stereo_3d ? flags_str : "");
 	fflush(stdout);
 }