dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Zack Rusin <zack@kde.org>
To: dri-devel@lists.freedesktop.org
Cc: mombasawalam@vmware.com,
	virtualization@lists.linux-foundation.org, krastevm@vmware.com,
	Gerd Hoffmann <kraxel@redhat.com>,
	spice-devel@lists.freedesktop.org,
	Dave Airlie <airlied@redhat.com>
Subject: [PATCH 3/6] drm/qxl: Create mouse hotspot properties on cursor planes
Date: Thu,  2 Jun 2022 11:42:40 -0400	[thread overview]
Message-ID: <20220602154243.1015688-4-zack@kde.org> (raw)
In-Reply-To: <20220602154243.1015688-1-zack@kde.org>

From: Zack Rusin <zackr@vmware.com>

Atomic modesetting got support for mouse hotspots via the hotspot
properties. Drivers need to create those properties on cursor planes
which require the mouse hotspot coordinates.

Add the code creating hotspot properties and port away from old legacy
hotspot API. The legacy hotspot paths have an implementation that works
with new atomic properties so there's no reason to keep them and it
makes sense to unify both paths.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: virtualization@lists.linux-foundation.org
Cc: spice-devel@lists.freedesktop.org
---
 drivers/gpu/drm/qxl/qxl_display.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 9a64fa4c7530..4b578f9960cd 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -508,8 +508,8 @@ static int qxl_primary_apply_cursor(struct qxl_device *qdev,
 
 	cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release);
 	cmd->type = QXL_CURSOR_SET;
-	cmd->u.set.position.x = plane_state->crtc_x + fb->hot_x;
-	cmd->u.set.position.y = plane_state->crtc_y + fb->hot_y;
+	cmd->u.set.position.x = plane_state->crtc_x + plane_state->hotspot_x;
+	cmd->u.set.position.y = plane_state->crtc_y + plane_state->hotspot_y;
 
 	cmd->u.set.shape = qxl_bo_physical_address(qdev, qcrtc->cursor_bo, 0);
 
@@ -552,8 +552,8 @@ static int qxl_primary_move_cursor(struct qxl_device *qdev,
 
 	cmd = (struct qxl_cursor_cmd *)qxl_release_map(qdev, release);
 	cmd->type = QXL_CURSOR_MOVE;
-	cmd->u.position.x = plane_state->crtc_x + fb->hot_x;
-	cmd->u.position.y = plane_state->crtc_y + fb->hot_y;
+	cmd->u.position.x = plane_state->crtc_x + plane_state->hotspot_x;
+	cmd->u.position.y = plane_state->crtc_y + plane_state->hotspot_y;
 	qxl_release_unmap(qdev, release, &cmd->release_info);
 
 	qxl_release_fence_buffer_objects(release);
@@ -849,8 +849,8 @@ static int qxl_plane_prepare_fb(struct drm_plane *plane,
 		struct qxl_bo *old_cursor_bo = qcrtc->cursor_bo;
 
 		qcrtc->cursor_bo = qxl_create_cursor(qdev, user_bo,
-						     new_state->fb->hot_x,
-						     new_state->fb->hot_y);
+						     new_state->hotspot_x,
+						     new_state->hotspot_y);
 		qxl_free_cursor(old_cursor_bo);
 	}
 
@@ -1002,6 +1002,7 @@ static int qdev_crtc_init(struct drm_device *dev, int crtc_id)
 
 	qxl_crtc->index = crtc_id;
 	drm_crtc_helper_add(&qxl_crtc->base, &qxl_crtc_helper_funcs);
+	drm_plane_create_hotspot_properties(cursor);
 	return 0;
 
 clean_cursor:
-- 
2.34.1


  parent reply	other threads:[~2022-06-02 15:43 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 15:42 [PATCH 0/6] drm: Add mouse cursor hotspot support to atomic KMS Zack Rusin
2022-06-02 15:42 ` [PATCH 1/6] drm/atomic: Add support for mouse hotspots Zack Rusin
2022-06-02 15:42 ` [PATCH 2/6] drm/vmwgfx: Create mouse hotspot properties on cursor planes Zack Rusin
2022-06-03 13:11   ` Martin Krastev (VMware)
2022-06-02 15:42 ` Zack Rusin [this message]
2022-06-02 22:05   ` [PATCH 3/6] drm/qxl: " kernel test robot
2022-06-02 23:26   ` kernel test robot
2022-06-02 15:42 ` [PATCH 4/6] drm/vboxvideo: " Zack Rusin
2022-06-02 15:42 ` [PATCH 5/6] drm/virtio: " Zack Rusin
2022-06-02 15:42 ` [PATCH 6/6] drm: Remove legacy cursor hotspot code Zack Rusin
2022-06-03 10:28 ` [PATCH 0/6] drm: Add mouse cursor hotspot support to atomic KMS Gerd Hoffmann
2022-06-03 14:43   ` Zack Rusin
2022-06-03 14:14 ` Simon Ser
2022-06-03 14:27   ` Zack Rusin
2022-06-03 14:32     ` Simon Ser
2022-06-03 14:38       ` Zack Rusin
2022-06-03 14:56         ` Simon Ser
2022-06-03 15:17           ` Zack Rusin
2022-06-03 15:22             ` Simon Ser
2022-06-03 15:32               ` Zack Rusin
2022-06-03 15:49                 ` Simon Ser
2022-06-03 18:31                   ` Zack Rusin
2022-06-05  7:30                     ` Simon Ser
2022-06-05 15:47                       ` Zack Rusin
2022-06-05 16:26                         ` Simon Ser
2022-06-05 18:16                           ` Zack Rusin
2022-06-06  8:11                             ` Simon Ser
2022-06-04 21:19               ` Hans de Goede
2022-06-05  7:34                 ` Simon Ser
2022-06-07 11:25             ` Gerd Hoffmann
2022-06-06  9:13         ` Pekka Paalanen
2022-06-07  8:07   ` Pekka Paalanen
2022-06-07 14:30     ` Gerd Hoffmann
2022-06-08  7:53       ` Pekka Paalanen
2022-06-08 14:52         ` Gerd Hoffmann
2022-06-07 17:50     ` Zack Rusin
2022-06-08  7:53       ` Pekka Paalanen
2022-06-09 19:39         ` Zack Rusin
2022-06-10  7:49           ` Pekka Paalanen
2022-06-10  8:22             ` Jonas Ådahl
2022-06-10  8:54           ` Simon Ser
2022-06-10  9:01             ` Daniel Vetter
2022-06-10  8:41   ` Daniel Vetter
2022-06-10  8:56     ` Pekka Paalanen
2022-06-10  8:59     ` Daniel Vetter
2022-06-10 12:03       ` Gerd Hoffmann
2022-06-10 14:24       ` Zack Rusin
2022-06-13  7:33         ` Pekka Paalanen
2022-06-13 13:14           ` Zack Rusin
2022-06-13 14:25             ` Pekka Paalanen
2022-06-13 14:54               ` Zack Rusin
2022-06-14  7:36                 ` Pekka Paalanen
2022-06-14 14:40                   ` Zack Rusin
2022-06-14 14:54                     ` Daniel Stone
2023-06-09 15:20       ` Albert Esteve
2023-06-21  7:10         ` Javier Martinez Canillas
2023-06-22  4:29           ` Zack Rusin
2023-06-22  6:20             ` Javier Martinez Canillas
2022-06-10  9:15     ` Simon Ser
2022-06-10  9:49       ` Daniel Vetter
2022-06-10 12:36         ` Gerd Hoffmann
2022-06-10 12:53           ` Simon Ser
2022-06-11 15:34             ` Hans de Goede
2022-06-13  7:45               ` Pekka Paalanen

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=20220602154243.1015688-4-zack@kde.org \
    --to=zack@kde.org \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krastevm@vmware.com \
    --cc=kraxel@redhat.com \
    --cc=mombasawalam@vmware.com \
    --cc=spice-devel@lists.freedesktop.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=zackr@vmware.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;
as well as URLs for NNTP newsgroup(s).