Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH v11 06/11] drm: Add DRM client cap for aspect-ratio
Date: Thu, 26 Apr 2018 17:23:17 +0300	[thread overview]
Message-ID: <20180426142317.GO23723@intel.com> (raw)
In-Reply-To: <20180423101125.GE13908@intel.com>

On Mon, Apr 23, 2018 at 01:11:25PM +0300, Ville Syrjälä wrote:
> On Mon, Apr 23, 2018 at 10:43:47AM +0530, Nautiyal, Ankit K wrote:
> > 
> > 
> > On 4/20/2018 7:37 PM, Ville Syrjälä wrote:
> > > On Fri, Apr 20, 2018 at 07:01:46PM +0530, Nautiyal, Ankit K wrote:
> > >> From: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> > >>
> > >> To enable aspect-ratio support in DRM, blindly exposing the aspect
> > >> ratio information along with mode, can break things in existing
> > >> user-spaces which have no intention or support to use this aspect
> > >> ratio information.
> > >>
> > >> To avoid this, a new drm client cap is required to enable a
> > >> user-space to advertise if it supports modes with aspect-ratio. Based
> > >> on this cap value, the kernel will take a call on exposing the aspect
> > >> ratio info in modes or not.
> > >>
> > >> This patch adds the client cap for aspect-ratio.
> > >>
> > >> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> > >> Cc: Shashank Sharma <shashank.sharma@intel.com>
> > >> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> > >>
> > >> V3: rebase
> > >> V4: As suggested by Marteen Lankhorst modified the commit message
> > >>      explaining the need to use the DRM cap for aspect-ratio. Also,
> > >>      tweaked the comment lines in the code for better understanding and
> > >>      clarity, as recommended by Shashank Sharma.
> > >> V5: rebase
> > >> V6: rebase
> > >> V7: rebase
> > >> V8: rebase
> > >> V9: rebase
> > >> V10: added comment explaining that no userspace breaks on aspect-ratio
> > >>       mode bits.
> > >>
> > >> Reviewed-by: Shashank Sharma <shashank.sharma@intel.com>
> > >> ---
> > >>   drivers/gpu/drm/drm_ioctl.c | 9 +++++++++
> > >>   include/drm/drm_file.h      | 8 ++++++++
> > >>   include/uapi/drm/drm.h      | 7 +++++++
> > >>   3 files changed, 24 insertions(+)
> > >>
> > >> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> > >> index af78291..39c8eab 100644
> > >> --- a/drivers/gpu/drm/drm_ioctl.c
> > >> +++ b/drivers/gpu/drm/drm_ioctl.c
> > >> @@ -325,6 +325,15 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
> > >>   		file_priv->atomic = req->value;
> > >>   		file_priv->universal_planes = req->value;
> > >>   		break;
> > >> +	case DRM_CLIENT_CAP_ASPECT_RATIO:
> > >> +		if (req->value > 1)
> > >> +			return -EINVAL;
> > >> +	/*
> > >> +	 * No Atomic userspace blows up on aspect ratio mode bits. Checked in
> > >> +	 * wayland/weston, xserver, and hardware-composer modeset paths.
> > >> +	 */
> > > Bogus indentation.
> > 
> > Thanks to point that out, will fix this.
> > 
> > > Also where's the aspect_ratio_allowed handling for the atomic cap?
> > > Or did we decide against it after all?
> > 
> > As discussed, aspect ratio is handled in the atomic modeset path, where 
> > in the modeset requests with aspect-ratios
> > are rejected, if the aspect-ratio cap not set.
> 
> That is not what we discussed on irc. What Daniel was suggesting is
> always enabling the aspect ratio cap for atomic clients, just as we
> already enable the univerals planes cap for atomic clients.

And to make sure we're on the same page finally

@@ -320,14 +320,15 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
        case DRM_CLIENT_CAP_ATOMIC:
                if (!drm_core_check_feature(dev, DRIVER_ATOMIC))
                        return -EINVAL;
                if (req->value > 1)
                        return -EINVAL;
                file_priv->atomic = req->value;
                file_priv->universal_planes = req->value;
+               file_priv->aspect_ratio_allowed = req->value;
                break;
        default:
                return -EINVAL;
        }
 
        return 0;
 }

is what we're talking about here.

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-04-26 14:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 13:31 [PATCH v11 00/11] Aspect ratio support in DRM layer Nautiyal, Ankit K
2018-04-20 13:31 ` [PATCH v11 01/11] drm/modes: Introduce drm_mode_match() Nautiyal, Ankit K
2018-04-20 13:31 ` [PATCH v11 02/11] drm/edid: Use drm_mode_match_no_clocks_no_stereo() for consistentcy Nautiyal, Ankit K
2018-04-20 13:31 ` [PATCH v11 03/11] drm/edid: Fix cea mode aspect ratio handling Nautiyal, Ankit K
2018-04-20 13:31 ` [PATCH v11 04/11] drm/edid: Don't send bogus aspect ratios in AVI infoframes Nautiyal, Ankit K
2018-04-20 13:31 ` [PATCH v11 05/11] video/hdmi: Reject illegal picture aspect ratios Nautiyal, Ankit K
2018-04-20 13:31 ` [PATCH v11 06/11] drm: Add DRM client cap for aspect-ratio Nautiyal, Ankit K
2018-04-20 14:07   ` Ville Syrjälä
2018-04-23  5:13     ` Nautiyal, Ankit K
2018-04-23 10:11       ` Ville Syrjälä
2018-04-26 14:23         ` Ville Syrjälä [this message]
2018-04-20 13:31 ` [PATCH v11 07/11] drm: Add helper functions to handle aspect-ratio flag bits Nautiyal, Ankit K
2018-04-20 14:12   ` Ville Syrjälä
2018-04-23  5:25     ` Nautiyal, Ankit K
2018-04-23 10:13       ` Ville Syrjälä
2018-04-24  4:10         ` Nautiyal, Ankit K
2018-04-23 10:22       ` Jani Nikula
2018-04-24  4:01         ` Nautiyal, Ankit K
2018-04-20 13:31 ` [PATCH v11 08/11] drm: Handle aspect ratio info in legacy and atomic modeset paths Nautiyal, Ankit K
2018-04-20 13:31 ` [PATCH v11 09/11] drm: Expose modes with aspect ratio, only if requested Nautiyal, Ankit K
2018-04-20 14:22   ` Ville Syrjälä
2018-04-23  5:49     ` Nautiyal, Ankit K
2018-04-23 10:16       ` Ville Syrjälä
2018-04-20 13:31 ` [PATCH v11 10/11] drm: Add aspect ratio parsing in DRM layer Nautiyal, Ankit K
2018-04-20 13:31 ` [PATCH v11 11/11] drm: Add and handle new aspect ratios " Nautiyal, Ankit K
2018-04-20 16:34 ` ✗ Fi.CI.CHECKPATCH: warning for Aspect ratio support " Patchwork
2018-04-20 16:58 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-20 18:03 ` ✗ 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=20180426142317.GO23723@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --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