All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] drm: Return -EOPNOTSUPP in drm_setclientcap() when driver do not support KMS
@ 2018-09-18 17:48 José Roberto de Souza
  2018-09-18 18:02 ` Ville Syrjälä
  2018-09-18 18:20 ` ✗ Fi.CI.BAT: failure for drm: Return -EOPNOTSUPP in drm_setclientcap() when driver do not support KMS (rev2) Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: José Roberto de Souza @ 2018-09-18 17:48 UTC (permalink / raw)
  To: intel-gfx; +Cc: José Roberto de Souza, dri-devel

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 */
+	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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-21  9:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-18 17:48 [PATCH v3] drm: Return -EOPNOTSUPP in drm_setclientcap() when driver do not support KMS José Roberto de Souza
2018-09-18 18:02 ` Ville Syrjälä
2018-09-21  9:21   ` Daniel Vetter
2018-09-18 18:20 ` ✗ Fi.CI.BAT: failure for drm: Return -EOPNOTSUPP in drm_setclientcap() when driver do not support KMS (rev2) Patchwork

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.