From nobody Tue Feb 10 04:02:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1674677836; cv=none; d=zohomail.com; s=zohoarc; b=axaqiZG1b8bapXfpFvx79vEmbHHYEhaq8BEkrHFUGXZTZ+rX7JE3szLkZTmO9EXoWxQ04CXT/JUCxQh+SH6YUj7pBi3JnO/0dMaQPJjhHQXzQk4ArMSbrZw2is3ZpPUm+1RphISA8UIJKrEn/D1B/MDCTvJsoVuS/O5OgtdwkKE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674677836; 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=O00HAtmC4iyuf+kTeqpSKoziD6rliRDsdftMEN3pMTI=; b=CtGrXLAaZJZrc8sn/kNwSPKAHzWHbGeE9IH/nwlGwmQ0YhTBRcMsBaLbmNbgZwQ7VtfX720pBZr67CxsyyPRmVi5Kk5LSUH1tmCGnoZzZyUaBrSi9uJE8e4rU7XJKg+XxVj4vUSg8Dz1UoJcRD34obHIYZ09yXyeU0KhSrp52x4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1674677836190619.9432772062527; Wed, 25 Jan 2023 12:17:16 -0800 (PST) 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-157-T4lqdMHONdmAMAgSErD4HA-1; Wed, 25 Jan 2023 15:16:22 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C18FA802534; Wed, 25 Jan 2023 20:16:13 +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 A6C3B2026D33; Wed, 25 Jan 2023 20:16:13 +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 28F1E194658D; Wed, 25 Jan 2023 20:16:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F04361946A4E for ; Wed, 25 Jan 2023 20:16:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E5C8A492B03; Wed, 25 Jan 2023 20:16:09 +0000 (UTC) Received: from himantopus.redhat.com (unknown [10.22.18.185]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC029492B01; Wed, 25 Jan 2023 20:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674677835; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=O00HAtmC4iyuf+kTeqpSKoziD6rliRDsdftMEN3pMTI=; b=is/555WrJt8zw/aumCEOxw2bPpgQgCUn4p+mMX90KmFfOizAPF+HZXElkrQGweAvjSq388 hiIsyALrWXlG+tmMK8Zhn4MnmgTY7eLC1CgSKWM6sFXZiX6KtiB7HqWVMG8qrqlqW2uFC2 R9g/7QoaSdpZ61ueiKAQUviVNZXdDSM= X-MC-Unique: T4lqdMHONdmAMAgSErD4HA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v6 6/8] conf: add support for 'blob' in virtio video device Date: Wed, 25 Jan 2023 14:16:05 -0600 Message-Id: <20230125201607.1378203-7-jjongsma@redhat.com> In-Reply-To: <20230125201607.1378203-1-jjongsma@redhat.com> References: <20230125201607.1378203-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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: , Cc: jtomko@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1674677838205100001 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 | 5 +++++ 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 fbbee99a80..59d83bdf3c 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6427,6 +6427,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 fcc65011b0..a7ee12defe 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -12865,6 +12865,9 @@ virDomainVideoModelDefParseXML(virDomainVideoDef *d= ef, if (virXMLPropUIntDefault(node, "heads", 10, VIR_XML_PROP_NONE, &def->= heads, 1) < 0) return -1; =20 + if (virXMLPropTristateSwitch(node, "blob", VIR_XML_PROP_NONE, &def->bl= ob) < 0) + return -1; + return 0; } =20 @@ -25177,6 +25180,8 @@ 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'", virTristateSwitchTypeToStri= ng(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 8890f5a3a5..5bd5c0d5e4 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1837,6 +1837,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 5559a71e14..10eeceda74 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 14044811c0..5661b930f7 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -4481,6 +4481,11 @@ + + + + + --=20 2.39.0