From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
Cc: daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v10 10/11] drm: Add aspect ratio parsing in DRM layer
Date: Fri, 6 Apr 2018 20:44:08 +0300 [thread overview]
Message-ID: <20180406174408.GA16976@intel.com> (raw)
In-Reply-To: <73defe1e-9bb6-dd9b-577f-a4fb382cf1e4@intel.com>
On Fri, Apr 06, 2018 at 10:55:14PM +0530, Nautiyal, Ankit K wrote:
> This patch is causing failure of IGT test kms_3d. The kms_3d test
> expects the no. of 3d modes to be 13.
>
> (The test has hard-coded value for expected no. of 3d modes as 13)
>
> But due to the addition of "matching aspect_ratio" in drm_mode_equal in
> this patch, the total no. of
>
> modes in the connector modelist is increased by 2, resulting in failure
> of assertion 'mode_count==13'.
If kms_3d isn't setting the aspect ratio cap how is it affected by these
changes?
>
> Perhaps this need to be handled in the test.
>
> -Regards,
>
> Ankit
>
>
> On 4/6/2018 10:34 PM, Nautiyal, Ankit K wrote:
> > From: "Sharma, Shashank" <shashank.sharma@intel.com>
> >
> > Current DRM layer functions don't parse aspect ratio information
> > while converting a user mode->kernel mode or vice versa. This
> > causes modeset to pick mode with wrong aspect ratio, eventually
> > causing failures in HDMI compliance test cases, due to wrong VIC.
> >
> > This patch adds aspect ratio information in DRM's mode conversion
> > and mode comparision functions, to make sure kernel picks mode
> > with right aspect ratio (as per the VIC).
> >
> > Background:
> > This patch was once reviewed and merged, and later reverted due to
> > lack of DRM cap protection. This is a re-spin of this patch, this
> > time with DRM cap protection, to avoid aspect ratio information, when
> > the client doesn't request for it.
> >
> > Review link: https://pw-emeril.freedesktop.org/patch/104068/
> > Background discussion: https://patchwork.kernel.org/patch/9379057/
> >
> > Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> > Signed-off-by: Lin, Jia <lin.a.jia@intel.com>
> > Signed-off-by: Akashdeep Sharma <akashdeep.sharma@intel.com>
> > Reviewed-by: Jim Bride <jim.bride@linux.intel.com> (V2)
> > Reviewed-by: Jose Abreu <Jose.Abreu@synopsys.com> (V4)
> >
> > Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> > Cc: Jim Bride <jim.bride@linux.intel.com>
> > Cc: Jose Abreu <Jose.Abreu@synopsys.com>
> > Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> >
> > V3: modified the aspect-ratio check in drm_mode_equal as per new flags
> > provided by Ville. https://patchwork.freedesktop.org/patch/188043/
> > V4: rebase
> > V5: rebase
> > V6: As recommended by Ville, avoided matching of aspect-ratio in
> > drm_fb_helper, while trying to find a common mode among connectors
> > for the target clone mode.
> > V7: rebase
> > V8: rebase
> > V9: rebase
> > V10: rebase
> > ---
> > drivers/gpu/drm/drm_fb_helper.c | 12 ++++++++++--
> > drivers/gpu/drm/drm_modes.c | 35 ++++++++++++++++++++++++++++++++++-
> > 2 files changed, 44 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> > index 0646b10..2ee1eaa 100644
> > --- a/drivers/gpu/drm/drm_fb_helper.c
> > +++ b/drivers/gpu/drm/drm_fb_helper.c
> > @@ -2183,7 +2183,11 @@ static bool drm_target_cloned(struct drm_fb_helper *fb_helper,
> > for (j = 0; j < i; j++) {
> > if (!enabled[j])
> > continue;
> > - if (!drm_mode_equal(modes[j], modes[i]))
> > + if (!drm_mode_match(modes[j], modes[i],
> > + DRM_MODE_MATCH_TIMINGS |
> > + DRM_MODE_MATCH_CLOCK |
> > + DRM_MODE_MATCH_FLAGS |
> > + DRM_MODE_MATCH_3D_FLAGS))
> > can_clone = false;
> > }
> > }
> > @@ -2203,7 +2207,11 @@ static bool drm_target_cloned(struct drm_fb_helper *fb_helper,
> >
> > fb_helper_conn = fb_helper->connector_info[i];
> > list_for_each_entry(mode, &fb_helper_conn->connector->modes, head) {
> > - if (drm_mode_equal(mode, dmt_mode))
> > + if (drm_mode_match(mode, dmt_mode,
> > + DRM_MODE_MATCH_TIMINGS |
> > + DRM_MODE_MATCH_CLOCK |
> > + DRM_MODE_MATCH_FLAGS |
> > + DRM_MODE_MATCH_3D_FLAGS))
> > modes[i] = mode;
> > }
> > if (!modes[i])
> > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> > index d6133e8..454f2ff 100644
> > --- a/drivers/gpu/drm/drm_modes.c
> > +++ b/drivers/gpu/drm/drm_modes.c
> > @@ -1049,7 +1049,8 @@ bool drm_mode_equal(const struct drm_display_mode *mode1,
> > DRM_MODE_MATCH_TIMINGS |
> > DRM_MODE_MATCH_CLOCK |
> > DRM_MODE_MATCH_FLAGS |
> > - DRM_MODE_MATCH_3D_FLAGS);
> > + DRM_MODE_MATCH_3D_FLAGS|
> > + DRM_MODE_MATCH_ASPECT_RATIO);
> > }
> > EXPORT_SYMBOL(drm_mode_equal);
> >
> > @@ -1647,6 +1648,20 @@ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out,
> > out->vrefresh = in->vrefresh;
> > out->flags = in->flags;
> > out->type = in->type;
> > +
> > + switch (in->picture_aspect_ratio) {
> > + case HDMI_PICTURE_ASPECT_4_3:
> > + out->flags |= DRM_MODE_FLAG_PIC_AR_4_3;
> > + break;
> > + case HDMI_PICTURE_ASPECT_16_9:
> > + out->flags |= DRM_MODE_FLAG_PIC_AR_16_9;
> > + break;
> > + case HDMI_PICTURE_ASPECT_RESERVED:
> > + default:
> > + out->flags |= DRM_MODE_FLAG_PIC_AR_NONE;
> > + break;
> > + }
> > +
> > strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
> > out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
> > }
> > @@ -1693,6 +1708,24 @@ int drm_mode_convert_umode(struct drm_device *dev,
> > strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN);
> > out->name[DRM_DISPLAY_MODE_LEN-1] = 0;
> >
> > + /* Clearing picture aspect ratio bits from out flags,
> > + * as the aspect-ratio information is not stored in
> > + * flags for kernel-mode, but in picture_aspect_ratio.
> > + */
> > + out->flags &= ~DRM_MODE_FLAG_PIC_AR_MASK;
> > +
> > + switch (in->flags & DRM_MODE_FLAG_PIC_AR_MASK) {
> > + case DRM_MODE_FLAG_PIC_AR_4_3:
> > + out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_4_3;
> > + break;
> > + case DRM_MODE_FLAG_PIC_AR_16_9:
> > + out->picture_aspect_ratio |= HDMI_PICTURE_ASPECT_16_9;
> > + break;
> > + default:
> > + out->picture_aspect_ratio = HDMI_PICTURE_ASPECT_NONE;
> > + break;
> > + }
> > +
> > out->status = drm_mode_validate_driver(dev, out);
> > if (out->status != MODE_OK)
> > return -EINVAL;
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-04-06 17:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-06 17:04 [PATCH v10 00/11] Aspect ratio support in DRM layer Nautiyal, Ankit K
2018-04-06 17:04 ` [PATCH v10 01/11] drm/modes: Introduce drm_mode_match() Nautiyal, Ankit K
2018-04-06 17:04 ` [PATCH v10 02/11] drm/edid: Use drm_mode_match_no_clocks_no_stereo() for consistentcy Nautiyal, Ankit K
2018-04-06 17:04 ` [PATCH v10 03/11] drm/edid: Fix cea mode aspect ratio handling Nautiyal, Ankit K
2018-04-06 17:04 ` [PATCH v10 04/11] drm/edid: Don't send bogus aspect ratios in AVI infoframes Nautiyal, Ankit K
2018-04-06 17:04 ` [PATCH v10 05/11] video/hdmi: Reject illegal picture aspect ratios Nautiyal, Ankit K
2018-04-06 17:04 ` [PATCH v10 06/11] drm: Add DRM client cap for aspect-ratio Nautiyal, Ankit K
2018-04-06 17:04 ` [PATCH v10 07/11] drm: Add helper functions to handle aspect-ratio flag bits Nautiyal, Ankit K
2018-04-06 17:04 ` [PATCH v10 08/11] drm: Handle aspect ratio info in legacy and atomic modeset paths Nautiyal, Ankit K
2018-04-06 17:04 ` [PATCH v10 09/11] drm: Expose modes with aspect ratio, only if requested Nautiyal, Ankit K
2018-04-06 17:04 ` [PATCH v10 10/11] drm: Add aspect ratio parsing in DRM layer Nautiyal, Ankit K
2018-04-06 17:25 ` Nautiyal, Ankit K
2018-04-06 17:44 ` Ville Syrjälä [this message]
2018-04-17 5:15 ` Nautiyal, Ankit K
2018-04-17 7:33 ` [Intel-gfx] " Daniel Vetter
2018-04-17 17:47 ` Ville Syrjälä
2018-04-18 16:02 ` Nautiyal, Ankit K
2018-04-06 17:04 ` [PATCH v10 11/11] drm: Add and handle new aspect ratios " Nautiyal, Ankit K
2018-04-06 17:23 ` ✗ Fi.CI.CHECKPATCH: warning for Aspect ratio support in DRM layer (rev2) Patchwork
2018-04-06 17:41 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-06 21:18 ` ✗ 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=20180406174408.GA16976@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).