Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 02/22] drm: Add a SET_CLIENT_CAP ioctl
Date: Wed, 25 Sep 2013 16:45:20 +0100	[thread overview]
Message-ID: <1380123940-14340-3-git-send-email-damien.lespiau@intel.com> (raw)
In-Reply-To: <1380123940-14340-1-git-send-email-damien.lespiau@intel.com>

This ioctl can be used to turn some knobs in a DRM driver. The client
can ask the DRM core for an alternate view of the reality: it can be
useful to be able to instruct the core that the DRM client can handle
new functionnality that would otherwise break current ABI.

v2: Rename to ioctl from SET_CAP to SET_CLIENT_CAP (Chris Wilson)

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/drm_drv.c   | 1 +
 drivers/gpu/drm/drm_ioctl.c | 9 +++++++++
 include/drm/drmP.h          | 2 ++
 include/uapi/drm/drm.h      | 7 +++++++
 4 files changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index e572dd2..e79d8d9 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -69,6 +69,7 @@ static const struct drm_ioctl_desc drm_ioctls[] = {
 	DRM_IOCTL_DEF(DRM_IOCTL_GET_CLIENT, drm_getclient, DRM_UNLOCKED),
 	DRM_IOCTL_DEF(DRM_IOCTL_GET_STATS, drm_getstats, DRM_UNLOCKED),
 	DRM_IOCTL_DEF(DRM_IOCTL_GET_CAP, drm_getcap, DRM_UNLOCKED|DRM_RENDER_ALLOW),
+	DRM_IOCTL_DEF(DRM_IOCTL_SET_CLIENT_CAP, drm_setclientcap, 0),
 	DRM_IOCTL_DEF(DRM_IOCTL_SET_VERSION, drm_setversion, DRM_MASTER),
 
 	DRM_IOCTL_DEF(DRM_IOCTL_SET_UNIQUE, drm_setunique, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index 07247e2..15da412 100644
--- a/drivers/gpu/drm/drm_ioctl.c
+++ b/drivers/gpu/drm/drm_ioctl.c
@@ -303,6 +303,15 @@ int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
 }
 
 /**
+ * Set device/driver capabilities
+ */
+int
+drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
+{
+	return -EINVAL;
+}
+
+/**
  * Setversion ioctl.
  *
  * \param inode device inode.
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index b46fb45..dbc86b0 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1303,6 +1303,8 @@ extern int drm_getstats(struct drm_device *dev, void *data,
 			struct drm_file *file_priv);
 extern int drm_getcap(struct drm_device *dev, void *data,
 		      struct drm_file *file_priv);
+extern int drm_setclientcap(struct drm_device *dev, void *data,
+			    struct drm_file *file_priv);
 extern int drm_setversion(struct drm_device *dev, void *data,
 			  struct drm_file *file_priv);
 extern int drm_noop(struct drm_device *dev, void *data,
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 1e09e8f..526baed 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -627,6 +627,12 @@ struct drm_get_cap {
 	__u64 value;
 };
 
+/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
+struct drm_set_client_cap {
+	__u64 capability;
+	__u64 value;
+};
+
 #define DRM_CLOEXEC O_CLOEXEC
 struct drm_prime_handle {
 	__u32 handle;
@@ -659,6 +665,7 @@ struct drm_prime_handle {
 #define DRM_IOCTL_GEM_FLINK		DRM_IOWR(0x0a, struct drm_gem_flink)
 #define DRM_IOCTL_GEM_OPEN		DRM_IOWR(0x0b, struct drm_gem_open)
 #define DRM_IOCTL_GET_CAP		DRM_IOWR(0x0c, struct drm_get_cap)
+#define DRM_IOCTL_SET_CLIENT_CAP	DRM_IOW( 0x0d, struct drm_set_client_cap)
 
 #define DRM_IOCTL_SET_UNIQUE		DRM_IOW( 0x10, struct drm_unique)
 #define DRM_IOCTL_AUTH_MAGIC		DRM_IOW( 0x11, struct drm_auth)
-- 
1.8.3.1

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

  parent reply	other threads:[~2013-09-25 15:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-25 15:45 HDMI stereo support v6 Damien Lespiau
2013-09-25 15:45 ` [PATCH 01/22] drm: Move the GET_CAP macros next to the corresponding ioctl structure Damien Lespiau
2013-09-25 15:45 ` Damien Lespiau [this message]
2013-09-25 15:45 ` [PATCH 03/22] drm: Add HDMI stereo 3D flags to struct drm_mode_modeinfo Damien Lespiau
2013-09-25 15:45 ` [PATCH 04/22] drm: Add a STEREO_3D capability to the SET_CLIENT_CAP ioctl Damien Lespiau
2013-09-25 15:45 ` [PATCH 05/22] drm/edid: Expose mandatory stereo modes for HDMI sinks Damien Lespiau
2013-09-25 15:45 ` [PATCH 06/22] drm: Extract add_hdmi_mode() out of do_hdmi_vsdb_modes() Damien Lespiau
2013-09-25 15:45 ` [PATCH 07/22] drm: Reject modes with more than 1 stereo flags set Damien Lespiau
2013-09-25 15:45 ` [PATCH 08/22] drm: Set the relevant infoframe field when scanning out a 3D mode Damien Lespiau
2013-09-25 15:45 ` [PATCH 09/22] drm: Make drm_match_cea_mode() return the underlying 2D VIC for 3d modes Damien Lespiau
2013-09-25 15:45 ` [PATCH 10/22] drm: Carry over the stereo flags when adding the alternate mode Damien Lespiau
2013-09-25 15:45 ` [PATCH 11/22] drm: Make exposing stereo modes a per-connector opt-in Damien Lespiau
2013-09-25 15:45 ` [PATCH 12/22] drm: Factor out common CRTC viewport checking code Damien Lespiau
2013-09-25 15:45 ` [PATCH 13/22] drm: Check the fb size against the adjusted v/hdisplay for stereo modes Damien Lespiau
2013-09-25 15:45 ` [PATCH 14/22] drm: Remove clock_index from struct drm_display_mode Damien Lespiau
2013-09-25 15:45 ` [PATCH 15/22] drm: Remove synth_clock " Damien Lespiau
2013-09-25 15:45 ` [PATCH 16/22] drm: Introduce a crtc_clock for " Damien Lespiau
2013-09-25 15:45 ` [PATCH 17/22] drm: Implement timings adjustments for frame packing Damien Lespiau
2013-09-25 15:45 ` [PATCH 18/22] drm/i915: Use crtc_clock in intel_dump_crtc_timings() Damien Lespiau
2013-09-25 15:45 ` [PATCH 19/22] drm/i915: Use crtc_clock with the adjusted mode Damien Lespiau
2013-09-25 15:45 ` [PATCH 20/22] drm/i915: Ask the DRM core do make stereo timings adjustements Damien Lespiau
2013-09-25 15:45 ` [PATCH 21/22] drm/i915: Prefer crtc_{h|v}display for pipe src dimensions Damien Lespiau
2013-09-25 15:45 ` [PATCH 22/22] drm/i915: Allow stereo modes on HDMI Damien Lespiau
2013-09-25 16:47 ` Upstreaming the stereo v6 series Damien Lespiau
2013-09-26  9:40   ` Daniel Vetter

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=1380123940-14340-3-git-send-email-damien.lespiau@intel.com \
    --to=damien.lespiau@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