From nobody Mon Feb 9 18:44:34 2026 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=1619785757; cv=none; d=zohomail.com; s=zohoarc; b=BP9WfsVw64lMw14vUPIOLPfEb9O/qu7SXXI5Qy6tE7hsjh70bHwLk6/fgd93X3Q3FNlWCbtspKwMLGs3RWvQrl+MSxnzTjkdbquooTxLGegv2Dag1qOTQ0cdv0xRkCV6MCZFQmid9i4EnCLxiZ9VOYqTWaSpab58OSS8WCY2J34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619785757; 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=ey0gFHB2zo39wP54pwEnakSpI3GmyFzY9G3TVdj63ZOdFRGlJetjITFE8EPIAw4gYJftX6b1QEGvlyIlOL5iJ5pB64jeeWCWuWgj2q4C2X6jY2xTuVq7P5c7MF2VIXOY6yExBRoJXrUpkUvJ5zBVm/Jwiq0abilNzwLLRTUm+BI= 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 1619785757457995.153573326417; Fri, 30 Apr 2021 05:29:17 -0700 (PDT) Received: from localhost ([::1]:50014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcSGi-0007aq-BQ for importer@patchew.org; Fri, 30 Apr 2021 08:29:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcRRf-0000er-Nw for qemu-devel@nongnu.org; Fri, 30 Apr 2021 07:36:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42053) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lcRRb-0001Pi-4l for qemu-devel@nongnu.org; Fri, 30 Apr 2021 07:36:31 -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-543-UnmTvodYO2GTulgU2yRtWg-1; Fri, 30 Apr 2021 07:36:23 -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 A43139196A5; Fri, 30 Apr 2021 11:36:22 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-203.ams2.redhat.com [10.36.112.203]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD4BA63BA7; Fri, 30 Apr 2021 11:36:08 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 51110180060D; Fri, 30 Apr 2021 13:35:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619782585; 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=UFv+Pvc6lhFcQFa8GpY19y8lCgHxjIuUdjA0T11CT9LJer4GeCBaFIq3Tv3cE0Qh3FnebF E8bCD0rzgmC7w01RSwb82EE73RuO5nrYqFj2RPBZtAHfpkqx5ZymLFsOKd02AIZ9lTe8AZ /lLTrUghHx0d9zPje1GBIhfr14EfXik= X-MC-Unique: UnmTvodYO2GTulgU2yRtWg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH v2 04/16] virtio-gpu: move virgl reset Date: Fri, 30 Apr 2021 13:35:35 +0200 Message-Id: <20210430113547.1816178-5-kraxel@redhat.com> In-Reply-To: <20210430113547.1816178-1-kraxel@redhat.com> References: <20210430113547.1816178-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=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.22, 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: Paolo Bonzini , tina.zhang@intel.com, Gerd Hoffmann , vivek.kasireddy@intel.com, "Michael S. Tsirkin" 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