From nobody Fri Dec 19 18:52:45 2025 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=1620653675; cv=none; d=zohomail.com; s=zohoarc; b=l2eeHMB7SqV1hkQY463rCT2RX1pFLHnIaSb1yXASH0WB7IxFIkx9rthx98yZLeVIhPLa+Ps0wsMr/aUooxhpmihHnaRiupSD3fxVIm4hNp5QyaDvj7CWoGB08EqmmklLoPd24x3ojtdrH0oPU7scLCgjbCBmp5jNV0csH40g8ZM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620653675; 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=IIKehQLi2lB1MsbxlExpLyutO9bx/lEjcbcqJxMzljs=; b=lum81NWsfTkqxMzdnsNxUwjTkvPz0oIUtsb9P1lAfO+yKu1Ec9P57qUhI6KTNEv0KdWVh1CirwtpKLmqPqMyIJ44IH0Ohh1CT9YpdTYsOPW1HY2AIhHhRPegemj6Shr2W1Nw5/FSOYTRc65sm/JbZ4BkQMecN+xMHlPxtuUZI6w= 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 1620653675761419.96629098300673; Mon, 10 May 2021 06:34:35 -0700 (PDT) Received: from localhost ([::1]:56106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lg63N-0000ey-TQ for importer@patchew.org; Mon, 10 May 2021 09:34:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg5rV-00056g-Bk for qemu-devel@nongnu.org; Mon, 10 May 2021 09:22:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg5rQ-00033M-7h for qemu-devel@nongnu.org; Mon, 10 May 2021 09:22:17 -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-366-_cQ4m3uiO-GHyM6ZG5__4w-1; Mon, 10 May 2021 09:22:08 -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 5B3AB61196 for ; Mon, 10 May 2021 13:22:07 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-112-11.ams2.redhat.com [10.36.112.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D8F5A60FC2; Mon, 10 May 2021 13:21:55 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C14F91800878; Mon, 10 May 2021 15:20:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620652930; 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=IIKehQLi2lB1MsbxlExpLyutO9bx/lEjcbcqJxMzljs=; b=I6HA39Dn3A6z8LVrC/TLZIFNT7ecZJCONOAHL1rR51Fk1ep2OHwEzbx1xT8Em4BH4+LNM6 5U8LEjGSOEP5R72QWBUmy77sWlSBgbDs2WhkPVuCGcT/N4JbJtnFKULgV/0KL2v3qotadQ RxtTwuB0AUHfND7VQho9+qekUsGy/Uk= X-MC-Unique: _cQ4m3uiO-GHyM6ZG5__4w-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 13/25] virtio-gpu: move virgl reset Date: Mon, 10 May 2021 15:20:39 +0200 Message-Id: <20210510132051.2208563-14-kraxel@redhat.com> In-Reply-To: <20210510132051.2208563-1-kraxel@redhat.com> References: <20210510132051.2208563-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=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.698, 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 , Gerd Hoffmann , "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 Message-id: 20210430113547.1816178-1-kraxel@redhat.com Message-Id: <20210430113547.1816178-5-kraxel@redhat.com> --- 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 7430f3cd9958..7130e41685c7 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -222,6 +222,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 461b7769b457..b500f86b20ca 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -1142,18 +1142,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); } @@ -1171,17 +1165,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.31.1