Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1063447rda; Mon, 23 Oct 2023 00:48:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGe9YOraIWzE85bZh/E0WxwvDEKhqjCV2ekl6iw7/4wC7+FBY+31234xtmHbw5H9aYn4BTw X-Received: by 2002:a17:90b:4b02:b0:27d:5964:4ee6 with SMTP id lx2-20020a17090b4b0200b0027d59644ee6mr7917962pjb.2.1698047306994; Mon, 23 Oct 2023 00:48:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698047306; cv=none; d=google.com; s=arc-20160816; b=kAQ7R0+UfrZSJv9hVQV/fjANjEDXhLlHXfeU7AAR3fH5KsvlQ9NZG/HGQwl1Njp4lo fHIe6Bm1loqnkv4rQsoxgotgczQo6GnQQDL+FYg3vteG/c8tGo/3rC/ndTzM0i4yOnyz WRPKH+PuuWG8eYLpY357ZDAPXj9MKVYPErrrIGCTRXBZrYftTVy9OlsqeNUSx24iTsPA 0y3DTpvfCmQTYqFYC5SkVRyiSxKXuqxhfv4py5q870eIww5SQC2TySIFQ++Wn/ZqxrsN x0Hm8W3qsry/JX7HC6PThNqCs5MS9HCOZQMmQ/aPWvhsFwb1xV6oRqv0SxAck4H2GCGE A5Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UMT8ba+r9A0Dp8O1xMjPSLzWa5y2hkT59m9kkQX4WYk=; fh=iOXPein6KwI+xNW54ixGY+J1K3GvRcpk6m8klmMMdY0=; b=atuN431KHIshqvIP26Q6lZsaxFoYLmsHTVuBtEbadcljUYqSiMDt439w4o1HEINWXC nnwI5FT7WHhyJkdnVLtVHCVSoCl+ochzwqlxl2rA+BSJddVCUDb97XRMJp4UKP/Cqak3 z3RbZfUY6cq7MHBl3KM3u/Ewm/f8jX2F14zw6yUR1c2Uf8cl463iexgDWVCFLPvosagP hpoB3ctHyrH23LDJdg6ecLXitoHRx+c+nFAxYA+tfnMBOEPq+ncZzgrCdNkhlxyakRAU zbBkbSOyxJR7fWAn0CQ7OA/iFmVzltTmGK6v0+PUjZm0QCrz7mKaNOk/fW+cvHdubmNc h8Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Jgljqsj0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id o16-20020a17090aac1000b002773af24826si8636135pjq.123.2023.10.23.00.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 00:48:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Jgljqsj0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 05A808053622; Mon, 23 Oct 2023 00:48:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233582AbjJWHsD (ORCPT + 99 others); Mon, 23 Oct 2023 03:48:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233622AbjJWHrt (ORCPT ); Mon, 23 Oct 2023 03:47:49 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73459D75 for ; Mon, 23 Oct 2023 00:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698047218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UMT8ba+r9A0Dp8O1xMjPSLzWa5y2hkT59m9kkQX4WYk=; b=Jgljqsj0paB/YbEffDLj3TYw/zWGpJr+/80Oy6FVd0qh6cKp8CUHee4siRpvWE3wdJnDQS 1JB/E3wRDHC3Cgdp8ajYwPQz89Wj9EMonGC/2NOwq7SoElVB8z1mmNW8sxoVOGz69K1JkF B9cpURzvtAS/8ffdLOxffeu5gd0jyuo= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-222-igkbjBZZMaO3OTy9IkNl7w-1; Mon, 23 Oct 2023 03:46:42 -0400 X-MC-Unique: igkbjBZZMaO3OTy9IkNl7w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E55FE299E759; Mon, 23 Oct 2023 07:46:40 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.225.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C936503B; Mon, 23 Oct 2023 07:46:36 +0000 (UTC) From: Albert Esteve To: qemu-devel@nongnu.org Cc: zackr@vmware.com, contact@emersion.fr, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, Maxime Ripard , iforbes@vmware.com, Maarten Lankhorst , Chia-I Wu , Thomas Zimmermann , Hans de Goede , Matt Roper , David Airlie , banackm@vmware.com, Rob Clark , javierm@redhat.com, krastevm@vmware.com, spice-devel@lists.freedesktop.org, Gurchetan Singh , Jonathan Corbet , David Airlie , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, mombasawalam@vmware.com, Daniel Vetter , ppaalanen@gmail.com, VMware Graphics Reviewers , Gerd Hoffmann Subject: [PATCH v6 4/9] drm/qxl: Use the hotspot properties from cursor planes Date: Mon, 23 Oct 2023 09:46:08 +0200 Message-ID: <20231023074613.41327-5-aesteve@redhat.com> In-Reply-To: <20231023074613.41327-1-aesteve@redhat.com> References: <20231023074613.41327-1-aesteve@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 23 Oct 2023 00:48:23 -0700 (PDT) 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: Dave Airlie Cc: Daniel Vetter Cc: virtualization@lists.linux-foundation.org Cc: spice-devel@lists.freedesktop.org Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/qxl/qxl_display.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 6492a70e3c396..5d689e0d3586c 100644 --- a/drivers/gpu/drm/qxl/qxl_display.c +++ b/drivers/gpu/drm/qxl/qxl_display.c @@ -485,7 +485,6 @@ static int qxl_primary_atomic_check(struct drm_plane *plane, static int qxl_primary_apply_cursor(struct qxl_device *qdev, struct drm_plane_state *plane_state) { - struct drm_framebuffer *fb = plane_state->fb; struct qxl_crtc *qcrtc = to_qxl_crtc(plane_state->crtc); struct qxl_cursor_cmd *cmd; struct qxl_release *release; @@ -510,8 +509,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); @@ -531,7 +530,6 @@ static int qxl_primary_apply_cursor(struct qxl_device *qdev, static int qxl_primary_move_cursor(struct qxl_device *qdev, struct drm_plane_state *plane_state) { - struct drm_framebuffer *fb = plane_state->fb; struct qxl_crtc *qcrtc = to_qxl_crtc(plane_state->crtc); struct qxl_cursor_cmd *cmd; struct qxl_release *release; @@ -554,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); @@ -851,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); } -- 2.41.0