From patchwork Sun Mar 12 14:50:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 20838 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91F9DC6FA99 for ; Sun, 12 Mar 2023 14:51:03 +0000 (UTC) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by mx.groups.io with SMTP id smtpd.web10.67839.1678632660069006938 for ; Sun, 12 Mar 2023 07:51:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ctF6Ldp6; spf=pass (domain: gmail.com, ip: 209.85.208.52, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f52.google.com with SMTP id x3so38951512edb.10 for ; Sun, 12 Mar 2023 07:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678632658; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8yghyqyGu/tx6039smy4Qk23+TdY491zJTNDBpEla5w=; b=ctF6Ldp6EVd49VOL74VyqGIbw880Q4BQUQDqVrFeDIasYujtbMgNXJ4EgxH2Bacibt pibnCVgXqDm8ACew9WX+zsZCyljlXY1jkNvFngv4oP6TZEqPi9CYtKjqAjkGcBjGkqzp DxUiJg9g/P+S4bzKM8+GrI6VkWGM7dPIBzuyJh2Mk6VkCX6fIWS1H+6YcAMT9m85mzXN TjDIfZfa/1/++6lN5OwZqGFVTtL427QSJ1XiEtPZ3V29Lxc3u99Jfalckc4lSId1qt2E kUPCSIE4nqvUiboe+nNuRog0BkcMj8zm84NYKbInWnrQp/Kd2qpffD3YYEUWRvCHZEjn y83A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678632658; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8yghyqyGu/tx6039smy4Qk23+TdY491zJTNDBpEla5w=; b=MdrpNse6W6gsHKIZORecRUBq8lPYWKIWX89bK1v8ppUBFXMN3MxQ68baPI/VdUrpKn KNnX5ucooRPlih3VKpS4J/FvxqFr1gpJRIe0gI7ni5nNQuxC6z53cyYE1UQjGSlCVYIQ I+WHFEZxDSpLhpoBSao5wSji3dGK64eTtZ0Zkws+ZNxHXhoUwCwHuUEmeu1/gJ7zDM0O nUn5RQtYrRGPITd9p/AUGBR5aXjq3D/FX1NMUH63YCGNvQIz8sAt0lKTpZvHyuJ84TFW 4gpM39NvVxe6+3Amyn8aF/GgRBzsso1yqCRyUr5ltHXDJ6MaMfwY38qygdXDcwBoWTXW pGaQ== X-Gm-Message-State: AO0yUKWQ9TJjyT9tM3zwmNw1Y0YSA+b1yRPP7FpTfkxxOfFH/V0S52gt BLyjp8oCG7PIcdpYqAtyoD8zfzkNlBU= X-Google-Smtp-Source: AK7set/SgT1TwkHUBYv6dNbtmDyDCodYsH+RtOgt4rbuV+JKIoDGDrItZ0+DdH9m3G0sU7G8uQbbiA== X-Received: by 2002:a17:907:2ce1:b0:8b1:32dd:3af with SMTP id hz1-20020a1709072ce100b008b132dd03afmr42579964ejc.28.1678632658052; Sun, 12 Mar 2023 07:50:58 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id l22-20020a50d6d6000000b004fa19f5ba99sm2012255edj.79.2023.03.12.07.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 07:50:57 -0700 (PDT) From: Alexander Kanavin X-Google-Original-From: Alexander Kanavin To: openembedded-core@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 1/7] runqemu: direct mesa to use its own drivers, rather than ones provided by host distro Date: Sun, 12 Mar 2023 15:50:47 +0100 Message-Id: <20230312145053.1427377-1-alex@linutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 12 Mar 2023 14:51:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178392 With mesa 23.0, it is not longer possible to use the host drivers, as mesa upstream has added strict checks for matching builds between drivers and libraries that load them. Signed-off-by: Alexander Kanavin --- scripts/runqemu | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/scripts/runqemu b/scripts/runqemu index 58b0c191e1..8e915f3d4c 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -447,30 +447,7 @@ class BaseConfig(object): self.set("MACHINE", arg) def set_dri_path(self): - # As runqemu can be run within bitbake (when using testimage, for example), - # we need to ensure that we run host pkg-config, and that it does not - # get mis-directed to native build paths set by bitbake. - env = os.environ.copy() - try: - del env['PKG_CONFIG_PATH'] - del env['PKG_CONFIG_DIR'] - del env['PKG_CONFIG_LIBDIR'] - del env['PKG_CONFIG_SYSROOT_DIR'] - except KeyError: - pass - try: - dripath = subprocess.check_output("PATH=/bin:/usr/bin:$PATH pkg-config --variable=dridriverdir dri", shell=True, env=env) - except subprocess.CalledProcessError as e: - raise RunQemuError("Could not determine the path to dri drivers on the host via pkg-config.\nPlease install Mesa development files (particularly, dri.pc) on the host machine.") - self.qemu_environ['LIBGL_DRIVERS_PATH'] = dripath.decode('utf-8').strip() - - # This preloads uninative libc pieces and therefore ensures that RPATH/RUNPATH - # in host mesa drivers doesn't trick uninative into loading host libc. - preload_items = ['libdl.so.2', 'librt.so.1', 'libpthread.so.0'] - uninative_path = os.path.dirname(self.get("UNINATIVE_LOADER")) - if os.path.exists(uninative_path): - preload_paths = [os.path.join(uninative_path, i) for i in preload_items] - self.qemu_environ['LD_PRELOAD'] = " ".join(preload_paths) + self.qemu_environ['LIBGL_DRIVERS_PATH'] = os.path.join(self.bindir_native, '../lib/dri') def check_args(self): for debug in ("-d", "--debug"): From patchwork Sun Mar 12 14:50:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 20843 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BADB7C7618E for ; Sun, 12 Mar 2023 14:51:03 +0000 (UTC) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by mx.groups.io with SMTP id smtpd.web11.67634.1678632660279093737 for ; Sun, 12 Mar 2023 07:51:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XPooPkwj; spf=pass (domain: gmail.com, ip: 209.85.208.41, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f41.google.com with SMTP id o12so39012830edb.9 for ; Sun, 12 Mar 2023 07:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678632659; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dfy/m96DG6ez6Iq+FjvGez6muQQ1jtnqLBaL861crpY=; b=XPooPkwjItqra50WtrDlhfIZPPZOLEqlcamSgplTuhz30ArsHyUEKstZJrSw5tFMRd KGWC84IQHTjx+BHJFVv+sNRqwb6+NyjA0KB3NdsiSQADclulhwouPsplyDDTgROPivlR hzxVG08G0f8ixMkHbc08IyDnq0GEUHMWNNOuarTKdhnYJ2VQo+kODphHtZfYhE6cCSUE 2F+wSFjckNeU1bm6lGH6ULN+cBeg+FbPGlWpCKUeqmsjjFPMMYR7FF6qVls3brzGJEKe E3x6/ARiQuiDVTq5Kg/mNOHoFjPblCBl5z5zOEGbwF3U6nxMN7HSYAV2fe6smZbZ9nBU H7ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678632659; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dfy/m96DG6ez6Iq+FjvGez6muQQ1jtnqLBaL861crpY=; b=Wbd9a0Hx60DejKpEWEuJeRQJJ4qKJ4WQku+YbqJbROw2IHq01DBL94601hqXWrIDmf WqfDxAJpITUF1cYR0dTKpu+AuZuybieHvlGFaB0H4Nh0yOZKFdF/A3sIq5sC0hjlPvLG dEodci6/+AkB8/t8FBGoCeN343/eNvFUYG/cAnGX5A6qWv69SeP62f0qksQ2PbBZ4NuE c8+deS6AUnTq1dXgV29743X6NjlWJrm4b+z5TBAvzpZAnWIY/6dxk5PWyFOVZieS8rlv swIUZWKhT3Sh/aHhpr1DKDWYcGIw9X8EmGvNjHd+Kow2VQinxS69WTr0abN4W5X1nH8G ITJA== X-Gm-Message-State: AO0yUKW+t+NhbdBWZF9N+klF1nfLYF04eMfh4oXVRc6y8v/TQxAGh1F6 rydLhDGBdwRjsL1+LoToBYmSMGXK8j8= X-Google-Smtp-Source: AK7set+YTdgWFhadMkeUXSj4bwhrFHN5rWMrMUnMeFYX3z5YeJ12p5Bmk2USTo6BZOWI0LONOnEV4A== X-Received: by 2002:a17:906:4fd5:b0:8b1:78b8:4208 with SMTP id i21-20020a1709064fd500b008b178b84208mr35790312ejw.1.1678632658555; Sun, 12 Mar 2023 07:50:58 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id l22-20020a50d6d6000000b004fa19f5ba99sm2012255edj.79.2023.03.12.07.50.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 07:50:58 -0700 (PDT) From: Alexander Kanavin X-Google-Original-From: Alexander Kanavin To: openembedded-core@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 2/7] bitbake.conf: do not set native opengl distro feature from target Date: Sun, 12 Mar 2023 15:50:48 +0100 Message-Id: <20230312145053.1427377-2-alex@linutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230312145053.1427377-1-alex@linutronix.de> References: <20230312145053.1427377-1-alex@linutronix.de> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 12 Mar 2023 14:51:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178393 This makes native opengl (and thus accelerated graphics in qemu) opt-in; the reason is that latest mesa tightly couples hardware drivers with its libraries, so we have to build both in mesa-native. Doing so significantly lengthens the builds, and so cannot be imposed by default. Add a check and a hint to runqemu so that there is a helpful error when there is no native/nativesdk opengl/virgl support. Signed-off-by: Alexander Kanavin --- meta/conf/bitbake.conf | 4 ++-- meta/lib/oeqa/selftest/cases/runtime_test.py | 4 ++-- scripts/runqemu | 11 ++++++++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index afd9e2f552..d1dc428583 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -912,8 +912,8 @@ DISTRO_FEATURES_NATIVESDK ?= "x11" # Normally target distro features will not be applied to native builds: # Native distro features on this list will use the target feature value -DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod opengl wayland" -DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod opengl wayland" +DISTRO_FEATURES_FILTER_NATIVE ?= "api-documentation debuginfod wayland" +DISTRO_FEATURES_FILTER_NATIVESDK ?= "api-documentation debuginfod wayland" DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit gobject-introspection-data ldconfig" MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode" diff --git a/meta/lib/oeqa/selftest/cases/runtime_test.py b/meta/lib/oeqa/selftest/cases/runtime_test.py index 81b8d056cc..661c09c109 100644 --- a/meta/lib/oeqa/selftest/cases/runtime_test.py +++ b/meta/lib/oeqa/selftest/cases/runtime_test.py @@ -232,7 +232,7 @@ class TestImage(OESelftestTestCase): if 'sdl' not in qemu_packageconfig: features += 'PACKAGECONFIG:append:pn-qemu-system-native = " sdl"\n' if 'opengl' not in qemu_distrofeatures: - features += 'DISTRO_FEATURES:append = " opengl"\n' + features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n' features += 'TEST_SUITES = "ping ssh virgl"\n' features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n' features += 'IMAGE_INSTALL:append = " kmscube"\n' @@ -264,7 +264,7 @@ class TestImage(OESelftestTestCase): qemu_distrofeatures = get_bb_var('DISTRO_FEATURES', 'qemu-system-native') features = 'IMAGE_CLASSES += "testimage"\n' if 'opengl' not in qemu_distrofeatures: - features += 'DISTRO_FEATURES:append = " opengl"\n' + features += 'DISTRO_FEATURES_NATIVE:append = " opengl"\n' features += 'TEST_SUITES = "ping ssh virgl"\n' features += 'IMAGE_FEATURES:append = " ssh-server-dropbear"\n' features += 'IMAGE_INSTALL:append = " kmscube"\n' diff --git a/scripts/runqemu b/scripts/runqemu index 8e915f3d4c..9f82aa12f1 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -447,7 +447,16 @@ class BaseConfig(object): self.set("MACHINE", arg) def set_dri_path(self): - self.qemu_environ['LIBGL_DRIVERS_PATH'] = os.path.join(self.bindir_native, '../lib/dri') + drivers_path = os.path.join(self.bindir_native, '../lib/dri') + if not os.path.exists(drivers_path) or not os.listdir(drivers_path): + raise RunQemuError(""" +qemu has been built without opengl support and accelerated graphics support is not available. +To enable it, add: +DISTRO_FEATURES_NATIVE:append = " opengl" +DISTRO_FEATURES_NATIVESDK:append = " opengl" +to your build configuration. +""") + self.qemu_environ['LIBGL_DRIVERS_PATH'] = drivers_path def check_args(self): for debug in ("-d", "--debug"): From patchwork Sun Mar 12 14:50:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 20842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACD19C7618D for ; Sun, 12 Mar 2023 14:51:03 +0000 (UTC) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by mx.groups.io with SMTP id smtpd.web10.67840.1678632660722832281 for ; Sun, 12 Mar 2023 07:51:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=L089oOzz; spf=pass (domain: gmail.com, ip: 209.85.208.46, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f46.google.com with SMTP id cn21so8835657edb.0 for ; Sun, 12 Mar 2023 07:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678632659; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E2JulSsT0PkuDB3bP33TEJAHOSVx6nPyWIVUQptsZ5U=; b=L089oOzzLbI7+AdYi+EnvfrtR0v0PsivLtKlHi50QAaSgEqc9jQXQKyqVcwvj5nSsu sk7LNP9nl/ao86TyTQ+xsfA+II1hiR1r9oRFUVNSe7Jkjb9Rc5/A+xjmntNH0ZokfHTE Z/0P5upZhfa8toTdiKDBnJyvXUt5EaL3xgFqMfJb7ac7q1IQyCs5LI1KbOtZw0oVO2Rp /3RZs7yuScFHKTQhuNya18QWOqQuNgWNvha9Rd11lOkmsfxeGQLsG8ANQoyPwM/im4Yv r5dPGxkBqkHy67V6nHQdzeg0W5T+4H2dmpZpeVo1fP4um9lMAQ1KXT0Kh2b+6KRHGMjg pjzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678632659; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E2JulSsT0PkuDB3bP33TEJAHOSVx6nPyWIVUQptsZ5U=; b=b4XU3VYtJD7qVHqeZVb5ODxgUCdWLUi65F/xGABuSZIjwPSbgN/fcdZ4gdcQeYbJZx b/AyVo0hj6TNe0DutT2m/rijXCe8tYq7Jg1gCgcxDKy8VCti1CHamjFKU6MjOcGMUcKZ 5C72bbHvGQlh/n9qhXyu+OrF8TqQPPtJOjAhg+u8ORglPcLd8rdzpQ7SrL6zsk/oO/99 fGo09elAJnJNVcwDx8ED8QK7UHz5vuhfK3PpBbDsrEs0rGOj96euc594XWfsoXBRdpCP 6A5CAcVL+GRXD8Nbr3beWwK4pjFhgnGHVyweCV/qHXfYy29HpKuF3Awb2rZ40ZG/6eOq Bfdw== X-Gm-Message-State: AO0yUKUeL/Day9ZcgwM2QMO3uR6g5+yXw7DfcwBgrU9hAUILHYKUVlx5 iQS9JBq5XlINZMCC8mlo0RyBG+2pgnI= X-Google-Smtp-Source: AK7set/+2GF54akPo1JuehIjPqSMx+A9npuUDofXOaFGDDgjow+j7jL7CJlG69Y1ojyVndwtjJ73qQ== X-Received: by 2002:a05:6402:502:b0:4fb:78a0:eabe with SMTP id m2-20020a056402050200b004fb78a0eabemr2540081edv.14.1678632659085; Sun, 12 Mar 2023 07:50:59 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id l22-20020a50d6d6000000b004fa19f5ba99sm2012255edj.79.2023.03.12.07.50.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 07:50:58 -0700 (PDT) From: Alexander Kanavin X-Google-Original-From: Alexander Kanavin To: openembedded-core@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 3/7] mesa: allow mesa-native/nativesdk only subject to opengl/vulkan DISTRO_FEATURE Date: Sun, 12 Mar 2023 15:50:49 +0100 Message-Id: <20230312145053.1427377-3-alex@linutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230312145053.1427377-1-alex@linutronix.de> References: <20230312145053.1427377-1-alex@linutronix.de> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 12 Mar 2023 14:51:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178394 This prevents accidental builds of it when native/nativesdk opengl is not actually enabled (which may cause undesirable lengthening of dependency chains or build failures because those dependencies don't enable options required for mesa). Signed-off-by: Alexander Kanavin --- meta/recipes-graphics/mesa/mesa.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index c0b8f65625..775aab9297 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -51,7 +51,7 @@ inherit meson pkgconfig python3native gettext features_check BBCLASSEXTEND = "native nativesdk" -ANY_OF_DISTRO_FEATURES:class-target = "opengl vulkan" +ANY_OF_DISTRO_FEATURES = "opengl vulkan" PLATFORMS ??= "${@bb.utils.filter('PACKAGECONFIG', 'x11 wayland', d)}" From patchwork Sun Mar 12 14:50:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 20840 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6661C6FD1F for ; Sun, 12 Mar 2023 14:51:03 +0000 (UTC) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by mx.groups.io with SMTP id smtpd.web11.67635.1678632661186513148 for ; Sun, 12 Mar 2023 07:51:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gnq3DQ+4; spf=pass (domain: gmail.com, ip: 209.85.208.50, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f50.google.com with SMTP id o12so39012886edb.9 for ; Sun, 12 Mar 2023 07:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678632659; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q4N+AQ3L8QTnwHRbrY4LEFCfR5tJfxor1ui4lAHYoFA=; b=gnq3DQ+48aN4eExwidjP5SPqgsQhanw9SzJXPUP3UFNCCEGMi389B/SpwkwLMS6hh5 JCLoB2uClwRWAErHU9BpKcnR0lN3RjWM6Y+p7RG++xp5RCfEn1NwDOGavr3olz1DqaPK RjOvz1lalTbMi8JpogJUK/+vaCuTYQlTFZbg7UU6gpaLv8J0bw7QyOK7XCCAuvR9EXZl FY2P51Uf0y5AQeWsalkN1ijJLdIRVT1dIMmiiWIaMRvRpyAF99fLtFdpP8y92Jpde/Vu U3+aTn9hZn7BhjnP24F+6w2plNuXkZ5GMt4l6f4MdYdo2NkJc/V17BJTMqdqW2fYLbdX FEkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678632659; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q4N+AQ3L8QTnwHRbrY4LEFCfR5tJfxor1ui4lAHYoFA=; b=MkP5xr66qN76LpTz6nva7kP3uk0ePyXhKkbqeX8sMtUFdZhKesncVKOrXshoow2kQ1 eaStxlRuTQbphPQnzqWg4xp4jARYHJ4YU4YNhyaOWy8uq1jy15LGa8jwWlTWEuyf/Cto Y4p0yVhWTXzRsD91USD+f0M4NBf28qk9KvH1E8WrnbYXe71eo1ED6Z/Aaoq6trhTPHga lisGjZcgn2SnkR/phWXI/AsHIFPDdlvrkhuRc3VNEb0fqUlrY5YBu5SQYEfD/Xa/0qXo 19w/OcPU6rRPz5eUknqWTStsMcnUnLdIkUX9C+IorepnYb/nMlWNnhwzV9ofG2qHlsNs W6Dw== X-Gm-Message-State: AO0yUKVgXNOe/xjJD2k9R98l8rAqmF2UkUzEbVJR4H+/ZTRe30Z9yDV4 xQMMapASczXRrkFX2x83q0ndhSD9vkE= X-Google-Smtp-Source: AK7set9lwbcotSjkD1KXP4/WY71AK/3Isx7czPafWULCEpP+eJckKhRUdKgK6nZOdXFnXZB9Iam+aA== X-Received: by 2002:a17:907:7a86:b0:91f:f1b7:3673 with SMTP id mm6-20020a1709077a8600b0091ff1b73673mr5088129ejc.15.1678632659661; Sun, 12 Mar 2023 07:50:59 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id l22-20020a50d6d6000000b004fa19f5ba99sm2012255edj.79.2023.03.12.07.50.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 07:50:59 -0700 (PDT) From: Alexander Kanavin X-Google-Original-From: Alexander Kanavin To: openembedded-core@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 4/7] mesa: enable a rich set of drivers for native builds Date: Sun, 12 Mar 2023 15:50:50 +0100 Message-Id: <20230312145053.1427377-4-alex@linutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230312145053.1427377-1-alex@linutronix.de> References: <20230312145053.1427377-1-alex@linutronix.de> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 12 Mar 2023 14:51:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178395 Without this, the only available driver would be swrast (without llvmpipe) which is far too slow to be practical, and so qemu wouldn't be able to perform accelerated graphics. Note that mesa-native itself is guarded by presence of 'opengl' in DISTRO_FEATURES_NATIVE, so building it is entirely opt-in. The one major dependency is llvm-native which takes just under three minutes on my machine. Signed-off-by: Alexander Kanavin --- meta/recipes-graphics/mesa/mesa.inc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index 775aab9297..f06c1a31da 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -89,6 +89,8 @@ PACKAGECONFIG = " \ ${@bb.utils.contains('LICENSE_FLAGS_ACCEPTED', 'commercial', 'video-codecs', '', d)} \ " +PACKAGECONFIG:append:class-native = "gallium-llvm r600" + # "gbm" requires "opengl" PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled" @@ -102,8 +104,8 @@ PACKAGECONFIG[dri3] = "-Ddri3=enabled, -Ddri3=disabled, xorgproto libxshmfence" # Vulkan drivers need dri3 enabled # amd could be enabled as well but requires gallium-llvm with llvm >= 3.9 VULKAN_DRIVERS = "" -VULKAN_DRIVERS:append:x86:class-target = ",intel" -VULKAN_DRIVERS:append:x86-64:class-target = ",intel" +VULKAN_DRIVERS:append:x86 = ",intel" +VULKAN_DRIVERS:append:x86-64 = ",intel" VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broadcom', '', d)}" PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers" @@ -149,8 +151,8 @@ PACKAGECONFIG[zink] = "" GALLIUMDRIVERS = "swrast" # gallium swrast was found to crash Xorg on startup in x32 qemu GALLIUMDRIVERS:x86-x32 = "" -GALLIUMDRIVERS:append:x86:class-target = ",i915,iris,crocus" -GALLIUMDRIVERS:append:x86-64:class-target = ",i915,iris,crocus" +GALLIUMDRIVERS:append:x86 = ",i915,iris,crocus" +GALLIUMDRIVERS:append:x86-64 = ",i915,iris,crocus" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', ',etnaviv', '', d)}" GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'freedreno', ',freedreno', '', d)}" @@ -162,8 +164,8 @@ GALLIUMDRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'zink', ',zink', ' # radeonsi requires LLVM GALLIUMDRIVERS_RADEONSI = "${@bb.utils.contains('PACKAGECONFIG', 'r600', ',radeonsi', '', d)}" GALLIUMDRIVERS_LLVM = "r300,nouveau${GALLIUMDRIVERS_RADEONSI}" -GALLIUMDRIVERS_LLVM:append:x86:class-target = ",svga" -GALLIUMDRIVERS_LLVM:append:x86-64:class-target = ",svga" +GALLIUMDRIVERS_LLVM:append:x86 = ",svga" +GALLIUMDRIVERS_LLVM:append:x86-64 = ",svga" PACKAGECONFIG[r600] = "" PACKAGECONFIG[virgl] = "" From patchwork Sun Mar 12 14:50:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 20839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98136C74A5B for ; Sun, 12 Mar 2023 14:51:03 +0000 (UTC) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by mx.groups.io with SMTP id smtpd.web10.67841.1678632661628457247 for ; Sun, 12 Mar 2023 07:51:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dngV73wG; spf=pass (domain: gmail.com, ip: 209.85.208.52, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f52.google.com with SMTP id g10so10147392eda.1 for ; Sun, 12 Mar 2023 07:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678632660; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ool8CY/rV+TxRAGpPCbgJhqayGlaxflLhFKQOjS5WYw=; b=dngV73wGP1RzbpZxH5J0E4oAmqGMaP09wZIAl7q2V+D6/UwLZ+6CchgyJZZoyzb8Yq 3O1aWd7KUT88gSmTT5X0DHvIS3iA4E+bdE9SMZUM5V+eYzbPwlcuiBslbhDrqPP13gWB bFGhH7kyZZRcI0CNH9WssXETPsOclgu8oLzbi1GvwoXggq/T2zBCKv9aKajlUAG6cXte 2hA3YGLHGlTn6f7Drd14V6VvxwGjKvpkm7SHC+djc4fpp+lBD57Aus3yoJMQcLAa/jRP 50z8DwzGiBurfag8+q4HYGrSssJrDuMswY04X8dDzO/+39+pQUlHzI2h+SEUOUpVjSFr /L/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678632660; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ool8CY/rV+TxRAGpPCbgJhqayGlaxflLhFKQOjS5WYw=; b=OetE8fqcmrazOu+ikih/26equXDzAPD+YZmnus9nhOendQ3cjD8GyJLM6ivWKLwbZ0 UsrvvUUcnk1jO2ozgJztvMtWP1TPZjQM2DDUu0EbCcVUyxqxCPDVSsVFbKIP58d4BHqF gJoV8U5w8f+tKCNCbRoc3KLfjDK8LXV/swt1uQG9G1zH7BO3ulcpNpNu8NKGr1/Z1e/M aFFYxd0rGAc16yVFR77vu2TMfNT49JIRuDp9Mc8DjM1wiuG917zw5gPVuP9oEAjfNzwS BDGY0CzN4hovQ8l1m63PSni3GUeCWeR+1c4QR6hLRf5vPxseNz9dnu7UORTxfuIpZlqk NPUg== X-Gm-Message-State: AO0yUKXuyDnJbnsYFCZye6HM5K6HpHK8Aqd2gD/22RFbQ4GcuwoKvvJ/ zgKejqrgheYdjyF08DCLIJSU2OJBssQ= X-Google-Smtp-Source: AK7set9u7jo9hpxXlVaEYuY78dhUtHqlUHXC/fHHDYz8/h/RsTj6wiY1cq79X0eF77Zucb066xh10A== X-Received: by 2002:a17:906:5a6e:b0:926:e917:133c with SMTP id my46-20020a1709065a6e00b00926e917133cmr1707354ejc.47.1678632660101; Sun, 12 Mar 2023 07:51:00 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id l22-20020a50d6d6000000b004fa19f5ba99sm2012255edj.79.2023.03.12.07.50.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 07:50:59 -0700 (PDT) From: Alexander Kanavin X-Google-Original-From: Alexander Kanavin To: openembedded-core@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 5/7] llvm: allow building libllvm in native builds, subject to PACKAGECONFIG Date: Sun, 12 Mar 2023 15:50:51 +0100 Message-Id: <20230312145053.1427377-5-alex@linutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230312145053.1427377-1-alex@linutronix.de> References: <20230312145053.1427377-1-alex@linutronix.de> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 12 Mar 2023 14:51:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178397 Also, enable that, if opengl is in native DISTRO_FEATURES: this allows mesa-native to build drivers that rely on libllvm, particularly llvmpipe, which is a (sort of) accelerated software renderer that is the only option on build hosts without dedicated or supported GPUs. Signed-off-by: Alexander Kanavin --- meta/recipes-devtools/llvm/llvm_git.bb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/meta/recipes-devtools/llvm/llvm_git.bb b/meta/recipes-devtools/llvm/llvm_git.bb index b4e983d2d0..f133653903 100644 --- a/meta/recipes-devtools/llvm/llvm_git.bb +++ b/meta/recipes-devtools/llvm/llvm_git.bb @@ -57,9 +57,11 @@ def get_llvm_arch(bb, d, arch_var): def get_llvm_host_arch(bb, d): return get_llvm_arch(bb, d, 'HOST_ARCH') -PACKAGECONFIG ??= "" +PACKAGECONFIG ??= "libllvm" +PACKAGECONFIG:class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'libllvm', '', d)}" # if optviewer OFF, force the modules to be not found or the ones on the host would be found PACKAGECONFIG[optviewer] = ",-DPY_PYGMENTS_FOUND=OFF -DPY_PYGMENTS_LEXERS_C_CPP_FOUND=OFF -DPY_YAML_FOUND=OFF,python3-pygments python3-pyyaml,python3-pygments python3-pyyaml" +PACKAGECONFIG[libllvm] = "" # # Default to build all OE-Core supported target arches (user overridable). @@ -102,14 +104,15 @@ do_compile:prepend:class-target() { } do_compile() { + if ${@bb.utils.contains('PACKAGECONFIG', 'libllvm', 'true', 'false', d)}; then ninja -v ${PARALLEL_MAKE} -} - -do_compile:class-native() { + else ninja -v ${PARALLEL_MAKE} llvm-config llvm-tblgen + fi } do_install() { + if ${@bb.utils.contains('PACKAGECONFIG', 'libllvm', 'true', 'false', d)}; then DESTDIR=${D} ninja -v install # llvm harcodes usr/lib as install path, so this corrects it to actual libdir @@ -121,9 +124,10 @@ do_install() { # reproducibility sed -i -e 's,${WORKDIR},,g' ${D}/${libdir}/cmake/llvm/LLVMConfig.cmake + fi } -do_install:class-native() { +do_install:append:class-native() { install -D -m 0755 ${B}/bin/llvm-tblgen ${D}${bindir}/llvm-tblgen${PV} install -D -m 0755 ${B}/bin/llvm-config ${D}${bindir}/llvm-config${PV} ln -sf llvm-config${PV} ${D}${bindir}/llvm-config From patchwork Sun Mar 12 14:50:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 20841 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA91EC7618B for ; Sun, 12 Mar 2023 14:51:03 +0000 (UTC) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by mx.groups.io with SMTP id smtpd.web10.67839.1678632660069006938 for ; Sun, 12 Mar 2023 07:51:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PNWSQlKo; spf=pass (domain: gmail.com, ip: 209.85.208.52, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f52.google.com with SMTP id x3so38951710edb.10 for ; Sun, 12 Mar 2023 07:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678632660; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ix4xDkUMEdaP7t5WBA/nR/Iy4wBgyGFTH5POQhQ/njo=; b=PNWSQlKojt05iNwHPwuCHU3sKm//R0RKZwu5DGPTseBFeB8hKAt/gPAOR5sziakrLA Ze1GBE2gqc+icpJWPKYigBN9AgkYNMaeOYs9JVGq8GqTf0s4csYVcgx+TG9P95q46gZW OU2nG0GN6OQ4fwSQpv9XcM3MzJ7PF1HxKghXCiaAOorJu9d/D1FRgQHK+HEG81FtW7CM Wy0qbbFhRYfgWREg1+CI5H/O5BLx4jO9AzALiudtybWG8AX6/otMgAXsYViByl5THdrW UHl57CP8doQEYMH3AQhBXAuF9EF7h9ncTCaRcjhFehcCuhWGXP04i1LJg+IQW7t85Kk7 EcRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678632660; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ix4xDkUMEdaP7t5WBA/nR/Iy4wBgyGFTH5POQhQ/njo=; b=Wcj6Jj4F+iA81vUqCi02UcxOSVwrEF1OcfyckuqT2E1D68ihaM7RhGFwXMfusAaoXn Y0Ij6kVlV7AIQJLpjC4XPmQz4itVKYJtbmkAyMp1dE7qT8Z2Q2ebKBwd1UGXQ8/Jkkiq iCSQvp5fxxqnlPBGEGQWL9xeYMH/TZ9W57ssCdFEsDgfR/OL68XjIajOxCoqAjGC0G9c XI1MmtslmuauW1cztJsvKTyxJc/GGKEdVVkeUVfkDVI3+5DaEhJ/gZZeG/k5jbVxnCHl MJenfp0ADECnpireD+vuvHNV6vB2EhMbX4MuAKlwa5vqA6JBbLRuaSG2ups+uIJPaU58 wzTQ== X-Gm-Message-State: AO0yUKUxjRn/HCAm8juw24m0M6d0D+y3H+TVyEWxxQFYEqtwDtp249A8 xXvhZEgN8yhk+yhwkViCAWsmQSbpet0= X-Google-Smtp-Source: AK7set8klAmqNzUTqAs+nQkdOVjjeBuI8eQy6M1nJmJvSzHxVrhbglaNx8MZrjUvJoJDXXWoQdmJ7g== X-Received: by 2002:a17:906:bc58:b0:928:a2:904e with SMTP id s24-20020a170906bc5800b0092800a2904emr1343071ejv.54.1678632660672; Sun, 12 Mar 2023 07:51:00 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id l22-20020a50d6d6000000b004fa19f5ba99sm2012255edj.79.2023.03.12.07.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 07:51:00 -0700 (PDT) From: Alexander Kanavin X-Google-Original-From: Alexander Kanavin To: openembedded-core@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 6/7] mesa: do not strip rpaths from dri drivers Date: Sun, 12 Mar 2023 15:50:52 +0100 Message-Id: <20230312145053.1427377-6-alex@linutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230312145053.1427377-1-alex@linutronix.de> References: <20230312145053.1427377-1-alex@linutronix.de> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 12 Mar 2023 14:51:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178396 This was needed back when we used upstream llvm-config which would add bogus rpaths into the drivers; nowadays it is replaced with a oe-specific wrapper. The particular reason is that mesa-native relies on having rpaths to work correctly (i.e. find other native libraries in the same sysroot location). Signed-off-by: Alexander Kanavin --- meta/recipes-graphics/mesa/mesa.inc | 3 --- 1 file changed, 3 deletions(-) diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index f06c1a31da..370b54ca6b 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -241,9 +241,6 @@ do_install:append () { rm -f ${D}${libdir}/gallium-pipe/*.la rm -f ${D}${libdir}/gbm/*.la - # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used - chrpath --delete ${D}${libdir}/dri/*_dri.so || true - # libwayland-egl has been moved to wayland 1.15+ rm -f ${D}${libdir}/libwayland-egl* rm -f ${D}${libdir}/pkgconfig/wayland-egl.pc From patchwork Sun Mar 12 14:50:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kanavin X-Patchwork-Id: 20844 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96166C6FD19 for ; Sun, 12 Mar 2023 14:51:03 +0000 (UTC) Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by mx.groups.io with SMTP id smtpd.web10.67844.1678632662964584416 for ; Sun, 12 Mar 2023 07:51:03 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DaozUYtX; spf=pass (domain: gmail.com, ip: 209.85.208.41, mailfrom: alex.kanavin@gmail.com) Received: by mail-ed1-f41.google.com with SMTP id j11so39032919edq.4 for ; Sun, 12 Mar 2023 07:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678632661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0SeX4rnhhPh2Y7i0vEwzB8hdrZSsqXlMnNRs3OCGjRs=; b=DaozUYtX74puCzVB2ULWWBh+qmWa+I+e5gbrT4amPRM4RLHy8wMCHCFyjW2Ili0XDW /4clcXMGEG2KjyALaAAHi8Upc6s2CwMTeO7WAH4aXNWnm3Is9Rvnggi4YOV2pZal+oC+ qKhH0KMBQJsMZi88d3+Wp90l8QCxlsyWCG/H5rGLK/MMqZaQHX+xF9qglQJ30Te4YMG2 eXCc2I0PHbIwl1kA57poviVurSn61YgJ8lgaEzrMlz76cXoRc+jYM2lNt60ATy4D8mHF jTEoTptbININj8Rc+67rUv0VtRlYSYyie9HSEZ6q6ZxpH2McEwB8dLHYKtoNsBSvUqFG 9AdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678632661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0SeX4rnhhPh2Y7i0vEwzB8hdrZSsqXlMnNRs3OCGjRs=; b=ld9ZTMjkVuH2vmNRVum3rE3sZpUwyBqulVX5hHDTQObDb4txP3NGkGqr752cDtQXkB Wdx5cN3MjoDdc0sg6GywO+0u71tygdQGhik1cZcITlV9n0XUlmaqDx5I+v21K2BLDfvn DNzJv6w7Rlen6D8L0Lkt1kPoFItfMB6SoBU8l1rkVoIZMKXhtlAwAhL2TTvbFjQnNoiK mfLdpLW1E+AqajCf2sHGIp6EAcLEnETUTZOhMoAlxbWs6dWsSk7E12TOH6cAXGOnZK8k pXxQLMPJAFUcVFxa+Wv2z9tCPmjq26PGcdVO17uXJkqy33RZXZZDvznf5ProQmsqVFpt Yq2Q== X-Gm-Message-State: AO0yUKUJZ0LyXwklHU7Dubtz1+TrSoGf73Ai+G5fBaql3uxsaZznZvMc oagi+rh0Qq0mkDHBcFewSbfymM1XZhE= X-Google-Smtp-Source: AK7set8NqfbDF+riwZXIx36ZXClnp7reZ3ccBTooW3r74xF4vAIuBz7tkS06sAp3yLxFNud+ErpDjA== X-Received: by 2002:a05:6402:2052:b0:4bf:d8d9:4b0e with SMTP id bc18-20020a056402205200b004bfd8d94b0emr28427702edb.22.1678632661279; Sun, 12 Mar 2023 07:51:01 -0700 (PDT) Received: from Zen2.lab.linutronix.de. (drugstore.linutronix.de. [80.153.143.164]) by smtp.gmail.com with ESMTPSA id l22-20020a50d6d6000000b004fa19f5ba99sm2012255edj.79.2023.03.12.07.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 07:51:01 -0700 (PDT) From: Alexander Kanavin X-Google-Original-From: Alexander Kanavin To: openembedded-core@lists.openembedded.org Cc: Alexander Kanavin Subject: [PATCH 7/7] mesa: update 22.3.5 -> 23.0.0 Date: Sun, 12 Mar 2023 15:50:53 +0100 Message-Id: <20230312145053.1427377-7-alex@linutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230312145053.1427377-1-alex@linutronix.de> References: <20230312145053.1427377-1-alex@linutronix.de> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 12 Mar 2023 14:51:03 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/178398 Drop patches: 0001-gbm-backend-fix-gbm-compile-without-dri.patch 0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch (backports) 0001-util-format-Check-for-NEON-before-using-it.patch (upstream submission has stalled with unanswered concerns from upstream; patch no longer applies; issue does not reproduce with 'raspberrypi0-wifi' MACHINE) Signed-off-by: Alexander Kanavin --- ...e-unsigned-instead-of-uint-to-fix-mu.patch | 44 ------------- ...-backend-fix-gbm-compile-without-dri.patch | 65 ------------------- ...ormat-Check-for-NEON-before-using-it.patch | 47 -------------- .../{mesa-gl_22.3.5.bb => mesa-gl_23.0.0.bb} | 0 meta/recipes-graphics/mesa/mesa.inc | 5 +- .../mesa/{mesa_22.3.5.bb => mesa_23.0.0.bb} | 0 6 files changed, 1 insertion(+), 160 deletions(-) delete mode 100644 meta/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch delete mode 100644 meta/recipes-graphics/mesa/files/0001-gbm-backend-fix-gbm-compile-without-dri.patch delete mode 100644 meta/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch rename meta/recipes-graphics/mesa/{mesa-gl_22.3.5.bb => mesa-gl_23.0.0.bb} (100%) rename meta/recipes-graphics/mesa/{mesa_22.3.5.bb => mesa_23.0.0.bb} (100%) diff --git a/meta/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch b/meta/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch deleted file mode 100644 index 3ab22889bf..0000000000 --- a/meta/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 8a5de0b6cf1090d7f29f3974ec79c32776cf2745 Mon Sep 17 00:00:00 2001 -From: Jami Kettunen -Date: Tue, 31 Aug 2021 00:15:58 +0300 -Subject: [PATCH] freedreno/pm4: Use unsigned instead of uint to fix musl build - -Upstream-Status: Backport - -Fixes the following error I noticed when building against aarch64 with -musl libc: - - In file included from ../src/freedreno/decode/crashdec.h:38, - from ../src/freedreno/decode/crashdec.c:40: - ../src/freedreno/common/freedreno_pm4.h:104:15: error: unknown type name 'uint' - 104 | static inline uint - | ^~~~ - ../src/freedreno/common/freedreno_pm4.h:105:25: error: unknown type name 'uint'; did you mean 'int'? - 105 | pm4_calc_odd_parity_bit(uint val) - | ^~~~ - | int - -Signed-off-by: Jami Kettunen -Part-of: ---- - src/freedreno/common/freedreno_pm4.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/freedreno/common/freedreno_pm4.h b/src/freedreno/common/freedreno_pm4.h -index 8f958953d693..091247e709a0 100644 ---- a/src/freedreno/common/freedreno_pm4.h -+++ b/src/freedreno/common/freedreno_pm4.h -@@ -105,8 +105,8 @@ pm4_pkt7_hdr(uint8_t opcode, uint16_t cnt) - #define cp_type3_opcode(pkt) (((pkt) >> 8) & 0xFF) - #define type3_pkt_size(pkt) ((((pkt) >> 16) & 0x3FFF) + 1) - --static inline uint --pm4_calc_odd_parity_bit(uint val) -+static inline unsigned -+pm4_calc_odd_parity_bit(unsigned val) - { - return (0x9669 >> (0xf & ((val) ^ ((val) >> 4) ^ ((val) >> 8) ^ - ((val) >> 12) ^ ((val) >> 16) ^ ((val) >> 20) ^ --- -2.39.2 - diff --git a/meta/recipes-graphics/mesa/files/0001-gbm-backend-fix-gbm-compile-without-dri.patch b/meta/recipes-graphics/mesa/files/0001-gbm-backend-fix-gbm-compile-without-dri.patch deleted file mode 100644 index 6541671b7a..0000000000 --- a/meta/recipes-graphics/mesa/files/0001-gbm-backend-fix-gbm-compile-without-dri.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 25946100e21cf2095bea334e8d7096798561d0b7 Mon Sep 17 00:00:00 2001 -From: Vincent Davis Jr -Date: Wed, 28 Dec 2022 16:28:01 -0600 -Subject: [PATCH] gbm/backend: fix gbm compile without dri - -Upstream-Status: Backport - -https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20447 -https://gitlab.freedesktop.org/mesa/mesa/-/commit/842ca284650f066e58706741a7d22d67b5088e60 - -At mesa version 22.2.3 patch wasn't introduced until after. - -Commit introduces a fix that allows for gbm to be built with an empty -backend. There are situation especially in a Yocto/OE cross compilation -environment where you want to build with an empty backend. The particular -situation is as such: - -The mesa-gl recipe is the preferred provider for virtual/libgbm, virtual/libgl, -virtual/mesa, etc... But the x11 DISTRO_FEATURE in't included this leads to build -errors such as: - -| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o: in function `find_backend': -| backend.c:(.text.find_backend+0xa4): undefined reference to `gbm_dri_backend' -| /../../../ld: src/gbm/libgbm.so.1.0.0.p/main_backend.c.o:(.data.rel.ro.builtin_backends+0x4): - undefined reference to `gbm_dri_backend' -| collect2: error: ld returned 1 exit status - -Issue should be replicable by setting -Ddri3=disabled and -Dgbm=enabled - -Add fix to bypasses compilation issue by excluding gbm dri backend. If -HAVE_DRI || HAVE_DRIX not specified. - -Acked-by: David Heidelberg -Signed-off-by: Vincent Davis Jr ---- - src/gbm/main/backend.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/gbm/main/backend.c b/src/gbm/main/backend.c -index 974d0a76a4e..feee0703495 100644 ---- a/src/gbm/main/backend.c -+++ b/src/gbm/main/backend.c -@@ -42,7 +42,9 @@ - #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) - #define VER_MIN(a, b) ((a) < (b) ? (a) : (b)) - -+#if defined(HAVE_DRI) || defined(HAVE_DRI2) || defined(HAVE_DRI3) - extern const struct gbm_backend gbm_dri_backend; -+#endif - - struct gbm_backend_desc { - const char *name; -@@ -51,7 +53,9 @@ struct gbm_backend_desc { - }; - - static const struct gbm_backend_desc builtin_backends[] = { -+#if defined(HAVE_DRI) || defined(HAVE_DRI2) || defined(HAVE_DRI3) - { "dri", &gbm_dri_backend }, -+#endif - }; - - #define BACKEND_LIB_SUFFIX "_gbm" --- -2.34.1 - diff --git a/meta/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch b/meta/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch deleted file mode 100644 index d22ff3c8a8..0000000000 --- a/meta/recipes-graphics/mesa/files/0001-util-format-Check-for-NEON-before-using-it.patch +++ /dev/null @@ -1,47 +0,0 @@ -From f17e836ef9b1bbc6056790596420b699e48128c2 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 2 Dec 2021 19:57:42 -0800 -Subject: [PATCH] util/format: Check for NEON before using it - -This fixes build on rpi0-w and any other machine which does not have -neon unit and is not used as FPU unit - -Fixes errors e.g. - -In file included from ../mesa-21.3.0/src/util/format/u_format_unpack_neon.c:35: -/mnt/b/yoe/master/build/tmp/work/arm1176jzfshf-vfp-yoe-linux-gnueabi/mesa/2_21.3.0-r0/recipe-sysroot-native/usr/lib/clang/13.0.1/include/arm_neon.h:32:2: error: "NEON support not enabled" - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14032] -Signed-off-by: Khem Raj - ---- - src/util/format/u_format.c | 2 +- - src/util/format/u_format_unpack_neon.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/util/format/u_format.c b/src/util/format/u_format.c -index c071250..0880984 100644 ---- a/src/util/format/u_format.c -+++ b/src/util/format/u_format.c -@@ -1184,7 +1184,7 @@ static void - util_format_unpack_table_init(void) - { - for (enum pipe_format format = PIPE_FORMAT_NONE; format < PIPE_FORMAT_COUNT; format++) { --#if (defined(PIPE_ARCH_AARCH64) || defined(PIPE_ARCH_ARM)) && !defined(NO_FORMAT_ASM) && !defined(__SOFTFP__) -+#if (defined(PIPE_ARCH_AARCH64) || (defined(__ARM_NEON) && defined(PIPE_ARCH_ARM))) && !defined(NO_FORMAT_ASM) - const struct util_format_unpack_description *unpack = util_format_unpack_description_neon(format); - if (unpack) { - util_format_unpack_table[format] = unpack; -diff --git a/src/util/format/u_format_unpack_neon.c b/src/util/format/u_format_unpack_neon.c -index a4a5cb1..1e4f794 100644 ---- a/src/util/format/u_format_unpack_neon.c -+++ b/src/util/format/u_format_unpack_neon.c -@@ -23,7 +23,7 @@ - - #include - --#if (defined(PIPE_ARCH_AARCH64) || defined(PIPE_ARCH_ARM)) && !defined(NO_FORMAT_ASM) && !defined(__SOFTFP__) -+#if (defined(PIPE_ARCH_AARCH64) || (defined(__ARM_NEON) && defined(PIPE_ARCH_ARM))) && !defined(NO_FORMAT_ASM) - - /* armhf builds default to vfp, not neon, and refuses to compile neon intrinsics - * unless you tell it "no really". diff --git a/meta/recipes-graphics/mesa/mesa-gl_22.3.5.bb b/meta/recipes-graphics/mesa/mesa-gl_23.0.0.bb similarity index 100% rename from meta/recipes-graphics/mesa/mesa-gl_22.3.5.bb rename to meta/recipes-graphics/mesa/mesa-gl_23.0.0.bb diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index 370b54ca6b..09a35ef33e 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc @@ -17,12 +17,9 @@ PE = "2" SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \ file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ - file://0001-util-format-Check-for-NEON-before-using-it.patch \ - file://0001-gbm-backend-fix-gbm-compile-without-dri.patch \ - file://0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch \ " -SRC_URI[sha256sum] = "3eed2ecae2bc674494566faab9fcc9beb21cd804c7ba2b59a1694f3d7236e6a9" +SRC_URI[sha256sum] = "01f3cff3763f09e0adabcb8011e4aebc6ad48f6a4dd4bae904fe918707d253e4" UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P\d+(\.\d+)+)" diff --git a/meta/recipes-graphics/mesa/mesa_22.3.5.bb b/meta/recipes-graphics/mesa/mesa_23.0.0.bb similarity index 100% rename from meta/recipes-graphics/mesa/mesa_22.3.5.bb rename to meta/recipes-graphics/mesa/mesa_23.0.0.bb