From nobody Mon Feb 9 19:08:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1621384983; cv=none; d=zohomail.com; s=zohoarc; b=A1TtbqZ9Sp6RqTwx/6iZi9JJXTTdaezN4BMvYVAujSvvIwkJzmIMPIbYywKMme5i+Vi0EXmmQ91n870pCaCXQPyrFjw+W7p9oaPqT+8t2t7ebyJMvdXIRL3b4ZhFzEU6MgC8xGft9RJbHQx9cQQD6O1Gv9yKqRbFa87LfykhvbI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621384983; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/5Cm6PQGKPnOMWz8xRsZyTwrjTh3i5EJ3CzQWZKGcns=; b=ZVEqtVtWLDwwbTpW9JB/bA3ylhUYPNsjdoRAZV8zRiO/4iryWyXUdbzOoMJv1x0OBliQpR7zF5VnHObVUc3pFh/O68AJmNkoLPHSAapggi81Nontof43j4Z4dylJXFPjNwmBci6PbWQtwdJ5lHZ5PF/MRG/MBH1kfcyiyqknyk4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621384983941243.47898658772897; Tue, 18 May 2021 17:43:03 -0700 (PDT) Received: from localhost ([::1]:57092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljAIg-0000GV-TO for importer@patchew.org; Tue, 18 May 2021 20:43:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljA3e-0004Jf-VT for qemu-devel@nongnu.org; Tue, 18 May 2021 20:27:32 -0400 Received: from mga09.intel.com ([134.134.136.24]:43003) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljA3b-0006Qv-5P for qemu-devel@nongnu.org; Tue, 18 May 2021 20:27:30 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2021 17:26:42 -0700 Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2021 17:26:42 -0700 IronPort-SDR: iBNWoLjkox51ikR7W0RU7V/jgdKYwLdB5XkOqEzdtEB2MlmXaufXVelj7S7p0n8pWuP6J9hi6x pftFrONAaU1w== X-IronPort-AV: E=McAfee;i="6200,9189,9988"; a="200902451" X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="200902451" IronPort-SDR: UX/RWxnJbi8/AGqF6dqdVxO1NSN4t6ldTo4SL2tnGzK6BqkNEqxfgmbyTqnUWS58yNzIzVw7hn WzplwDpBpy+w== X-IronPort-AV: E=Sophos;i="5.82,310,1613462400"; d="scan'208";a="394177397" From: Vivek Kasireddy To: qemu-devel@nongnu.org Subject: [PATCH v5 13/13] virtio-gpu: Update cursor data using blob Date: Tue, 18 May 2021 17:14:14 -0700 Message-Id: <20210519001414.786439-14-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210519001414.786439-1-vivek.kasireddy@intel.com> References: <20210519001414.786439-1-vivek.kasireddy@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=134.134.136.24; envelope-from=vivek.kasireddy@intel.com; helo=mga09.intel.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vivek Kasireddy , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" If a blob is available for the cursor, copy the data from the blob. Based-on-patch-by: Gerd Hoffmann Cc: Gerd Hoffmann Signed-off-by: Vivek Kasireddy --- hw/display/virtio-gpu.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 8366fa2245..d840fc195b 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -49,6 +49,7 @@ void virtio_gpu_update_cursor_data(VirtIOGPU *g, { struct virtio_gpu_simple_resource *res; uint32_t pixels; + void *data; =20 res =3D virtio_gpu_find_check_resource(g, resource_id, false, __func__, NULL); @@ -56,14 +57,22 @@ void virtio_gpu_update_cursor_data(VirtIOGPU *g, return; } =20 - if (pixman_image_get_width(res->image) !=3D s->current_cursor->width = || - pixman_image_get_height(res->image) !=3D s->current_cursor->height= ) { - return; + if (res->blob_size) { + if (res->blob_size < (s->current_cursor->width * + s->current_cursor->height * 4)) { + return; + } + data =3D res->blob; + } else { + if (pixman_image_get_width(res->image) !=3D s->current_cursor->wi= dth || + pixman_image_get_height(res->image) !=3D s->current_cursor->he= ight) { + return; + } + data =3D pixman_image_get_data(res->image); } =20 pixels =3D s->current_cursor->width * s->current_cursor->height; - memcpy(s->current_cursor->data, - pixman_image_get_data(res->image), + memcpy(s->current_cursor->data, data, pixels * sizeof(uint32_t)); } =20 --=20 2.30.2