diff mbox series

[v3] drm: Return -EOPNOTSUPP in drm_setclientcap() when driver do not support KMS

Message ID 20180918174809.17123-1-jose.souza@intel.com (mailing list archive)
State New, archived
Headers show
Series [v3] drm: Return -EOPNOTSUPP in drm_setclientcap() when driver do not support KMS | expand

Commit Message

Souza, Jose Sept. 18, 2018, 5:48 p.m. UTC
All DRM_CLIENT capabilities are tied to KMS support, so returning
-EOPNOTSUPP when KMS is not supported.

v2: returning -EOPNOTSUPP(same value as posix ENOTSUP and available
in uapi) instead of -ENOTSUPP

v3: adding comments about the feature requirement about capabilities

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/drm_ioctl.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Ville Syrjälä Sept. 18, 2018, 6:02 p.m. UTC | #1
On Tue, Sep 18, 2018 at 10:48:09AM -0700, José Roberto de Souza wrote:
> All DRM_CLIENT capabilities are tied to KMS support, so returning
> -EOPNOTSUPP when KMS is not supported.
> 
> v2: returning -EOPNOTSUPP(same value as posix ENOTSUP and available
> in uapi) instead of -ENOTSUPP
> 
> v3: adding comments about the feature requirement about capabilities
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/drm_ioctl.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> index 60dfbfae6a02..94bd872d56c4 100644
> --- a/drivers/gpu/drm/drm_ioctl.c
> +++ b/drivers/gpu/drm/drm_ioctl.c
> @@ -306,6 +306,12 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
>  {
>  	struct drm_set_client_cap *req = data;
>  
> +	/* No render-only settable capabilities for now */
> +
> +	/* Below caps that only works with KMS drivers */

That doesn't seem quite English.

> +	if (!drm_core_check_feature(dev, DRIVER_MODESET))
> +		return -EOPNOTSUPP;
> +
>  	switch (req->capability) {
>  	case DRM_CLIENT_CAP_STEREO_3D:
>  		if (req->value > 1)
> -- 
> 2.19.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter Sept. 21, 2018, 9:21 a.m. UTC | #2
On Tue, Sep 18, 2018 at 09:02:04PM +0300, Ville Syrjälä wrote:
> On Tue, Sep 18, 2018 at 10:48:09AM -0700, José Roberto de Souza wrote:
> > All DRM_CLIENT capabilities are tied to KMS support, so returning
> > -EOPNOTSUPP when KMS is not supported.
> > 
> > v2: returning -EOPNOTSUPP(same value as posix ENOTSUP and available
> > in uapi) instead of -ENOTSUPP
> > 
> > v3: adding comments about the feature requirement about capabilities
> > 
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/drm_ioctl.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
> > index 60dfbfae6a02..94bd872d56c4 100644
> > --- a/drivers/gpu/drm/drm_ioctl.c
> > +++ b/drivers/gpu/drm/drm_ioctl.c
> > @@ -306,6 +306,12 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
> >  {
> >  	struct drm_set_client_cap *req = data;
> >  
> > +	/* No render-only settable capabilities for now */
> > +
> > +	/* Below caps that only works with KMS drivers */
> 
> That doesn't seem quite English.

Looks close enough to me, so applied. Ime if you want to polish English,
it's best to just suggest a different wording, but then we don't have a
whole lot of professional English editors around here :-)

Thanks for the patch.
-Daniel

> 
> > +	if (!drm_core_check_feature(dev, DRIVER_MODESET))
> > +		return -EOPNOTSUPP;
> > +
> >  	switch (req->capability) {
> >  	case DRM_CLIENT_CAP_STEREO_3D:
> >  		if (req->value > 1)
> > -- 
> > 2.19.0
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Ville Syrjälä
> Intel
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 60dfbfae6a02..94bd872d56c4 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -306,6 +306,12 @@  drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
 {
 	struct drm_set_client_cap *req = data;
 
+	/* No render-only settable capabilities for now */
+
+	/* Below caps that only works with KMS drivers */
+	if (!drm_core_check_feature(dev, DRIVER_MODESET))
+		return -EOPNOTSUPP;
+
 	switch (req->capability) {
 	case DRM_CLIENT_CAP_STEREO_3D:
 		if (req->value > 1)