From nobody Tue Feb 10 01:50:02 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=1615544102; cv=none; d=zohomail.com; s=zohoarc; b=Q/VGF9p8DFrQOOXoOxKz8c4100/lVrKibxQEmMSxSjLKhLlH/zwT5xNm/ACPGFcxUF1Ao+qNBH3NpQ3t8RQlPAt7aiqO4P7HjbykBlQ+pS+JeJzY8nVl//uvVboNIIYyQElHYiDAYedBTCZ8QCM/naNYfEG0O9hNuQz5ZKxZ7c4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615544102; 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=cKRfBZkSvtMBQ2Oho3jsinCzQg5se417u2EKUQvW77M=; b=nobPJS+u9d2Kr8rY6Z8SfS7BvkEUMgr3bXZZ5DFLUC3uMxG9uyt3VrILfm4GFsag4bCKlttAtpWvwDoZ+EKMHzjg8ZcnL/nGsNEKGFNClFlO8U5OMZpHFacc34AmGXL6BaSw1fM55xVjWzF2GKByZSEtsP73J6unpLt0H1UN7Gg= 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 1615544102286933.0235801797295; Fri, 12 Mar 2021 02:15:02 -0800 (PST) Received: from localhost ([::1]:33774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKeov-0008DU-4y for importer@patchew.org; Fri, 12 Mar 2021 05:15:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKeeT-0001dQ-Mm for qemu-devel@nongnu.org; Fri, 12 Mar 2021 05:04:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lKeeR-0003bJ-W3 for qemu-devel@nongnu.org; Fri, 12 Mar 2021 05:04:13 -0500 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-511-1Yk0i7P9MtaNC2rAMJlldA-1; Fri, 12 Mar 2021 05:04:09 -0500 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 800BB107ACCD for ; Fri, 12 Mar 2021 10:04:08 +0000 (UTC) Received: from localhost (unknown [10.36.110.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6CCA5DAA5; Fri, 12 Mar 2021 10:04:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615543451; 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=cKRfBZkSvtMBQ2Oho3jsinCzQg5se417u2EKUQvW77M=; b=am9UNmqImte3aMRP6UK5XU9ORBSCSgBOtd2ByDPd3+R/rPAZ1iedpBcYUWJJ/9RsQQzk2y PPmNAt0QAhOYSG0PX5CDED8sxi5mg3TFxY3pU29erBJIedGQokM0q/MCdfmnpJP1mMmIlv awfGeYFfbz01PW3k9hoSCSCbbyi8/8Y= X-MC-Unique: 1Yk0i7P9MtaNC2rAMJlldA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH 16/27] vhost-user-gpu: add vg_send_disable_scanout() Date: Fri, 12 Mar 2021 14:00:57 +0400 Message-Id: <20210312100108.2706195-17-marcandre.lureau@redhat.com> In-Reply-To: <20210312100108.2706195-1-marcandre.lureau@redhat.com> References: <20210312100108.2706195-1-marcandre.lureau@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=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=marcandre.lureau@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.25, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau --- contrib/vhost-user-gpu/vugpu.h | 1 + contrib/vhost-user-gpu/vhost-user-gpu.c | 24 ++++++++++++++++-------- contrib/vhost-user-gpu/virgl.c | 8 +------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/contrib/vhost-user-gpu/vugpu.h b/contrib/vhost-user-gpu/vugpu.h index 04d5615812..e19abb670d 100644 --- a/contrib/vhost-user-gpu/vugpu.h +++ b/contrib/vhost-user-gpu/vugpu.h @@ -179,5 +179,6 @@ void vg_send_msg(VuGpu *g, const VhostUserGpuMsg *ms= g, int fd); bool vg_recv_msg(VuGpu *g, uint32_t expect_req, uint32_t expect_size, gpointer payload); =20 +void vg_send_disable_scanout(VuGpu *g, int scanout_id); =20 #endif diff --git a/contrib/vhost-user-gpu/vhost-user-gpu.c b/contrib/vhost-user-g= pu/vhost-user-gpu.c index f73f292c9f..69fedd376b 100644 --- a/contrib/vhost-user-gpu/vhost-user-gpu.c +++ b/contrib/vhost-user-gpu/vhost-user-gpu.c @@ -356,6 +356,21 @@ vg_resource_create_2d(VuGpu *g, QTAILQ_INSERT_HEAD(&g->reslist, res, next); } =20 +void +vg_send_disable_scanout(VuGpu *g, int scanout_id) +{ + g_debug("send disable scanout %d", scanout_id); + + if (g->sock_fd >=3D 0) { + VhostUserGpuMsg msg =3D { + .request =3D VHOST_USER_GPU_SCANOUT, + .size =3D sizeof(VhostUserGpuScanout), + .payload.scanout.scanout_id =3D scanout_id, + }; + vg_send_msg(g, &msg, -1); + } +} + static void vg_disable_scanout(VuGpu *g, int scanout_id) { @@ -374,14 +389,7 @@ vg_disable_scanout(VuGpu *g, int scanout_id) scanout->width =3D 0; scanout->height =3D 0; =20 - if (g->sock_fd >=3D 0) { - VhostUserGpuMsg msg =3D { - .request =3D VHOST_USER_GPU_SCANOUT, - .size =3D sizeof(VhostUserGpuScanout), - .payload.scanout.scanout_id =3D scanout_id, - }; - vg_send_msg(g, &msg, -1); - } + vg_send_disable_scanout(g, scanout_id); } =20 static void diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c index 9e6660c7ab..fe153425f5 100644 --- a/contrib/vhost-user-gpu/virgl.c +++ b/contrib/vhost-user-gpu/virgl.c @@ -354,13 +354,7 @@ virgl_cmd_set_scanout(VuGpu *g, vg_send_msg(g, &msg, fd); close(fd); } else { - VhostUserGpuMsg msg =3D { - .request =3D VHOST_USER_GPU_DMABUF_SCANOUT, - .size =3D sizeof(VhostUserGpuDMABUFScanout), - .payload.dmabuf_scanout.scanout_id =3D ss.scanout_id, - }; - g_debug("disable scanout"); - vg_send_msg(g, &msg, -1); + vg_send_disable_scanout(g, ss.scanout_id); } g->scanout[ss.scanout_id].resource_id =3D ss.resource_id; } --=20 2.29.0