From: Mika Kahola <mika.kahola@intel.com>
To: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>,
igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/2] lib/igt_kms.c: modify kmstest_dump_mode to print aspect ratio of a mode
Date: Mon, 12 Feb 2018 16:34:17 +0200 [thread overview]
Message-ID: <1518446057.7484.5.camel@intel.com> (raw)
In-Reply-To: <1516798260-11685-2-git-send-email-ankit.k.nautiyal@intel.com>
On Wed, 2018-01-24 at 18:20 +0530, Nautiyal, Ankit K wrote:
> From: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>
> This patch adds the support to print the aspect ratio of the modes
> (if provided) along with other mode information.
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
> lib/igt_kms.c | 31 +++++++++++++++++++++++++++++--
> 1 file changed, 29 insertions(+), 2 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index eb57f4a..585f94d 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -56,6 +56,14 @@
> #include "igt_sysfs.h"
> #include "sw_sync.h"
>
> +#ifndef DRM_MODE_FLAG_PIC_AR_64_27
> +#define DRM_MODE_FLAG_PIC_AR_64_27 (3<<19)
> +#endif
> +
> +#ifndef DRM_MODE_FLAG_PIC_AR_256_135
> +#define DRM_MODE_FLAG_PIC_AR_256_135 (4<<19)
> +#endif
> +
Shouldn't these be defined in /include/uapi/drm/drm_mode.h? Although, I
wasn't able to find these definitions from that file. Do we have a
patch under review in drm to fill this gap?
Otherwise, the patch looks good.
Acked-by: Mika Kahola <mika.kahola@intel.com>
> /**
> * SECTION:igt_kms
> * @short_description: Kernel modesetting support library
> @@ -491,6 +499,22 @@ static const char *mode_stereo_name(const
> drmModeModeInfo *mode)
> }
> }
>
> +static const char *mode_aspect_name(const drmModeModeInfo *mode)
> +{
> + switch (mode->flags & DRM_MODE_FLAG_PIC_AR_MASK) {
> + case DRM_MODE_FLAG_PIC_AR_4_3:
> + return "4:3";
> + case DRM_MODE_FLAG_PIC_AR_16_9:
> + return "16:9";
> + case DRM_MODE_FLAG_PIC_AR_64_27:
> + return "64:27";
> + case DRM_MODE_FLAG_PIC_AR_256_135:
> + return "256:135";
> + default:
> + return NULL;
> + }
> +}
> +
> /**
> * kmstest_dump_mode:
> * @mode: libdrm mode structure
> @@ -500,8 +524,9 @@ static const char *mode_stereo_name(const
> drmModeModeInfo *mode)
> void kmstest_dump_mode(drmModeModeInfo *mode)
> {
> const char *stereo = mode_stereo_name(mode);
> + const char *aspect_ratio = mode_aspect_name(mode);
>
> - igt_info(" %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x
> %d%s%s%s\n",
> + igt_info(" %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d%s%s%s
> %s%s%s\n",
> mode->name, mode->vrefresh,
> mode->hdisplay, mode->hsync_start,
> mode->hsync_end, mode->htotal,
> @@ -509,7 +534,9 @@ void kmstest_dump_mode(drmModeModeInfo *mode)
> mode->vsync_end, mode->vtotal,
> mode->flags, mode->type, mode->clock,
> stereo ? " (3D:" : "",
> - stereo ? stereo : "", stereo ? ")" : "");
> + stereo ? stereo : "", stereo ? ")" : "",
> + aspect_ratio ? " (Pixel Aspect Ratio:" : "",
> + aspect_ratio ? aspect_ratio : "", aspect_ratio ?
> ")" : "");
> }
>
> /**
--
Mika Kahola - Intel OTC
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
WARNING: multiple messages have this Message-ID (diff)
From: Mika Kahola <mika.kahola@intel.com>
To: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>,
igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 1/2] lib/igt_kms.c: modify kmstest_dump_mode to print aspect ratio of a mode
Date: Mon, 12 Feb 2018 16:34:17 +0200 [thread overview]
Message-ID: <1518446057.7484.5.camel@intel.com> (raw)
In-Reply-To: <1516798260-11685-2-git-send-email-ankit.k.nautiyal@intel.com>
On Wed, 2018-01-24 at 18:20 +0530, Nautiyal, Ankit K wrote:
> From: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>
> This patch adds the support to print the aspect ratio of the modes
> (if provided) along with other mode information.
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
> lib/igt_kms.c | 31 +++++++++++++++++++++++++++++--
> 1 file changed, 29 insertions(+), 2 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index eb57f4a..585f94d 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -56,6 +56,14 @@
> #include "igt_sysfs.h"
> #include "sw_sync.h"
>
> +#ifndef DRM_MODE_FLAG_PIC_AR_64_27
> +#define DRM_MODE_FLAG_PIC_AR_64_27 (3<<19)
> +#endif
> +
> +#ifndef DRM_MODE_FLAG_PIC_AR_256_135
> +#define DRM_MODE_FLAG_PIC_AR_256_135 (4<<19)
> +#endif
> +
Shouldn't these be defined in /include/uapi/drm/drm_mode.h? Although, I
wasn't able to find these definitions from that file. Do we have a
patch under review in drm to fill this gap?
Otherwise, the patch looks good.
Acked-by: Mika Kahola <mika.kahola@intel.com>
> /**
> * SECTION:igt_kms
> * @short_description: Kernel modesetting support library
> @@ -491,6 +499,22 @@ static const char *mode_stereo_name(const
> drmModeModeInfo *mode)
> }
> }
>
> +static const char *mode_aspect_name(const drmModeModeInfo *mode)
> +{
> + switch (mode->flags & DRM_MODE_FLAG_PIC_AR_MASK) {
> + case DRM_MODE_FLAG_PIC_AR_4_3:
> + return "4:3";
> + case DRM_MODE_FLAG_PIC_AR_16_9:
> + return "16:9";
> + case DRM_MODE_FLAG_PIC_AR_64_27:
> + return "64:27";
> + case DRM_MODE_FLAG_PIC_AR_256_135:
> + return "256:135";
> + default:
> + return NULL;
> + }
> +}
> +
> /**
> * kmstest_dump_mode:
> * @mode: libdrm mode structure
> @@ -500,8 +524,9 @@ static const char *mode_stereo_name(const
> drmModeModeInfo *mode)
> void kmstest_dump_mode(drmModeModeInfo *mode)
> {
> const char *stereo = mode_stereo_name(mode);
> + const char *aspect_ratio = mode_aspect_name(mode);
>
> - igt_info(" %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x
> %d%s%s%s\n",
> + igt_info(" %s %d %d %d %d %d %d %d %d %d 0x%x 0x%x %d%s%s%s
> %s%s%s\n",
> mode->name, mode->vrefresh,
> mode->hdisplay, mode->hsync_start,
> mode->hsync_end, mode->htotal,
> @@ -509,7 +534,9 @@ void kmstest_dump_mode(drmModeModeInfo *mode)
> mode->vsync_end, mode->vtotal,
> mode->flags, mode->type, mode->clock,
> stereo ? " (3D:" : "",
> - stereo ? stereo : "", stereo ? ")" : "");
> + stereo ? stereo : "", stereo ? ")" : "",
> + aspect_ratio ? " (Pixel Aspect Ratio:" : "",
> + aspect_ratio ? aspect_ratio : "", aspect_ratio ?
> ")" : "");
> }
>
> /**
--
Mika Kahola - Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-02-12 14:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 12:50 [igt-dev] [PATCH i-g-t 0/2] Test modes with aspect ratios Nautiyal, Ankit K
2018-01-24 12:50 ` Nautiyal, Ankit K
2018-01-24 12:50 ` [Intel-gfx] [igt-dev] [PATCH i-g-t 1/2] lib/igt_kms.c: modify kmstest_dump_mode to print aspect ratio of a mode Nautiyal, Ankit K
2018-01-24 12:50 ` Nautiyal, Ankit K
2018-02-12 14:34 ` Mika Kahola [this message]
2018-02-12 14:34 ` Mika Kahola
2018-02-13 11:09 ` Nautiyal, Ankit K
2018-02-13 11:09 ` Nautiyal, Ankit K
2018-01-24 12:51 ` [Intel-gfx] [igt-dev] [PATCH i-g-t 2/2] tests/testdisplay.c: add support to test modes with aspect ratio Nautiyal, Ankit K
2018-01-24 12:51 ` Nautiyal, Ankit K
2018-01-24 13:13 ` [igt-dev] ✓ Fi.CI.BAT: success for Test modes with aspect ratios Patchwork
2018-01-24 17:28 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
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=1518446057.7484.5.camel@intel.com \
--to=mika.kahola@intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.