From patchwork Mon Aug 23 10:04:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12452265 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CBEFC4338F for ; Mon, 23 Aug 2021 10:06:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D058961026 for ; Mon, 23 Aug 2021 10:06:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D058961026 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:40640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mI6qa-0005yZ-2I for qemu-devel@archiver.kernel.org; Mon, 23 Aug 2021 06:06:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45724) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mI6pF-0003z8-1b for qemu-devel@nongnu.org; Mon, 23 Aug 2021 06:05:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43291) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mI6pD-00051B-8q for qemu-devel@nongnu.org; Mon, 23 Aug 2021 06:05:04 -0400 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= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-478-kbASzOY0OHmqccdtXPCM-A-1; Mon, 23 Aug 2021 06:05:01 -0400 X-MC-Unique: kbASzOY0OHmqccdtXPCM-A-1 Received: by mail-wr1-f71.google.com with SMTP id a13-20020adfed0d000000b00156fd70137aso4826590wro.8 for ; Mon, 23 Aug 2021 03:05:01 -0700 (PDT) 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=p7KAENv5pL1/C6elC4nxzP1ufroflTh3c+ZnfLcXEDII4UO3ofh8M4xcDovG19FmDk MahNCwmRcovnkeWx3FlDrmZ/6rDHX1Gd0VQb1V/5+L2IYIe7AbSwRx63YGb/ATMoaT5W 2vCgXu9NVnrg9xEAScC6slWqht9P8YjuX0hbR/zK7zNosRbHyCH5Tt09T9qYw2KNhGqF qmRzsCVA8m6AO4mSJ1Skwaegajnp0/WxAA1+xnBaLctvg2ffKl19irReHxtx/1BT09r9 jl35JM8gWOQ9gwyBzsfCG34VRtFq2QYLeX38xbT4vo1UtevsQQ2ennj2xXvU/KvF/iMS NyQw== X-Gm-Message-State: AOAM532yobEJU6OGnKfONksf330I2t9w3zbfr0tkWz4mAKRLxoRO45i7 HIDKf5em3VihYFzyoEyqDR4sfwr5uYVWHjd7S9mRjygtyd+wekJaCNF1PLlmjyDfEv5NbK/z7wo 6v8qP6ueCYTCqHbcoCfXVKZohMibxhPEHe1m8fyakIDNdSe2Eg5CL6ASUb4feHJxQ X-Received: by 2002:adf:fc45:: with SMTP id e5mr12361469wrs.127.1629713099769; 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.746, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Maxim R ." , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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=on: cannot enable blob resources 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é --- .../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 => hw/display/virtio-gpu-udmabuf-stubs.c (100%) diff --git a/stubs/virtio-gpu-udmabuf.c b/hw/display/virtio-gpu-udmabuf-stubs.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 = 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-udmabuf.c')) + virtio_gpu_ss.add(when: 'CONFIG_LINUX', if_true: files('virtio-gpu-udmabuf.c'), + if_false: files('virtio-gpu-udmabuf-stubs.c')) virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-user-gpu.c')) hw_display_modules += {'virtio-gpu': virtio_gpu_ss} 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 From patchwork Mon Aug 23 10:04:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12452267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1703FC4320A for ; Mon, 23 Aug 2021 10:06:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D48816121E for ; Mon, 23 Aug 2021 10:06:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D48816121E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:41136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mI6qm-0006IQ-3e for qemu-devel@archiver.kernel.org; Mon, 23 Aug 2021 06:06:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mI6pN-00049o-5c for qemu-devel@nongnu.org; Mon, 23 Aug 2021 06:05:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48327) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mI6pH-00054v-58 for qemu-devel@nongnu.org; Mon, 23 Aug 2021 06:05:12 -0400 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= 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-516-DCqkG2gBNYCuttypFv68Jw-1; Mon, 23 Aug 2021 06:05:05 -0400 X-MC-Unique: DCqkG2gBNYCuttypFv68Jw-1 Received: by mail-wm1-f70.google.com with SMTP id i204-20020a1c22d5000000b002e74466ad9bso2379325wmi.4 for ; Mon, 23 Aug 2021 03:05:05 -0700 (PDT) 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=ZBY4tmlrfuLACeDB0rzF1g4Kk3tGisJdb5MwGuV4oWX0sTdxtTPvjc5SbGP1wFHeri 63JezeoPQn1BuGjUDbhdi0fa298/zicLZ+Vx0Sgt+3n0Us9ZNTt/4HL3ugi+OrSHgFH8 Jq1umHbO7kGoPpThgyFheFkHWTh22Q4rVWBLbPWGc6lDVUqgUV7XSdK+0z3tBSw5NO8m oMkayOZr67UNHCrbwwhkp6BaJXEmb6jVT4jsO4exNWBAyVoLH+PLaK0P0zsCJCnhnIOU Zi31c15gnKgruTzdB/qv7UYc6neyl6YSdN+D7uaXlJVCl3FOKtjrpP9tmOyZCbBm++ki DTUg== X-Gm-Message-State: AOAM533IItLZXwuqXQE1W92H/kC8qXBCzf9jWaIgYVeJmLwKGB4qxoG0 LffZTzYtYiSKGdx0xOSd2WCu7JnR+FIt3M4ZGoizL6vT3zsDK2DE8GM+Ji0EDnJJsskj+HWIcyf bD14sgqV8E7gidEJT7DY17sqM47KdRsk/vWuIgFoGv3Sj8NNIn7m9J/9YoheQXIVl X-Received: by 2002:adf:ec8b:: with SMTP id z11mr77266wrn.122.1629713104060; 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.746, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Maxim R ." , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- 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); +#ifdef CONFIG_LINUX /* udmabuf.c */ int udmabuf_fd(void); +#endif #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" -#ifdef CONFIG_LINUX - #include #include @@ -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')) -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')) vnc_ss = ss.source_set()