From nobody Sun May 5 20:00:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@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 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629713103; cv=none; d=zohomail.com; s=zohoarc; b=c+BpxbrVRJI+xX8ggIStba8CE2fnvr1FVrcsTf8kH8AMnigwkpJo6DbvQopKH3MutLdugUxktu7B+iBGTpMPefyQ516uNRR6nqGa5zYsTFGxWagFy059KnUz9qGYttJobp15MXpBDV3C/IjmCcdUmVXIKr+p64i119S8tdZav2M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629713103; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=x3MNa52CjStDNo7Dg9qJDNMNu1i98ikPvkmb0ZODO0I=; b=EkBslJwTknpP6m5ZO73SMRMpNgj5zq+vjcbrl+w3VX7e4FYUZdJEUqd9V229j0clGTzdfn50fnFiR3EfgzBczZzezU6pfwWEK3aebdiRl+b0CQu6U2KSgcED98dOBRQ8m3ohbLFl5wPxwtJXc3v8lIDFLnSR3kSI6XXQVQtVMdc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1629713103892314.409555226571; Mon, 23 Aug 2021 03:05:03 -0700 (PDT) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-447-8HNE_G9iPi-jtN6LIf96AQ-1; Mon, 23 Aug 2021 06:05:01 -0400 Received: by mail-wm1-f70.google.com with SMTP id h1-20020a05600c350100b002e751bf6733so303132wmq.8 for ; Mon, 23 Aug 2021 03:05:00 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id b18sm14621051wrr.89.2021.08.23.03.04.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 03:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629713102; 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=x3MNa52CjStDNo7Dg9qJDNMNu1i98ikPvkmb0ZODO0I=; b=KAU4b4lAxk0Yn5QPNHH1TVtRomDij0BPfqOXdMoOwLKvWpPxu84qU/E6BR62yoZN8O/4vD Ehtn8p9L2aJSPwrvBAeNYikWe0omoqnrUnq2Np5dGZUGwfx8c9swIwO3g9R/kNX1JQoA2n ZR/GDmREfPDOqKnyqG/UZpMvA6ysEtM= X-MC-Unique: 8HNE_G9iPi-jtN6LIf96AQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x3MNa52CjStDNo7Dg9qJDNMNu1i98ikPvkmb0ZODO0I=; b=n0VdTNxcgtH3SZPwRfPIVW9Mb6XNBt23CDCmyB4KRl1Loc5Hnfq8d1e+qjO4K8vi1V cRVp9myi/ZZc6YSkJNOhs48ODbI721FsRnHovSM8VhsWVQrayzpkWjpAeybLu/yDzCDt MYN3vB+tFnL5iD62kZP8atJs99iYdDBH0jRHYK75e6RYhmj9b9PVdH8NVg+tzoxdFcRC /M/TRN/Og5XgrQSFYAt7So7PScllp46i92xcR+TGxYlue2KQunJvy+z7st3TV5pnpYPM Me84MUtPsPaa5XeTHEi4JTz9M5jDDFMnriXCcBCIXi6yFxEKattrX+64vH/Hv+VOBHII Kvwg== X-Gm-Message-State: AOAM5315t8LzLE7hcPeqrnIE8UrUictBOQslDT6Z8eX5VIawRWgyHyjk UCHM4a56Np+B3QWFbw49aaBzgvcvOP6vcnFtDHCnRBeGdL8tniTsshyfAQQyYyX8zJITqyg/5nk mjIukuHtoxouRKQ== X-Received: by 2002:adf:fc45:: with SMTP id e5mr12361460wrs.127.1629713099699; Mon, 23 Aug 2021 03:04:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgfaIKWWOOcZaqO6LfhJ6ygV0aqL+WrvXT6WWC2NRZHhqW3M0V7TUBEbH2xf4QkCRX8xKVPg== X-Received: by 2002:adf:fc45:: with SMTP id e5mr12361446wrs.127.1629713099556; Mon, 23 Aug 2021 03:04:59 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , "Maxim R ." , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/2] hw/display: Restrict virtio-gpu-udmabuf stubs to !Linux Date: Mon, 23 Aug 2021 12:04:53 +0200 Message-Id: <20210823100454.615816-2-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210823100454.615816-1-philmd@redhat.com> References: <20210823100454.615816-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com 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: 1629713104997100001 When using qemu configured with --enabled-modules, the generic stubs are used instead of the module symbols: qemu-system-x86_64: -device virtio-vga,blob=3Don: cannot enable blob reso= urces without udmabuf Restrict the stubs to Linux and only link them when CONFIG_VIRTIO_GPU is disabled (only the modularized version is available when it is enabled). Reported-by: Maxim R. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/553 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- .../display/virtio-gpu-udmabuf-stubs.c | 0 hw/display/meson.build | 3 ++- stubs/meson.build | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) rename stubs/virtio-gpu-udmabuf.c =3D> hw/display/virtio-gpu-udmabuf-stubs= .c (100%) diff --git a/stubs/virtio-gpu-udmabuf.c b/hw/display/virtio-gpu-udmabuf-stu= bs.c similarity index 100% rename from stubs/virtio-gpu-udmabuf.c rename to hw/display/virtio-gpu-udmabuf-stubs.c diff --git a/hw/display/meson.build b/hw/display/meson.build index 1e6b707d3c0..861c43ff984 100644 --- a/hw/display/meson.build +++ b/hw/display/meson.build @@ -56,7 +56,8 @@ virtio_gpu_ss =3D ss.source_set() virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_GPU', if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c'), = pixman]) - virtio_gpu_ss.add(when: 'CONFIG_LINUX', if_true: files('virtio-gpu-udmab= uf.c')) + virtio_gpu_ss.add(when: 'CONFIG_LINUX', if_true: files('virtio-gpu-udmab= uf.c'), + if_false: files('virtio-gpu-udma= buf-stubs.c')) virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-u= ser-gpu.c')) hw_display_modules +=3D {'virtio-gpu': virtio_gpu_ss} =20 diff --git a/stubs/meson.build b/stubs/meson.build index d3fa8646b38..3d7cfac608e 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -53,7 +53,6 @@ stub_ss.add(files('semihost.c')) stub_ss.add(files('usb-dev-stub.c')) stub_ss.add(files('xen-hw-stub.c')) - stub_ss.add(files('virtio-gpu-udmabuf.c')) else stub_ss.add(files('qdev.c')) endif --=20 2.31.1 From nobody Sun May 5 20:00:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@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 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629713108; cv=none; d=zohomail.com; s=zohoarc; b=ErspuxvVL7wUGy4GkuonnhDkSH3JbWxVPXWynyzxvmGqFeGkmwDxku3XBsHKvKiaMrCKJZ+YDl2hOdA0qE2qRcGOIx0Wj++7aH5jAKqVrv8t8u15pc/evsXPB2tlU8e6yHYFPi1opWGT8eVeF9I6eSJ9ODmI16a2lxiPQ0kQDUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629713108; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=Wfc/4Gz2Hjk+FPq0SDNJe+8m9GY+Hogbg+U7zMPUhXc=; b=hUpeM5r+3UXNxIsdySmKkT2EN3DLWsc+jInviguQrCU86ffeuphUiRZbACqsXGVXtaJHtFv3BI78o7kE2mPy2Vu4ZE+oGBDbvXCr+CTrBiFxGVbzeDsK/ui8N/m4BObKG03QvbC0IVI07ib67Re/GdIkxT5kmkBG6PKONL3MPAk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1629713108066160.0994951294291; Mon, 23 Aug 2021 03:05:08 -0700 (PDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-323-R0ewnlp_P-OoafXjFVtsFg-1; Mon, 23 Aug 2021 06:05:05 -0400 Received: by mail-wm1-f72.google.com with SMTP id n20-20020a05600c4f9400b002e6dc6a99b9so4269071wmq.1 for ; Mon, 23 Aug 2021 03:05:05 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id y21sm2834538wmc.11.2021.08.23.03.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 03:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629713106; 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=Wfc/4Gz2Hjk+FPq0SDNJe+8m9GY+Hogbg+U7zMPUhXc=; b=D2MV/a1PD0YbZRjPiXrFUBDVvGBIrH76Mv2/Cn3ZsfZTEB6poYZDAV8YHzVuN2BN53AORy Lr69+frokmr4R41GufmN34hUTa3VP4RloMt13jwEVR54ZBKsB3EaUPJRijyukPI3ZVReGF LkEDSNF+fdH8RUh6FVfjqETKjzEsDdI= X-MC-Unique: R0ewnlp_P-OoafXjFVtsFg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Wfc/4Gz2Hjk+FPq0SDNJe+8m9GY+Hogbg+U7zMPUhXc=; b=YIVzSejrGjxkVKfiXZsJbnUUDaA/lUqydfHR3VoQPmybdERFZThMVctDY1JgM1oxPM dXJCUnjlOQE+oNLCrRJcWTyrlnxHccaBQymx0SiFCN51v7Q4MzX6DlwIIDmG0CwJ09My 1WNCmQqYrC4g2/cScnJy+oR+f1GqFBKtfolNprqFPCom+gO5bjbdD7fG3Z7e9gD7nw6T wp/z70fFHa8umaPPZjC58H2ZyaUgZhJ4phVJjVTit99+vsiG0UEZbvMTTLAmneC+nRQ4 3hecEUpKaEsRJRbz+JBuEhglKbvCN1EgsP8kl7wdq+D0UDYWjfWUj+kLIMAUTdXeQjYu rdeg== X-Gm-Message-State: AOAM531M+6xB0RI6WMe/mJ6d9T/hDvhpAAkHYyzOsSKgfljESByBTgDi qfGMt86Cqzrjw1+Ud6RbFU9itAaoL/cKw2zzxkYgkQXLUIWu0eZ6n0ridWcLenK7RoO6mobgO2O 1j3E2xUjtnjrjIw== X-Received: by 2002:adf:ec8b:: with SMTP id z11mr77262wrn.122.1629713104027; Mon, 23 Aug 2021 03:05:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTwrzVGPd0AsTzwGc+tS+6zMpBm9A8ymguDPudIDhmKaEke68cLC9EEidpdz2+/Ev45L4dyg== X-Received: by 2002:adf:ec8b:: with SMTP id z11mr77245wrn.122.1629713103906; Mon, 23 Aug 2021 03:05:03 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , "Maxim R ." , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/2] ui/console: Restrict udmabuf_fd() to Linux Date: Mon, 23 Aug 2021 12:04:54 +0200 Message-Id: <20210823100454.615816-3-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210823100454.615816-1-philmd@redhat.com> References: <20210823100454.615816-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com 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: 1629713109628100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/ui/console.h | 2 ++ ui/udmabuf.c | 11 ----------- ui/meson.build | 6 ++++-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index b30b63976a5..3be21497a2e 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -471,7 +471,9 @@ bool vnc_display_reload_certs(const char *id, Error **= errp); /* input.c */ int index_from_key(const char *key, size_t key_length); =20 +#ifdef CONFIG_LINUX /* udmabuf.c */ int udmabuf_fd(void); +#endif =20 #endif diff --git a/ui/udmabuf.c b/ui/udmabuf.c index 23abe1e7eb9..cebceb26100 100644 --- a/ui/udmabuf.c +++ b/ui/udmabuf.c @@ -8,8 +8,6 @@ #include "qapi/error.h" #include "ui/console.h" =20 -#ifdef CONFIG_LINUX - #include #include =20 @@ -29,12 +27,3 @@ int udmabuf_fd(void) } return udmabuf; } - -#else - -int udmabuf_fd(void) -{ - return -1; -} - -#endif diff --git a/ui/meson.build b/ui/meson.build index a3a187d633a..7d25c1b95b5 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -12,12 +12,14 @@ 'kbd-state.c', 'keymaps.c', 'qemu-pixman.c', - 'udmabuf.c', )) softmmu_ss.add([spice_headers, files('spice-module.c')]) softmmu_ss.add(when: spice_protocol, if_true: files('vdagent.c')) =20 -softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('input-linux.c')) +softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files( + 'input-linux.c', + 'udmabuf.c', +)) softmmu_ss.add(when: cocoa, if_true: files('cocoa.m')) =20 vnc_ss =3D ss.source_set() --=20 2.31.1