From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153124; cv=none; d=zohomail.com; s=zohoarc; b=i+NGRmgFH9XPtEwEBvSa8m0zS83Dx9mh5Dc9QrWIzLHt9IEEj7wrEB+5mg7NPzS9aJN32/vO9mrIRN3h89YYolVhFz13qAKdOAaFvQFbFeUDP6NicZ2caXZ//KXPrRkiuFRUWWKgRSQxHuHRCCBYk88MELsBJi5hFdit08Ub9J8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153124; h=Content-Type: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=duCwyNlglNcqemTVpMO0z8NLXL7nnvuZpAoGomh3gjc=; b=D5s+E9CHO5htM8WDrL3MmM3S4mufm75LrGOExwH4YOGM6YDVYMr0WPJOCourf24pwXtM1Oqbgw5On8HRYCX7lks2ItLADTRtvDoIy5t2fZtOSY5TsODNFbeb80vBkMtgrLr/mVrMZ9WISkLW/CvRavZiU2qxO8+H58lmSwYlLOk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1616153124007204.18761172102552; Fri, 19 Mar 2021 04:25:24 -0700 (PDT) Received: from localhost ([::1]:56180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDFq-0004lJ-Vr for importer@patchew.org; Fri, 19 Mar 2021 07:25:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCb-0008Hq-E2 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58143) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCZ-0007fQ-Rt for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:01 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-101-bd6aBQNpPWSunRq0qXC0CA-1; Fri, 19 Mar 2021 07:21:56 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C15F410866A5; Fri, 19 Mar 2021 11:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 31E3B19C79; Fri, 19 Mar 2021 11:21:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BE6AF180039F; Fri, 19 Mar 2021 12:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=duCwyNlglNcqemTVpMO0z8NLXL7nnvuZpAoGomh3gjc=; b=VPTd/ha867KxYYw3Mh5hIpMJfeTpicbtkMtxUh0lVYa4gXIrFy8CjUtQQO78AzSrbqi+su 6UKZbInkLYlLDOKcTunXWWtYM8jRRH1tdRqOEffcH76BlUvUtZPXZMshpTauZo2/8j6zv5 TUGYXQx4t8VKZnN8d4XYaSXLQnaPjho= X-MC-Unique: bd6aBQNpPWSunRq0qXC0CA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 01/15] virtio-gpu: rename virgl source file. Date: Fri, 19 Mar 2021 12:21:33 +0100 Message-Id: <20210319112147.4138943-2-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" "3d" -> "virgl" as 3d is a rather broad term. Hopefully a bit less confusing. Signed-off-by: Gerd Hoffmann --- hw/display/{virtio-gpu-3d.c =3D> virtio-gpu-virgl.c} | 0 hw/display/meson.build | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename hw/display/{virtio-gpu-3d.c =3D> virtio-gpu-virgl.c} (100%) diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-virgl.c similarity index 100% rename from hw/display/virtio-gpu-3d.c rename to hw/display/virtio-gpu-virgl.c diff --git a/hw/display/meson.build b/hw/display/meson.build index 9d79e3951d9e..8e465731b85b 100644 --- a/hw/display/meson.build +++ b/hw/display/meson.build @@ -58,7 +58,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_GPU') virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_GPU', if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c'), = pixman, virgl]) virtio_gpu_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRGL'], - if_true: [files('virtio-gpu-3d.c'), pixman, virgl]) + if_true: [files('virtio-gpu-virgl.c'), pixman, virgl]) virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-u= ser-gpu.c')) hw_display_modules +=3D {'virtio-gpu': virtio_gpu_ss} endif --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153243; cv=none; d=zohomail.com; s=zohoarc; b=K8BNWRGKoAJNxiuR63LlsfT/5HsVRGlsWZb3HH2nJ95nVeDIfaXfOxfzN+YNGvGgQvMsTNFhL+Fb3Ic9dJBXtaCQ+gSbtkhUoki365roFkdMUFGkSAN+Y28ohlm0JqjFh05E7nxVB9HCUFF4XLPgBi2ec2s14RUwSFzt+we0WTk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153243; h=Content-Type: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=CazhN+s4LUPCfiHbWXTqyiIPy68Xuh01R49WXADmg+U=; b=hSjYVNDXwZWPHxezClHuDP2sWHlevv0arj/LKA+41g+24TDbF2njIzC8okhlEBnTSITisfEEIykfDD16/1Fuum48ObJYUHJiA4fkPt7sg3miSewGkI/LL1QDVPQjSWt+yqLB2c2wHL1WtZ0IXiPAjg3Gf2e/ey3IjfotJy9i10s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1616153243144610.9652013230835; Fri, 19 Mar 2021 04:27:23 -0700 (PDT) Received: from localhost ([::1]:33868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDHl-0007F7-W4 for importer@patchew.org; Fri, 19 Mar 2021 07:27:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCc-0008K9-RM for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50998) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCZ-0007ej-5E for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:02 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-404-h-hbInqkOsW8ac8HltHZ_A-1; Fri, 19 Mar 2021 07:21:56 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C838A83DD22; Fri, 19 Mar 2021 11:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51A7D19715; Fri, 19 Mar 2021 11:21:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CF88C18003A4; Fri, 19 Mar 2021 12:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CazhN+s4LUPCfiHbWXTqyiIPy68Xuh01R49WXADmg+U=; b=Kqqd5ittwowp/TZJwyCAL2NSl6n0CvyFH42AFHsryfZPmF0GaVOKz1VrRsGGPeLbTnkxEa AqpVv9i3BvcMXbIV+JWSwDJ51+M+cflLxfgWg/FwqEp+6aa9UDSv2LJeWB09kjFpSusnlL Fd3oacTbkk2fAis01VQRIVvEdBh6J7I= X-MC-Unique: h-hbInqkOsW8ac8HltHZ_A-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 02/15] virtio-gpu: add virtio-gpu-gl-device Date: Fri, 19 Mar 2021 12:21:34 +0100 Message-Id: <20210319112147.4138943-3-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Just a skeleton for starters, following patches will add more code. Signed-off-by: Gerd Hoffmann --- include/hw/virtio/virtio-gpu.h | 7 ++++++ hw/display/virtio-gpu-gl.c | 41 ++++++++++++++++++++++++++++++++++ util/module.c | 1 + hw/display/meson.build | 2 +- 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 hw/display/virtio-gpu-gl.c diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index fae149235c58..8ee6b8fe0fb8 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -31,6 +31,9 @@ OBJECT_DECLARE_TYPE(VirtIOGPUBase, VirtIOGPUBaseClass, #define TYPE_VIRTIO_GPU "virtio-gpu-device" OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPU, VIRTIO_GPU) =20 +#define TYPE_VIRTIO_GPU_GL "virtio-gpu-gl-device" +OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPUGL, VIRTIO_GPU_GL) + #define TYPE_VHOST_USER_GPU "vhost-user-gpu" OBJECT_DECLARE_SIMPLE_TYPE(VhostUserGPU, VHOST_USER_GPU) =20 @@ -163,6 +166,10 @@ struct VirtIOGPU { } stats; }; =20 +struct VirtIOGPUGL { + struct VirtIOGPU parent_obj; +}; + struct VhostUserGPU { VirtIOGPUBase parent_obj; =20 diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c new file mode 100644 index 000000000000..a477cbe186d3 --- /dev/null +++ b/hw/display/virtio-gpu-gl.c @@ -0,0 +1,41 @@ +/* + * Virtio GPU Device + * + * Copyright Red Hat, Inc. 2013-2014 + * + * Authors: + * Dave Airlie + * Gerd Hoffmann + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "qemu/iov.h" +#include "qemu/module.h" +#include "qemu/error-report.h" +#include "qapi/error.h" +#include "hw/virtio/virtio.h" +#include "hw/virtio/virtio-gpu.h" +#include "hw/virtio/virtio-gpu-bswap.h" +#include "hw/virtio/virtio-gpu-pixman.h" +#include "hw/qdev-properties.h" + +static void virtio_gpu_gl_class_init(ObjectClass *klass, void *data) +{ +} + +static const TypeInfo virtio_gpu_gl_info =3D { + .name =3D TYPE_VIRTIO_GPU_GL, + .parent =3D TYPE_VIRTIO_GPU, + .instance_size =3D sizeof(VirtIOGPUGL), + .class_init =3D virtio_gpu_gl_class_init, +}; + +static void virtio_register_types(void) +{ + type_register_static(&virtio_gpu_gl_info); +} + +type_init(virtio_register_types) diff --git a/util/module.c b/util/module.c index c65060c167df..fb80b85fe606 100644 --- a/util/module.c +++ b/util/module.c @@ -300,6 +300,7 @@ static struct { { "qxl-vga", "hw-", "display-qxl" }, { "qxl", "hw-", "display-qxl" }, { "virtio-gpu-device", "hw-", "display-virtio-gpu" }, + { "virtio-gpu-gl-device", "hw-", "display-virtio-gpu" }, { "vhost-user-gpu", "hw-", "display-virtio-gpu" }, { "virtio-gpu-pci-base", "hw-", "display-virtio-gpu-pci" }, { "virtio-gpu-pci", "hw-", "display-virtio-gpu-pci" }, diff --git a/hw/display/meson.build b/hw/display/meson.build index 8e465731b85b..5161efa08a6e 100644 --- a/hw/display/meson.build +++ b/hw/display/meson.build @@ -58,7 +58,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_GPU') virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_GPU', if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c'), = pixman, virgl]) virtio_gpu_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRGL'], - if_true: [files('virtio-gpu-virgl.c'), pixman, virgl]) + if_true: [files('virtio-gpu-gl.c', 'virtio-gpu-virgl.c= '), pixman, virgl]) virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-u= ser-gpu.c')) hw_display_modules +=3D {'virtio-gpu': virtio_gpu_ss} endif --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616152992; cv=none; d=zohomail.com; s=zohoarc; b=SXwVuUNmIDpmnH9aigbqCKY5i2mxRYXTckqNkos5W6emqZCFPXc6IB3i4GxMyBQ4Zj+gd9/EJLAgrjJLlHGO84qP9jSmHk7I9mngqrqjNTW0SDcRYJFnFkOMyTdTXAFwJ+wj2YquQFjgN9H0U/zunCjlyzp7Ax+8fOKr3cF7zmM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616152992; h=Content-Type: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=2yxbkPn7dkdOa7pe9daclhW9r72WRhaDltGH35jfc58=; b=cXsrwvl5MgYt0VOYlZsCmtrLZlvhWRBtqxzBcfbu/4QAzPHI/uE5bkLD+k5dpbdCBW+YAlYSA4tOoDwOJpaayMwYOizknr8+tcwbsu5AlTNRDw/cbRNIJ7zcAIIX6mfxOFAKLyhl59K785y35pyGoluc0s+RENP/0cUGrBVF9b0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 16161529928971014.6533043016123; Fri, 19 Mar 2021 04:23:12 -0700 (PDT) Received: from localhost ([::1]:47760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDDj-0001Lq-O1 for importer@patchew.org; Fri, 19 Mar 2021 07:23:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCa-0008Hg-Mu for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:56145) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCZ-0007ef-4G for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:00 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-400-LsT7wBBmOo-VkIHaHBQNbQ-1; Fri, 19 Mar 2021 07:21:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A962281431D; Fri, 19 Mar 2021 11:21:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4EF7C69108; Fri, 19 Mar 2021 11:21:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DCF5C18003A5; Fri, 19 Mar 2021 12:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2yxbkPn7dkdOa7pe9daclhW9r72WRhaDltGH35jfc58=; b=e+ho4LCwbSkH5Xm0uI7f8rjg9NVdDItVHT6a4/39Bei+hfij8lTu+Rg1biZUZZ+ib2YToj wdZND6w7+shDr6pkk8IV6LzlDAQxEJ/k5j9B7u1B6AE1DYDII8whQZlZgQoRDhZksp0egu nn+012jUybbpVQTwPBPfHaFmt0fZwNA= X-MC-Unique: LsT7wBBmOo-VkIHaHBQNbQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 03/15] virtio-gpu: add virtio-gpu-gl-pci Date: Fri, 19 Mar 2021 12:21:35 +0100 Message-Id: <20210319112147.4138943-4-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Add pci proxy for virtio-gpu-gl-device. Signed-off-by: Gerd Hoffmann --- hw/display/virtio-gpu-pci.c | 27 +++++++++++++++++++++++++++ util/module.c | 1 + 2 files changed, 28 insertions(+) diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c index d742a30aecf7..f5c685862ef7 100644 --- a/hw/display/virtio-gpu-pci.c +++ b/hw/display/virtio-gpu-pci.c @@ -91,10 +91,37 @@ static const VirtioPCIDeviceTypeInfo virtio_gpu_pci_inf= o =3D { .instance_init =3D virtio_gpu_initfn, }; =20 +#define TYPE_VIRTIO_GPU_GL_PCI "virtio-gpu-gl-pci" +typedef struct VirtIOGPUGLPCI VirtIOGPUGLPCI; +DECLARE_INSTANCE_CHECKER(VirtIOGPUGLPCI, VIRTIO_GPU_GL_PCI, + TYPE_VIRTIO_GPU_GL_PCI) + +struct VirtIOGPUGLPCI { + VirtIOGPUPCIBase parent_obj; + VirtIOGPUGL vdev; +}; + +static void virtio_gpu_gl_initfn(Object *obj) +{ + VirtIOGPUGLPCI *dev =3D VIRTIO_GPU_GL_PCI(obj); + + virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev), + TYPE_VIRTIO_GPU_GL); + VIRTIO_GPU_PCI_BASE(obj)->vgpu =3D VIRTIO_GPU_BASE(&dev->vdev); +} + +static const VirtioPCIDeviceTypeInfo virtio_gpu_gl_pci_info =3D { + .generic_name =3D TYPE_VIRTIO_GPU_GL_PCI, + .parent =3D TYPE_VIRTIO_GPU_PCI_BASE, + .instance_size =3D sizeof(VirtIOGPUGLPCI), + .instance_init =3D virtio_gpu_gl_initfn, +}; + static void virtio_gpu_pci_register_types(void) { type_register_static(&virtio_gpu_pci_base_info); virtio_pci_types_register(&virtio_gpu_pci_info); + virtio_pci_types_register(&virtio_gpu_gl_pci_info); } =20 type_init(virtio_gpu_pci_register_types) diff --git a/util/module.c b/util/module.c index fb80b85fe606..f825b071baa2 100644 --- a/util/module.c +++ b/util/module.c @@ -304,6 +304,7 @@ static struct { { "vhost-user-gpu", "hw-", "display-virtio-gpu" }, { "virtio-gpu-pci-base", "hw-", "display-virtio-gpu-pci" }, { "virtio-gpu-pci", "hw-", "display-virtio-gpu-pci" }, + { "virtio-gpu-gl-pci", "hw-", "display-virtio-gpu-pci" }, { "vhost-user-gpu-pci", "hw-", "display-virtio-gpu-pci" }, { "virtio-vga-base", "hw-", "display-virtio-vga" }, { "virtio-vga", "hw-", "display-virtio-vga" }, --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616152998; cv=none; d=zohomail.com; s=zohoarc; b=B1Tq6bkNlOOwLKws+sDPFi5E3UMcRUHQjgrjEw7Y9IYCoMDUGR/xDCqnHQwy9TmhkPWCu1ldKlbpgjTqwZ2ti7VvuNXSkHT06rt1koGYDA2sJWPXzk24XUpleE3Ay3Hs2Mukq24hRiMPx4yQjYmikEob7pBEBJVRmMp1L8jnfZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616152998; h=Content-Type: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=+yIAG3Al8HNgrwLzCfgMacdoXn6DrIUneGS5xZzZMIA=; b=B+4c1WXh2yzYU0/qHd2d5SrbfGKixrvuUIAi3Zfk4flIjEHNcQ1mhnWvUGphWyRQDDYHFL0EwSjjH2Ow7Be5s1hjR6hQT7Ij+iBh2ZaiLsdUw7o3oK2halYuyUxZz7tztF96Rbgd4MI57yJKym64zQzD+G04lZ8vf3YtOzVQF8Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 161615299824654.763263416210634; Fri, 19 Mar 2021 04:23:18 -0700 (PDT) Received: from localhost ([::1]:48280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDDp-0001Yf-1S for importer@patchew.org; Fri, 19 Mar 2021 07:23:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCe-0008Mc-Hq for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21425) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCc-0007il-U5 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:04 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-93-yZLpKJQTO5mwO7N-TYDOow-1; Fri, 19 Mar 2021 07:21:58 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 58734802B7E; Fri, 19 Mar 2021 11:21:57 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72F5A5D9F2; Fri, 19 Mar 2021 11:21:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EA27918003A8; Fri, 19 Mar 2021 12:21:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+yIAG3Al8HNgrwLzCfgMacdoXn6DrIUneGS5xZzZMIA=; b=T8emCjz+8TxgM8mDhZAewB7W/KvgF4qp4ywm8GrEPdtrQ4AYyCwoXLjsXLLnPIMZ7YXils XT69mSmlnjvGLLVHEVJWZBM1ZPIpCNnHklAThz1b22D2Qe3LwedDylBbaZPrCk/3vu8QJ2 CkHfTpNOSxJY2WcmcfcgPhd7X4b3hik= X-MC-Unique: yZLpKJQTO5mwO7N-TYDOow-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 04/15] virtio-gpu: add virtio-vga-gl Date: Fri, 19 Mar 2021 12:21:36 +0100 Message-Id: <20210319112147.4138943-5-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Add pci proxy for virtio-gpu-gl-device, with vga compatibility. Signed-off-by: Gerd Hoffmann --- hw/display/virtio-vga.c | 30 ++++++++++++++++++++++++++++++ util/module.c | 1 + 2 files changed, 31 insertions(+) diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index d3c640406152..f45ebe97d3ed 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -269,10 +269,40 @@ static VirtioPCIDeviceTypeInfo virtio_vga_info =3D { .instance_init =3D virtio_vga_inst_initfn, }; =20 +#define TYPE_VIRTIO_VGA_GL "virtio-vga-gl" + +typedef struct VirtIOVGAGL VirtIOVGAGL; +DECLARE_INSTANCE_CHECKER(VirtIOVGAGL, VIRTIO_VGA_GL, + TYPE_VIRTIO_VGA_GL) + +struct VirtIOVGAGL { + VirtIOVGABase parent_obj; + + VirtIOGPUGL vdev; +}; + +static void virtio_vga_gl_inst_initfn(Object *obj) +{ + VirtIOVGAGL *dev =3D VIRTIO_VGA_GL(obj); + + virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev), + TYPE_VIRTIO_GPU_GL); + VIRTIO_VGA_BASE(dev)->vgpu =3D VIRTIO_GPU_BASE(&dev->vdev); +} + + +static VirtioPCIDeviceTypeInfo virtio_vga_gl_info =3D { + .generic_name =3D TYPE_VIRTIO_VGA_GL, + .parent =3D TYPE_VIRTIO_VGA_BASE, + .instance_size =3D sizeof(VirtIOVGAGL), + .instance_init =3D virtio_vga_gl_inst_initfn, +}; + static void virtio_vga_register_types(void) { type_register_static(&virtio_vga_base_info); virtio_pci_types_register(&virtio_vga_info); + virtio_pci_types_register(&virtio_vga_gl_info); } =20 type_init(virtio_vga_register_types) diff --git a/util/module.c b/util/module.c index f825b071baa2..0bbe2b25fbec 100644 --- a/util/module.c +++ b/util/module.c @@ -308,6 +308,7 @@ static struct { { "vhost-user-gpu-pci", "hw-", "display-virtio-gpu-pci" }, { "virtio-vga-base", "hw-", "display-virtio-vga" }, { "virtio-vga", "hw-", "display-virtio-vga" }, + { "virtio-vga-gl", "hw-", "display-virtio-vga" }, { "vhost-user-vga", "hw-", "display-virtio-vga" }, { "chardev-braille", "chardev-", "baum" }, { "chardev-spicevmc", "chardev-", "spice" }, --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153249; cv=none; d=zohomail.com; s=zohoarc; b=IdmfTXoeywqm20lSUWPcQ8Uk0TsRc2hkvrtyqcsYVwhcFPr4hmkvgalpLjIdImXVE3iOi/+1TTPqhBQDisDJ9y9xYGDWMCpq/WHsCoa6aumSINvf7keKBN0jniE/iYpyZDqEJYJ2CkwlUuoJ+DU9VX1/rmLE6jrqmzxo5nf+3QQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153249; h=Content-Type: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=W5msPHfDPE8ZjYfXa0hRMK1hPCL03sJxjOy2f0Kvi2Q=; b=fSuJGsFqXhN8hg7lpJOX/GVSMQaCGUMpCfpeqku8yx4WwmW/kF4+D9euGjLdiUTQxbOjUHB1LOEByioeq+x8izg4kx+vmMJ0m3FH/krpKgMUDAzjBn6P/4NuHdAlWyk/5+1aRrRW0KwxuljPheXsecrlkW6pwbcnb0ix7DflHeo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 161615324923066.39916366378725; Fri, 19 Mar 2021 04:27:29 -0700 (PDT) Received: from localhost ([::1]:34226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDHs-0007Nu-5f for importer@patchew.org; Fri, 19 Mar 2021 07:27:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCj-00005B-G8 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44091) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lNDCh-0007lj-H3 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:09 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-566-E4IqtrRLMyyxC3SA4RGq0w-1; Fri, 19 Mar 2021 07:22:05 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 117A881622; Fri, 19 Mar 2021 11:22:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5945460CD7; Fri, 19 Mar 2021 11:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0589D18003A9; Fri, 19 Mar 2021 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W5msPHfDPE8ZjYfXa0hRMK1hPCL03sJxjOy2f0Kvi2Q=; b=BPzgmEJh7SjsargEHPqqRpZn0ecuzc6jQiVB4JKPCWSINF+z8/+K6mayrGGbqQCkMP1zTm JUNog/WyMSc939Dm+4MCYM6I7PYJfAmsZnPa6eD5+gD4Afa7UdWl4I2R5g8mejDjThvxN/ MGneYNdgC61T5rZNoL2PPklgv5HbjF8= X-MC-Unique: E4IqtrRLMyyxC3SA4RGq0w-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 05/15] virtio-gpu: move virgl realize + properties Date: Fri, 19 Mar 2021 12:21:37 +0100 Message-Id: <20210319112147.4138943-6-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Move device init (realize) and properties. Drop the virgl property, the virtio-gpu-gl-device has virgl enabled no matter what. Just use virtio-gpu-device instead if you don't want enable virgl and opengl. This simplifies the logic and reduces the test matrix. Signed-off-by: Gerd Hoffmann --- include/hw/virtio/virtio-gpu.h | 1 + hw/display/virtio-gpu-gl.c | 33 +++++++++++++++++++++++++++++++++ hw/display/virtio-gpu.c | 23 +---------------------- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 8ee6b8fe0fb8..4c1a8faebec9 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -220,6 +220,7 @@ int virtio_gpu_create_mapping_iov(VirtIOGPU *g, void virtio_gpu_cleanup_mapping_iov(VirtIOGPU *g, struct iovec *iov, uint32_t count); void virtio_gpu_process_cmdq(VirtIOGPU *g); +void virtio_gpu_device_realize(DeviceState *qdev, Error **errp); =20 /* virtio-gpu-3d.c */ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index a477cbe186d3..9b7b5f00d7e6 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -16,14 +16,47 @@ #include "qemu/module.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "sysemu/sysemu.h" #include "hw/virtio/virtio.h" #include "hw/virtio/virtio-gpu.h" #include "hw/virtio/virtio-gpu-bswap.h" #include "hw/virtio/virtio-gpu-pixman.h" #include "hw/qdev-properties.h" =20 +static void virtio_gpu_gl_device_realize(DeviceState *qdev, Error **errp) +{ + VirtIOGPU *g =3D VIRTIO_GPU(qdev); + +#if defined(HOST_WORDS_BIGENDIAN) + error_setg(errp, "virgl is not supported on bigendian platforms"); + return; +#endif + + if (!display_opengl) { + error_setg(errp, "opengl is not available"); + return; + } + + g->parent_obj.conf.flags |=3D (1 << VIRTIO_GPU_FLAG_VIRGL_ENABLED); + VIRTIO_GPU_BASE(g)->virtio_config.num_capsets =3D + virtio_gpu_virgl_get_num_capsets(g); + + virtio_gpu_device_realize(qdev, errp); +} + +static Property virtio_gpu_gl_properties[] =3D { + DEFINE_PROP_BIT("stats", VirtIOGPU, parent_obj.conf.flags, + VIRTIO_GPU_FLAG_STATS_ENABLED, false), + DEFINE_PROP_END_OF_LIST(), +}; + static void virtio_gpu_gl_class_init(ObjectClass *klass, void *data) { + DeviceClass *dc =3D DEVICE_CLASS(klass); + VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_CLASS(klass); + + vdc->realize =3D virtio_gpu_gl_device_realize; + device_class_set_props(dc, virtio_gpu_gl_properties); } =20 static const TypeInfo virtio_gpu_gl_info =3D { diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index c9f5e36fd076..2ee6ba756aba 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -1105,25 +1105,10 @@ static int virtio_gpu_load(QEMUFile *f, void *opaqu= e, size_t size, return 0; } =20 -static void virtio_gpu_device_realize(DeviceState *qdev, Error **errp) +void virtio_gpu_device_realize(DeviceState *qdev, Error **errp) { VirtIODevice *vdev =3D VIRTIO_DEVICE(qdev); VirtIOGPU *g =3D VIRTIO_GPU(qdev); - bool have_virgl; - -#if !defined(CONFIG_VIRGL) || defined(HOST_WORDS_BIGENDIAN) - have_virgl =3D false; -#else - have_virgl =3D display_opengl; -#endif - if (!have_virgl) { - g->parent_obj.conf.flags &=3D ~(1 << VIRTIO_GPU_FLAG_VIRGL_ENABLED= ); - } else { -#if defined(CONFIG_VIRGL) - VIRTIO_GPU_BASE(g)->virtio_config.num_capsets =3D - virtio_gpu_virgl_get_num_capsets(g); -#endif - } =20 if (!virtio_gpu_base_device_realize(qdev, virtio_gpu_handle_ctrl_cb, @@ -1235,12 +1220,6 @@ static Property virtio_gpu_properties[] =3D { VIRTIO_GPU_BASE_PROPERTIES(VirtIOGPU, parent_obj.conf), DEFINE_PROP_SIZE("max_hostmem", VirtIOGPU, conf_max_hostmem, 256 * MiB), -#ifdef CONFIG_VIRGL - DEFINE_PROP_BIT("virgl", VirtIOGPU, parent_obj.conf.flags, - VIRTIO_GPU_FLAG_VIRGL_ENABLED, true), - DEFINE_PROP_BIT("stats", VirtIOGPU, parent_obj.conf.flags, - VIRTIO_GPU_FLAG_STATS_ENABLED, false), -#endif DEFINE_PROP_END_OF_LIST(), }; =20 --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153347; cv=none; d=zohomail.com; s=zohoarc; b=CQHFuhhcrT3fdDlfMyEp+Fz/f8iJDZ3ZIZaRJ3Dd8elL68MPWY3O2EaEHKMi2haTwqjA8kpLK62ZLXUdKMkC3LC9uy4mVgw5ttC5BOuyFSSPurUce79VRyMfhgZvpi6L7PykaN3k61oWdj/lGzDsMOyvclCPHWUJaqDt7Dk5FcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153347; h=Content-Type: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=vOvyha5542i4mdxbIN7WTp4XctpbTj5g8szd3EOgRX4=; b=L3f4MYEOsWO/Amj790lrWPsdiWKoLC3eXaL9/PJ+1TRKU96vMUMIlG95Z4R5EeRoDibQ5v067AIN+UZiqczJ6YPIFm/vVxhCVsqsBNM4R0IEJabaaXvUdsGqh0QfZLTHxJnNDV0NSdKqMA2VJNkfYfh9Z/MLOxsyh32WXNsS2/A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1616153347462252.85306415411515; Fri, 19 Mar 2021 04:29:07 -0700 (PDT) Received: from localhost ([::1]:40278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDJS-0001Q3-AZ for importer@patchew.org; Fri, 19 Mar 2021 07:29:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCk-00008B-SK for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:35855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lNDCi-0007mV-2W for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:10 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-568-iwTqHY6iOL-KH4cCCrSduw-1; Fri, 19 Mar 2021 07:22:05 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4BDF310866A7; Fri, 19 Mar 2021 11:22:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C73460BF1; Fri, 19 Mar 2021 11:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 14B8B1800615; Fri, 19 Mar 2021 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vOvyha5542i4mdxbIN7WTp4XctpbTj5g8szd3EOgRX4=; b=IJq0VjeOdzb3+v+DdzDO09TUr7Nj8biz0ltFWb1sW3rcM9Pk416oPrYi8l93GDdFEFjfYA wCoOHraFDW2qm5zlAn41s9/QfvWcsJ6hvVU4lMiNzMKZ7JNa78/ShSb9gOoq0K4wjanmgs 5slQBMTkTj7J0NOVUATenG5XV17zJyI= X-MC-Unique: iwTqHY6iOL-KH4cCCrSduw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 06/15] virtio-gpu: move virgl reset Date: Fri, 19 Mar 2021 12:21:38 +0100 Message-Id: <20210319112147.4138943-7-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/hw/virtio/virtio-gpu.h | 1 + hw/display/virtio-gpu-gl.c | 17 +++++++++++++++++ hw/display/virtio-gpu.c | 19 +------------------ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 4c1a8faebec9..a7b7d78310ea 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -221,6 +221,7 @@ void virtio_gpu_cleanup_mapping_iov(VirtIOGPU *g, struct iovec *iov, uint32_t count); void virtio_gpu_process_cmdq(VirtIOGPU *g); void virtio_gpu_device_realize(DeviceState *qdev, Error **errp); +void virtio_gpu_reset(VirtIODevice *vdev); =20 /* virtio-gpu-3d.c */ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index 9b7b5f00d7e6..c3e562f835f7 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -23,6 +23,22 @@ #include "hw/virtio/virtio-gpu-pixman.h" #include "hw/qdev-properties.h" =20 +static void virtio_gpu_gl_reset(VirtIODevice *vdev) +{ + VirtIOGPU *g =3D VIRTIO_GPU(vdev); + + virtio_gpu_reset(vdev); + + if (g->parent_obj.use_virgl_renderer) { + if (g->parent_obj.renderer_blocked) { + g->renderer_reset =3D true; + } else { + virtio_gpu_virgl_reset(g); + } + g->parent_obj.use_virgl_renderer =3D false; + } +} + static void virtio_gpu_gl_device_realize(DeviceState *qdev, Error **errp) { VirtIOGPU *g =3D VIRTIO_GPU(qdev); @@ -56,6 +72,7 @@ static void virtio_gpu_gl_class_init(ObjectClass *klass, = void *data) VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_CLASS(klass); =20 vdc->realize =3D virtio_gpu_gl_device_realize; + vdc->reset =3D virtio_gpu_gl_reset; device_class_set_props(dc, virtio_gpu_gl_properties); } =20 diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 2ee6ba756aba..68286f75a01a 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -1126,18 +1126,12 @@ void virtio_gpu_device_realize(DeviceState *qdev, E= rror **errp) QTAILQ_INIT(&g->fenceq); } =20 -static void virtio_gpu_reset(VirtIODevice *vdev) +void virtio_gpu_reset(VirtIODevice *vdev) { VirtIOGPU *g =3D VIRTIO_GPU(vdev); struct virtio_gpu_simple_resource *res, *tmp; struct virtio_gpu_ctrl_command *cmd; =20 -#ifdef CONFIG_VIRGL - if (g->parent_obj.use_virgl_renderer) { - virtio_gpu_virgl_reset(g); - } -#endif - QTAILQ_FOREACH_SAFE(res, &g->reslist, next, tmp) { virtio_gpu_resource_destroy(g, res); } @@ -1155,17 +1149,6 @@ static void virtio_gpu_reset(VirtIODevice *vdev) g_free(cmd); } =20 -#ifdef CONFIG_VIRGL - if (g->parent_obj.use_virgl_renderer) { - if (g->parent_obj.renderer_blocked) { - g->renderer_reset =3D true; - } else { - virtio_gpu_virgl_reset(g); - } - g->parent_obj.use_virgl_renderer =3D false; - } -#endif - virtio_gpu_base_reset(VIRTIO_GPU_BASE(vdev)); } =20 --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153130; cv=none; d=zohomail.com; s=zohoarc; b=R0NOOYxbYgZIdznso46XF657vkBxGzM/hLAzsCw4SZQ/qSYBxndhzTzZfTkr5fnj4++DHG5JGtqEzqphOez6VBOgmaFkljOdw0IumxxOCHADtpRS9SkmQJaVSkVKHfWlBWH3ghCYr5RnlcEA+r3ynhwOsjPenGShY1BqdaIj+Wc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153130; h=Content-Type: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=VuFpGqKJ7y13aOr+sF6JhBiOaHNOzSXfGJS+bPt23so=; b=jVuyfvWgxpQfiiL+yBwod4qlj6+e0pQSEP5YpTi0E/IOU968CEUU1MkTAcbNHwhXKL1qU/yZF/Z7wk1tWibR7OGkyFSw80LlsvY3wLsSwYl+3uRKMsefxe1TVNSRQ9YaClT1UrWpO6pga/j3LoACx6FiJ8zucnskrmYbiQIwkY4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1616153130113852.8734816928128; Fri, 19 Mar 2021 04:25:30 -0700 (PDT) Received: from localhost ([::1]:56772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDFx-0004zY-2C for importer@patchew.org; Fri, 19 Mar 2021 07:25:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCf-0008Ot-NX for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCd-0007im-3s for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:05 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-6-GXUZSFJhMseFNDMzSn8gSQ-1; Fri, 19 Mar 2021 07:21:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9C95618C8C12; Fri, 19 Mar 2021 11:21:57 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F89B69108; Fri, 19 Mar 2021 11:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 21C1E1800628; Fri, 19 Mar 2021 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VuFpGqKJ7y13aOr+sF6JhBiOaHNOzSXfGJS+bPt23so=; b=GP1MOHyZOK6rFUbKejSBfB4QrBra+PQMNhTGdQTOawY1nJCy3lNCpd2uHhV/A0t2fuLjgL 3tc2LHCPUR6m9/4a1epCTKFQMpTStw5JLrAv+iRRlOQIDUBgs2psW2qt9NtsXkRg/CS/9j 2iVddL+AJRDqUgEjIP7oZPxQS+Gzn/I= X-MC-Unique: GXUZSFJhMseFNDMzSn8gSQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 07/15] virtio-gpu: use class function for ctrl queue handlers Date: Fri, 19 Mar 2021 12:21:39 +0100 Message-Id: <20210319112147.4138943-8-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/hw/virtio/virtio-gpu.h | 8 +++++++- hw/display/virtio-gpu.c | 12 +++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index a7b7d78310ea..380aa7dd6322 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -29,7 +29,7 @@ OBJECT_DECLARE_TYPE(VirtIOGPUBase, VirtIOGPUBaseClass, VIRTIO_GPU_BASE) =20 #define TYPE_VIRTIO_GPU "virtio-gpu-device" -OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPU, VIRTIO_GPU) +OBJECT_DECLARE_TYPE(VirtIOGPU, VirtIOGPUClass, VIRTIO_GPU) =20 #define TYPE_VIRTIO_GPU_GL "virtio-gpu-gl-device" OBJECT_DECLARE_SIMPLE_TYPE(VirtIOGPUGL, VIRTIO_GPU_GL) @@ -166,6 +166,12 @@ struct VirtIOGPU { } stats; }; =20 +struct VirtIOGPUClass { + VirtIOGPUBaseClass parent; + + void (*handle_ctrl)(VirtIODevice *vdev, VirtQueue *vq); +}; + struct VirtIOGPUGL { struct VirtIOGPU parent_obj; }; diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 68286f75a01a..39ef22b7c08d 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -893,7 +893,9 @@ static void virtio_gpu_handle_ctrl(VirtIODevice *vdev, = VirtQueue *vq) static void virtio_gpu_ctrl_bh(void *opaque) { VirtIOGPU *g =3D opaque; - virtio_gpu_handle_ctrl(&g->parent_obj.parent_obj, g->ctrl_vq); + VirtIOGPUClass *vgc =3D VIRTIO_GPU_GET_CLASS(g); + + vgc->handle_ctrl(&g->parent_obj.parent_obj, g->ctrl_vq); } =20 static void virtio_gpu_handle_cursor(VirtIODevice *vdev, VirtQueue *vq) @@ -1210,9 +1212,12 @@ static void virtio_gpu_class_init(ObjectClass *klass= , void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_CLASS(klass); - VirtIOGPUBaseClass *vgc =3D VIRTIO_GPU_BASE_CLASS(klass); + VirtIOGPUBaseClass *vbc =3D VIRTIO_GPU_BASE_CLASS(klass); + VirtIOGPUClass *vgc =3D VIRTIO_GPU_CLASS(klass); + + vbc->gl_flushed =3D virtio_gpu_gl_flushed; + vgc->handle_ctrl =3D virtio_gpu_handle_ctrl; =20 - vgc->gl_flushed =3D virtio_gpu_gl_flushed; vdc->realize =3D virtio_gpu_device_realize; vdc->reset =3D virtio_gpu_reset; vdc->get_config =3D virtio_gpu_get_config; @@ -1226,6 +1231,7 @@ static const TypeInfo virtio_gpu_info =3D { .name =3D TYPE_VIRTIO_GPU, .parent =3D TYPE_VIRTIO_GPU_BASE, .instance_size =3D sizeof(VirtIOGPU), + .class_size =3D sizeof(VirtIOGPUClass), .class_init =3D virtio_gpu_class_init, }; =20 --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153745; cv=none; d=zohomail.com; s=zohoarc; b=OWjBsJp0gD6VDZqvjRMYzXUfXGxMBmIkYgKDqFbE+SM+sqlG4VmJr+LQGJyOPuCS6+zoY9zISmR9y0ClAJ1zaKgK/7aTJRTXCPbjr+FTzDcOOsxx2C1a5JsqnncHMb6ckg949NXfDOp/NE+nbeGy4NEUW2PswBWfOJ2KYUV7J7Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153745; h=Content-Type: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=zN5UnJ+pYx/PpNMhGlBA6xMrw9ZYFiFztsTIti1deVI=; b=Kj6tlVDxOmDEUeREsIq41x6pJwVn1S1CcB7dWLpNrDakMLq45FkV3biSIjG5VHT3qepeVWAGHYPpoox1LtJqhUJUcpV1xr1H6ATlDRDL2ddsJoME+erzWXisJpd3I+ICDVWxVIU5QfuGL3WNBv3ulpckksZoZGDOqguXVwgYIs8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1616153745387238.29022471012365; Fri, 19 Mar 2021 04:35:45 -0700 (PDT) Received: from localhost ([::1]:57904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDPs-0000D5-56 for importer@patchew.org; Fri, 19 Mar 2021 07:35:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCk-00007H-HV for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59148) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCh-0007mP-W0 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:10 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-107-WAC1yNxJOe6y10ExXK7TGQ-1; Fri, 19 Mar 2021 07:22:05 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5807E83DD26; Fri, 19 Mar 2021 11:22:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D49310013C1; Fri, 19 Mar 2021 11:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2EEF9180062A; Fri, 19 Mar 2021 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zN5UnJ+pYx/PpNMhGlBA6xMrw9ZYFiFztsTIti1deVI=; b=CO8crtyOYUPjvXERbqOP1tyk76ThfhN9Hj3wFVJDYfftbDB7wqy6dnoJFOR9XmeD2hpHLT TOucGhkZ8ihfhWZNm5NYh0oawmTlCh4OLLsEaZavTHv/CxzO4yZFHVcqvbX/J720reZhzv BOTi8XUdO8LhNAp/D3EGzI8QzT8BL6A= X-MC-Unique: WAC1yNxJOe6y10ExXK7TGQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 08/15] virtio-gpu: move virgl handle_ctrl Date: Fri, 19 Mar 2021 12:21:40 +0100 Message-Id: <20210319112147.4138943-9-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- hw/display/virtio-gpu-gl.c | 33 +++++++++++++++++++++++++++++++++ hw/display/virtio-gpu.c | 13 ------------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index c3e562f835f7..6d0ce5bcd6f1 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -23,6 +23,36 @@ #include "hw/virtio/virtio-gpu-pixman.h" #include "hw/qdev-properties.h" =20 +static void virtio_gpu_gl_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) +{ + VirtIOGPU *g =3D VIRTIO_GPU(vdev); + struct virtio_gpu_ctrl_command *cmd; + + if (!virtio_queue_ready(vq)) { + return; + } + + if (!g->renderer_inited && g->parent_obj.use_virgl_renderer) { + virtio_gpu_virgl_init(g); + g->renderer_inited =3D true; + } + + cmd =3D virtqueue_pop(vq, sizeof(struct virtio_gpu_ctrl_command)); + while (cmd) { + cmd->vq =3D vq; + cmd->error =3D 0; + cmd->finished =3D false; + QTAILQ_INSERT_TAIL(&g->cmdq, cmd, next); + cmd =3D virtqueue_pop(vq, sizeof(struct virtio_gpu_ctrl_command)); + } + + virtio_gpu_process_cmdq(g); + + if (g->parent_obj.use_virgl_renderer) { + virtio_gpu_virgl_fence_poll(g); + } +} + static void virtio_gpu_gl_reset(VirtIODevice *vdev) { VirtIOGPU *g =3D VIRTIO_GPU(vdev); @@ -70,6 +100,9 @@ static void virtio_gpu_gl_class_init(ObjectClass *klass,= void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_CLASS(klass); + VirtIOGPUClass *vgc =3D VIRTIO_GPU_CLASS(klass); + + vgc->handle_ctrl =3D virtio_gpu_gl_handle_ctrl; =20 vdc->realize =3D virtio_gpu_gl_device_realize; vdc->reset =3D virtio_gpu_gl_reset; diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 39ef22b7c08d..5901e09bcd81 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -865,13 +865,6 @@ static void virtio_gpu_handle_ctrl(VirtIODevice *vdev,= VirtQueue *vq) return; } =20 -#ifdef CONFIG_VIRGL - if (!g->renderer_inited && g->parent_obj.use_virgl_renderer) { - virtio_gpu_virgl_init(g); - g->renderer_inited =3D true; - } -#endif - cmd =3D virtqueue_pop(vq, sizeof(struct virtio_gpu_ctrl_command)); while (cmd) { cmd->vq =3D vq; @@ -882,12 +875,6 @@ static void virtio_gpu_handle_ctrl(VirtIODevice *vdev,= VirtQueue *vq) } =20 virtio_gpu_process_cmdq(g); - -#ifdef CONFIG_VIRGL - if (g->parent_obj.use_virgl_renderer) { - virtio_gpu_virgl_fence_poll(g); - } -#endif } =20 static void virtio_gpu_ctrl_bh(void *opaque) --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153623; cv=none; d=zohomail.com; s=zohoarc; b=EKlhMrcoOuzIqk8ilAqjkbbk+2qBi7KKBuC6+tJcbqUuBR2OIsKmfcv55vaRWPYL7mFxq4Pp2qPVJUtqByrsoe/89IpZYES20o2yTJNZ2IRvF7wR2kSMELQuTVvQV+of69gE0wgUWJ4wHt9AwJBMoYN/LoNejAySXvmlxi0a6eA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153623; h=Content-Type: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=byEmvQrMpP/CdT9jGgCkT76amTfNmYOr0AitR0MffkY=; b=RYqjUqf0UIHSxXYVJ2yNwLNncXB9ENS/oRyFER7G8ZHB7/ddP7GtpHFfKI/8RcY6x2YwHnPdmOLZXbHStAHCcvw+bX7d6JvoyokP8nDqgq16oM2X24TFOPh9RKOpUdOizf6KHrHf3QgG5p58ONMsjKlmb19FXNIDiJXYX++cN44= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 161615362322643.841596061343125; Fri, 19 Mar 2021 04:33:43 -0700 (PDT) Received: from localhost ([::1]:51974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDNu-0006HS-0p for importer@patchew.org; Fri, 19 Mar 2021 07:33:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCj-0008Vu-02 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34986) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCh-0007le-60 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:08 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-205-r9tJVUn5Pz-uqbwGwNnP6A-1; Fri, 19 Mar 2021 07:22:04 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B47908018A9; Fri, 19 Mar 2021 11:22:03 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5E2836F969; Fri, 19 Mar 2021 11:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3C3DE180062D; Fri, 19 Mar 2021 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=byEmvQrMpP/CdT9jGgCkT76amTfNmYOr0AitR0MffkY=; b=Puw2pVZ4OSxUiq10gEijNRuSgNtoIf5T2wJyKefKNEJ3vQj6whu8LS6ol0OFZPbhav7QDX 0q8Zq2umj0qU1inCZpGtceLaIS2dQ0AuC6McEBqneQnjyo5UBpjBX4/nI9S5VULar+78hs FnOwfJ4/XC658SdIDE+b8fNT6sufoqI= X-MC-Unique: r9tJVUn5Pz-uqbwGwNnP6A-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 09/15] virtio-gpu: move virgl gl_flushed Date: Fri, 19 Mar 2021 12:21:41 +0100 Message-Id: <20210319112147.4138943-10-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- hw/display/virtio-gpu-gl.c | 13 +++++++++++++ hw/display/virtio-gpu.c | 15 --------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index 6d0ce5bcd6f1..e976fb8d04c4 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -23,6 +23,17 @@ #include "hw/virtio/virtio-gpu-pixman.h" #include "hw/qdev-properties.h" =20 +static void virtio_gpu_gl_flushed(VirtIOGPUBase *b) +{ + VirtIOGPU *g =3D VIRTIO_GPU(b); + + if (g->renderer_reset) { + g->renderer_reset =3D false; + virtio_gpu_virgl_reset(g); + } + virtio_gpu_process_cmdq(g); +} + static void virtio_gpu_gl_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) { VirtIOGPU *g =3D VIRTIO_GPU(vdev); @@ -100,8 +111,10 @@ static void virtio_gpu_gl_class_init(ObjectClass *klas= s, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_CLASS(klass); + VirtIOGPUBaseClass *vbc =3D VIRTIO_GPU_BASE_CLASS(klass); VirtIOGPUClass *vgc =3D VIRTIO_GPU_CLASS(klass); =20 + vbc->gl_flushed =3D virtio_gpu_gl_flushed; vgc->handle_ctrl =3D virtio_gpu_gl_handle_ctrl; =20 vdc->realize =3D virtio_gpu_gl_device_realize; diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 5901e09bcd81..ae80519c7356 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -843,19 +843,6 @@ void virtio_gpu_process_cmdq(VirtIOGPU *g) g->processing_cmdq =3D false; } =20 -static void virtio_gpu_gl_flushed(VirtIOGPUBase *b) -{ - VirtIOGPU *g =3D VIRTIO_GPU(b); - -#ifdef CONFIG_VIRGL - if (g->renderer_reset) { - g->renderer_reset =3D false; - virtio_gpu_virgl_reset(g); - } -#endif - virtio_gpu_process_cmdq(g); -} - static void virtio_gpu_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) { VirtIOGPU *g =3D VIRTIO_GPU(vdev); @@ -1199,10 +1186,8 @@ static void virtio_gpu_class_init(ObjectClass *klass= , void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_CLASS(klass); - VirtIOGPUBaseClass *vbc =3D VIRTIO_GPU_BASE_CLASS(klass); VirtIOGPUClass *vgc =3D VIRTIO_GPU_CLASS(klass); =20 - vbc->gl_flushed =3D virtio_gpu_gl_flushed; vgc->handle_ctrl =3D virtio_gpu_handle_ctrl; =20 vdc->realize =3D virtio_gpu_device_realize; --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153006; cv=none; d=zohomail.com; s=zohoarc; b=HxZK780nyZV4Ol4obiaNIyZM6CQjcyeiKCSdQ/+y8ZVkyFgS0WTqIzWMlMVDAVvgpblSbNtsv2TaYs6uPSMeH6TpSFyHADiysxFziiI5iXyIPGqEpKw8nvhc42Uesvv1i5598ZPkyCJH0xniaA56ekOluZBEHi6k7P5nnM80PYc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153006; h=Content-Type: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=flG4vCcohiYPuPddxsmca0eoSsF3ZLP6wMrnLYWqORw=; b=Q4J8lfvWCsPoeVsOZ+MsaBaQDZcxMfuSxdvHNQEbpXutg3skMfs1MLyUeNJKcJMt+2PPK0aMxE7VA0fJ35acN3p4tZFIiffRVgICm2KcO09azdWrJSsASCB8unpuXalZmo+zpKzMpWMzGpKkTTC12A1HOWJ5IxCsrmgW2JZKeMs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1616153006659307.0258172611859; Fri, 19 Mar 2021 04:23:26 -0700 (PDT) Received: from localhost ([::1]:49136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDDx-0001uu-Jb for importer@patchew.org; Fri, 19 Mar 2021 07:23:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCm-0000Aq-4m for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:45332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCi-0007mX-3T for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:11 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-402-BAOIhJp1NPG2hGYgMLXwYA-1; Fri, 19 Mar 2021 07:22:05 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 52A2318C8C06; Fri, 19 Mar 2021 11:22:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6043E10013D7; Fri, 19 Mar 2021 11:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4B4911800793; Fri, 19 Mar 2021 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=flG4vCcohiYPuPddxsmca0eoSsF3ZLP6wMrnLYWqORw=; b=NBqiNO0FGS5zyz7sEYhl3pBgFxz6vCArao+APFpt0dxVqIJYIQavAVYQc2T4khICR8bUVz OOdM0s6/zAys0Ehi5KeS9cBX94mRkJ0j5R+sdvIT8Rwc3eR4Ek5Rl5oa9R3CLJZpVlj99I G909PJtWYfkPPSHi5RxzDT3ULOmUrbQ= X-MC-Unique: BAOIhJp1NPG2hGYgMLXwYA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 10/15] virtio-gpu: move virgl process_cmd Date: Fri, 19 Mar 2021 12:21:42 +0100 Message-Id: <20210319112147.4138943-11-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/hw/virtio/virtio-gpu.h | 2 ++ hw/display/virtio-gpu-gl.c | 11 +++++++++++ hw/display/virtio-gpu.c | 9 +++++---- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 380aa7dd6322..4ce39d2abb4c 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -170,6 +170,7 @@ struct VirtIOGPUClass { VirtIOGPUBaseClass parent; =20 void (*handle_ctrl)(VirtIODevice *vdev, VirtQueue *vq); + void (*process_cmd)(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd); }; =20 struct VirtIOGPUGL { @@ -228,6 +229,7 @@ void virtio_gpu_cleanup_mapping_iov(VirtIOGPU *g, void virtio_gpu_process_cmdq(VirtIOGPU *g); void virtio_gpu_device_realize(DeviceState *qdev, Error **errp); void virtio_gpu_reset(VirtIODevice *vdev); +void virtio_gpu_simple_process_cmd(VirtIOGPU *g, struct virtio_gpu_ctrl_co= mmand *cmd); =20 /* virtio-gpu-3d.c */ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index e976fb8d04c4..792cc0b41256 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -23,6 +23,16 @@ #include "hw/virtio/virtio-gpu-pixman.h" #include "hw/qdev-properties.h" =20 +static void virtio_gpu_gl_process_cmd(VirtIOGPU *g, + struct virtio_gpu_ctrl_command *cmd) +{ + if (g->parent_obj.use_virgl_renderer) { + virtio_gpu_virgl_process_cmd(g, cmd); + return; + } + virtio_gpu_simple_process_cmd(g, cmd); +} + static void virtio_gpu_gl_flushed(VirtIOGPUBase *b) { VirtIOGPU *g =3D VIRTIO_GPU(b); @@ -116,6 +126,7 @@ static void virtio_gpu_gl_class_init(ObjectClass *klass= , void *data) =20 vbc->gl_flushed =3D virtio_gpu_gl_flushed; vgc->handle_ctrl =3D virtio_gpu_gl_handle_ctrl; + vgc->process_cmd =3D virtio_gpu_gl_process_cmd; =20 vdc->realize =3D virtio_gpu_gl_device_realize; vdc->reset =3D virtio_gpu_gl_reset; diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index ae80519c7356..e61bfffa8019 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -747,8 +747,8 @@ virtio_gpu_resource_detach_backing(VirtIOGPU *g, virtio_gpu_cleanup_mapping(g, res); } =20 -static void virtio_gpu_simple_process_cmd(VirtIOGPU *g, - struct virtio_gpu_ctrl_command *= cmd) +void virtio_gpu_simple_process_cmd(VirtIOGPU *g, + struct virtio_gpu_ctrl_command *cmd) { VIRTIO_GPU_FILL_CMD(cmd->cmd_hdr); virtio_gpu_ctrl_hdr_bswap(&cmd->cmd_hdr); @@ -806,6 +806,7 @@ static void virtio_gpu_handle_cursor_cb(VirtIODevice *v= dev, VirtQueue *vq) void virtio_gpu_process_cmdq(VirtIOGPU *g) { struct virtio_gpu_ctrl_command *cmd; + VirtIOGPUClass *vgc =3D VIRTIO_GPU_GET_CLASS(g); =20 if (g->processing_cmdq) { return; @@ -819,8 +820,7 @@ void virtio_gpu_process_cmdq(VirtIOGPU *g) } =20 /* process command */ - VIRGL(g, virtio_gpu_virgl_process_cmd, virtio_gpu_simple_process_c= md, - g, cmd); + vgc->process_cmd(g, cmd); =20 QTAILQ_REMOVE(&g->cmdq, cmd, next); if (virtio_gpu_stats_enabled(g->parent_obj.conf)) { @@ -1189,6 +1189,7 @@ static void virtio_gpu_class_init(ObjectClass *klass,= void *data) VirtIOGPUClass *vgc =3D VIRTIO_GPU_CLASS(klass); =20 vgc->handle_ctrl =3D virtio_gpu_handle_ctrl; + vgc->process_cmd =3D virtio_gpu_simple_process_cmd; =20 vdc->realize =3D virtio_gpu_device_realize; vdc->reset =3D virtio_gpu_reset; --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153422; cv=none; d=zohomail.com; s=zohoarc; b=iHQG6JzqtgLY1qCjMqIJhGkNKjMgPdLEL5fcYKeEzDWvSxGkfhn4ce8G0+EWptntqHJ40II4f0u2dQbjtc4Bwhq3JBq31wSE1JBDv7ADCBUwppicFb9+ptAjBpuVe/vJvppKGaPx254lYMtAAPnPYtWn5JoeRNBFyHkBoYzaQ/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153422; h=Content-Type: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=FxHTD7DL9VIpADnJyPky8JqIRzo8V34WM13UYnNOYsw=; b=B9tThPDKm4oXFGOYwSoBUzirhUxDCUhEPJoP8vNyEsDqbxGO/91z5/HQHpcTPa6QsBSW8Fk73lXoWYj9tgVzc6Jp8FVIWnmX/YpR4xX93P+AlTqz2g7lTk/67oBZK5EKkW2KQLyX39Cur0i9rNT1/EM0Ve+q4Yj63H+ZzB9OU0g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1616153422684341.661691608635; Fri, 19 Mar 2021 04:30:22 -0700 (PDT) Received: from localhost ([::1]:46002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDKf-0003jQ-Ib for importer@patchew.org; Fri, 19 Mar 2021 07:30:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCh-0008Ry-64 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54969) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCf-0007kF-7o for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:06 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-361-DejN4rayMQK2J9TszWc6ig-1; Fri, 19 Mar 2021 07:22:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 94A1C800D53; Fri, 19 Mar 2021 11:21:59 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D5F85D9F2; Fri, 19 Mar 2021 11:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5AA8A1800794; Fri, 19 Mar 2021 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FxHTD7DL9VIpADnJyPky8JqIRzo8V34WM13UYnNOYsw=; b=ipi0psQYCWF6WM5DgPcmKyohq+Sx3M5GTBoiYjgAiOjTF0F8XCXpDEmTJky5LPG/TBV+vm dgbmPyyyOCXnQdUAVJBQLVUrEqXztfa3j4Rkl+yon9BeIBWxeDcJtIu5v6uz9447wsRNzZ n8Z2ZoeKaDx0bk8kV1uP0N7I9BI1vXs= X-MC-Unique: DejN4rayMQK2J9TszWc6ig-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 11/15] virtio-gpu: move update_cursor_data Date: Fri, 19 Mar 2021 12:21:43 +0100 Message-Id: <20210319112147.4138943-12-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/hw/virtio/virtio-gpu.h | 6 ++++++ hw/display/virtio-gpu-gl.c | 30 +++++++++++++++++++++++++++ hw/display/virtio-gpu.c | 38 ++++++---------------------------- 3 files changed, 42 insertions(+), 32 deletions(-) diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 4ce39d2abb4c..cd55c2d07090 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -171,6 +171,9 @@ struct VirtIOGPUClass { =20 void (*handle_ctrl)(VirtIODevice *vdev, VirtQueue *vq); void (*process_cmd)(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd); + void (*update_cursor_data)(VirtIOGPU *g, + struct virtio_gpu_scanout *s, + uint32_t resource_id); }; =20 struct VirtIOGPUGL { @@ -230,6 +233,9 @@ void virtio_gpu_process_cmdq(VirtIOGPU *g); void virtio_gpu_device_realize(DeviceState *qdev, Error **errp); void virtio_gpu_reset(VirtIODevice *vdev); void virtio_gpu_simple_process_cmd(VirtIOGPU *g, struct virtio_gpu_ctrl_co= mmand *cmd); +void virtio_gpu_update_cursor_data(VirtIOGPU *g, + struct virtio_gpu_scanout *s, + uint32_t resource_id); =20 /* virtio-gpu-3d.c */ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index 792cc0b41256..b4303cc5bb41 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -23,6 +23,35 @@ #include "hw/virtio/virtio-gpu-pixman.h" #include "hw/qdev-properties.h" =20 +#include + +static void virtio_gpu_gl_update_cursor_data(VirtIOGPU *g, + struct virtio_gpu_scanout *s, + uint32_t resource_id) +{ + uint32_t width, height; + uint32_t pixels, *data; + + if (g->parent_obj.use_virgl_renderer) { + data =3D virgl_renderer_get_cursor_data(resource_id, &width, &heig= ht); + if (!data) { + return; + } + + if (width !=3D s->current_cursor->width || + height !=3D s->current_cursor->height) { + free(data); + return; + } + + pixels =3D s->current_cursor->width * s->current_cursor->height; + memcpy(s->current_cursor->data, data, pixels * sizeof(uint32_t)); + free(data); + return; + } + virtio_gpu_update_cursor_data(g, s, resource_id); +} + static void virtio_gpu_gl_process_cmd(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd) { @@ -127,6 +156,7 @@ static void virtio_gpu_gl_class_init(ObjectClass *klass= , void *data) vbc->gl_flushed =3D virtio_gpu_gl_flushed; vgc->handle_ctrl =3D virtio_gpu_gl_handle_ctrl; vgc->process_cmd =3D virtio_gpu_gl_process_cmd; + vgc->update_cursor_data =3D virtio_gpu_gl_update_cursor_data; =20 vdc->realize =3D virtio_gpu_gl_device_realize; vdc->reset =3D virtio_gpu_gl_reset; diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index e61bfffa8019..2c0065277ffd 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -56,9 +56,9 @@ static void virtio_gpu_cleanup_mapping(VirtIOGPU *g, } while (0) #endif =20 -static void update_cursor_data_simple(VirtIOGPU *g, - struct virtio_gpu_scanout *s, - uint32_t resource_id) +void virtio_gpu_update_cursor_data(VirtIOGPU *g, + struct virtio_gpu_scanout *s, + uint32_t resource_id) { struct virtio_gpu_simple_resource *res; uint32_t pixels; @@ -79,36 +79,10 @@ static void update_cursor_data_simple(VirtIOGPU *g, pixels * sizeof(uint32_t)); } =20 -#ifdef CONFIG_VIRGL - -static void update_cursor_data_virgl(VirtIOGPU *g, - struct virtio_gpu_scanout *s, - uint32_t resource_id) -{ - uint32_t width, height; - uint32_t pixels, *data; - - data =3D virgl_renderer_get_cursor_data(resource_id, &width, &height); - if (!data) { - return; - } - - if (width !=3D s->current_cursor->width || - height !=3D s->current_cursor->height) { - free(data); - return; - } - - pixels =3D s->current_cursor->width * s->current_cursor->height; - memcpy(s->current_cursor->data, data, pixels * sizeof(uint32_t)); - free(data); -} - -#endif - static void update_cursor(VirtIOGPU *g, struct virtio_gpu_update_cursor *c= ursor) { struct virtio_gpu_scanout *s; + VirtIOGPUClass *vgc =3D VIRTIO_GPU_GET_CLASS(g); bool move =3D cursor->hdr.type =3D=3D VIRTIO_GPU_CMD_MOVE_CURSOR; =20 if (cursor->pos.scanout_id >=3D g->parent_obj.conf.max_outputs) { @@ -131,8 +105,7 @@ static void update_cursor(VirtIOGPU *g, struct virtio_g= pu_update_cursor *cursor) s->current_cursor->hot_y =3D cursor->hot_y; =20 if (cursor->resource_id > 0) { - VIRGL(g, update_cursor_data_virgl, update_cursor_data_simple, - g, s, cursor->resource_id); + vgc->update_cursor_data(g, s, cursor->resource_id); } dpy_cursor_define(s->con, s->current_cursor); =20 @@ -1190,6 +1163,7 @@ static void virtio_gpu_class_init(ObjectClass *klass,= void *data) =20 vgc->handle_ctrl =3D virtio_gpu_handle_ctrl; vgc->process_cmd =3D virtio_gpu_simple_process_cmd; + vgc->update_cursor_data =3D virtio_gpu_update_cursor_data; =20 vdc->realize =3D virtio_gpu_device_realize; vdc->reset =3D virtio_gpu_reset; --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153340; cv=none; d=zohomail.com; s=zohoarc; b=GogLtIRkKmVGmkW8Ysj4FHHU1qZutbg7GDrrrLZUqlJGptJeJWkT9Y20vIa/LZxSfSrGO+6USi6vWiuaykSd7hVoOneOIcdUNtcnStj7fqFDCxGu3xTSCuAOyrVExFOwxRWFiXSySJsJVmRfb7v/vIZaVS+zk+uyTjnH185F9c8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153340; h=Content-Type: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=FqAYOsMnPWZx85KmwaW1n5DtDkhnNWnH1Jn/W4qaUiE=; b=Jh7eSHlk9bYCUx/tUYNmPcWaK1g2gZIZBJwWvs2EWFkFXrmcLVweWuJqRvdCTrS/CDhku8fX6ypxQa7I/kmqKol7ZBwciWeqWVO5eknboVqJyqffzqPpy4wacQVtjru2aln44cMB/z84wlCyaEX9gx4p30utvQqPthWxJlQd1Nc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1616153340308428.441053309558; Fri, 19 Mar 2021 04:29:00 -0700 (PDT) Received: from localhost ([::1]:39616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDJL-00019u-9t for importer@patchew.org; Fri, 19 Mar 2021 07:28:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCe-0008MK-CG for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:37483) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lNDCb-0007gp-Ad for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:04 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-508-wagQog0VMyW7BoQ1jIcSlA-1; Fri, 19 Mar 2021 07:21:58 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 99DFD1007CAD; Fri, 19 Mar 2021 11:21:57 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B89819C79; Fri, 19 Mar 2021 11:21:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 660421800795; Fri, 19 Mar 2021 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FqAYOsMnPWZx85KmwaW1n5DtDkhnNWnH1Jn/W4qaUiE=; b=YXJZFlwKqIxS8DmySUGhIbhCb18fhuOtc5xMv10nE8/6LtNAE6XLOFDdZrhMhiSPxASmO9 jhp6Oyb7Xv7IVHNH2Qh7BrvSmJT/fjspSVUQRmcp0/9ohu2Ats2K4rshI1QmK2Pncl+Z0M 9ItXhGIOcZ/PciFIfDPlLT1ghg5Nd2M= X-MC-Unique: wagQog0VMyW7BoQ1jIcSlA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 12/15] virtio-gpu: drop VIRGL() macro Date: Fri, 19 Mar 2021 12:21:44 +0100 Message-Id: <20210319112147.4138943-13-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Drops last virgl/opengl dependency from virtio-gpu-device. Signed-off-by: Gerd Hoffmann --- hw/display/virtio-gpu.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 2c0065277ffd..34cf35127a3d 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -39,23 +39,6 @@ virtio_gpu_find_resource(VirtIOGPU *g, uint32_t resource= _id); static void virtio_gpu_cleanup_mapping(VirtIOGPU *g, struct virtio_gpu_simple_resource *= res); =20 -#ifdef CONFIG_VIRGL -#include -#define VIRGL(_g, _virgl, _simple, ...) \ - do { \ - if (_g->parent_obj.use_virgl_renderer) { \ - _virgl(__VA_ARGS__); \ - } else { \ - _simple(__VA_ARGS__); \ - } \ - } while (0) -#else -#define VIRGL(_g, _virgl, _simple, ...) \ - do { \ - _simple(__VA_ARGS__); \ - } while (0) -#endif - void virtio_gpu_update_cursor_data(VirtIOGPU *g, struct virtio_gpu_scanout *s, uint32_t resource_id) --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153138; cv=none; d=zohomail.com; s=zohoarc; b=DfaaLZlHMptn8Fn5OpXLaP9JJSyP8NiiMnlQeqtqbxSYLilKB9OlJOOJtAiUAsWyYmc1cV/HDBxhD8rQ1KSgDFPUuLd6Ni6VZh+0BdH0G1z/zm3DQ56tIx3YIHHaI+42DpMO0DeDfewD/uZ+nlf4/m6Lp8ZXwj53xxLEYFg+K1Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153138; h=Content-Type: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=MrUBPmX0a7ukZtBLDdNpkTALSF38NEwT5OsVHKJDdhY=; b=XKEALPC2NmhzEGY6RQWvzXKui5RVxf5rFEiKvxLlOP6HHVuz9Cm/6vDZua5BBB3kdduljdQ/WMvt5uPAC9llj9aIfOHDhnZl1jFMA1dGCM4lZW25inJD88xo1tyEKF9zLuznM0dPqqwaNTRYWYMjknM66AL2lkmocwg8C425eFY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1616153138101284.1920761898074; Fri, 19 Mar 2021 04:25:38 -0700 (PDT) Received: from localhost ([::1]:57352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDG5-0005E8-2m for importer@patchew.org; Fri, 19 Mar 2021 07:25:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCm-0000Cw-Uk for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCj-0007nP-IC for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:12 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-343-eVKJuFk7PgmucemqF74u2Q-1; Fri, 19 Mar 2021 07:22:07 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C6CB881620; Fri, 19 Mar 2021 11:22:05 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6D4A5F706; Fri, 19 Mar 2021 11:21:58 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7212A1800796; Fri, 19 Mar 2021 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MrUBPmX0a7ukZtBLDdNpkTALSF38NEwT5OsVHKJDdhY=; b=IJMedD7QxfY8PrnnThIdq2HcnrmHNVHN6QzGdlPxSO73iMt15t6uI9sRzgikeYhquti6JD nw3fY0q8JRo/DO3s4dA1AtJBBQrNYvrhP8waSMfzGzCsg/c0Q6Wf+7N9WzLUNH95IH2icG RP8zhKrxAePQZ4Zsd1HgBN2XuQhpypQ= X-MC-Unique: eVKJuFk7PgmucemqF74u2Q-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 13/15] virtio-gpu: move virtio-gpu-gl-device to separate module Date: Fri, 19 Mar 2021 12:21:45 +0100 Message-Id: <20210319112147.4138943-14-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- util/module.c | 4 +++- hw/display/meson.build | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/util/module.c b/util/module.c index 0bbe2b25fbec..ffff98a7e751 100644 --- a/util/module.c +++ b/util/module.c @@ -182,6 +182,8 @@ static const struct { { "ui-spice-app", "ui-spice-core" }, { "ui-spice-app", "chardev-spice" }, =20 + { "hw-display-virtio-gpu-gl", "hw-display-virtio-gpu" }, + #ifdef CONFIG_OPENGL { "ui-egl-headless", "ui-opengl" }, { "ui-gtk", "ui-opengl" }, @@ -300,7 +302,7 @@ static struct { { "qxl-vga", "hw-", "display-qxl" }, { "qxl", "hw-", "display-qxl" }, { "virtio-gpu-device", "hw-", "display-virtio-gpu" }, - { "virtio-gpu-gl-device", "hw-", "display-virtio-gpu" }, + { "virtio-gpu-gl-device", "hw-", "display-virtio-gpu-gl" }, { "vhost-user-gpu", "hw-", "display-virtio-gpu" }, { "virtio-gpu-pci-base", "hw-", "display-virtio-gpu-pci" }, { "virtio-gpu-pci", "hw-", "display-virtio-gpu-pci" }, diff --git a/hw/display/meson.build b/hw/display/meson.build index 5161efa08a6e..7cd5a1129812 100644 --- a/hw/display/meson.build +++ b/hw/display/meson.build @@ -56,13 +56,18 @@ softmmu_ss.add(when: [pixman, 'CONFIG_ATI_VGA'], if_tru= e: files('ati.c', 'ati_2d if config_all_devices.has_key('CONFIG_VIRTIO_GPU') virtio_gpu_ss =3D ss.source_set() virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_GPU', - if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c'), = pixman, virgl]) - virtio_gpu_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRGL'], - if_true: [files('virtio-gpu-gl.c', 'virtio-gpu-virgl.c= '), pixman, virgl]) + if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c'), = pixman]) virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-u= ser-gpu.c')) hw_display_modules +=3D {'virtio-gpu': virtio_gpu_ss} endif =20 +if config_all_devices.has_key('CONFIG_VIRTIO_GPU') + virtio_gpu_gl_ss =3D ss.source_set() + virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRGL', opengl], + if_true: [files('virtio-gpu-gl.c', 'virtio-gpu-virg= l.c'), pixman, virgl]) + hw_display_modules +=3D {'virtio-gpu-gl': virtio_gpu_gl_ss} +endif + if config_all_devices.has_key('CONFIG_VIRTIO_PCI') virtio_gpu_pci_ss =3D ss.source_set() virtio_gpu_pci_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI'], --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153849; cv=none; d=zohomail.com; s=zohoarc; b=n1o+5sBMNBMJhmxI7HxBJwT6l5m5C3BJ3xZ3lZujPgH4eqNUvPlkAAGjJu3SbEN8DJRwLF4fxZjDHCZAu/BRCO6bikojM6pvusyt25sTKbMkGzExjRPla71OW+vDOEOnDw7+fOh/fBZKuLZp+JXq+hp3ulRgpfT9vbYoMstbH3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153849; h=Content-Type: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=jrkxG63TNThk+XeYHZrBXUFuTeY0glajiLouqEzD6Bs=; b=cH4Jrhiu29LDMc9pY0RlF4NWz6xf0se1704RPOnbFZD8hxBTv8PLS0R+hyPkyb1EcEsK8aQNF9JybLurS9HWdVQa6yCB5qZ+q0KMU8P6qfgoV6hqTK+Gu5gQk53tQU+5oLCrE8jhHj3dNqYWs405ZNnb3luDg6wu1QRQ3FGLGoQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1616153849066281.4957217520641; Fri, 19 Mar 2021 04:37:29 -0700 (PDT) Received: from localhost ([::1]:34042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDRX-00026x-3V for importer@patchew.org; Fri, 19 Mar 2021 07:37:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCm-0000Bg-F5 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lNDCj-0007nL-Jo for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:12 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-594-NWNlCQgsO8ukX2K7ZWgJJA-1; Fri, 19 Mar 2021 07:22:07 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 061C6800D53; Fri, 19 Mar 2021 11:22:06 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E78D43805; Fri, 19 Mar 2021 11:21:58 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 81B511800797; Fri, 19 Mar 2021 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jrkxG63TNThk+XeYHZrBXUFuTeY0glajiLouqEzD6Bs=; b=T2alCCHyxszXUEbkKzjUG5JJiKdygdF75Ae/J4oCz9zs0ztMvgPayuu8l1neR0LBFFk665 KNtXYWIqdasVZ/HlTBEKWxsvWYB+307PaNz1T66gcUs5Jnr+v40/IhCkYEp5EJMgjnESAl Om5HTLjPXucmFvR0hZBX0X1vuN6LX6w= X-MC-Unique: NWNlCQgsO8ukX2K7ZWgJJA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 14/15] virtio-gpu: drop use_virgl_renderer Date: Fri, 19 Mar 2021 12:21:46 +0100 Message-Id: <20210319112147.4138943-15-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Now that we have separated the gl and non-gl code flows to two different devices there is little reason turn on and off virglrenderer usage at runtime. The gl code can simply use virglrenderer unconditionally. So drop use_virgl_renderer field and just do that. Signed-off-by: Gerd Hoffmann --- include/hw/virtio/virtio-gpu.h | 1 - hw/display/virtio-gpu-base.c | 6 +---- hw/display/virtio-gpu-gl.c | 44 ++++++++++------------------------ 3 files changed, 14 insertions(+), 37 deletions(-) diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index cd55c2d07090..9629885c895f 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -111,7 +111,6 @@ struct VirtIOGPUBase { struct virtio_gpu_config virtio_config; const GraphicHwOps *hw_ops; =20 - bool use_virgl_renderer; int renderer_blocked; int enable; =20 diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c index 25f8920fdb67..afb3ee7d9afc 100644 --- a/hw/display/virtio-gpu-base.c +++ b/hw/display/virtio-gpu-base.c @@ -25,7 +25,6 @@ virtio_gpu_base_reset(VirtIOGPUBase *g) int i; =20 g->enable =3D 0; - g->use_virgl_renderer =3D false; =20 for (i =3D 0; i < g->conf.max_outputs; i++) { g->scanout[i].resource_id =3D 0; @@ -162,7 +161,6 @@ virtio_gpu_base_device_realize(DeviceState *qdev, return false; } =20 - g->use_virgl_renderer =3D false; if (virtio_gpu_virgl_enabled(g->conf)) { error_setg(&g->migration_blocker, "virgl is not yet migratable"); if (migrate_add_blocker(g->migration_blocker, errp) < 0) { @@ -218,10 +216,8 @@ static void virtio_gpu_base_set_features(VirtIODevice *vdev, uint64_t features) { static const uint32_t virgl =3D (1 << VIRTIO_GPU_F_VIRGL); - VirtIOGPUBase *g =3D VIRTIO_GPU_BASE(vdev); =20 - g->use_virgl_renderer =3D ((features & virgl) =3D=3D virgl); - trace_virtio_gpu_features(g->use_virgl_renderer); + trace_virtio_gpu_features(((features & virgl) =3D=3D virgl)); } =20 static void diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index b4303cc5bb41..1642a973549e 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -32,34 +32,20 @@ static void virtio_gpu_gl_update_cursor_data(VirtIOGPU = *g, uint32_t width, height; uint32_t pixels, *data; =20 - if (g->parent_obj.use_virgl_renderer) { - data =3D virgl_renderer_get_cursor_data(resource_id, &width, &heig= ht); - if (!data) { - return; - } + data =3D virgl_renderer_get_cursor_data(resource_id, &width, &height); + if (!data) { + return; + } =20 - if (width !=3D s->current_cursor->width || - height !=3D s->current_cursor->height) { - free(data); - return; - } - - pixels =3D s->current_cursor->width * s->current_cursor->height; - memcpy(s->current_cursor->data, data, pixels * sizeof(uint32_t)); + if (width !=3D s->current_cursor->width || + height !=3D s->current_cursor->height) { free(data); return; } - virtio_gpu_update_cursor_data(g, s, resource_id); -} =20 -static void virtio_gpu_gl_process_cmd(VirtIOGPU *g, - struct virtio_gpu_ctrl_command *cmd) -{ - if (g->parent_obj.use_virgl_renderer) { - virtio_gpu_virgl_process_cmd(g, cmd); - return; - } - virtio_gpu_simple_process_cmd(g, cmd); + pixels =3D s->current_cursor->width * s->current_cursor->height; + memcpy(s->current_cursor->data, data, pixels * sizeof(uint32_t)); + free(data); } =20 static void virtio_gpu_gl_flushed(VirtIOGPUBase *b) @@ -82,7 +68,7 @@ static void virtio_gpu_gl_handle_ctrl(VirtIODevice *vdev,= VirtQueue *vq) return; } =20 - if (!g->renderer_inited && g->parent_obj.use_virgl_renderer) { + if (!g->renderer_inited) { virtio_gpu_virgl_init(g); g->renderer_inited =3D true; } @@ -97,10 +83,7 @@ static void virtio_gpu_gl_handle_ctrl(VirtIODevice *vdev= , VirtQueue *vq) } =20 virtio_gpu_process_cmdq(g); - - if (g->parent_obj.use_virgl_renderer) { - virtio_gpu_virgl_fence_poll(g); - } + virtio_gpu_virgl_fence_poll(g); } =20 static void virtio_gpu_gl_reset(VirtIODevice *vdev) @@ -109,13 +92,12 @@ static void virtio_gpu_gl_reset(VirtIODevice *vdev) =20 virtio_gpu_reset(vdev); =20 - if (g->parent_obj.use_virgl_renderer) { + if (g->renderer_inited) { if (g->parent_obj.renderer_blocked) { g->renderer_reset =3D true; } else { virtio_gpu_virgl_reset(g); } - g->parent_obj.use_virgl_renderer =3D false; } } =20 @@ -155,7 +137,7 @@ static void virtio_gpu_gl_class_init(ObjectClass *klass= , void *data) =20 vbc->gl_flushed =3D virtio_gpu_gl_flushed; vgc->handle_ctrl =3D virtio_gpu_gl_handle_ctrl; - vgc->process_cmd =3D virtio_gpu_gl_process_cmd; + vgc->process_cmd =3D virtio_gpu_virgl_process_cmd; vgc->update_cursor_data =3D virtio_gpu_gl_update_cursor_data; =20 vdc->realize =3D virtio_gpu_gl_device_realize; --=20 2.30.2 From nobody Fri May 3 02:02:56 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616153432; cv=none; d=zohomail.com; s=zohoarc; b=giDa0dR6urOcZXFOG8fUfot1LHBh8KHw1TMoSU4IGDuBX1iMIGQLaylNpsVg4oFFV1TOFGnXfw9AE1/z2PUAScVk/yK6M2kFmm4vKY8Y6WjV5DUbKU9/q5/EcBmeCqj+X29tpH8zf1BpKGlBWR5jCLWTviAd5HedlCEdlGbBO2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616153432; h=Content-Type: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=AJ1JBrLBxe9EHq3xWl9922BvWfAX+kOOzzkjmeLFekE=; b=Sp09bQEjULFtZMXuNKvU99JY7dPo5WmyWaxfmug8pC/yx3NUvDEuspgNom+ocrwVjeu9T3lH4hcUKv0i6tdW21Uw6sb+jr9Lp1heawUtVoX/SkCRtSKoUYWtpxI6A9DTu7E0jzxM+0W5k36FxNVy4YbrFukeLCzj91GFLTLTpyA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1616153432978406.34106919751343; Fri, 19 Mar 2021 04:30:32 -0700 (PDT) Received: from localhost ([::1]:46602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNDKp-0003y4-PR for importer@patchew.org; Fri, 19 Mar 2021 07:30:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNDCm-0000AY-1D for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:23017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lNDCi-0007mW-26 for qemu-devel@nongnu.org; Fri, 19 Mar 2021 07:22:11 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-568-K7eOJnMrMTG_74y3RYq34Q-1; Fri, 19 Mar 2021 07:22:05 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4610483DD25; Fri, 19 Mar 2021 11:22:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-41.ams2.redhat.com [10.36.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29F1D60C13; Fri, 19 Mar 2021 11:21:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8EFF11800798; Fri, 19 Mar 2021 12:21:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616152927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AJ1JBrLBxe9EHq3xWl9922BvWfAX+kOOzzkjmeLFekE=; b=V7z8R9OWEGqz27E8R8mCjosqqX940+oYRNPt6zc6Hd422VgAXzaZQtguF93ySCcIN1eNal NWujIH6KUfKrleX9MgO4S1hF7djCkD9xutSNNvdbnWMf3dJBTggVPmD6BMp+PqzV7oq8dc gzMfo2yYxk1ox8t9OS7ghD8ZzKBJ7OA= X-MC-Unique: K7eOJnMrMTG_74y3RYq34Q-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 15/15] virtio-gpu: move fields to struct VirtIOGPUGL Date: Fri, 19 Mar 2021 12:21:47 +0100 Message-Id: <20210319112147.4138943-16-kraxel@redhat.com> In-Reply-To: <20210319112147.4138943-1-kraxel@redhat.com> References: <20210319112147.4138943-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.251, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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: "Michael S. Tsirkin" , Gerd Hoffmann , vivek.kasireddy@intel.com, tina.zhang@intel.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Move two virglrenderer state variables to struct VirtIOGPUGL. Signed-off-by: Gerd Hoffmann --- include/hw/virtio/virtio-gpu.h | 5 +++-- hw/display/virtio-gpu-gl.c | 15 +++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 9629885c895f..0a8281aeb555 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -151,8 +151,6 @@ struct VirtIOGPU { uint64_t hostmem; =20 bool processing_cmdq; - bool renderer_inited; - bool renderer_reset; QEMUTimer *fence_poll; QEMUTimer *print_stats; =20 @@ -177,6 +175,9 @@ struct VirtIOGPUClass { =20 struct VirtIOGPUGL { struct VirtIOGPU parent_obj; + + bool renderer_inited; + bool renderer_reset; }; =20 struct VhostUserGPU { diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c index 1642a973549e..d971b480806a 100644 --- a/hw/display/virtio-gpu-gl.c +++ b/hw/display/virtio-gpu-gl.c @@ -51,9 +51,10 @@ static void virtio_gpu_gl_update_cursor_data(VirtIOGPU *= g, static void virtio_gpu_gl_flushed(VirtIOGPUBase *b) { VirtIOGPU *g =3D VIRTIO_GPU(b); + VirtIOGPUGL *gl =3D VIRTIO_GPU_GL(b); =20 - if (g->renderer_reset) { - g->renderer_reset =3D false; + if (gl->renderer_reset) { + gl->renderer_reset =3D false; virtio_gpu_virgl_reset(g); } virtio_gpu_process_cmdq(g); @@ -62,15 +63,16 @@ static void virtio_gpu_gl_flushed(VirtIOGPUBase *b) static void virtio_gpu_gl_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) { VirtIOGPU *g =3D VIRTIO_GPU(vdev); + VirtIOGPUGL *gl =3D VIRTIO_GPU_GL(vdev); struct virtio_gpu_ctrl_command *cmd; =20 if (!virtio_queue_ready(vq)) { return; } =20 - if (!g->renderer_inited) { + if (!gl->renderer_inited) { virtio_gpu_virgl_init(g); - g->renderer_inited =3D true; + gl->renderer_inited =3D true; } =20 cmd =3D virtqueue_pop(vq, sizeof(struct virtio_gpu_ctrl_command)); @@ -89,12 +91,13 @@ static void virtio_gpu_gl_handle_ctrl(VirtIODevice *vde= v, VirtQueue *vq) static void virtio_gpu_gl_reset(VirtIODevice *vdev) { VirtIOGPU *g =3D VIRTIO_GPU(vdev); + VirtIOGPUGL *gl =3D VIRTIO_GPU_GL(vdev); =20 virtio_gpu_reset(vdev); =20 - if (g->renderer_inited) { + if (gl->renderer_inited) { if (g->parent_obj.renderer_blocked) { - g->renderer_reset =3D true; + gl->renderer_reset =3D true; } else { virtio_gpu_virgl_reset(g); } --=20 2.30.2