From nobody Mon Feb 9 19:53:05 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=1667579464; cv=none; d=zohomail.com; s=zohoarc; b=jQtFEs0KXMgdAsoejBiQvtXGI0JQvxI66bUENIhsNK5HN8peQ4bPLtGBcs8rMDuno/9ZaFOMCKkdr9GHR5nWipysuErPqgndxMEBpug2a88Fy18lewCmQj2JaqVyDwpuufNOmHmpJrp7RDxZj/9q+crFrKijUbhd6xbUKV9BtfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1667579464; 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=1+Q2tQEg04/moVOCq4xfy6KpbH0srnMMTdZQrqDYjoA=; b=iHT+jfOpCgzp0PAZNOBfyzOB6PjvzSV6FCKMemchct2X404uwM93ATyFqDkR0CLHt8ogGrPZBY9DtsTsVFP4QJcR4cHdwAAiBAWAuPg8BwwdxJyBYn6v9ZoKxSZCMJggPrkYZvGgLdvMZ06dg6HuyLhrhyuiNzX6MvIRtgxus5A= 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 1667579464077591.5777524780351; Fri, 4 Nov 2022 09:31:04 -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-544-ghWJ7mLGMuSjrXar4zN2xg-1; Fri, 04 Nov 2022 12:29:56 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 646CA965432; Fri, 4 Nov 2022 16:29: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 4FDBC4EA5C; Fri, 4 Nov 2022 16:29:52 +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 3535819465B3; Fri, 4 Nov 2022 16:29:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C3FB91946588 for ; Fri, 4 Nov 2022 16:29:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9AE4C4EA61; Fri, 4 Nov 2022 16:29:50 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.11.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 775124EA52 for ; Fri, 4 Nov 2022 16:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667579462; 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=1+Q2tQEg04/moVOCq4xfy6KpbH0srnMMTdZQrqDYjoA=; b=hjUNWtDjds3fAk2i+QCuFa5sMCfnmhjBvkPt8cIMV/x4Q98c2W6MzJ9FTfl1jzlf84WlJa zwV4UzLceRR1g692uBJyqAzsakws12R3w3LyGKt3llX4PArSjs40orhuyclI7ye5XWabii xLwS5D9t648JBMxorSqbqKs39zRIbkU= X-MC-Unique: ghWJ7mLGMuSjrXar4zN2xg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v5 4/6] conf: add support for 'blob' in virtio video device Date: Fri, 4 Nov 2022 11:29:46 -0500 Message-Id: <20221104162948.92768-5-jjongsma@redhat.com> In-Reply-To: <20221104162948.92768-1-jjongsma@redhat.com> References: <20221104162948.92768-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.5 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: 1667579464939100002 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 Reviewed-by: J=C3=A1n Tomko --- 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 e28b805009..b057fc4703 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.10.0` (QEMU driver only), devices with type "virtio" ha= ve 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 7484059e47..adbb41d19e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -12583,6 +12583,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 @@ -24623,6 +24626,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 760ad22071..9e184bef69 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1790,6 +1790,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 81f6d5dbd5..5ce795df1d 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 cefe818044..6731490061 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -4410,6 +4410,11 @@ + + + + + --=20 2.38.1