From nobody Mon Feb 9 23:57:59 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=1652200472; cv=none; d=zohomail.com; s=zohoarc; b=k+ndulS6iNsPu3ncfbcexOJh7xDJE60zmTyxwW/WCB0G7RSR2OXkNCg/sKrGoX17XSGI38r+OU01aBFdz6DMgbx0YVTNEJ1k4usiC7KAhbzupr9e1hxe5Q0zdWtVQ9fpW2XM8DPWP5svxoGJY+hI9zW0lvEHfSG9iKRJI+WvMxo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652200472; 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=3R2n0wmg8XZiHwMEvdIhZDlKBsOkZ81VsijbdK9dX2g=; b=hLLiHhMkT0XOQz5ZHO8SbR4QxVCA8ds9AIooQFPGcFveOkQF68yQRPsnrG+rhSRlmcjI2KbtiaWNOtJuQuE2CDml9Kp8XCB3A0wPkdaZOaGVhtdC+KNaRu08IvEEvGYp/UYXetrzW5V4kE5zbnr2CArafENGzaDLBRls2cEnSXs= 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 1652200472315252.67044983358073; Tue, 10 May 2022 09:34:32 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-489-tJ-MfRQSPPCacN1B3UScVQ-1; Tue, 10 May 2022 12:27:10 -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 E717E8D676C; Tue, 10 May 2022 16:24:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D26DA40CFD06; Tue, 10 May 2022 16:24:40 +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 4BC8E1940370; Tue, 10 May 2022 16:24:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 047F3194705D for ; Tue, 10 May 2022 16:24:33 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D95E940CFD1A; Tue, 10 May 2022 16:24:32 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.19.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B970340CFD06 for ; Tue, 10 May 2022 16:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652200471; 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=3R2n0wmg8XZiHwMEvdIhZDlKBsOkZ81VsijbdK9dX2g=; b=DImDPAH4N1nYDFmkZKmqH6YlBO55rdxCanIBi0enP29XY1EugtzcyoJY9ceDPSFAaUiirk E2QzLuLDiTxOkoFQDmXGYZaSun4FOQrhzN5X0PKW+JISd/vOHPUJ+b4LIz2OqEGI4KwFXY DvOP+jwJbqJbqspeRfQmLL0+eNv3tmI= X-MC-Unique: tJ-MfRQSPPCacN1B3UScVQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v3 4/6] conf: add support for 'blob' in virtio video device Date: Tue, 10 May 2022 11:24:29 -0500 Message-Id: <20220510162431.579952-5-jjongsma@redhat.com> In-Reply-To: <20220510162431.579952-1-jjongsma@redhat.com> References: <20220510162431.579952-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1652200473465100001 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 | 6 ++++++ 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, 28 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 993c65e50b..2161cc7e30 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6198,6 +6198,12 @@ A video device. :since:`since 1.3.3` ) extends secondary bar and makes it addressable as 64bit memory. =20 + :since:`Since 8.2.0`, devices with type "virtio" have an optional ``blo= b`` + attribute that can be set to "on" or "off". Setting ``blob`` to "on" wi= ll + enable the use of blob resources in the device. This can accelerate the + display path by reducing or eliminating copying of pixel data between t= he + guest and host. + :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 60c27ddd34..ae86f455bd 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14154,6 +14154,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 @@ -26075,6 +26078,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 acd0588e9b..afa6db2403 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1763,6 +1763,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 18eb8d697d..da0ff06570 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -226,9 +226,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 2544864eb4..16b3fd9c53 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -4251,6 +4251,11 @@ + + + + + --=20 2.35.1