<div dir="ltr"><div dir="ltr"><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 28, 2023 at 9:42 AM Zbigniew Kempczyński <<a href="mailto:zbigniew.kempczynski@intel.com">zbigniew.kempczynski@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Jul 21, 2023 at 03:04:56PM +0200, Albert Esteve wrote:<br>
> Update the drm included header to obtain<br>
> VIRTUAL_CURSOR_PLANE capability and be<br>
> able to test cursor hotspot setting.<br>
> <br>
> This commit should be removed once the kernel<br>
> patch is applied and update the headers<br>
> as appropiate.<br>
> <br>
> Signed-off-by: Albert Esteve <<a href="mailto:aesteve@redhat.com" target="_blank">aesteve@redhat.com</a>><br>
> ---<br>
> include/drm-uapi/drm.h | 54 +++++++++++++++++++++++++++++++++++++++++-<br>
> 1 file changed, 53 insertions(+), 1 deletion(-)<br>
> <br>
<br>
I'm sorry Albert but we don't allow to add not accepted changes<br>
upstream regarding uapi headers. Only verbatim copy of uapi<br>
headers may land in igt.<br>
<br>
In patch [PATCH 2/3] igt_kms: add hotspot plane property you're<br>
unconditionally using definition which doesn't exists upstream<br>
yet. Likely it will just return from ioctl but I got doubts it<br>
should be written this way.<br>
<br>
I would suggest to introduce:<br>
<br>
#define LOCAL_DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT▸ 6<br>
<br>
in igt_kms.h instead drm.h. And when drm.h will land in igt<br>
remove this localized definition replacing with official one.<br></blockquote><div><br></div><div>Hi Zbigniew,</div><div><br></div><div>Sure, that is why I mention in the commit that it should be removed</div><div>once the kernel patch lands.</div><div><br></div><div>There is a dependency, and I was not expecting this patch to be</div><div>upstreamed before the kernel patch lands.</div><div><br></div><div>But I'm ok with your suggestion. It will result in a cleaner patch to review :)</div><div><br></div><div>Thanks!</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
--<br>
Zbigniew<br>
<br>
> diff --git a/include/drm-uapi/drm.h b/include/drm-uapi/drm.h<br>
> index 5e54c3aa4..57b261a45 100644<br>
> --- a/include/drm-uapi/drm.h<br>
> +++ b/include/drm-uapi/drm.h<br>
> @@ -35,7 +35,13 @@<br>
> #ifndef _DRM_H_<br>
> #define _DRM_H_<br>
> <br>
> -#if defined(__linux__)<br>
> +#if defined(__KERNEL__)<br>
> +<br>
> +#include <linux/types.h><br>
> +#include <asm/ioctl.h><br>
> +typedef unsigned int drm_handle_t;<br>
> +<br>
> +#elif defined(__linux__)<br>
> <br>
> #include <linux/types.h><br>
> #include <asm/ioctl.h><br>
> @@ -830,6 +836,32 @@ struct drm_get_cap {<br>
> */<br>
> #define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5<br>
> <br>
> +/**<br>
> + * DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT<br>
> + *<br>
> + * Drivers for para-virtualized hardware (e.g. vmwgfx, qxl, virtio and<br>
> + * virtualbox) have additional restrictions for cursor planes (thus<br>
> + * making cursor planes on those drivers not truly universal,) e.g.<br>
> + * they need cursor planes to act like one would expect from a mouse<br>
> + * cursor and have correctly set hotspot properties.<br>
> + * If this client cap is not set the DRM core will hide cursor plane on<br>
> + * those virtualized drivers because not setting it implies that the<br>
> + * client is not capable of dealing with those extra restictions.<br>
> + * Clients which do set cursor hotspot and treat the cursor plane<br>
> + * like a mouse cursor should set this property.<br>
> + * The client must enable &DRM_CLIENT_CAP_ATOMIC first.<br>
> + *<br>
> + * Setting this property on drivers which do not special case<br>
> + * cursor planes (i.e. non-virtualized drivers) will return<br>
> + * EOPNOTSUPP, which can be used by userspace to gauge<br>
> + * requirements of the hardware/drivers they're running on.<br>
> + *<br>
> + * This capability is always supported for atomic-capable virtualized<br>
> + * drivers starting from kernel version 6.6.<br>
> + */<br>
> +#define DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT 6<br>
> +<br>
> +<br>
> /* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */<br>
> struct drm_set_client_cap {<br>
> __u64 capability;<br>
> @@ -1090,6 +1122,24 @@ extern "C" {<br>
> #define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer)<br>
> #define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array)<br>
> <br>
> +/**<br>
> + * DRM_IOCTL_MODE_GETFB2 - Get framebuffer metadata.<br>
> + *<br>
> + * This queries metadata about a framebuffer. User-space fills<br>
> + * &drm_mode_fb_cmd2.fb_id as the input, and the kernels fills the rest of the<br>
> + * struct as the output.<br>
> + *<br>
> + * If the client is DRM master or has &CAP_SYS_ADMIN, &drm_mode_fb_cmd2.handles<br>
> + * will be filled with GEM buffer handles. Planes are valid until one has a<br>
> + * zero handle -- this can be used to compute the number of planes.<br>
> + *<br>
> + * Otherwise, &drm_mode_fb_cmd2.handles will be zeroed and planes are valid<br>
> + * until one has a zero &drm_mode_fb_cmd2.pitches.<br>
> + *<br>
> + * If the framebuffer has a format modifier, &DRM_MODE_FB_MODIFIERS will be set<br>
> + * in &drm_mode_fb_cmd2.flags and &drm_mode_fb_cmd2.modifier will contain the<br>
> + * modifier. Otherwise, user-space must ignore &drm_mode_fb_cmd2.modifier.<br>
> + */<br>
> #define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)<br>
> <br>
> /*<br>
> @@ -1144,6 +1194,7 @@ struct drm_event_crtc_sequence {<br>
> };<br>
> <br>
> /* typedef area */<br>
> +#ifndef __KERNEL__<br>
> typedef struct drm_clip_rect drm_clip_rect_t;<br>
> typedef struct drm_drawable_info drm_drawable_info_t;<br>
> typedef struct drm_tex_region drm_tex_region_t;<br>
> @@ -1185,6 +1236,7 @@ typedef struct drm_agp_binding drm_agp_binding_t;<br>
> typedef struct drm_agp_info drm_agp_info_t;<br>
> typedef struct drm_scatter_gather drm_scatter_gather_t;<br>
> typedef struct drm_set_version drm_set_version_t;<br>
> +#endif<br>
> <br>
> #if defined(__cplusplus)<br>
> }<br>
> -- <br>
> 2.40.0<br>
> <br>
<br>
</blockquote></div></div>