Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Albert Esteve <aesteve@redhat.com>
To: igt-dev@lists.freedesktop.org
Cc: belmouss@redhat.com, Albert Esteve <aesteve@redhat.com>,
	javierm@redhat.com
Subject: [igt-dev] [PATCH 1/3] drm header update: temp commit
Date: Fri, 21 Jul 2023 15:04:56 +0200	[thread overview]
Message-ID: <20230721130458.64856-2-aesteve@redhat.com> (raw)
In-Reply-To: <20230721130458.64856-1-aesteve@redhat.com>

Update the drm included header to obtain
VIRTUAL_CURSOR_PLANE capability and be
able to test cursor hotspot setting.

This commit should be removed once the kernel
patch is applied and update the headers
as appropiate.

Signed-off-by: Albert Esteve <aesteve@redhat.com>
---
 include/drm-uapi/drm.h | 54 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)

diff --git a/include/drm-uapi/drm.h b/include/drm-uapi/drm.h
index 5e54c3aa4..57b261a45 100644
--- a/include/drm-uapi/drm.h
+++ b/include/drm-uapi/drm.h
@@ -35,7 +35,13 @@
 #ifndef _DRM_H_
 #define _DRM_H_
 
-#if   defined(__linux__)
+#if defined(__KERNEL__)
+
+#include <linux/types.h>
+#include <asm/ioctl.h>
+typedef unsigned int drm_handle_t;
+
+#elif defined(__linux__)
 
 #include <linux/types.h>
 #include <asm/ioctl.h>
@@ -830,6 +836,32 @@ struct drm_get_cap {
  */
 #define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS	5
 
+/**
+ * DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT
+ *
+ * Drivers for para-virtualized hardware (e.g. vmwgfx, qxl, virtio and
+ * virtualbox) have additional restrictions for cursor planes (thus
+ * making cursor planes on those drivers not truly universal,) e.g.
+ * they need cursor planes to act like one would expect from a mouse
+ * cursor and have correctly set hotspot properties.
+ * If this client cap is not set the DRM core will hide cursor plane on
+ * those virtualized drivers because not setting it implies that the
+ * client is not capable of dealing with those extra restictions.
+ * Clients which do set cursor hotspot and treat the cursor plane
+ * like a mouse cursor should set this property.
+ * The client must enable &DRM_CLIENT_CAP_ATOMIC first.
+ *
+ * Setting this property on drivers which do not special case
+ * cursor planes (i.e. non-virtualized drivers) will return
+ * EOPNOTSUPP, which can be used by userspace to gauge
+ * requirements of the hardware/drivers they're running on.
+ *
+ * This capability is always supported for atomic-capable virtualized
+ * drivers starting from kernel version 6.6.
+ */
+#define DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT	6
+
+
 /* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
 struct drm_set_client_cap {
 	__u64 capability;
@@ -1090,6 +1122,24 @@ extern "C" {
 #define DRM_IOCTL_SYNCOBJ_TRANSFER	DRM_IOWR(0xCC, struct drm_syncobj_transfer)
 #define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL	DRM_IOWR(0xCD, struct drm_syncobj_timeline_array)
 
+/**
+ * DRM_IOCTL_MODE_GETFB2 - Get framebuffer metadata.
+ *
+ * This queries metadata about a framebuffer. User-space fills
+ * &drm_mode_fb_cmd2.fb_id as the input, and the kernels fills the rest of the
+ * struct as the output.
+ *
+ * If the client is DRM master or has &CAP_SYS_ADMIN, &drm_mode_fb_cmd2.handles
+ * will be filled with GEM buffer handles. Planes are valid until one has a
+ * zero handle -- this can be used to compute the number of planes.
+ *
+ * Otherwise, &drm_mode_fb_cmd2.handles will be zeroed and planes are valid
+ * until one has a zero &drm_mode_fb_cmd2.pitches.
+ *
+ * If the framebuffer has a format modifier, &DRM_MODE_FB_MODIFIERS will be set
+ * in &drm_mode_fb_cmd2.flags and &drm_mode_fb_cmd2.modifier will contain the
+ * modifier. Otherwise, user-space must ignore &drm_mode_fb_cmd2.modifier.
+ */
 #define DRM_IOCTL_MODE_GETFB2		DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
 
 /*
@@ -1144,6 +1194,7 @@ struct drm_event_crtc_sequence {
 };
 
 /* typedef area */
+#ifndef __KERNEL__
 typedef struct drm_clip_rect drm_clip_rect_t;
 typedef struct drm_drawable_info drm_drawable_info_t;
 typedef struct drm_tex_region drm_tex_region_t;
@@ -1185,6 +1236,7 @@ typedef struct drm_agp_binding drm_agp_binding_t;
 typedef struct drm_agp_info drm_agp_info_t;
 typedef struct drm_scatter_gather drm_scatter_gather_t;
 typedef struct drm_set_version drm_set_version_t;
+#endif
 
 #if defined(__cplusplus)
 }
-- 
2.40.0

  reply	other threads:[~2023-07-21 13:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21 13:04 [igt-dev] [PATCH 0/3] Add atomic DRM cursor hotspot test Albert Esteve
2023-07-21 13:04 ` Albert Esteve [this message]
2023-07-28  7:41   ` [igt-dev] [PATCH 1/3] drm header update: temp commit Zbigniew Kempczyński
2023-07-28  7:57     ` Albert Esteve
2023-07-28  8:31       ` Zbigniew Kempczyński
2023-07-21 13:04 ` [igt-dev] [PATCH 2/3] igt_kms: add hotspot plane property Albert Esteve
2023-07-25 13:40   ` Javier Martinez Canillas
2023-07-26 14:42     ` Albert Esteve
2023-07-21 13:04 ` [igt-dev] [PATCH 3/3] kms_cursor_legacy: modeset-atomic-cursor-hotspot Albert Esteve
2023-07-25 14:26   ` Javier Martinez Canillas
2023-07-26 14:50     ` Albert Esteve
2023-07-26 14:53       ` Javier Martinez Canillas
2023-07-24 12:22 ` [igt-dev] ✓ Fi.CI.BAT: success for Add atomic DRM cursor hotspot test Patchwork
2023-07-24 17:02 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-07-25 15:51 ` [igt-dev] [PATCH 0/3] " Kamil Konieczny
2023-07-26 14:52   ` Albert Esteve

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=20230721130458.64856-2-aesteve@redhat.com \
    --to=aesteve@redhat.com \
    --cc=belmouss@redhat.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    /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