From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753218AbcEaKyV (ORCPT ); Tue, 31 May 2016 06:54:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60182 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751637AbcEaKxY (ORCPT ); Tue, 31 May 2016 06:53:24 -0400 From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Cc: Daniel Vetter , Gerd Hoffmann , David Airlie , virtualization@lists.linux-foundation.org (open list:VIRTIO GPU DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 5/5] virtio-gpu: pick up hotspot from framebuffer Date: Tue, 31 May 2016 12:53:13 +0200 Message-Id: <1464691994-5704-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1464691994-5704-1-git-send-email-kraxel@redhat.com> References: <1464691994-5704-1-git-send-email-kraxel@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 31 May 2016 10:53:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_plane.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 4780354..b7778a7 100644 --- a/drivers/gpu/drm/virtio/virtgpu_plane.c +++ b/drivers/gpu/drm/virtio/virtgpu_plane.c @@ -153,17 +153,23 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, } if (plane->state->fb != old_state->fb) { - DRM_DEBUG("update, handle %d, +%d+%d\n", handle, + DRM_DEBUG("update, handle %d, pos +%d+%d, hot %d,%d\n", handle, plane->state->crtc_x, - plane->state->crtc_y); + plane->state->crtc_y, + plane->state->fb ? plane->state->fb->hot_x : 0, + plane->state->fb ? plane->state->fb->hot_y : 0); output->cursor.hdr.type = cpu_to_le32(VIRTIO_GPU_CMD_UPDATE_CURSOR); output->cursor.resource_id = cpu_to_le32(handle); -#if 0 - /* TODO */ - output->cursor.hot_x = cpu_to_le32(hot_x); - output->cursor.hot_y = cpu_to_le32(hot_y); -#endif + if (plane->state->fb) { + output->cursor.hot_x = + cpu_to_le32(plane->state->fb->hot_x); + output->cursor.hot_y = + cpu_to_le32(plane->state->fb->hot_y); + } else { + output->cursor.hot_x = cpu_to_le32(0); + output->cursor.hot_y = cpu_to_le32(0); + } } else { DRM_DEBUG("move +%d+%d\n", plane->state->crtc_x, -- 1.8.3.1