* Re: [PATCH v6 9/9] drm: Introduce documentation for hotspot properties [not found] ` <20231023074613.41327-10-aesteve@redhat.com> @ 2023-10-23 8:23 ` Pekka Paalanen 0 siblings, 0 replies; 5+ messages in thread From: Pekka Paalanen @ 2023-10-23 8:23 UTC (permalink / raw) To: Albert Esteve Cc: linux-doc, qemu-devel, banackm, virtualization, David Airlie, mombasawalam, iforbes, Jonathan Corbet, javierm, VMware Graphics Reviewers, David Airlie, Chia-I Wu, Daniel Vetter, Maarten Lankhorst, Maxime Ripard, Hans de Goede, dri-devel, spice-devel, Gurchetan Singh, Matt Roper, contact, linux-kernel, krastevm, Rob Clark, Thomas Zimmermann, zackr [-- Attachment #1.1: Type: text/plain, Size: 5598 bytes --] On Mon, 23 Oct 2023 09:46:13 +0200 Albert Esteve <aesteve@redhat.com> wrote: > From: Michael Banack <banackm@vmware.com> > > To clarify the intent and reasoning behind the hotspot properties > introduce userspace documentation that goes over cursor handling > in para-virtualized environments. > > The documentation is generic enough to not special case for any > specific hypervisor and should apply equally to all. > > Signed-off-by: Zack Rusin <zackr@vmware.com> Hi, the below doc text: Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com> Thanks, pq > --- > Documentation/gpu/drm-kms.rst | 6 ++++ > drivers/gpu/drm/drm_plane.c | 58 ++++++++++++++++++++++++++++++++++- > 2 files changed, 63 insertions(+), 1 deletion(-) > > diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst > index a0c83fc481264..158cdcc9351f9 100644 > --- a/Documentation/gpu/drm-kms.rst > +++ b/Documentation/gpu/drm-kms.rst > @@ -577,6 +577,12 @@ Variable Refresh Properties > .. kernel-doc:: drivers/gpu/drm/drm_connector.c > :doc: Variable refresh properties > > +Cursor Hotspot Properties > +--------------------------- > + > +.. kernel-doc:: drivers/gpu/drm/drm_plane.c > + :doc: hotspot properties > + > Existing KMS Properties > ----------------------- > > diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c > index 1dc00ad4c33c3..f3f2eae83cca8 100644 > --- a/drivers/gpu/drm/drm_plane.c > +++ b/drivers/gpu/drm/drm_plane.c > @@ -230,6 +230,61 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane > return 0; > } > > +/** > + * DOC: hotspot properties > + * > + * HOTSPOT_X: property to set mouse hotspot x offset. > + * HOTSPOT_Y: property to set mouse hotspot y offset. > + * > + * When the plane is being used as a cursor image to display a mouse pointer, > + * the "hotspot" is the offset within the cursor image where mouse events > + * are expected to go. > + * > + * Positive values move the hotspot from the top-left corner of the cursor > + * plane towards the right and bottom. > + * > + * Most display drivers do not need this information because the > + * hotspot is not actually connected to anything visible on screen. > + * However, this is necessary for display drivers like the para-virtualized > + * drivers (eg qxl, vbox, virtio, vmwgfx), that are attached to a user console > + * with a mouse pointer. Since these consoles are often being remoted over a > + * network, they would otherwise have to wait to display the pointer movement to > + * the user until a full network round-trip has occurred. New mouse events have > + * to be sent from the user's console, over the network to the virtual input > + * devices, forwarded to the desktop for processing, and then the cursor plane's > + * position can be updated and sent back to the user's console over the network. > + * Instead, with the hotspot information, the console can anticipate the new > + * location, and draw the mouse cursor there before the confirmation comes in. > + * To do that correctly, the user's console must be able predict how the > + * desktop will process mouse events, which normally requires the desktop's > + * mouse topology information, ie where each CRTC sits in the mouse coordinate > + * space. This is typically sent to the para-virtualized drivers using some > + * driver-specific method, and the driver then forwards it to the console by > + * way of the virtual display device or hypervisor. > + * > + * The assumption is generally made that there is only one cursor plane being > + * used this way at a time, and that the desktop is feeding all mouse devices > + * into the same global pointer. Para-virtualized drivers that require this > + * should only be exposing a single cursor plane, or find some other way > + * to coordinate with a userspace desktop that supports multiple pointers. > + * If the hotspot properties are set, the cursor plane is therefore assumed to be > + * used only for displaying a mouse cursor image, and the position of the combined > + * cursor plane + offset can therefore be used for coordinating with input from a > + * mouse device. > + * > + * The cursor will then be drawn either at the location of the plane in the CRTC > + * console, or as a free-floating cursor plane on the user's console > + * corresponding to their desktop mouse position. > + * > + * DRM clients which would like to work correctly on drivers which expose > + * hotspot properties should advertise DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT. > + * Setting this property on drivers which do not special case > + * cursor planes will return EOPNOTSUPP, which can be used by userspace to > + * gauge requirements of the hardware/drivers they're running on. Advertising > + * DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT implies that the userspace client will be > + * correctly setting the hotspot properties. > + */ > + > /** > * drm_plane_create_hotspot_properties - creates the mouse hotspot > * properties and attaches them to the given cursor plane > @@ -237,7 +292,8 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane > * @plane: drm cursor plane > * > * This function enables the mouse hotspot property on a given > - * cursor plane. > + * cursor plane. Look at the documentation for hotspot properties > + * to get a better understanding for what they're used for. > * > * RETURNS: > * Zero for success or -errno [-- Attachment #1.2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 183 bytes --] _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <-ngmaSLF2S5emYjTBWcLRNzvJRoe_eZ-Nv9HQhE6ZLuK8nIE2ZbfVh2G2O2Z41GoIFIRpts0ukEtFXUx8pNAptmrZBhlXxaQGykx_qCZ_9k=@emersion.fr>]
[parent not found: <CADSE00KW4+hpbAbZAusBngq5FYSa067wYJCGeetqngWRJaD9Kg@mail.gmail.com>]
* Re: [PATCH v6 0/9] Fix cursor planes with virtualized drivers [not found] ` <CADSE00KW4+hpbAbZAusBngq5FYSa067wYJCGeetqngWRJaD9Kg@mail.gmail.com> @ 2023-11-22 12:49 ` Javier Martinez Canillas 2023-11-23 22:11 ` Simon Ser 0 siblings, 1 reply; 5+ messages in thread From: Javier Martinez Canillas @ 2023-11-22 12:49 UTC (permalink / raw) To: Albert Esteve, Simon Ser Cc: qemu-devel, zackr, linux-doc, dri-devel, Maxime Ripard, iforbes, Maarten Lankhorst, Chia-I Wu, Thomas Zimmermann, Hans de Goede, Matt Roper, David Airlie, banackm, Rob Clark, krastevm, spice-devel, Gurchetan Singh, Jonathan Corbet, David Airlie, virtualization, linux-kernel, mombasawalam, Daniel Vetter, ppaalanen, VMware Graphics Reviewers, Gerd Hoffmann Albert Esteve <aesteve@redhat.com> writes: Hello, [...] > >> > Mutter patch: >> > https://lists.freedesktop.org/archives/igt-dev/2023-July/058427.html >> >> Seems like this link is same as IGT? Copy-pasta fail maybe? >> >> > Ah yes, my bad, this is the correct link: > https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3337 The mutter chages are already in good shape and the MR has even be approved by a mutter developer. Any objections to merge the series ? -- Best regards, Javier Martinez Canillas Core Platforms Red Hat ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v6 0/9] Fix cursor planes with virtualized drivers 2023-11-22 12:49 ` [PATCH v6 0/9] Fix cursor planes with virtualized drivers Javier Martinez Canillas @ 2023-11-23 22:11 ` Simon Ser 2023-11-24 10:56 ` Javier Martinez Canillas 0 siblings, 1 reply; 5+ messages in thread From: Simon Ser @ 2023-11-23 22:11 UTC (permalink / raw) To: Javier Martinez Canillas Cc: Albert Esteve, qemu-devel, zackr, linux-doc, dri-devel, Maxime Ripard, iforbes, Maarten Lankhorst, Chia-I Wu, Thomas Zimmermann, Hans de Goede, Matt Roper, David Airlie, banackm, Rob Clark, krastevm, spice-devel, Gurchetan Singh, Jonathan Corbet, David Airlie, virtualization, linux-kernel, mombasawalam, Daniel Vetter, ppaalanen, VMware Graphics Reviewers, Gerd Hoffmann On Wednesday, November 22nd, 2023 at 13:49, Javier Martinez Canillas <javierm@redhat.com> wrote: > Any objections to merge the series ? No objections from me :) ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v6 0/9] Fix cursor planes with virtualized drivers 2023-11-23 22:11 ` Simon Ser @ 2023-11-24 10:56 ` Javier Martinez Canillas 0 siblings, 0 replies; 5+ messages in thread From: Javier Martinez Canillas @ 2023-11-24 10:56 UTC (permalink / raw) To: Simon Ser Cc: Albert Esteve, qemu-devel, zackr, linux-doc, dri-devel, Maxime Ripard, iforbes, Maarten Lankhorst, Chia-I Wu, Thomas Zimmermann, Hans de Goede, Matt Roper, David Airlie, banackm, Rob Clark, krastevm, spice-devel, Gurchetan Singh, Jonathan Corbet, David Airlie, virtualization, linux-kernel, mombasawalam, Daniel Vetter, ppaalanen, VMware Graphics Reviewers, Gerd Hoffmann Simon Ser <contact@emersion.fr> writes: Hello Simon, > On Wednesday, November 22nd, 2023 at 13:49, Javier Martinez Canillas <javierm@redhat.com> wrote: > >> Any objections to merge the series ? > > No objections from me :) > Perfect, I'll merge this series then to unblock the mutter MR. Thanks again! -- Best regards, Javier Martinez Canillas Core Platforms Red Hat ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v6 0/9] Fix cursor planes with virtualized drivers [not found] <20231023074613.41327-1-aesteve@redhat.com> [not found] ` <20231023074613.41327-10-aesteve@redhat.com> [not found] ` <-ngmaSLF2S5emYjTBWcLRNzvJRoe_eZ-Nv9HQhE6ZLuK8nIE2ZbfVh2G2O2Z41GoIFIRpts0ukEtFXUx8pNAptmrZBhlXxaQGykx_qCZ_9k=@emersion.fr> @ 2023-11-24 14:41 ` Javier Martinez Canillas 2 siblings, 0 replies; 5+ messages in thread From: Javier Martinez Canillas @ 2023-11-24 14:41 UTC (permalink / raw) To: Albert Esteve, qemu-devel Cc: zackr, contact, linux-doc, dri-devel, Maxime Ripard, iforbes, Maarten Lankhorst, Chia-I Wu, Thomas Zimmermann, Hans de Goede, Matt Roper, David Airlie, banackm, Rob Clark, krastevm, spice-devel, Gurchetan Singh, Jonathan Corbet, David Airlie, virtualization, linux-kernel, mombasawalam, Daniel Vetter, ppaalanen, VMware Graphics Reviewers, Gerd Hoffmann, Albert Esteve Albert Esteve <aesteve@redhat.com> writes: > v6: Shift DRIVER_CURSOR_HOTSPOT flag bit to BIT(9), since BIT(8) > was already taken by DRIVER_GEM_GPUVA. > > v5: Add a change with documentation from Michael, based on his discussion > with Pekka and bump the kernel version DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT > might be introduced with to 6.6. > > v4: Make drm_plane_create_hotspot_properties static, rename > DRM_CLIENT_CAP_VIRTUALIZED_CURSOR_PLANE to DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT > and some minor stylistic fixes for things found by Javier and Pekka > in v3. > > v3: Renames, fixes and cleanups suggested by Daniel, Simon and Pekka > after v2. There's no major changes in functionality. Please let me know > if I missed anything, it's been a while since v2. > > Virtualized drivers have had a lot of issues with cursor support on top > of atomic modesetting. This set both fixes the long standing problems > with atomic kms and virtualized drivers and adds code to let userspace > use atomic kms on virtualized drivers while preserving functioning > seamless cursors between the host and guest. > > The first change in the set is one that should be backported as far as > possible, likely 5.4 stable, because earlier stable kernels do not have > virtualbox driver. The change makes virtualized drivers stop exposing > a cursor plane for atomic clients, this fixes mouse cursor on all well > formed compositors which will automatically fallback to software cursor. > > The rest of the changes until the last one ports the legacy hotspot code > to atomic plane properties. > > Finally the last change introduces userspace API to let userspace > clients advertise the fact that they are aware of additional restrictions > placed upon the cursor plane by virtualized drivers and lets them use > atomic kms with virtualized drivers (the clients are expected to set > hotspots correctly when advertising support for virtual cursor plane). > > Link to the IGT test covering this patch (already merged): > https://lists.freedesktop.org/archives/igt-dev/2023-July/058427.html > > Mutter patch: > https://lists.freedesktop.org/archives/igt-dev/2023-July/058427.html > > Michael Banack (1): > drm: Introduce documentation for hotspot properties > > Zack Rusin (8): > drm: Disable the cursor plane on atomic contexts with virtualized > drivers > drm/atomic: Add support for mouse hotspots > drm/vmwgfx: Use the hotspot properties from cursor planes > drm/qxl: Use the hotspot properties from cursor planes > drm/vboxvideo: Use the hotspot properties from cursor planes > drm/virtio: Use the hotspot properties from cursor planes > drm: Remove legacy cursor hotspot code > drm: Introduce DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT > Pushed to drm-misc (drm-misc-next). Thanks! -- Best regards, Javier Martinez Canillas Core Platforms Red Hat ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-11-24 14:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231023074613.41327-1-aesteve@redhat.com>
[not found] ` <20231023074613.41327-10-aesteve@redhat.com>
2023-10-23 8:23 ` [PATCH v6 9/9] drm: Introduce documentation for hotspot properties Pekka Paalanen
[not found] ` <-ngmaSLF2S5emYjTBWcLRNzvJRoe_eZ-Nv9HQhE6ZLuK8nIE2ZbfVh2G2O2Z41GoIFIRpts0ukEtFXUx8pNAptmrZBhlXxaQGykx_qCZ_9k=@emersion.fr>
[not found] ` <CADSE00KW4+hpbAbZAusBngq5FYSa067wYJCGeetqngWRJaD9Kg@mail.gmail.com>
2023-11-22 12:49 ` [PATCH v6 0/9] Fix cursor planes with virtualized drivers Javier Martinez Canillas
2023-11-23 22:11 ` Simon Ser
2023-11-24 10:56 ` Javier Martinez Canillas
2023-11-24 14:41 ` Javier Martinez Canillas
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).