All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Zack Rusin <zack@kde.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, krastevm@vmware.com,
	mombasawalam@vmware.com
Subject: Re: [PATCH v2 5/8] drm/vboxvideo: Use the hotspot properties from cursor planes
Date: Tue, 12 Jul 2022 10:56:00 +0300	[thread overview]
Message-ID: <20220712105600.4a8592c1@eldfell> (raw)
In-Reply-To: <20220712033246.1148476-6-zack@kde.org>

[-- Attachment #1: Type: text/plain, Size: 2473 bytes --]

On Mon, 11 Jul 2022 23:32:43 -0400
Zack Rusin <zack@kde.org> wrote:

> From: Zack Rusin <zackr@vmware.com>
> 
> Atomic modesetting got support for mouse hotspots via the hotspot
> properties. Port the legacy kms hotspot handling to the new properties
> on cursor planes.
> 
> Signed-off-by: Zack Rusin <zackr@vmware.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> ---
>  drivers/gpu/drm/vboxvideo/vbox_mode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vboxvideo/vbox_mode.c b/drivers/gpu/drm/vboxvideo/vbox_mode.c
> index fa0d73ce07bc..ca3134adb104 100644
> --- a/drivers/gpu/drm/vboxvideo/vbox_mode.c
> +++ b/drivers/gpu/drm/vboxvideo/vbox_mode.c
> @@ -429,8 +429,8 @@ static void vbox_cursor_atomic_update(struct drm_plane *plane,
>  	flags = VBOX_MOUSE_POINTER_VISIBLE | VBOX_MOUSE_POINTER_SHAPE |
>  		VBOX_MOUSE_POINTER_ALPHA;
>  	hgsmi_update_pointer_shape(vbox->guest_pool, flags,
> -				   min_t(u32, max(fb->hot_x, 0), width),
> -				   min_t(u32, max(fb->hot_y, 0), height),
> +				   min_t(u32, max(new_state->hotspot_x, 0), width),
> +				   min_t(u32, max(new_state->hotspot_y, 0), height),
>  				   width, height, vbox->cursor_data, data_size);
>  
>  	mutex_unlock(&vbox->hw_mutex);

Hi,

this looks like silent clamping of the hotspot coordinates.

Should the DRM core perhaps already ensure that the hotspot must reside
inside the plane (fb) boundaries and reject the atomic (TEST_ONLY)
commit when it's outside?

Or if this restriction is not universal, maybe this driver should
reject invalid hotspots rather than silently mangle them?

Also, if supports_virtual_cursor_plane is false, should there not be
somewhere code that will ignore the values set to the atomic hotspot
properties?

When one KMS client switches to another, the first one being hotspot
aware and the latter not, and both atomic, then the latter KMS client
who doesn't know to drive the hotspot will inherit potentially invalid
hotspot from the previous KMS client. Does something prevent that from
being a problem?

The old KMS client may have left the virtual cursor plane visible, and
the new KMS client doesn't even know the virtual cursor plane exists
because it doesn't set the DRM client cap. Something should probably
ensure the virtual cursor plane gets disabled, right?


Thanks,
pq

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-07-12  7:56 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12  3:32 [PATCH v2 0/8] Fix cursor planes with virtualized drivers Zack Rusin
2022-07-12  3:32 ` [PATCH v2 1/8] drm: Disable the cursor plane on atomic contexts " Zack Rusin
2022-07-12  3:32   ` Zack Rusin
2022-08-10 16:40   ` Daniel Vetter
2022-08-10 16:40     ` Daniel Vetter
2022-08-10 16:40     ` Daniel Vetter
2023-05-02  9:32     ` Javier Martinez Canillas
2023-05-02  9:32       ` Javier Martinez Canillas
2023-05-03  3:35       ` Zack Rusin
2023-05-03  3:35         ` Zack Rusin
2023-05-03  7:48         ` Javier Martinez Canillas
2023-05-03  7:48           ` Javier Martinez Canillas
2023-05-03  8:01           ` Pekka Paalanen
2023-05-03  8:01             ` Pekka Paalanen
2023-05-03  8:01             ` Pekka Paalanen
2023-05-04  1:50           ` Zack Rusin
2023-05-04  1:50             ` Zack Rusin
2023-05-04 10:39             ` Pekka Paalanen
2023-05-04 10:39               ` Pekka Paalanen
2023-05-04 10:39               ` Pekka Paalanen
2023-05-04 11:27               ` Jonas Ådahl
2023-05-04 11:27                 ` Jonas Ådahl
2023-05-04 12:13                 ` Pekka Paalanen
2023-05-04 12:13                   ` Pekka Paalanen
2023-05-04 12:13                   ` Pekka Paalanen
2023-05-03  7:54         ` Pekka Paalanen
2023-05-03  7:54           ` Pekka Paalanen
2023-05-03  7:54           ` Pekka Paalanen
2023-05-04  1:43           ` Zack Rusin
2023-05-04  1:43             ` Zack Rusin
2023-05-04  8:21             ` Pekka Paalanen
2023-05-04  8:21               ` Pekka Paalanen
2023-05-04  8:21               ` Pekka Paalanen
2022-07-12  3:32 ` [PATCH v2 2/8] drm/atomic: Add support for mouse hotspots Zack Rusin
2023-05-03  7:59   ` Daniel Vetter
2022-07-12  3:32 ` [PATCH v2 3/8] drm/vmwgfx: Use the hotspot properties from cursor planes Zack Rusin
2022-07-25 13:35   ` Martin Krastev (VMware)
2022-07-12  3:32 ` [PATCH v2 4/8] drm/qxl: " Zack Rusin
2022-07-12  7:58   ` Gerd Hoffmann
2022-07-12  7:58     ` Gerd Hoffmann
2022-07-12  3:32 ` [PATCH v2 5/8] drm/vboxvideo: " Zack Rusin
2022-07-12  7:56   ` Pekka Paalanen [this message]
2022-07-13  3:35     ` Zack Rusin
2022-07-13  7:20       ` Pekka Paalanen
2022-07-13 13:35         ` Zack Rusin
2022-07-14  7:38           ` Pekka Paalanen
2022-07-12  3:32 ` [PATCH v2 6/8] drm/virtio: " Zack Rusin
2022-07-12  7:58   ` Gerd Hoffmann
2022-07-12  7:58     ` Gerd Hoffmann
2022-07-12  3:32 ` [PATCH v2 7/8] drm: Remove legacy cursor hotspot code Zack Rusin
2022-07-12  3:32 ` [PATCH v2 8/8] drm: Introduce DRM_CLIENT_CAP_SUPPORTS_VIRTUAL_CURSOR_PLANE Zack Rusin
2022-07-12  7:57   ` Simon Ser
2022-07-12  8:01   ` Pekka Paalanen
2022-07-12  7:54 ` [PATCH v2 0/8] Fix cursor planes with virtualized drivers Pekka Paalanen
2022-07-12  8:00 ` Simon Ser

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=20220712105600.4a8592c1@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=krastevm@vmware.com \
    --cc=mombasawalam@vmware.com \
    --cc=zack@kde.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 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.