From patchwork Wed Jun 28 05:21:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zack Rusin X-Patchwork-Id: 13295207 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC5B3EB64D7 for ; Wed, 28 Jun 2023 05:22:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 73C7F10E354; Wed, 28 Jun 2023 05:21:57 +0000 (UTC) Received: from letterbox.kde.org (letterbox.kde.org [46.43.1.242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 78EEA10E352 for ; Wed, 28 Jun 2023 05:21:54 +0000 (UTC) Received: from vertex.vmware.com (pool-173-49-113-140.phlapa.fios.verizon.net [173.49.113.140]) (Authenticated sender: zack) by letterbox.kde.org (Postfix) with ESMTPSA id EA0D83224D2; Wed, 28 Jun 2023 06:21:51 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kde.org; s=users; t=1687929713; bh=iQvjrZKG7Gf6CZI7WMDAMRzlaxfPXmiZ6Xef3UBB+ig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iFthLZo+/wcZ/+fit+IUqwYjNNswgbDRGNuj9awiqx6ge8JfAAWXN4VC4KfjnB7ba ORd6jd5GKVO5AtzBfF/93sdKSs484NtdIfeTBomsMnmoMB2HRFCBQ0N9S5+spu4+g0 +PMIvGvk/h5m1sMqimHX+atE/uIpDrrJ/bWbKK8tHmvXMo35WsLMPZr1leR70ObZLq Xqpe54qdPIvDOtCJwQDId+onrFBqhqKEC0mnS09NaVeVyqF0Thgzfx5bO2kTuVDIXj rMFbPt5R+QmxZ9D1IWyhpmrgsGUkJUMddemiFwG80Acfk9SeRHH0fGTtnAWW8e3YYV 349sF129vBzWA== From: Zack Rusin To: dri-devel@lists.freedesktop.org Subject: [PATCH v4 6/8] drm/virtio: Use the hotspot properties from cursor planes Date: Wed, 28 Jun 2023 01:21:31 -0400 Message-Id: <20230628052133.553154-7-zack@kde.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230628052133.553154-1-zack@kde.org> References: <20230628052133.553154-1-zack@kde.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Zack Rusin Cc: David Airlie , javierm@redhat.com, banackm@vmware.com, Gurchetan Singh , krastevm@vmware.com, ppaalanen@gmail.com, iforbes@vmware.com, virtualization@lists.linux-foundation.org, mombasawalam@vmware.com, Gerd Hoffmann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Zack Rusin 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 Reviewed-by: Gerd Hoffmann Cc: David Airlie Cc: Gurchetan Singh Cc: Chia-I Wu Cc: Daniel Vetter Cc: virtualization@lists.linux-foundation.org Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/virtio/virtgpu_plane.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index a2e045f3a000..20de599658c1 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -323,16 +323,16 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, DRM_DEBUG("update, handle %d, pos +%d+%d, hot %d,%d\n", handle, plane->state->crtc_x, plane->state->crtc_y, - plane->state->fb ? plane->state->fb->hot_x : 0, - plane->state->fb ? plane->state->fb->hot_y : 0); + plane->state->hotspot_x, + plane->state->hotspot_y); output->cursor.hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_UPDATE_CURSOR); output->cursor.resource_id = cpu_to_le32(handle); if (plane->state->fb) { output->cursor.hot_x = - cpu_to_le32(plane->state->fb->hot_x); + cpu_to_le32(plane->state->hotspot_x); output->cursor.hot_y = - cpu_to_le32(plane->state->fb->hot_y); + cpu_to_le32(plane->state->hotspot_y); } else { output->cursor.hot_x = cpu_to_le32(0); output->cursor.hot_y = cpu_to_le32(0);