From nobody Tue Feb 10 01:58:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1660847999; cv=none; d=zohomail.com; s=zohoarc; b=EY77PjypfXtIRqRlGj8T8lpOZ083sh9KG31P3UdRB9Nr8LP0Y3I4JtE8e5lK4GWJvb6ZDafXHDGfCRW3NaDj0KAXkplbDTtZagB0f+2T837pOSw753/WQCbeF/DtfwFGDv6aPBzTCDIO3eev2IWYZNbKEeild8pm7gUQKcSRrNM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1660847999; h=Content-Type:Content-Transfer-Encoding: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=LsYxroove/apfZKni5KCfNOQ7fJIHKF9plsXDIhUNjI=; b=UBLX7wteO4PiJ7ZqDZHmapG3+TV4SlufDtxVKoLWflG1dDCDWv2TsQSkfxE+nNZfm+u4Uo0rSj+QzR56VPcyrw2hEB5aX2V0QAkCOKy6imGl2MbU8GK28BHRebIHRyfh+KvqGX9MQKPV5juW8z/E3rAzxSlR/gvptE8xbACNEtw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1660847999356327.5257646554278; Thu, 18 Aug 2022 11:39:59 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-79-xAAKa-14PeC3Bj8vRXhpAg-1; Thu, 18 Aug 2022 14:39:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 11AD829324A5; Thu, 18 Aug 2022 18:39:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0E5A404C6DE; Thu, 18 Aug 2022 18:39:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3E20E195355E; Thu, 18 Aug 2022 18:39:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D69F51946A41 for ; Thu, 18 Aug 2022 18:39:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CB0BC492C3B; Thu, 18 Aug 2022 18:39:48 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.9.8]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A9CD4492CA4 for ; Thu, 18 Aug 2022 18:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660847998; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=LsYxroove/apfZKni5KCfNOQ7fJIHKF9plsXDIhUNjI=; b=VInqMj2CgeOyKOkFQRAL8AAtzNDwbPtfV+T8S8mBDgCAozS8JuuLeRpwp31JBt6ifUyDfo dFSdINH2/enb8cLg93desdJC9elMdAsiDm/dLQSxOuWyxde+W25fjioe/p/43/AvaRziZc CK82+YoHTaW55bKCIUhMbxDxZ4l6/uE= X-MC-Unique: xAAKa-14PeC3Bj8vRXhpAg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v4 4/6] conf: add support for 'blob' in virtio video device Date: Thu, 18 Aug 2022 13:39:45 -0500 Message-Id: <20220818183947.2812228-5-jjongsma@redhat.com> In-Reply-To: <20220818183947.2812228-1-jjongsma@redhat.com> References: <20220818183947.2812228-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1660847999706100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Add the ability to enable blob resources for the virtio video device. This will accelerate the display path due to less or no copying of pixel data. Blob resource support can be enabled with e.g.: Some additional background information about blob resources: https://lists.freedesktop.org/archives/dri-devel/2020-August/275972.html https://www.kraxel.org/blog/2021/05/virtio-gpu-qemu-graphics-update/ Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2032406 Signed-off-by: Jonathon Jongsma --- docs/formatdomain.rst | 7 +++++++ src/conf/domain_conf.c | 6 ++++++ src/conf/domain_conf.h | 1 + src/conf/domain_validate.c | 13 ++++++++++--- src/conf/schemas/domaincommon.rng | 5 +++++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 212104fe1f..cf8a09adec 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6346,6 +6346,13 @@ A video device. :since:`since 1.3.3` ) extends secondary bar and makes it addressable as 64bit memory. =20 + :since:`Since 8.7.0` (QEMU driver only), devices with type "virtio" hav= e an + optional ``blob`` attribute that can be set to "on" or "off". Setting + ``blob`` to "on" will enable the use of blob resources in the device. T= his + can accelerate the display path by reducing or eliminating copying of p= ixel + data between the guest and host. Note that blob resource support requir= es + QEMU version 6.1 or newer. + :since:`Since 5.9.0` , the ``model`` element may also have an optional ``resolution`` sub-element. The ``resolution`` element has attributes `= `x`` and ``y`` to set the minimum resolution for the video device. This diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c39602ec75..57177b1544 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -12894,6 +12894,9 @@ virDomainVideoModelDefParseXML(virDomainVideoDef *d= ef, else if (rc =3D=3D 0) def->heads =3D 1; =20 + if (virXMLPropTristateSwitch(node, "blob", VIR_XML_PROP_NONE, &def->bl= ob) < 0) + return -1; + return 0; } =20 @@ -24973,6 +24976,9 @@ virDomainVideoDefFormat(virBuffer *buf, virBufferAsprintf(buf, " heads=3D'%u'", def->heads); if (def->primary) virBufferAddLit(buf, " primary=3D'yes'"); + if (def->blob !=3D VIR_TRISTATE_SWITCH_ABSENT) + virBufferAsprintf(buf, " blob=3D'%s'", + virTristateSwitchTypeToString(def->blob)); if (def->accel || def->res) { virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 7d293f1d8a..8ab14d6a3c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1789,6 +1789,7 @@ struct _virDomainVideoDef { bool primary; virDomainVideoAccelDef *accel; virDomainVideoResolutionDef *res; + virTristateSwitch blob; virDomainVideoDriverDef *driver; virDomainDeviceInfo info; virDomainVirtioOptions *virtio; diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 1c78a3d31c..1908d4459e 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -225,9 +225,16 @@ virDomainVideoDefValidate(const virDomainVideoDef *vid= eo, } } =20 - if (video->type !=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO && - (virDomainCheckVirtioOptionsAreAbsent(video->virtio) < 0)) - return -1; + if (video->type !=3D VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { + if (virDomainCheckVirtioOptionsAreAbsent(video->virtio) < 0) + return -1; + if (video->blob !=3D VIR_TRISTATE_SWITCH_ABSENT) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("video type '%s' does not support blob resour= ces"), + virDomainVideoTypeToString(video->type)); + return -1; + } + } =20 return 0; } diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index 7f6ea1d888..80eb8d9ee9 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -4378,6 +4378,11 @@ + + + + + --=20 2.37.1