diff options
Diffstat (limited to 'recipes-graphics')
63 files changed, 957 insertions, 2917 deletions
diff --git a/recipes-graphics/cairo/cairo_%.bbappend b/recipes-graphics/cairo/cairo_%.bbappend index 2c73c7f3..bf8c38fc 100644 --- a/recipes-graphics/cairo/cairo_%.bbappend +++ b/recipes-graphics/cairo/cairo_%.bbappend @@ -1,2 +1,5 @@ -PACKAGECONFIG:append:imxgpu3d = " egl glesv2" -PACKAGECONFIG:remove:imxgpu3d = "opengl" +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + +RDEPENDS:${PN}:append:imxgpu:libc-musl = " gcompat" diff --git a/recipes-graphics/drm/libdrm_2.4.109.imx.bb b/recipes-graphics/drm/libdrm_2.4.115.imx.bb index 6a9ab254..ada0b7ae 100644 --- a/recipes-graphics/drm/libdrm_2.4.109.imx.bb +++ b/recipes-graphics/drm/libdrm_2.4.115.imx.bb @@ -6,14 +6,16 @@ accelerated OpenGL drivers." HOMEPAGE = "http://dri.freedesktop.org" SECTION = "x11/base" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71" +LIC_FILES_CHKSUM = "file://LICENSE;md5=9eb1f4831351ab42d762c40b3ebb7add \ + file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71" PROVIDES = "drm" DEPENDS = "libpthread-stubs" -IMX_LIBDRM_SRC ?= "git://source.codeaurora.org/external/imx/libdrm-imx.git;protocol=https;nobranch=1" -SRCBRANCH ?= "libdrm-imx-2.4.109" SRC_URI = "${IMX_LIBDRM_SRC};branch=${SRCBRANCH}" -SRCREV = "1d943abb1fccc350a129950d2690948f64503bb7" +IMX_LIBDRM_SRC ?= "git://github.com/nxp-imx/libdrm-imx.git;protocol=https" +SRCBRANCH ?= "libdrm-imx-2.4.115" +SRCREV = "0f889a1f9640f6210132dd565141eb19005245fb" + S = "${WORKDIR}/git" DEFAULT_PREFERENCE = "-1" @@ -21,25 +23,25 @@ COMPATIBLE_MACHINE = "(imx-nxp-bsp)" inherit meson pkgconfig manpages -PACKAGECONFIG ??= "libkms intel radeon amdgpu nouveau vmwgfx omap freedreno vc4 etnaviv install-test-programs" -PACKAGECONFIG[libkms] = "-Dlibkms=true,-Dlibkms=false" -PACKAGECONFIG[intel] = "-Dintel=true,-Dintel=false,libpciaccess" -PACKAGECONFIG[radeon] = "-Dradeon=true,-Dradeon=false" -PACKAGECONFIG[amdgpu] = "-Damdgpu=true,-Damdgpu=false" -PACKAGECONFIG[nouveau] = "-Dnouveau=true,-Dnouveau=false" -PACKAGECONFIG[vmwgfx] = "-Dvmwgfx=true,-Dvmwgfx=false" -PACKAGECONFIG[omap] = "-Domap=true,-Domap=false" -PACKAGECONFIG[exynos] = "-Dexynos=true,-Dexynos=false" -PACKAGECONFIG[freedreno] = "-Dfreedreno=true,-Dfreedreno=false" -PACKAGECONFIG[tegra] = "-Dtegra=true,-Dtegra=false" -PACKAGECONFIG[vc4] = "-Dvc4=true,-Dvc4=false" -PACKAGECONFIG[etnaviv] = "-Detnaviv=true,-Detnaviv=false" +PACKAGECONFIG ??= "intel radeon amdgpu nouveau vmwgfx omap freedreno vc4 etnaviv tests install-test-programs" +PACKAGECONFIG[intel] = "-Dintel=enabled,-Dintel=disabled,libpciaccess" +PACKAGECONFIG[radeon] = "-Dradeon=enabled,-Dradeon=disabled" +PACKAGECONFIG[amdgpu] = "-Damdgpu=enabled,-Damdgpu=disabled" +PACKAGECONFIG[nouveau] = "-Dnouveau=enabled,-Dnouveau=disabled" +PACKAGECONFIG[vmwgfx] = "-Dvmwgfx=enabled,-Dvmwgfx=disabled" +PACKAGECONFIG[omap] = "-Domap=enabled,-Domap=disabled" +PACKAGECONFIG[exynos] = "-Dexynos=enabled,-Dexynos=disabled" +PACKAGECONFIG[freedreno] = "-Dfreedreno=enabled,-Dfreedreno=disabled" +PACKAGECONFIG[tegra] = "-Dtegra=enabled,-Dtegra=disabled" +PACKAGECONFIG[vc4] = "-Dvc4=enabled,-Dvc4=disabled" +PACKAGECONFIG[etnaviv] = "-Detnaviv=enabled,-Detnaviv=disabled" PACKAGECONFIG[freedreno-kgsl] = "-Dfreedreno-kgsl=true,-Dfreedreno-kgsl=false" -PACKAGECONFIG[valgrind] = "-Dvalgrind=true,-Dvalgrind=false,valgrind" +PACKAGECONFIG[valgrind] = "-Dvalgrind=enabled,-Dvalgrind=disabled,valgrind" PACKAGECONFIG[install-test-programs] = "-Dinstall-test-programs=true,-Dinstall-test-programs=false" -PACKAGECONFIG[cairo-tests] = "-Dcairo-tests=true,-Dcairo-tests=false" +PACKAGECONFIG[cairo-tests] = "-Dcairo-tests=enabled,-Dcairo-tests=disabled" +PACKAGECONFIG[tests] = "-Dtests=true,-Dtests=false" PACKAGECONFIG[udev] = "-Dudev=true,-Dudev=false,udev" -PACKAGECONFIG[manpages] = "-Dman-pages=true,-Dman-pages=false,libxslt-native xmlto-native python3-docutils-native" +PACKAGECONFIG[manpages] = "-Dman-pages=enabled,-Dman-pages=disabled,libxslt-native xmlto-native python3-docutils-native" ALLOW_EMPTY:${PN}-drivers = "1" PACKAGES =+ "${PN}-tests ${PN}-drivers ${PN}-radeon ${PN}-nouveau ${PN}-omap \ diff --git a/recipes-graphics/glew/glew_%.bbappend b/recipes-graphics/glew/glew_%.bbappend new file mode 100644 index 00000000..95da4790 --- /dev/null +++ b/recipes-graphics/glew/glew_%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG:imxgpu = "egl-gles2" diff --git a/recipes-graphics/gtk+/gtk+3_%.bbappend b/recipes-graphics/gtk+/gtk+3_%.bbappend index 2f108a27..6bc01807 100644 --- a/recipes-graphics/gtk+/gtk+3_%.bbappend +++ b/recipes-graphics/gtk+/gtk+3_%.bbappend @@ -1,5 +1 @@ DEPENDS:append:imxgpu2d = " virtual/egl" - -PACKAGECONFIG:remove:imxgpu2d = " \ - ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "x11", "", d)} \ -" diff --git a/recipes-graphics/harfbuzz/harfbuzz_%.bbappend b/recipes-graphics/harfbuzz/harfbuzz_%.bbappend new file mode 100644 index 00000000..bf8c38fc --- /dev/null +++ b/recipes-graphics/harfbuzz/harfbuzz_%.bbappend @@ -0,0 +1,5 @@ +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + +RDEPENDS:${PN}:append:imxgpu:libc-musl = " gcompat" diff --git a/recipes-graphics/imx-g2d/imx-dpu-g2d_2.0.0.bb b/recipes-graphics/imx-g2d/imx-dpu-g2d_2.0.0.bb deleted file mode 100644 index c8e4169d..00000000 --- a/recipes-graphics/imx-g2d/imx-dpu-g2d_2.0.0.bb +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2016 Freescale Semiconductor -# Copyright 2017-2022 NXP -# Released under the MIT license (see COPYING.MIT for the terms) - -DESCRIPTION = "G2D library using i.MX DPU" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=be5ff43682ed6c57dfcbeb97651c2829" - -DEPENDS = "libgal-imx libdrm" -PROVIDES += "virtual/libg2d" - -SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true" -SRC_URI[md5sum] = "96bc124401896dec1272a86cb2baef54" -SRC_URI[sha256sum] = "8e636b65b08cba6b4c2130c8dbff81ee1af42ef818c013aede81ab7e321899a4" - -inherit fsl-eula-unpack - -do_install () { - install -d ${D}${libdir} - install -d ${D}${includedir} - cp -r ${S}/g2d/usr/lib/*.so* ${D}${libdir} - cp -Pr ${S}/g2d/usr/include/* ${D}${includedir} -} - -INSANE_SKIP:${PN} += "ldflags" - -COMPATIBLE_MACHINE = "(imxdpu)" diff --git a/recipes-graphics/imx-g2d/imx-dpu-g2d_2.1.10.bb b/recipes-graphics/imx-g2d/imx-dpu-g2d_2.1.10.bb new file mode 100644 index 00000000..16011bd4 --- /dev/null +++ b/recipes-graphics/imx-g2d/imx-dpu-g2d_2.1.10.bb @@ -0,0 +1,38 @@ +# Copyright (C) 2016 Freescale Semiconductor +# Copyright 2017-2022 NXP +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "G2D library using i.MX DPU" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://COPYING;md5=db4762b09b6bda63da103963e6e081de" + +DEPENDS = "libgal-imx libdrm" +PROVIDES += "virtual/libg2d" + +SRC_URI = "${FSL_MIRROR}/${IMX_BIN_NAME}.bin;fsl-eula=true" +IMX_BIN_NAME = "${BP}-${IMX_SRCREV_ABBREV}" +IMX_SRCREV_ABBREV = "7ed5396" +SRC_URI[md5sum] = "eed4f724973192564474efbda83f67bc" +SRC_URI[sha256sum] = "bca725e442c1438990cf1b41a59194e6efbd080c63d9b683a0d572e27f900e25" + +S = "${WORKDIR}/${IMX_BIN_NAME}" + +inherit fsl-eula-unpack + +do_install () { + install -d ${D}${libdir} + install -d ${D}${includedir} + cp -d ${S}/g2d/usr/lib/*.so* ${D}${libdir} + cp -Pr ${S}/g2d/usr/include/* ${D}${includedir} +} + +INSANE_SKIP:append:libc-musl = " file-rdeps" +RDEPENDS:${PN}:append:libc-musl = " gcompat" + +# The packaged binaries have been stripped of debug info, so disable +# operations accordingly. +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_SYSROOT_STRIP = "1" + +COMPATIBLE_MACHINE = "(imxdpu)" diff --git a/recipes-graphics/imx-g2d/imx-g2d-samples_2.0.0.bb b/recipes-graphics/imx-g2d/imx-g2d-samples_2.0.0.bb deleted file mode 100644 index 9832aac2..00000000 --- a/recipes-graphics/imx-g2d/imx-g2d-samples_2.0.0.bb +++ /dev/null @@ -1,32 +0,0 @@ -SUMMARY = "i.MX G2D Samples" -DESCRIPTION = "Set of sample applications for i.MX G2D" -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://COPYING;md5=0858ec9c7a80c4a2cf16e4f825a2cc91" - -DEPENDS = "virtual/libg2d" - -GPU_G2D_SAMPLES_SRC ?= "git://github.com/nxpmicro/g2d-samples.git;protocol=https" -SRCBRANCH ?= "imx_2.0" -SRC_URI = "${GPU_G2D_SAMPLES_SRC};branch=${SRCBRANCH}" -SRCREV = "267af142881d350218c2c2cead8f304a28bbee07" - -S = "${WORKDIR}/git" - -inherit pkgconfig - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)}" - -PACKAGECONFIG[wayland] = "USE_WAYLAND=true,USE_WAYLAND=false,wayland-native wayland-protocols" - -EXTRA_OEMAKE += " \ - SDKTARGETSYSROOT=${STAGING_DIR_HOST} \ - ${PACKAGECONFIG_CONFARGS} \ -" - -do_install() { - oe_runmake install DESTDIR=${D} -} - -FILES:${PN} += "/opt" - -COMPATIBLE_MACHINE = "(imxgpu2d)" diff --git a/recipes-graphics/imx-g2d/imx-g2d-samples_git.bb b/recipes-graphics/imx-g2d/imx-g2d-samples_git.bb new file mode 100644 index 00000000..649a16d2 --- /dev/null +++ b/recipes-graphics/imx-g2d/imx-g2d-samples_git.bb @@ -0,0 +1,68 @@ +SUMMARY = "i.MX G2D Samples" +DESCRIPTION = "Set of sample applications for i.MX G2D" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=0858ec9c7a80c4a2cf16e4f825a2cc91" + +DEPENDS = "cairo" + +PV = "2.1+git${SRCPV}" + +SRC_URI = "${GPU_G2D_SAMPLES_SRC};branch=${SRCBRANCH}" +GPU_G2D_SAMPLES_SRC ?= "git://github.com/nxp-imx/g2d-samples.git;protocol=https" +SRCBRANCH ?= "imx_2.1" +SRCREV = "4391dcda499870418bb38fe395c3cba0664c5bab" + +S = "${WORKDIR}/git" + +inherit pkgconfig + +PACKAGECONFIG ??= "${PACKAGECONFIG_IMPLEMENTATION}" +PACKAGECONFIG_IMPLEMENTATION = "" +PACKAGECONFIG_IMPLEMENTATION:imxgpu2d:imxdpu = "dpu" +PACKAGECONFIG_IMPLEMENTATION:imxgpu2d = "gpu-drm" +PACKAGECONFIG_IMPLEMENTATION:imxgpu2d:imxfbdev = "gpu-fbdev" +PACKAGECONFIG_IMPLEMENTATION:mx93-nxp-bsp = "pxp" + +PACKAGECONFIG[dpu] = " \ + BUILD_IMPLEMENTATION=dpu, \ + , \ + imx-dpu-g2d wayland-native wayland wayland-protocols, \ + , \ + , \ + gpu-drm gpu-fbdev pxp" +PACKAGECONFIG[gpu-drm] = " \ + BUILD_IMPLEMENTATION=gpu-drm, \ + , \ + imx-gpu-g2d wayland-native wayland wayland-protocols, \ + , \ + , \ + dpu gpu-fbdev pxp" +PACKAGECONFIG[gpu-fbdev] = " \ + BUILD_IMPLEMENTATION=gpu-fbdev, \ + , \ + imx-gpu-g2d, \ + , \ + , \ + dpu gpu-drm pxp" +PACKAGECONFIG[pxp] = " \ + BUILD_IMPLEMENTATION=pxp, \ + , \ + imx-pxp-g2d wayland-native wayland wayland-protocols, \ + , \ + , \ + dpu gpu-drm gpu-fbdev" + +EXTRA_OEMAKE += " \ + SDKTARGETSYSROOT=${STAGING_DIR_HOST} \ + ${PACKAGECONFIG_CONFARGS} \ +" + +do_install() { + oe_runmake install DESTDIR=${D} +} + +FILES:${PN} += "/opt" + +PACKAGE_ARCH = "${MACHINE_SOCARCH}" + +COMPATIBLE_MACHINE = "(imxgpu2d|mx93-nxp-bsp)" diff --git a/recipes-graphics/imx-g2d/imx-gpu-g2d_6.4.11.p2.2.bb b/recipes-graphics/imx-g2d/imx-gpu-g2d_6.4.11.p2.2.bb new file mode 100644 index 00000000..b9a7d938 --- /dev/null +++ b/recipes-graphics/imx-g2d/imx-gpu-g2d_6.4.11.p2.2.bb @@ -0,0 +1,44 @@ +# Copyright (C) 2016 Freescale Semiconductor +# Copyright 2017-2022 NXP +# Copyright 2018 (C) O.S. Systems Software LTDA. +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "G2D library using i.MX GPU" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://COPYING;md5=2827219e81f28aba7c6a569f7c437fa7" +DEPENDS = "libgal-imx" +PROVIDES = "virtual/libg2d" + +SRC_URI = "${FSL_MIRROR}/${IMX_BIN_NAME}.bin;name=${TARGET_ARCH};fsl-eula=true" +IMX_BIN_NAME = "${BP}-${TARGET_ARCH}-${IMX_SRCREV_ABBREV}" +IMX_SRCREV_ABBREV = "fd0148d" +SRC_URI[aarch64.md5sum] = "ebc4cb8fdfa0b8ef9b11d7bb0fd4710f" +SRC_URI[aarch64.sha256sum] = "1cedc606be965b01300613ccea81b4fd589d940306bb1caa30a37c41928616ec" +SRC_URI[arm.md5sum] = "77233957a27ae4da3f01d33b3fbc69d9" +SRC_URI[arm.sha256sum] = "bc168b19096a997251e7137f82ffcff404c61709cf5f227c53a099f631569f76" + +S = "${WORKDIR}/${IMX_BIN_NAME}" + +inherit fsl-eula-unpack + +SOC_INSTALL_DIR = "SOC_INSTALL_DIR_NOT_SET" +SOC_INSTALL_DIR:mx8mm-nxp-bsp = "mx8mm" + +do_install () { + install -d ${D}${libdir} + install -d ${D}${includedir} + cp -d ${S}/g2d/usr/lib/*.so* ${D}${libdir} + if [ -d ${S}/g2d/usr/lib/${SOC_INSTALL_DIR} ]; then + cp -d ${S}/g2d/usr/lib/${SOC_INSTALL_DIR}/*.so* ${D}${libdir} + fi + cp -Pr ${S}/g2d/usr/include/* ${D}${includedir} +} + +# The packaged binaries have been stripped of debug info, so disable +# operations accordingly. +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" +INHIBIT_PACKAGE_STRIP = "1" +INHIBIT_SYSROOT_STRIP = "1" + +PACKAGE_ARCH = "${MACHINE_SOCARCH}" +COMPATIBLE_MACHINE = "(imxgpu2d)" diff --git a/recipes-graphics/imx-g2d/imx-gpu-g2d_6.4.3.p4.0.bb b/recipes-graphics/imx-g2d/imx-gpu-g2d_6.4.3.p4.0.bb deleted file mode 100644 index 1f3c2e60..00000000 --- a/recipes-graphics/imx-g2d/imx-gpu-g2d_6.4.3.p4.0.bb +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2016 Freescale Semiconductor -# Copyright 2017-2022 NXP -# Copyright 2018 (C) O.S. Systems Software LTDA. -# Released under the MIT license (see COPYING.MIT for the terms) - -DESCRIPTION = "G2D library using i.MX GPU" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=be5ff43682ed6c57dfcbeb97651c2829" -DEPENDS = "libgal-imx" -PROVIDES = "virtual/libg2d" - -FSLBIN_NAME = "${PN}-${PV}-${TARGET_ARCH}" - -SRC_URI = "${FSL_MIRROR}/${FSLBIN_NAME}.bin;name=${TARGET_ARCH};fsl-eula=true" -SRC_URI[aarch64.md5sum] = "b3b3c285796cd5d47841b73c4735e6bd" -SRC_URI[aarch64.sha256sum] = "f2d592d1389be0c16f8dbe6374d480d674c2e31f4195916dbd6baf71473a0e60" -SRC_URI[arm.md5sum] = "82f6a394505bc9d348a35f26cd02bd6a" -SRC_URI[arm.sha256sum] = "96f0213009087de0842740401a67a19d70d5a7ae928843c9c9bee3f8f177b2a0" - -S = "${WORKDIR}/${FSLBIN_NAME}" - -inherit fsl-eula-unpack - -do_install () { - install -d ${D}${libdir} - install -d ${D}${includedir} - cp -r ${S}/g2d/usr/lib/*.so* ${D}${libdir} - cp -Pr ${S}/g2d/usr/include/* ${D}${includedir} -} - -INSANE_SKIP:${PN} = "ldflags" - -COMPATIBLE_MACHINE = "(imxgpu2d)" diff --git a/recipes-graphics/imx-g2d/imx-pxp-g2d_git.bb b/recipes-graphics/imx-g2d/imx-pxp-g2d_git.bb new file mode 100644 index 00000000..dedee983 --- /dev/null +++ b/recipes-graphics/imx-g2d/imx-pxp-g2d_git.bb @@ -0,0 +1,28 @@ +# Copyright (C) 2016 Freescale Semiconductor +# Copyright 2017-2023 NXP +# Released under the MIT license (see COPYING.MIT for the terms) + +DESCRIPTION = "G2D library using i.MX PXP" +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2827219e81f28aba7c6a569f7c437fa7" + +PROVIDES += "virtual/libg2d" + +PV = "2.1.0+git${SRCPV}" + +SRC_URI = "${IMX_PXP_G2D_SRC};branch=${SRCBRANCH}" +IMX_PXP_G2D_SRC ?= "git://github.com/nxp-imx/imx-g2d-pxp.git;protocol=https" +SRCBRANCH ?= "imx_2.1" +SRCREV = "f3adab05bd0cbb7c38578110d772e8ddf52b4e8e" + +S = "${WORKDIR}/git" + +inherit use-imx-headers + +EXTRA_OEMAKE = "PLATFORM=IMX93 INCLUDE='-I${STAGING_INCDIR_IMX}' DEST_DIR=${D}" + +do_install() { + oe_runmake install +} + +COMPATIBLE_MACHINE = "(mx93-nxp-bsp)" diff --git a/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace_10.0.0.bb b/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace_10.0.0.bb index bd041582..a2f049a8 100644 --- a/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace_10.0.0.bb +++ b/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace_10.0.0.bb @@ -4,10 +4,10 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE;md5=aeb969185a143c3c25130bc2c3ef9a50" DEPENDS = "imx-gpu-viv zlib libpng procps" -SRC_URI = "git://source.codeaurora.org/external/imx/apitrace-imx.git;protocol=https;branch=imx_10.0 \ +SRC_URI = "git://github.com/nxp-imx/apitrace-imx.git;protocol=https;branch=imx_10.0 \ file://0001-dlsym-workaround-glibc-2.34-build-failure.patch \ " -SRCREV = "90a59407f1cddd31b4dac67e5a2500100eb091bc" +SRCREV = "522cb2981289b7ba20d6dd4b4bf75097e079815b" S = "${WORKDIR}/git" @@ -43,6 +43,13 @@ FILES:${PN} += " \ ${libdir}/apitrace/scripts/* \ ${libdir}/apitrace/wrappers/* \ " - +EXTRA_OECMAKE += "\ + -DENABLE_GUI=OFF \ + -DENABLE_STATIC_LIBGCC=OFF \ + -DENABLE_STATIC_LIBSTDCXX=OFF \ + -DPython3_ROOT_DIR=/usr/bin/python3-native \ +" PACKAGE_ARCH = "${MACHINE_SOCARCH}" COMPATIBLE_MACHINE = "(imxgpu)" +SECURITY_CFLAGS:toolchain-clang = "" + diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc b/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc index 8d014259..56a9ec4d 100644 --- a/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc +++ b/recipes-graphics/imx-gpu-viv/imx-gpu-viv-6.inc @@ -1,12 +1,12 @@ # Copyright (C) 2012-2016 Freescale Semiconductor # Copyright (C) 2012-2018 O.S. Systems Software LTDA. -# Copyright 2017-2021 NXP +# Copyright 2017-2023 NXP # Released under the MIT license (see COPYING.MIT for the terms) DESCRIPTION = "GPU driver and apps for i.MX" SECTION = "libs" LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=be5ff43682ed6c57dfcbeb97651c2829" +LIC_FILES_CHKSUM = "file://COPYING;md5=ea25d099982d035af85d193c88a1b479" DEPENDS += " \ ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', \ @@ -25,7 +25,20 @@ DEPENDS:append:mx8-nxp-bsp = " patchelf-native" # We depend on mesa to fill in what is missing. DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'mesa', '', d)}" -EXTRA_PROVIDES = "" +DEPENDS:append:libc-musl = " gcompat" + +PROVIDES += " \ + imx-gpu-viv \ + libgal-imx \ + virtual/egl \ + virtual/libopenvg \ + ${EXTRA_PROVIDES} \ +" +EXTRA_PROVIDES = " \ + ${PROVIDES_OPENCL} \ + ${PROVIDES_OPENGLES3} \ + ${PROVIDES_OPENVX} \ +" EXTRA_PROVIDES:append:imxgpu3d = " \ virtual/libgl \ virtual/libgles1 \ @@ -34,31 +47,37 @@ EXTRA_PROVIDES:append:imxgpu3d = " \ EXTRA_PROVIDES:append:mx8-nxp-bsp = " \ virtual/libgbm \ " -PROVIDES_OPENVX = "" -PROVIDES_OPENVX:mx8-nxp-bsp = "virtual/libopenvx" -PROVIDES_OPENVX:mx8mm-nxp-bsp = "" -PROVIDES += " \ - imx-gpu-viv \ - libgal-imx \ + +PROVIDES_OPENCL = " \ opencl-headers \ opencl-clhpp \ opencl-icd-loader \ - virtual/egl \ - virtual/libopenvg \ virtual/opencl-icd \ - ${PROVIDES_OPENVX} \ - ${EXTRA_PROVIDES} \ " +PROVIDES_OPENCL:mx7-nxp-bsp = "" +PROVIDES_OPENCL:mx8mm-nxp-bsp = "" + +PROVIDES_OPENGLES3 = "" +PROVIDES_OPENGLES3:mx8-nxp-bsp = "virtual/libgles3" + +# Note: OpenVX is fully supported on i.MX 8 QuadMax and 8 QuadPlus. +# However, only limited support is provided on other i.MX 8 machines +# as needed for i.MX machine learning packages. +PROVIDES_OPENVX = "" +PROVIDES_OPENVX:mx8-nxp-bsp = "virtual/libopenvx" +PROVIDES_OPENVX:mx8mm-nxp-bsp = "" RPROVIDES:${PN}:imxgpu3d += "imx-gpu-viv" PE = "1" -inherit fsl-eula-unpack features_check +inherit fsl-eula-unpack -REQUIRED_DISTRO_FEATURES:mx8-nxp-bsp = "wayland" +FILESEXTRAPATHS:append := "${THISDIR}/imx-gpu-viv:" +SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true \ + file://imx_icd.json" -SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}.bin;fsl-eula=true" +S = "${WORKDIR}/${BPN}-${PV}-${IMX_SRCREV_ABBREV}" PACKAGECONFIG ?= "" @@ -66,27 +85,42 @@ PACKAGECONFIG ?= "" PACKAGECONFIG[valgrind] = "" # Note : If you add a package here, to prevent a naming conflict see the python_anonymous() futher below -IMX_PACKAGES_GBM = "" -IMX_PACKAGES_GBM:mx8-nxp-bsp = "libgbm-imx libgbm-imx-dev" -PACKAGES =+ "libclc-imx libclc-imx-dev \ +PACKAGES =+ " \ libgl-imx libgl-imx-dev \ libgles1-imx libgles1-imx-dev \ libgles2-imx libgles2-imx-dev \ libgles3-imx-dev \ libglslc-imx libglslc-imx-dev \ - libopencl-imx libopencl-imx-dev \ + ${PACKAGES_OPENCL} \ libopenvg-imx libopenvg-imx-dev \ libvdk-imx libvdk-imx-dev \ libegl-imx libegl-imx-dev \ libgal-imx libgal-imx-dev \ libvsc-imx \ - ${IMX_PACKAGES_GBM} \ + ${PACKAGES_GBM} \ imx-gpu-viv-tools \ imx-gpu-viv-demos \ - libvulkan-imx libvulkan-imx-dev \ - libopenvx-imx libopenvx-imx-dev \ + ${PACKAGES_VULKAN} \ + ${PACKAGES_OPENVX} \ libnn-imx \ + libspirv-imx \ " + +PACKAGES_GBM = "" +PACKAGES_GBM:mx8-nxp-bsp = "libgbm-imx libgbm-imx-dev" + +PACKAGES_OPENCL = "libclc-imx libopencl-imx libopencl-imx-dev" +PACKAGES_OPENCL:mx7-nxp-bsp = "" +PACKAGES_OPENCL:mx8mm-nxp-bsp = "" + +PACKAGES_OPENVX = \ + "${@bb.utils.contains("PROVIDES_OPENVX", "virtual/libopenvx", \ + "libopenvx-imx libopenvx-imx-dev", "", d)}" + +PACKAGES_VULKAN = "" +PACKAGES_VULKAN:imxvulkan = "libvulkan-imx libvulkan-imx-dev" +PACKAGES_VULKAN:mx8mm-nxp-bsp = "libvulkan-imx libvulkan-imx-dev" + python __anonymous () { has_vivante_kernel_driver_support = (d.getVar('MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT') or '0') if has_vivante_kernel_driver_support != '1': @@ -154,8 +188,7 @@ IMX_SOC:mx8mq-nxp-bsp = "mx8mq" IMX_SOC:mx8mn-nxp-bsp = "mx8mn" IMX_SOC:mx8ulp-nxp-bsp = "mx8ulp" -LIBVULKAN_VERSION_MAJOR = "1" -LIBVULKAN_VERSION = "${LIBVULKAN_VERSION_MAJOR}.2.1" +LIBVULKAN_API_VERSION = "1.3.239" do_install () { install -d ${D}${libdir} @@ -170,6 +203,7 @@ do_install () { # Use vulkan header from vulkan-headers recipe to support vkmark rm -rf ${D}${includedir}/vulkan/ + # Install SOC-specific drivers if [ -d ${S}/gpu-core/usr/lib/${IMX_SOC} ]; then cp -r ${S}/gpu-core/usr/lib/${IMX_SOC}/* ${D}${libdir} fi @@ -179,38 +213,78 @@ do_install () { install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/gbm.pc ${D}${libdir}/pkgconfig/gbm.pc fi + install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc + install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc + install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/vg.pc ${D}${libdir}/pkgconfig/vg.pc + + # Install backend-specific drivers if [ "${BACKEND}" = "wayland" ]; then + # Wayland backend + if ! ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'true', 'false', d)}; then + install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/gl.pc ${D}${libdir}/pkgconfig/gl.pc + fi install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/egl_wayland.pc ${D}${libdir}/pkgconfig/egl.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/vg.pc ${D}${libdir}/pkgconfig/vg.pc - else - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/vg.pc ${D}${libdir}/pkgconfig/vg.pc + cp -r ${S}/gpu-core/usr/lib/wayland/* ${D}${libdir} + elif [ "${IS_MX8}" != "1" ]; then + # Framebuffer backend for i.MX 6 and 7 install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/egl_linuxfb.pc ${D}${libdir}/pkgconfig/egl.pc + cp -r ${S}/gpu-core/usr/lib/fb/* ${D}${libdir} + else + # Framebuffer backend for i.MX 8 and beyond + install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/egl.pc ${D}${libdir}/pkgconfig/egl.pc + cp -r ${S}/gpu-core/usr/lib/wayland/* ${D}${libdir} + set -f + for f in ${FILES:libvdk-imx} ${FILES:libvdk-imx-dev}; do + set +f + rm -rf ${D}/$f + done + rm -rf \ + ${D}/opt/viv_samples/es20 \ + ${D}/opt/viv_samples/tiger \ + ${D}/opt/viv_samples/vdk fi - - # Install Vendor ICDs for OpenCL's installable client driver loader (ICDs Loader) - install -d ${D}${sysconfdir}/OpenCL/vendors/ - install -m 0644 ${S}/gpu-core/etc/Vivante.icd ${D}${sysconfdir}/OpenCL/vendors/Vivante.icd - - # Handle backend specific drivers - cp -r ${S}/gpu-core/usr/lib/${BACKEND}/* ${D}${libdir} if [ "${BACKEND}" = "wayland" ] && [ "${IS_MX8}" != "1" ]; then # Special case for libVDK on Wayland backend, deliver fb library as well. cp ${S}/gpu-core/usr/lib/fb/libVDK.so.1.2.0 ${D}${libdir}/libVDK-fb.so.1.2.0 fi + + if [ -z "${PACKAGES_OPENCL}" ]; then + set -f + for f in ${FILES:libopencl-imx} ${FILES:libopencl-imx-dev} ${FILES:libclc-imx}; do + set +f + rm -rf ${D}$f + done + rm -rf ${D}/opt/viv_samples/cl11 + else + # Install Vendor ICDs for OpenCL's installable client driver loader (ICDs Loader) + install -d ${D}${sysconfdir}/OpenCL/vendors/ + install -m 0644 ${S}/gpu-core/etc/Vivante.icd ${D}${sysconfdir}/OpenCL/vendors/Vivante.icd + + if [ "${OPENCL_VX_INTRINSIC_EXTENSION_PACKAGES}" = "" ]; then + rm -f ${D}${includedir}/CL/cl_viv_vx_ext.h + fi + fi + + if [ -z "${PACKAGES_OPENVX}" ]; then + set -f + for f in ${FILES:libopenvx-imx} ${FILES:libopenvx-imx-dev}; do + set +f + rm -rf ${D}$f + done + fi + if [ "${IS_MX8}" = "1" ]; then - # Rename the vulkan implementation library which is wrapped by the vulkan-loader - # library of the same name - MAJOR=${LIBVULKAN_VERSION_MAJOR} - FULL=${LIBVULKAN_VERSION} - mv ${D}${libdir}/libvulkan.so.$FULL ${D}${libdir}/libvulkan_VSI.so.$FULL - patchelf --set-soname libvulkan_VSI.so.$MAJOR ${D}${libdir}/libvulkan_VSI.so.$FULL - rm ${D}${libdir}/libvulkan.so.$MAJOR ${D}${libdir}/libvulkan.so - ln -s libvulkan_VSI.so.$FULL ${D}${libdir}/libvulkan_VSI.so.$MAJOR - ln -s libvulkan_VSI.so.$FULL ${D}${libdir}/libvulkan_VSI.so + if [ -z "${PACKAGES_VULKAN}" ]; then + set -f + for f in ${FILES:libvulkan-imx} ${FILES:libvulkan-imx-dev}; do + set +f + rm -rf ${D}$f + done + else + install -Dm 0644 ${WORKDIR}/imx_icd.json ${D}${sysconfdir}/vulkan/icd.d/imx_icd.json + sed -i "s,%libdir%,${libdir}," ${D}${sysconfdir}/vulkan/icd.d/imx_icd.json + sed -i "s,%api_version%,${LIBVULKAN_API_VERSION}," ${D}${sysconfdir}/vulkan/icd.d/imx_icd.json + fi fi # FIXME: MX6SL does not have 3D support; hack it for now @@ -239,18 +313,35 @@ do_install () { chown -R root:root "${D}" } +do_install:append:libc-musl() { + # libs + for f in `find ${D}${libdir} -name '*.so*' -type f` + do + patchelf --add-needed libgcompat.so.0 $f + done + # binaries + for f in `find ${D}/opt ${D}${bindir} -name '*' -type f -executable` + do + # prune scripts + if `patchelf --print-interpreter $f 2>&1 > /dev/null` + then + patchelf --set-interpreter ${root_prefix}`patchelf --print-interpreter $f` $f + patchelf --add-needed libgcompat.so.0 $f + fi + done +} + ALLOW_EMPTY:${PN} = "1" -FILES:libclc-imx = "${libdir}/libCLC${SOLIBS} ${includedir}/CL/cl_viv_vx_ext.h" -FILES:libclc-imx-dev = "${includedir}/CL ${libdir}/libCLC${SOLIBSDEV}" +FILES:libclc-imx = "${libdir}/libCLC${SOLIBS}" +FILES:libegl-imx = "${libdir}/libEGL${REALSOLIBS} ${libdir}/libEGL${SOLIBS} " +FILES:libegl-imx-dev = "${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc" # libEGL.so is used by some demo apps from Freescale INSANE_SKIP:libegl-imx += "dev-so" -FILES:libegl-imx = "${libdir}/libEGL${REALSOLIBS} ${libdir}/libEGL${SOLIBSDEV} " -FILES:libegl-imx-dev = "${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc" FILES:libgal-imx = "${libdir}/libGAL${SOLIBS} ${libdir}/libGAL_egl${SOLIBS}" -FILES:libgal-imx-dev = "${libdir}/libGAL${SOLIBSDEV} ${includedir}/HAL" +FILES:libgal-imx-dev = "${includedir}/HAL" RDEPENDS:libgal-imx += "${@bb.utils.contains('PACKAGECONFIG', 'valgrind', 'valgrind', '', d)}" RPROVIDES:libgal-imx += "libgal-imx" RRECOMMENDS:libgal-imx += "kernel-module-imx-gpu-viv" @@ -258,14 +349,20 @@ INSANE_SKIP:libgal-imx += "build-deps" FILES:libvsc-imx = "${libdir}/libVSC${SOLIBS}" -FILES:libgbm-imx:mx8-nxp-bsp = "${libdir}/libgbm*${REALSOLIBS} ${libdir}/libgbm${SOLIBSDEV} ${libdir}/libgbm_viv${SOLIBSDEV}" -FILES:libgbm-imx-dev:mx8-nxp-bsp = "${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h" -RDEPENDS:libgbm-imx:append:mx8-nxp-bsp = " libdrm" +FILES:libgbm-imx = "${libdir}/libgbm*${REALSOLIBS} ${libdir}/libgbm${SOLIBS} ${libdir}/libgbm_viv${SOLIBS}" +FILES:libgbm-imx-dev = "${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h" +RDEPENDS:libgbm-imx:append = " libdrm" INSANE_SKIP:libgbm-imx += "dev-so" -FILES:libvulkan-imx = "${libdir}/libvulkan_VSI${REALSOLIBS} ${libdir}/libSPIRV_viv${SOLIBS}" +FILES:libvulkan-imx = "\ + ${libdir}/libvulkan_VSI${REALSOLIBS} \ + ${sysconfdir}/vulkan" FILES:libvulkan-imx-dev = "${includedir}/vulkan ${libdir}/libvulkan_VSI${SOLIBSDEV}" +FILES:libspirv-imx = " \ + ${libdir}/libSPIRV_viv${SOLIBS} \ +" + FILES:libopenvx-imx = " \ ${libdir}/libOpenVX${REALSOLIBS} \ ${libdir}/libOpenVXC${SOLIBS} \ @@ -274,27 +371,33 @@ FILES:libopenvx-imx = " \ ${libdir}/libArchModelSw${SOLIBS} \ " FILES:libopenvx-imx-dev = "${includedir}/VX ${libdir}/libOpenVX${SOLIBSDEV}" -RDEPENDS:libopenvx-imx = "libnn-imx" - +RDEPENDS:libopenvx-imx = "libnn-imx ${OPENCL_VX_INTRINSIC_EXTENSION_PACKAGES}" +OPENCL_VX_INTRINSIC_EXTENSION_PACKAGES = "" +OPENCL_VX_INTRINSIC_EXTENSION_PACKAGES:mx8qm-nxp-bsp = "libclc-imx libopencl-imx-dev" +OPENCL_VX_INTRINSIC_EXTENSION_PACKAGES:mx8mp-nxp-bsp = "libclc-imx libopencl-imx-dev" +INSANE_SKIP:libopenvx-imx += "dev-deps" + +FILES:libgl-imx = "${libdir}/libGL${REALSOLIBS} ${libdir}/libGL${SOLIBS}" +FILES:libgl-imx-dev = "${includedir}/GL ${libdir}/pkgconfig/gl.pc" # libGL is only targeting X11 backend, and in case if Wayland-only is used - # package QA complains on missing RDEPENDS, which are only available for X11. # Skip "file-rdeps" QA for this package. -FILES:libgl-imx = "${libdir}/libGL${REALSOLIBS}" -FILES:libgl-imx-dev = "${libdir}/libGL${SOLIBSDEV} ${includedir}/GL" INSANE_SKIP:libgl-imx += "file-rdeps" +# libEGL does dlopen of libGL.so +INSANE_SKIP:libgl-imx += "dev-so" -# libEGL needs to open libGLESv1.so -INSANE_SKIP:libgles1-imx += "dev-so" FILES:libgles1-imx = "${libdir}/libGLESv1*${REALSOLIBS} ${libdir}/libGLESv1*${SOLIBS} ${libdir}/libGLES_*${REALSOLIBS} ${libdir}/libGLES_*${SOLIBS}" -FILES:libgles1-imx-dev = "${includedir}/GLES ${libdir}/libGLESv1*${SOLIBS} ${libdir}/libGLES_*${SOLIBSDEV} ${libdir}/pkgconfig/glesv1_cm.pc" +FILES:libgles1-imx-dev = "${includedir}/GLES ${libdir}/pkgconfig/glesv1_cm.pc" RPROVIDES:libgles1-imx = "libgles-imx" RPROVIDES:libgles1-imx-dev = "libgles-imx-dev" +# libEGL does dlopen of libGLESv1.so +INSANE_SKIP:libgles1-imx += "dev-so" -# libEGL needs to open libGLESv2.so -INSANE_SKIP:libgles2-imx += "dev-so" FILES:libgles2-imx = "${libdir}/libGLESv2${REALSOLIBS} ${libdir}/libGLESv2${SOLIBS}" -FILES:libgles2-imx-dev = "${includedir}/GLES2 ${libdir}/libGLESv2${SOLIBSDEV} ${libdir}/pkgconfig/glesv2.pc" +FILES:libgles2-imx-dev = "${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc" RDEPENDS:libgles2-imx = "libglslc-imx" +# libEGL does dlopen of libGLESv2.so +INSANE_SKIP:libgles2-imx += "dev-so" FILES:libgles3-imx-dev = "${includedir}/GLES3" # as long as there is no libgles3: ship libgles3-dev along with @@ -302,7 +405,6 @@ FILES:libgles3-imx-dev = "${includedir}/GLES3" RDEPENDS:libgles2-imx-dev += "libgles3-imx-dev" FILES:libglslc-imx = "${libdir}/libGLSLC${SOLIBS}" -FILES:libglslc-imx-dev = "${includedir}/CL ${libdir}/libGLSLC${SOLIBSDEV}" FILES:libopencl-imx = "${libdir}/libOpenCL${REALSOLIBS} \ ${libdir}/libVivanteOpenCL${SOLIBS} \ @@ -311,8 +413,10 @@ FILES:libopencl-imx = "${libdir}/libOpenCL${REALSOLIBS} \ FILES:libopencl-imx-dev = "${includedir}/CL ${libdir}/libOpenCL${SOLIBSDEV}" RDEPENDS:libopencl-imx= "libclc-imx" -FILES:libopenvg-imx = "${libdir}/libOpenVG*${REALSOLIBS}" -FILES:libopenvg-imx-dev = "${includedir}/VG ${libdir}/libOpenVG*${SOLIBSDEV} ${libdir}/pkgconfig/vg.pc" +FILES:libopenvg-imx = "${libdir}/libOpenVG*${REALSOLIBS} ${libdir}/libOpenVG*${SOLIBS}" +FILES:libopenvg-imx-dev = "${includedir}/VG ${libdir}/pkgconfig/vg.pc" +# libEGL does dlopen of libOpenVG.so +INSANE_SKIP:libopenvg-imx += "dev-so" FILES:libvdk-imx = "${libdir}/libVDK*${REALSOLIBS}" FILES:libvdk-imx-dev = "${includedir}/*vdk*.h ${libdir}/libVDK${SOLIBSDEV}" @@ -323,3 +427,8 @@ FILES:imx-gpu-viv-demos = "/opt" INSANE_SKIP:imx-gpu-viv-demos += "rpaths dev-deps" FILES:libnn-imx = "${libdir}/libNN*${SOLIBS}" + +# It will use gcompat at runtime therefore checking for these at compile time wont be useful as +# they dont match musl/gcompat but it should run fine +INSANE_SKIP:append:libc-musl = " file-rdeps" + diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv/imx_icd.json b/recipes-graphics/imx-gpu-viv/imx-gpu-viv/imx_icd.json new file mode 100644 index 00000000..21d83f94 --- /dev/null +++ b/recipes-graphics/imx-gpu-viv/imx-gpu-viv/imx_icd.json @@ -0,0 +1,7 @@ +{ + "file_format_version": "1.0.0", + "ICD": { + "library_path": "%libdir%/libvulkan_VSI.so.1", + "api_version": "%api_version%" + } +} diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.11.p2.2-aarch32.bb b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.11.p2.2-aarch32.bb new file mode 100644 index 00000000..07a92246 --- /dev/null +++ b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.11.p2.2-aarch32.bb @@ -0,0 +1,10 @@ +require imx-gpu-viv-6.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=2827219e81f28aba7c6a569f7c437fa7" + +IMX_SRCREV_ABBREV = "fd0148d" + +SRC_URI[md5sum] = "267d3e2d580e264157b7de01df22fb66" +SRC_URI[sha256sum] = "15efe6da5d4bac2a6067c2a898190be8754df6f14128c3db4756cff59c6da049" + +COMPATIBLE_MACHINE = "(mx6q-nxp-bsp|mx6dl-nxp-bsp|mx6sx-nxp-bsp|mx6sl-nxp-bsp|mx7ulp-nxp-bsp)" diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.11.p2.2-aarch64.bb b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.11.p2.2-aarch64.bb new file mode 100644 index 00000000..cea83ddc --- /dev/null +++ b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.11.p2.2-aarch64.bb @@ -0,0 +1,10 @@ +require imx-gpu-viv-6.inc + +LIC_FILES_CHKSUM = "file://COPYING;md5=2827219e81f28aba7c6a569f7c437fa7" + +IMX_SRCREV_ABBREV = "fd0148d" + +SRC_URI[md5sum] = "b76784e04f24ec9f2bedf2dd377ed5a8" +SRC_URI[sha256sum] = "6e34f3718925ba37c362cd09a3228cc56d03cfad323ebae0932f64449dbaeb2e" + +COMPATIBLE_MACHINE = "(mx8-nxp-bsp)" diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p4.0-aarch32.bb b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p4.0-aarch32.bb deleted file mode 100644 index d6cae8b6..00000000 --- a/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p4.0-aarch32.bb +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) 2013-2016 Freescale Semiconductor -# Copyright 2017-2020 NXP -# Released under the MIT license (see COPYING.MIT for the terms) - -require imx-gpu-viv-6.inc - -SRC_URI[md5sum] = "9abc4e59919b68f81094c194edb525a2" -SRC_URI[sha256sum] = "5f56e4690287fd4e8480d2c43101ef30383c95d155a3f06beadecad309e684a3" - -COMPATIBLE_MACHINE = "(mx6q-nxp-bsp|mx6dl-nxp-bsp|mx6sx-nxp-bsp|mx6sl-nxp-bsp|mx7ulp-nxp-bsp)" diff --git a/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p4.0-aarch64.bb b/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p4.0-aarch64.bb deleted file mode 100644 index 81ca2526..00000000 --- a/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.4.3.p4.0-aarch64.bb +++ /dev/null @@ -1,6 +0,0 @@ -require imx-gpu-viv-6.inc - -SRC_URI[md5sum] = "20cecb3e5440f63bb6612c740ccfe43a" -SRC_URI[sha256sum] = "283f2f51cadf5138bd47269a73425a51f69453556fb80f18521da04317e547a8" - -COMPATIBLE_MACHINE = "(mx8-nxp-bsp)" diff --git a/recipes-graphics/libva/libva_%.bbappend b/recipes-graphics/libva/libva_%.bbappend new file mode 100644 index 00000000..080052f8 --- /dev/null +++ b/recipes-graphics/libva/libva_%.bbappend @@ -0,0 +1 @@ +PACKAGECONFIG:remove:imxgpu = "glx" diff --git a/recipes-graphics/mesa/libglu_%.bbappend b/recipes-graphics/mesa/libglu_%.bbappend new file mode 100644 index 00000000..96745dd8 --- /dev/null +++ b/recipes-graphics/mesa/libglu_%.bbappend @@ -0,0 +1 @@ +REQUIRED_DISTRO_FEATURES:remove:imxgpu = "x11" diff --git a/recipes-graphics/mesa/mesa-demos/Add-OpenVG-demos-to-support-wayland.patch b/recipes-graphics/mesa/mesa-demos/Add-OpenVG-demos-to-support-wayland.patch deleted file mode 100644 index 19bcca98..00000000 --- a/recipes-graphics/mesa/mesa-demos/Add-OpenVG-demos-to-support-wayland.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 8aba54422d9a77383c150f9f70240b18b6e1918e Mon Sep 17 00:00:00 2001 -From: Prabhu Sundararaj <prabhu.sundararaj@freescale.com> -Date: Thu, 9 Apr 2015 15:47:21 -0500 -Subject: [PATCH] Add OpenVG demos to support wayland. - -Upstream-Status: Pending - -Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@freescale.com> ---- - src/egl/Makefile.am | 6 +++--- - src/egl/openvg/Makefile.am | 33 +++++++++++++++++++++++++++++---- - 2 files changed, 32 insertions(+), 7 deletions(-) - -Index: mesa-demos-8.2.0/src/egl/Makefile.am -=================================================================== ---- mesa-demos-8.2.0.orig/src/egl/Makefile.am 2016-05-09 11:45:51.479100180 -0500 -+++ mesa-demos-8.2.0/src/egl/Makefile.am 2016-05-09 11:45:51.475100160 -0500 -@@ -26,10 +26,10 @@ - eglut \ - opengles1 \ - opengles2 \ -- oes_vg -+ oes_vg \ -+ openvg - - if HAVE_GLU - SUBDIRS += \ -- opengl \ -- openvg -+ opengl - endif -Index: mesa-demos-8.2.0/src/egl/openvg/Makefile.am -=================================================================== ---- mesa-demos-8.2.0.orig/src/egl/openvg/Makefile.am 2016-05-09 11:45:51.479100180 -0500 -+++ mesa-demos-8.2.0/src/egl/openvg/Makefile.am 2016-05-09 12:39:30.000000000 -0500 -@@ -47,13 +47,26 @@ - endif - endif - -+if HAVE_WAYLAND -+EGL_WL_DEMOS = \ -+ lion_wayland \ -+ sp_wayland -+ -+if HAVE_FREETYPE2 -+EGL_WL_DEMOS += \ -+ vgtext_wayland -+endif -+endif -+ - if HAVE_EGL - if HAVE_VG - bin_PROGRAMS = \ -- $(EGL_X11_DEMOS) -+ $(EGL_X11_DEMOS) \ -+ $(EGL_WL_DEMOS) - endif - endif - -+if HAVE_X11 - lion_x11_SOURCES = lion.c lion-render.c lion-render.h - sp_x11_SOURCES = sp.c - -@@ -63,6 +76,20 @@ - text_SOURCES = text.c - text_CFLAGS = $(AM_CFLAGS) @FREETYPE2_CFLAGS@ - text_LDADD = @FREETYPE2_LIBS@ ../eglut/libeglut_x11.la -+endif -+ -+if HAVE_WAYLAND -+lion_wayland_SOURCES = lion.c lion-render.c lion-render.h -+lion_wayland_LDADD = ../eglut/libeglut_wayland.la -+ -+sp_wayland_SOURCES = sp.c -+sp_wayland_LDADD = ../eglut/libeglut_wayland.la -+ -+vgtext_wayland_SOURCES = text.c -+vgtext_wayland_CFLAGS = $(AM_CFLAGS) @FREETYPE2_CFLAGS@ -+vgtext_wayland_LDADD = @FREETYPE2_LIBS@ ../eglut/libeglut_wayland.la -+ -+endif - - SUBDIRS = \ - trivial diff --git a/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch b/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch index d899540f..8401793c 100644 --- a/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch +++ b/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Replace glWindowPos2iARB calls with glWindowPos2i Vivante libGL does not provide the glWindowPos2iARB symbol, but glWindowPos2i. Use this instead. -Upstream-Status: Inapropriate [embedded specific] +Upstream-Status: Inappropriate [embedded specific] Reported-by: Jeremy Stashluk <jstashluk@dekaresearch.com> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> diff --git a/recipes-graphics/mesa/mesa-demos/fix-clear-build-break.patch b/recipes-graphics/mesa/mesa-demos/fix-clear-build-break.patch index eb541d65..459a6ebd 100644 --- a/recipes-graphics/mesa/mesa-demos/fix-clear-build-break.patch +++ b/recipes-graphics/mesa/mesa-demos/fix-clear-build-break.patch @@ -1,7 +1,8 @@ mesa-demos: Add extension header to fix build break now that gl1 is removed -Upstream Status: Pending +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> diff --git a/src/egl/opengles1/clear.c b/src/egl/opengles1/clear.c index 9fe1b5291e1905fd6fe572063ed707d59ce45a81..ca9954a21b5f475709dbdef07f90b900962fcbc7 100644 --- a/src/egl/opengles1/clear.c diff --git a/recipes-graphics/mesa/mesa-demos_%.bbappend b/recipes-graphics/mesa/mesa-demos_%.bbappend index 4b518185..ff5d71ae 100644 --- a/recipes-graphics/mesa/mesa-demos_%.bbappend +++ b/recipes-graphics/mesa/mesa-demos_%.bbappend @@ -1,26 +1,23 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" -SRC_URI:append:imxgpu = " file://Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch \ - file://fix-clear-build-break.patch \ - file://Add-OpenVG-demos-to-support-wayland.patch" +SRC_URI:append:imxgpu = " \ + file://Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch \ + file://fix-clear-build-break.patch" +REQUIRED_DISTRO_FEATURES:remove:imxgpu = "x11" + +PACKAGECONFIG:remove = " \ + ${PACKAGECONFIG_REMOVE_IF_2D_ONLY} \ + ${PACKAGECONFIG_REMOVE_IF_GPU}" PACKAGECONFIG_REMOVE_IF_2D_ONLY = "" PACKAGECONFIG_REMOVE_IF_2D_ONLY:imxgpu2d = "gles1 gles2" PACKAGECONFIG_REMOVE_IF_2D_ONLY:imxgpu3d = "" PACKAGECONFIG_REMOVE_IF_GPU = "" -PACKAGECONFIG_REMOVE_IF_GPU:imxgpu = " \ - ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'glu x11', '', d)} \ -" -PACKAGECONFIG:remove = " \ - ${PACKAGECONFIG_REMOVE_IF_2D_ONLY} \ - ${PACKAGECONFIG_REMOVE_IF_GPU} \ -" +PACKAGECONFIG_REMOVE_IF_GPU:imxgpu = "x11" -PACKAGECONFIG_APPEND_IF_GPU = "" -PACKAGECONFIG_APPEND_IF_GPU:imxgpu = " \ - ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland vg', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glut', '', d)} \ -" PACKAGECONFIG:append = " \ - ${PACKAGECONFIG_APPEND_IF_GPU} \ -" + ${PACKAGECONFIG_APPEND_IF_GPU}" +PACKAGECONFIG_APPEND_IF_GPU = "" +PACKAGECONFIG_APPEND_IF_GPU:imxgpu = "glu" + +PACKAGECONFIG[glu] = ",,libglu" diff --git a/recipes-graphics/pango/pango_%.bbappend b/recipes-graphics/pango/pango_%.bbappend new file mode 100644 index 00000000..bf8c38fc --- /dev/null +++ b/recipes-graphics/pango/pango_%.bbappend @@ -0,0 +1,5 @@ +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + +RDEPENDS:${PN}:append:imxgpu:libc-musl = " gcompat" diff --git a/recipes-graphics/piglit/piglit_%.bbappend b/recipes-graphics/piglit/piglit_%.bbappend new file mode 100644 index 00000000..fe2a0bc2 --- /dev/null +++ b/recipes-graphics/piglit/piglit_%.bbappend @@ -0,0 +1,6 @@ +PACKAGECONFIG:remove:imxgpu = "glx" + +PACKAGECONFIG:append:mx8-nxp-bsp = " opencl" +PACKAGECONFIG:append:mx9-nxp-bsp = " opencl" + +CFLAGS:append:imxgpu:toolchain-clang = " -Wno-error=int-conversion" diff --git a/recipes-graphics/vulkan/vulkan-loader_%.bbappend b/recipes-graphics/vulkan/vulkan-loader_%.bbappend deleted file mode 100644 index 90776168..00000000 --- a/recipes-graphics/vulkan/vulkan-loader_%.bbappend +++ /dev/null @@ -1,3 +0,0 @@ -# The i.MX implementation is dynamically loaded, so it requires an -# explicit runtime dependency. -RRECOMMENDS:${PN}:append:imxgpu = " libvulkan-imx" diff --git a/recipes-graphics/vulkan/vulkan-loader_1.3.239.0.imx.bbappend b/recipes-graphics/vulkan/vulkan-loader_1.3.239.0.imx.bbappend new file mode 100644 index 00000000..05f566a8 --- /dev/null +++ b/recipes-graphics/vulkan/vulkan-loader_1.3.239.0.imx.bbappend @@ -0,0 +1,7 @@ +# libvulkan.so is loaded dynamically, so put it in the main package +SOLIBS = ".so*" +FILES_SOLIBSDEV = "" +INSANE_SKIP:${PN} += "dev-so" + +# Override default mesa drivers with i.MX GPU drivers +RRECOMMENDS:${PN}:imxvulkan = "libvulkan-imx" diff --git a/recipes-graphics/waffle/waffle/0001-meson-Add-missing-wayland-dependency-on-EGL.patch b/recipes-graphics/waffle/waffle/0001-meson-Add-missing-wayland-dependency-on-EGL.patch index 5f587d84..6f4be031 100644 --- a/recipes-graphics/waffle/waffle/0001-meson-Add-missing-wayland-dependency-on-EGL.patch +++ b/recipes-graphics/waffle/waffle/0001-meson-Add-missing-wayland-dependency-on-EGL.patch @@ -14,9 +14,11 @@ Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---- a/meson.build -+++ b/meson.build -@@ -63,6 +63,7 @@ dep_gl = _dep_null +Index: git/meson.build +=================================================================== +--- git.orig/meson.build ++++ git/meson.build +@@ -65,6 +65,7 @@ dep_gl = _dep_null dep_egl = _dep_null dep_wayland_client = _dep_null dep_wayland_egl = _dep_null @@ -24,7 +26,7 @@ Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> dep_wayland_scanner = _dep_null dep_wayland_proto = _dep_null dep_x11_xcb = _dep_null -@@ -104,7 +105,8 @@ else +@@ -106,7 +107,8 @@ else dep_wayland_client = dependency( 'wayland-client', version : '>= 1.10', required : get_option('wayland'), ) @@ -34,8 +36,8 @@ Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> 'wayland-egl', version : '>= 9.1', required : get_option('wayland'), ) dep_wayland_scanner = dependency( -@@ -120,7 +122,7 @@ else - wayland_xdg_shell_xml = join_paths(dep_wayland_proto.get_pkgconfig_variable('pkgdatadir'), +@@ -124,7 +126,7 @@ else + wayland_xdg_shell_xml = join_paths(dep_wayland_proto.get_variable(pkgconfig: 'pkgdatadir'), 'stable/xdg-shell/xdg-shell.xml') endif - build_wayland = dep_egl.found() and dep_wayland_client.found() and dep_wayland_egl.found() and dep_wayland_scanner.found() and dep_wayland_proto.found() diff --git a/recipes-graphics/wayland/required-distro-features.inc b/recipes-graphics/wayland/required-distro-features.inc new file mode 100644 index 00000000..bb4a0e8e --- /dev/null +++ b/recipes-graphics/wayland/required-distro-features.inc @@ -0,0 +1,8 @@ +# distro features required by weston recipes + +inherit features_check + +# requires pam enabled if started via systemd +# +REQUIRED_DISTRO_FEATURES = "wayland opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}" + diff --git a/recipes-graphics/wayland/wayland-protocols_1.25.imx.bb b/recipes-graphics/wayland/wayland-protocols_1.32.imx.bb index be6cbdb0..6b2a7091 100644 --- a/recipes-graphics/wayland/wayland-protocols_1.25.imx.bb +++ b/recipes-graphics/wayland/wayland-protocols_1.32.imx.bb @@ -6,11 +6,12 @@ protocol either in Wayland core, or some other protocol in \ wayland-protocols." HOMEPAGE = "http://wayland.freedesktop.org" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://COPYING;md5=c7b12b6702da38ca028ace54aae3d484 \ +LIC_FILES_CHKSUM = "file://LICENSE;md5=c7b12b6702da38ca028ace54aae3d484 \ file://stable/presentation-time/presentation-time.xml;endline=26;md5=4646cd7d9edc9fa55db941f2d3a7dc53" -SRC_URI = "git://source.codeaurora.org/external/imx/wayland-protocols-imx.git;protocol=https;branch=wayland-protocols-imx-1.25" -SRCREV = "a104fb66d1b899dc04077422c2204638675ee4a6" +SRC_URI = "git://github.com/nxp-imx/wayland-protocols-imx.git;protocol=https;branch=wayland-protocols-imx-${@oe.utils.trim_version("${PV}", 2)}" +SRCREV = "7ece577d467f8afb2f5a2f7fff3761a1e0ee9dad" + S = "${WORKDIR}/git" UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" @@ -24,5 +25,7 @@ EXTRA_OEMESON += "-Dtests=false" PACKAGES = "${PN}" FILES:${PN} += "${datadir}/pkgconfig/wayland-protocols.pc" +BBCLASSEXTEND = "native nativesdk" + PACKAGE_ARCH = "${MACHINE_SOCARCH}" -COMPATIBLE_MACHINE = "(imxfbdev|imxgpu)" +COMPATIBLE_MACHINE = "(mx6-nxp-bsp|mx7-nxp-bsp|mx8-nxp-bsp|mx9-nxp-bsp)" diff --git a/recipes-graphics/wayland/weston-10.0.4.imx/0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch b/recipes-graphics/wayland/weston-10.0.4.imx/0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch new file mode 100644 index 00000000..59f2a4b6 --- /dev/null +++ b/recipes-graphics/wayland/weston-10.0.4.imx/0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch @@ -0,0 +1,41 @@ +From 77eba6f6b04ff21b77c41500657495b4fd12a5f6 Mon Sep 17 00:00:00 2001 +From: Max Krummenacher <max.krummenacher@toradex.com> +Date: Mon, 11 Jul 2022 19:38:19 +0000 +Subject: [PATCH] Revert "protocol: no found wayland-scanner with Yocto + toolchain" + +This reverts commit 7859a762617682bd804e210ad3bda6bdcd3ea24a. + +With openembedded commit e525db4eb9 ("wayland: update 1.20.0 -> 1.21.0") +package config seems no longer to provide the path to the native +weston scanner. + +Thus the build fails with: + +| Run-time dependency wayland-scanner found: YES 1.21.0 +| Program /usr/bin/wayland-scanner found: NO +| +| ../git/protocol/meson.build:2:0: ERROR: Program '/usr/bin/wayland-scanner' not found or not executable + +Dropping weston 9.0.0-imx commit 7859a762 (protocol: no found +wayland-scanner with Yocto toolchain") fixes the issue. + +Upstream-Status: Inappropriate [Cross-compile Specific] +Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> +--- + protocol/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/protocol/meson.build b/protocol/meson.build +index bdd322ac..e50b23bb 100644 +--- a/protocol/meson.build ++++ b/protocol/meson.build +@@ -1,4 +1,4 @@ +-dep_scanner = dependency('wayland-scanner', native: false) ++dep_scanner = dependency('wayland-scanner', native: true) + prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner')) + + dep_wp = dependency('wayland-protocols', version: '>= 1.24') +-- +2.17.1 + diff --git a/recipes-graphics/wayland/weston-10.0.4.imx/0001-g2d-renderer.c-Include-sys-stat.h.patch b/recipes-graphics/wayland/weston-10.0.4.imx/0001-g2d-renderer.c-Include-sys-stat.h.patch new file mode 100644 index 00000000..b9cb31fb --- /dev/null +++ b/recipes-graphics/wayland/weston-10.0.4.imx/0001-g2d-renderer.c-Include-sys-stat.h.patch @@ -0,0 +1,34 @@ +From 4afe9b2f9ef24ce0c9bf1cd41f94ca45afa4f445 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 12 Sep 2022 20:58:14 -0700 +Subject: [PATCH] g2d-renderer.c: Include sys/stat.h + +This is needed for getting stat() prototype, its flagged with clang-15 +as error. + +| ../git/libweston/renderer-g2d/g2d-renderer.c:2057:6: error: call to undeclared function 'stat'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] +| if (stat(gr->drm_device, &dev_stat) != 0) { +| ^ +| 1 error generated. + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + libweston/renderer-g2d/g2d-renderer.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libweston/renderer-g2d/g2d-renderer.c b/libweston/renderer-g2d/g2d-renderer.c +index f59fc4ee..36a458fc 100644 +--- a/libweston/renderer-g2d/g2d-renderer.c ++++ b/libweston/renderer-g2d/g2d-renderer.c +@@ -41,6 +41,7 @@ + #include <drm_fourcc.h> + #include <poll.h> + #include <errno.h> ++#include <sys/stat.h> /* stat() */ + + #include <libweston/libweston.h> + #include "g2d-renderer.h" +-- +2.37.3 + diff --git a/recipes-graphics/wayland/weston-init.bbappend b/recipes-graphics/wayland/weston-init.bbappend index 4ba6cba7..9d04df23 100644 --- a/recipes-graphics/wayland/weston-init.bbappend +++ b/recipes-graphics/wayland/weston-init.bbappend @@ -8,46 +8,86 @@ REQUIRED_DISTRO_FEATURES:remove = "${IMX_REQUIRED_DISTRO_FEATURES_REMOVE}" SRC_URI:append:mx6sl-nxp-bsp = " file://weston.config" -# To customize weston.ini, start by setting the desired assignment in weston.ini, -# commented out. For example: -# #xwayland=true -# Then add the assignment to INI_UNCOMMENT_ASSIGNMENTS. -INI_UNCOMMENT_ASSIGNMENTS:append:imx-nxp-bsp = " \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland=true', '', d)} \ -" -INI_UNCOMMENT_ASSIGNMENTS:append:mx8-nxp-bsp = " \ - repaint-window=16 \ -" -INI_UNCOMMENT_ASSIGNMENTS:append:mx8mq-nxp-bsp = " \ - gbm-format=argb8888 \ - \\[shell\\] \ - size=1920x1080 \ +PACKAGECONFIG ??= " \ + no-idle-timeout \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xwayland', '', d)} \ + ${PACKAGECONFIG_GBM_FORMAT} \ + ${PACKAGECONFIG_REPAINT_WINDOW} \ + ${PACKAGECONFIG_SIZE} \ + ${PACKAGECONFIG_USE_G2D} \ " -# FIXME: The 8QM and 8QXP SoCs have better performance without G2D so don't enable it -# Ideally, this should be seamless and Vivante ought to handle it internally and take the fastest -# rendering code. -INI_UNCOMMENT_USE_G2D:imxgpu2d ?= "use-g2d=1" -INI_UNCOMMENT_USE_G2D:mx8qm-nxp-bsp = "" -INI_UNCOMMENT_USE_G2D:mx8qxp-nxp-bsp = "" -INI_UNCOMMENT_USE_G2D:mx8dx-nxp-bsp = "" -INI_UNCOMMENT_ASSIGNMENTS:append:imxgpu2d = " \ - ${INI_UNCOMMENT_USE_G2D} \ -" +# Mainline BSPs dont support xwayland +PACKAGECONFIG:remove:use-mainline-bsp = "xwayland" -uncomment() { - if ! grep -q "^#$1" $2 && ! grep -q "^$1" $2; then - bbwarn "Commented setting '#$1' not found in file $2" - fi - sed -i -e 's,^#'"$1"','"$1"',g' $2 -} +PACKAGECONFIG_GBM_FORMAT ?= "" +PACKAGECONFIG_GBM_FORMAT:mx8mq-nxp-bsp ?= "gbm-format" +PACKAGECONFIG_GBM_FORMAT:mx93-nxp-bsp ?= "gbm-format" + +GBM_FORMAT_VALUE:mx8mq-nxp-bsp = "argb8888" +GBM_FORMAT_VALUE:mx93-nxp-bsp = "argb8888" + +PACKAGECONFIG_REPAINT_WINDOW ?= "" +PACKAGECONFIG_REPAINT_WINDOW:mx8-nxp-bsp ?= "repaint-window" +PACKAGECONFIG_REPAINT_WINDOW:mx9-nxp-bsp ?= "repaint-window" + +PACKAGECONFIG_SIZE ?= "" +PACKAGECONFIG_SIZE:mx8mq-nxp-bsp ?= "size" + +SIZE_VALUE:mx8mq-nxp-bsp = "1920x1080" + +HAS_G2D = "false" +HAS_G2D:imxgpu2d = "true" + +PACKAGECONFIG_USE_G2D ?= "" +PACKAGECONFIG_USE_G2D:imxgpu2d ?= "use-g2d" +PACKAGECONFIG_USE_G2D:mx8qm-nxp-bsp ?= "" +PACKAGECONFIG_USE_G2D:mx8qxp-nxp-bsp ?= "" +PACKAGECONFIG_USE_G2D:mx8dx-nxp-bsp ?= "" +PACKAGECONFIG_USE_G2D:mx93-nxp-bsp ?= "use-g2d" + +USE_G2D_VALUE = "true" +USE_G2D_VALUE:mx6-nxp-bsp = "1" +USE_G2D_VALUE:mx7-nxp-bsp = "1" + +PACKAGECONFIG[gbm-format] = ",," +PACKAGECONFIG[rdp] = ",," +PACKAGECONFIG[repaint-window] = ",," +PACKAGECONFIG[size] = ",," +PACKAGECONFIG[use-g2d] = ",," +PACKAGECONFIG[xwayland] = ",," do_install:append() { if [ -f "${WORKDIR}/weston.config" ]; then install -Dm0755 ${WORKDIR}/weston.config ${D}${sysconfdir}/default/weston fi - for assignment in ${INI_UNCOMMENT_ASSIGNMENTS}; do - uncomment "$assignment" ${D}${sysconfdir}/xdg/weston/weston.ini - done + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'gbm-format', 'yes', 'no', d)}" = "yes" ]; then + sed -i -e "/^\[core\]/a gbm-format=${GBM_FORMAT_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'rdp', 'yes', 'no', d)}" = "yes" ]; then + sed -i -e "s|^command=${bindir}/weston .*|& --rdp-tls-cert=${sysconfdir}/freerdp/keys/server.crt --rdp-tls-key=${sysconfdir}/freerdp/keys/server.key|" ${D}${sysconfdir}/xdg/weston/weston.ini + sed -i -e "/^\[core\]/a modules=screen-share.so" ${D}${sysconfdir}/xdg/weston/weston.ini + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'repaint-window', 'yes', 'no', d)}" = "yes" ]; then + sed -i -e "/^\[core\]/a repaint-window=16" ${D}${sysconfdir}/xdg/weston/weston.ini + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'size', 'yes', 'no', d)}" = "yes" ]; then + sed -i -e "/^\[shell\]/a size=${SIZE_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'use-g2d', 'yes', 'no', d)}" = "yes" ]; then + sed -i -e "/^\[core\]/a use-g2d=${USE_G2D_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini + elif ${HAS_G2D}; then + sed -i -e "/^\[core\]/a #use-g2d=${USE_G2D_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "no" ]; then + sed -i -e "s/^xwayland=true/#xwayland=true/g" ${D}${sysconfdir}/xdg/weston/weston.ini + fi + sed -i -e 's,@bindir@,${bindir},g' ${D}${sysconfdir}/xdg/weston/weston.ini } diff --git a/recipes-graphics/wayland/weston-init/imx-nxp-bsp/weston.ini b/recipes-graphics/wayland/weston-init/imx-nxp-bsp/weston.ini index 3e8be42f..19e6ad24 100644 --- a/recipes-graphics/wayland/weston-init/imx-nxp-bsp/weston.ini +++ b/recipes-graphics/wayland/weston-init/imx-nxp-bsp/weston.ini @@ -1,14 +1,7 @@ [core] -#gbm-format=argb8888 -idle-time=0 -#use-g2d=1 -#xwayland=true -#repaint-window=16 #enable-overlay-view=1 -modules=screen-share.so -#[shell] -#size=1920x1080 +[shell] [libinput] touchscreen_calibrator=true @@ -28,4 +21,5 @@ touchscreen_calibrator=true #transform=rotate-90 [screen-share] -command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize --rdp-tls-cert=/etc/freerdp/keys/server.crt --rdp-tls-key=/etc/freerdp/keys/server.key +command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize +#start-on-startup=true diff --git a/recipes-graphics/wayland/weston/0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch b/recipes-graphics/wayland/weston/0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch index dde00546..25a4770f 100644 --- a/recipes-graphics/wayland/weston/0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch +++ b/recipes-graphics/wayland/weston/0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch @@ -1,4 +1,4 @@ -From be066d9841a9cd5e9cc5ef3c457bd1e33b2a5fae Mon Sep 17 00:00:00 2001 +From 3aa4024ac4107e68552be4dfe5fce511900629c9 Mon Sep 17 00:00:00 2001 From: Max Krummenacher <max.krummenacher@toradex.com> Date: Mon, 11 Jul 2022 19:38:19 +0000 Subject: [PATCH] Revert "protocol: no found wayland-scanner with Yocto @@ -20,13 +20,14 @@ Thus the build fails with: Dropping weston 9.0.0-imx commit 7859a762 (protocol: no found wayland-scanner with Yocto toolchain") fixes the issue. +Upstream-Status: Inappropriate [Cross-compile specific] Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> --- protocol/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/meson.build b/protocol/meson.build -index dc90ec2a..8290ad44 100644 +index e8698530..ba52089b 100644 --- a/protocol/meson.build +++ b/protocol/meson.build @@ -1,4 +1,4 @@ @@ -34,7 +35,7 @@ index dc90ec2a..8290ad44 100644 +dep_scanner = dependency('wayland-scanner', native: true) prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner')) - dep_wp = dependency('wayland-protocols', version: '>= 1.18') + dep_wp = dependency('wayland-protocols', version: '>= 1.26', -- -2.20.1 +2.25.1 diff --git a/recipes-graphics/wayland/weston/0001-g2d-renderer-Add-vsync-to-cloned-displays.patch b/recipes-graphics/wayland/weston/0001-g2d-renderer-Add-vsync-to-cloned-displays.patch deleted file mode 100644 index fb2d47bf..00000000 --- a/recipes-graphics/wayland/weston/0001-g2d-renderer-Add-vsync-to-cloned-displays.patch +++ /dev/null @@ -1,102 +0,0 @@ -From b719011b7c015e2d6f0108c9d0709b98d21d6a89 Mon Sep 17 00:00:00 2001 -From: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com> -Date: Mon, 21 Mar 2022 12:37:18 +0100 -Subject: [PATCH] g2d-renderer: Add vsync to cloned displays. - -When using g2d clone mode allocates additional surfaces according to -FB_MULTI_BUFFER for each cloned display. The g2d blit from the main screen -to the cloned displays is done using inactive surface. The FBIOPAN_DISPLAY -ioctl to the surface is done afterwards. - -Signed-off-by: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com> ---- - libweston/renderer-g2d/g2d-renderer.c | 33 +++++++++++++++++++++------ - 1 file changed, 26 insertions(+), 7 deletions(-) - -diff --git a/libweston/renderer-g2d/g2d-renderer.c b/libweston/renderer-g2d/g2d-renderer.c -index 34a077b7..3e6395d6 100644 ---- a/libweston/renderer-g2d/g2d-renderer.c -+++ b/libweston/renderer-g2d/g2d-renderer.c -@@ -525,6 +525,7 @@ g2d_blit_surface(void *handle, struct g2d_surfaceEx * srcG2dSurface, struct g2d_ - static void - g2d_flip_surface(struct weston_output *output) - { -+ int i; - struct g2d_output_state *go = get_output_state(output); - go->fb_info.varinfo.yoffset = go->activebuffer * go->fb_info.y_resolution; - -@@ -532,6 +533,16 @@ g2d_flip_surface(struct weston_output *output) - { - weston_log("FBIOPAN_DISPLAY Failed\n"); - } -+ -+ for (i = 0; i < go->clone_display_num; i++) -+ { -+ go->mirror_fb_info[i].varinfo.yoffset = go->activebuffer * go->mirror_fb_info[i].y_resolution; -+ if(ioctl(go->mirror_fb_info[i].fb_fd, FBIOPAN_DISPLAY, &(go->mirror_fb_info[i].varinfo)) < 0) -+ { -+ weston_log("FBIOPAN_DISPLAY clone %d Failed\n", i); -+ } -+ } -+ - go->activebuffer = (go->activebuffer + 1) % go->nNumBuffers; - } - -@@ -571,17 +582,18 @@ copy_to_framebuffer(struct weston_output *output, pixman_region32_t* output_dama - int i = 0; - for(i = 0; i < go->clone_display_num; i++) - { -+ int idx = i * go->nNumBuffers + go->activebuffer; - g2dRECT srcRect = {0, 0, go->renderSurf[go->activebuffer].base.width, go->renderSurf[go->activebuffer].base.height}; -- g2dRECT dstrect = {0, 0, go->mirrorSurf[i].base.width, go->mirrorSurf[i].base.height}; -+ g2dRECT dstrect = {0, 0, go->mirrorSurf[idx].base.width, go->mirrorSurf[idx].base.height}; - if(go->directBlit || go->nNumBuffers > 1) - { - g2d_blit_surface(gr->handle, &go->renderSurf[go->activebuffer], -- &go->mirrorSurf[i], &srcRect, &dstrect); -+ &go->mirrorSurf[idx], &srcRect, &dstrect); - } - else - { - g2d_blit_surface(gr->handle, &go->offscreenSurface, -- &go->mirrorSurf[i], &srcRect, &dstrect); -+ &go->mirrorSurf[idx], &srcRect, &dstrect); - } - } - } -@@ -2113,6 +2125,7 @@ g2d_fbdev_renderer_output_create(struct weston_output *output, - int clone_display_num = 0; - int count = 0; - int k=0, dispCount = 0; -+ int offset = 0; - char displays[5][32]; - weston_log("g2d_renderer_output_create device=%s\n", device); - count = strlen(device); -@@ -2166,7 +2179,7 @@ g2d_fbdev_renderer_output_create(struct weston_output *output, - - if(go->clone_display_num) - { -- go->mirrorSurf = zalloc(sizeof(struct g2d_surfaceEx) * clone_display_num); -+ go->mirrorSurf = zalloc(sizeof(struct g2d_surfaceEx) * clone_display_num * go->nNumBuffers); - go->mirror_fb_info = zalloc(sizeof(struct fb_screeninfo) * clone_display_num); - if(go->mirrorSurf == NULL || go->mirror_fb_info == NULL) - return -1; -@@ -2178,9 +2191,15 @@ g2d_fbdev_renderer_output_create(struct weston_output *output, - weston_log("Open frame buffer failed.\n"); - return -1; - } -- get_G2dSurface_from_screeninfo(&go->mirror_fb_info[i], &go->mirrorSurf[i]); -- go->mirrorSurf[i].base.planes[0] = go->mirror_fb_info[i].physical; -- g2d_clear(gr->handle, &go->mirrorSurf[i].base); -+ -+ offset = go->mirror_fb_info[i].stride_bytes * go->mirror_fb_info[i].y_resolution; -+ for(k = 0; k < go->nNumBuffers; k++) -+ { -+ int idx = i * go->nNumBuffers + k; -+ get_G2dSurface_from_screeninfo(&go->mirror_fb_info[i], &go->mirrorSurf[idx]); -+ go->mirrorSurf[idx].base.planes[0] = go->mirror_fb_info[i].physical + (offset * k); -+ g2d_clear(gr->handle, &go->mirrorSurf[idx].base); -+ } - } - } - g2d_finish(gr->handle); diff --git a/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch b/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch deleted file mode 100644 index db640055..00000000 --- a/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 4be82f75a47bd456452ab713d7d57a75d844f42a Mon Sep 17 00:00:00 2001 -From: Marius Vlad <marius.vlad@collabora.com> -Date: Thu, 1 Apr 2021 00:12:00 +0300 -Subject: [PATCH] libweston/backend-drm: Re-order gbm destruction at - DRM-backend tear down - -Tearing down the drm-backend when there are no input devices, would call -for the gbm device destruction before compositor shutdown. The latter -would call into the renderer detroy function and assume that the -EGLDisplay, which was created using the before-mentioned gbm device, is -still available. This patch re-orders the gbm destruction after the -compositor shutdown when no one would make use of it. - -Fixes: #314 - -Signed-off-by: Marius Vlad <marius.vlad@collabora.com> -Suggested-by: Daniel Stone <daniel.stone@collabora.com> - -Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/weston/-/commit/d171c7b3ba346c4d0bd6494f45ebf0be3c3cc5fb] ---- - libweston/backend-drm/drm.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c -index 9d3b5dcc..67834d3e 100644 ---- a/libweston/backend-drm/drm.c -+++ b/libweston/backend-drm/drm.c -@@ -3402,10 +3402,6 @@ err_drm_source: - wl_event_source_remove(b->drm_source); - err_udev_input: - udev_input_destroy(&b->input); --#ifdef BUILD_DRM_GBM -- if (b->gbm) -- gbm_device_destroy(b->gbm); --#endif - destroy_sprites(b); - err_udev_dev: - udev_device_unref(drm_device); -@@ -3415,6 +3411,10 @@ err_launcher: - weston_launcher_destroy(compositor->launcher); - err_compositor: - weston_compositor_shutdown(compositor); -+#ifdef BUILD_DRM_GBM -+ if (b->gbm) -+ gbm_device_destroy(b->gbm); -+#endif - free(b); - return NULL; - } --- -2.17.1 - diff --git a/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch b/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch deleted file mode 100644 index 06e0f7ba..00000000 --- a/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a2ba4714a6872e547621d29d9ddcb0f374b88cf6 Mon Sep 17 00:00:00 2001 -From: Chen Qi <Qi.Chen@windriver.com> -Date: Tue, 20 Apr 2021 20:42:18 -0700 -Subject: [PATCH] meson.build: fix incorrect header - -The wayland.c actually include 'xdg-shell-client-protocol.h' instead of -the server one, so fix it. Otherwise, it's possible to get build failure -due to race condition. - -Upstream-Status: Pending - -Signed-off-by: Chen Qi <Qi.Chen@windriver.com> ---- - libweston/backend-wayland/meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libweston/backend-wayland/meson.build b/libweston/backend-wayland/meson.build -index 7e82513..29270b5 100644 ---- a/libweston/backend-wayland/meson.build -+++ b/libweston/backend-wayland/meson.build -@@ -10,7 +10,7 @@ srcs_wlwl = [ - fullscreen_shell_unstable_v1_protocol_c, - presentation_time_protocol_c, - presentation_time_server_protocol_h, -- xdg_shell_server_protocol_h, -+ xdg_shell_client_protocol_h, - xdg_shell_protocol_c, - ] - --- -2.30.2 - diff --git a/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch deleted file mode 100644 index f6ebfd8f..00000000 --- a/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch +++ /dev/null @@ -1,199 +0,0 @@ -From a1548c742bf2dedbb47282d8a00407b60bbab669 Mon Sep 17 00:00:00 2001 -From: Tom Hochstein <tom.hochstein@nxp.com> -Date: Wed, 22 Feb 2017 15:53:30 +0200 -Subject: [PATCH] weston-launch: Provide a default version that doesn't require - - PAM - -weston-launch requires PAM for starting weston as a non-root user. - -Since starting weston as root is a valid use case by itself, if -PAM is not available, provide a default version of weston-launch -without non-root-user support. - -Upstream-Status: Denied [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/725] - -Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> -Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> -Signed-off-by: Denys Dmytriyenko <denys@ti.com> -Signed-off-by: Ming Liu <ming.liu@toradex.com> - ---- - libweston/meson.build | 16 ++++++++++++---- - libweston/weston-launch.c | 21 +++++++++++++++++++++ - meson_options.txt | 7 +++++++ - 3 files changed, 40 insertions(+), 4 deletions(-) - -diff --git a/libweston/meson.build b/libweston/meson.build -index 08d23ec..cb9fd3f 100644 ---- a/libweston/meson.build -+++ b/libweston/meson.build -@@ -216,16 +216,24 @@ dep_vertex_clipping = declare_dependency( - ) - - if get_option('weston-launch') -- dep_pam = cc.find_library('pam') -+ deps_weston_launch = [systemd_dep, dep_libdrm] - -- if not cc.has_function('pam_open_session', dependencies: dep_pam) -- error('pam_open_session not found for weston-launch') -+ if get_option('pam') -+ dep_pam = cc.find_library('pam') -+ if not cc.has_function('pam_open_session', dependencies: dep_pam) -+ error('pam_open_session not found for weston-launch') -+ endif -+ -+ if dep_pam.found() -+ deps_weston_launch += dep_pam -+ config_h.set('HAVE_PAM', '1') -+ endif - endif - - executable( - 'weston-launch', - 'weston-launch.c', -- dependencies: [dep_pam, systemd_dep, dep_libdrm], -+ dependencies: deps_weston_launch, - include_directories: common_inc, - install: true - ) -diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c -index 521cb2c..2d42d33 100644 ---- a/libweston/weston-launch.c -+++ b/libweston/weston-launch.c -@@ -51,7 +51,9 @@ - - #include <pwd.h> - #include <grp.h> -+#ifdef HAVE_PAM - #include <security/pam_appl.h> -+#endif - - #ifdef HAVE_SYSTEMD_LOGIN - #include <systemd/sd-login.h> -@@ -100,8 +102,10 @@ drmSetMaster(int drm_fd) - #endif - - struct weston_launch { -+#ifdef HAVE_PAM - struct pam_conv pc; - pam_handle_t *ph; -+#endif - int tty; - int ttynr; - int sock[2]; -@@ -192,6 +196,7 @@ weston_launch_allowed(struct weston_launch *wl) - return false; - } - -+#ifdef HAVE_PAM - static int - pam_conversation_fn(int msg_count, - const struct pam_message **messages, -@@ -232,6 +237,7 @@ setup_pam(struct weston_launch *wl) - - return 0; - } -+#endif - - static int - setup_launcher_socket(struct weston_launch *wl) -@@ -466,6 +472,7 @@ quit(struct weston_launch *wl, int status) - close(wl->signalfd); - close(wl->sock[0]); - -+#ifdef HAVE_PAM - if (wl->new_user) { - err = pam_close_session(wl->ph, 0); - if (err) -@@ -473,6 +480,7 @@ quit(struct weston_launch *wl, int status) - err, pam_strerror(wl->ph, err)); - pam_end(wl->ph, err); - } -+#endif - - /* - * Get a fresh handle to the tty as the previous one is in -@@ -710,6 +718,7 @@ setup_session(struct weston_launch *wl, char **child_argv) - setenv("HOME", wl->pw->pw_dir, 1); - setenv("SHELL", wl->pw->pw_shell, 1); - -+#ifdef HAVE_PAM - env = pam_getenvlist(wl->ph); - if (env) { - for (i = 0; env[i]; ++i) { -@@ -718,6 +727,7 @@ setup_session(struct weston_launch *wl, char **child_argv) - } - free(env); - } -+#endif - - /* - * We open a new session, so it makes sense -@@ -789,8 +799,10 @@ static void - help(const char *name) - { - fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name); -+#ifdef HAVE_PAM - fprintf(stderr, " -u, --user Start session as specified username,\n" - " e.g. -u joe, requires root.\n"); -+#endif - fprintf(stderr, " -t, --tty Start session on alternative tty,\n" - " e.g. -t /dev/tty4, requires -u option.\n"); - fprintf(stderr, " -v, --verbose Be verbose\n"); -@@ -804,7 +816,9 @@ main(int argc, char *argv[]) - int i, c; - char *tty = NULL; - struct option opts[] = { -+#ifdef HAVE_PAM - { "user", required_argument, NULL, 'u' }, -+#endif - { "tty", required_argument, NULL, 't' }, - { "verbose", no_argument, NULL, 'v' }, - { "help", no_argument, NULL, 'h' }, -@@ -816,11 +830,16 @@ main(int argc, char *argv[]) - while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) { - switch (c) { - case 'u': -+#ifdef HAVE_PAM - wl.new_user = optarg; - if (getuid() != 0) { - fprintf(stderr, "weston: Permission denied. -u allowed for root only\n"); - exit(EXIT_FAILURE); - } -+#else -+ fprintf(stderr, "weston: -u is unsupported in this weston-launch build\n"); -+ exit(EXIT_FAILURE); -+#endif - break; - case 't': - tty = optarg; -@@ -872,8 +891,10 @@ main(int argc, char *argv[]) - if (setup_tty(&wl, tty) < 0) - exit(EXIT_FAILURE); - -+#ifdef HAVE_PAM - if (wl.new_user && setup_pam(&wl) < 0) - exit(EXIT_FAILURE); -+#endif - - if (setup_launcher_socket(&wl) < 0) - exit(EXIT_FAILURE); -diff --git a/meson_options.txt b/meson_options.txt -index 239bd2d..99e4ec3 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -73,6 +73,13 @@ option( - ) - - option( -+ 'pam', -+ type: 'boolean', -+ value: true, -+ description: 'Define if PAM is available' -+) -+ -+option( - 'xwayland', - type: 'boolean', - value: true, diff --git a/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch b/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch deleted file mode 100644 index a4444e5d..00000000 --- a/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch +++ /dev/null @@ -1,23 +0,0 @@ -Fix atomic modesetting with musl - -atomic modesetting seems to fail with drm weston backend and this patch fixes -it, below errors are seen before weston exits - -atomic: couldn't commit new state: Invalid argument - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/issues/158] -Signed-off-by: Khem Raj <raj.khem@gmail.com> - ---- a/libweston/backend-drm/kms.c -+++ b/libweston/backend-drm/kms.c -@@ -1168,8 +1168,8 @@ drm_pending_state_apply_atomic(struct dr - wl_list_for_each(plane, &b->plane_list, link) { - drm_debug(b, "\t\t[atomic] starting with plane %lu disabled\n", - (unsigned long) plane->plane_id); -- plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0); -- plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0); -+ //plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0); -+ //plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0); - } - - flags |= DRM_MODE_ATOMIC_ALLOW_MODESET; diff --git a/recipes-graphics/wayland/weston/xwayland.weston-start b/recipes-graphics/wayland/weston/xwayland.weston-start index db384b1a..49204f21 100644 --- a/recipes-graphics/wayland/weston/xwayland.weston-start +++ b/recipes-graphics/wayland/weston/xwayland.weston-start @@ -1,5 +1,6 @@ #!/bin/sh if type Xwayland >/dev/null 2>/dev/null; then - mkdir -p /tmp/.X11-unix + mkdir -m 775 -p /tmp/.X11-unix + chown root:video /tmp/.X11-unix fi diff --git a/recipes-graphics/wayland/weston_9.0.0.imx.bb b/recipes-graphics/wayland/weston_10.0.4.imx.bb index 63143787..e31d2280 100644 --- a/recipes-graphics/wayland/weston_9.0.0.imx.bb +++ b/recipes-graphics/wayland/weston_10.0.4.imx.bb @@ -3,37 +3,33 @@ # recipe. The second section customizes the recipe for i.MX. ########### OE-core copy ################## -# Upstream hash: c8aa0222ce2be647911114aaebcbb0d55d7caf87 +# Upstream hash: 4b42fd87da290ddea098605aea3a5cce1fb432a7 SUMMARY = "Weston, a Wayland compositor" DESCRIPTION = "Weston is the reference implementation of a Wayland compositor" HOMEPAGE = "http://wayland.freedesktop.org" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \ - file://libweston/compositor.c;endline=27;md5=6c53bbbd99273f4f7c4affa855c33c0a" + file://libweston/compositor.c;endline=27;md5=eb6d5297798cabe2ddc65e2af519bcf0 \ + " -SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ +SRC_URI = "https://gitlab.freedesktop.org/wayland/weston/-/releases/${PV}/downloads/${BPN}-${PV}.tar.xz \ file://weston.png \ file://weston.desktop \ file://xwayland.weston-start \ file://systemd-notify.weston-start \ - file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ - file://0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch \ - file://0001-meson.build-fix-incorrect-header.patch \ - file://0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch \ - file://0001-g2d-renderer-Add-vsync-to-cloned-displays.patch \ -" + " -SRC_URI:append:libc-musl = " file://dont-use-plane-add-prop.patch " - -SRC_URI[sha256sum] = "5cf5d6ce192e0eb15c1fc861a436bf21b5bb3b91dbdabbdebe83e1f83aa098fe" +SRC_URI[sha256sum] = "89646ca0d9f8d413c2767e5c3828eaa3fa149c2a105b3729a6894fa7cf1549e7" UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" +UPSTREAM_CHECK_REGEX = "weston-(?P<pver>\d+\.\d+\.(?!9\d+)\d+)" + +inherit meson pkgconfig useradd -inherit meson pkgconfig useradd features_check # depends on virtual/egl -# weston-init requires pam enabled if started via systemd -REQUIRED_DISTRO_FEATURES = "opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}" +# +require ${THISDIR}/required-distro-features.inc DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0" DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native" @@ -42,19 +38,22 @@ LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'lto', '-Wl,-z,undefs', '', WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}" -EXTRA_OEMESON += "-Dbackend-default=auto -Dpipewire=false" +EXTRA_OEMESON += "-Dpipewire=false" -PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl clients', '', d)} \ +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms wayland egl clients', '', d)} \ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \ ${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \ - launch \ + ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'sysvinit', 'launcher-libseat', '', d)} \ image-jpeg \ screenshare \ shell-desktop \ shell-fullscreen \ shell-ivi" +# Can be 'damage', 'im', 'egl', 'shm', 'touch', 'dmabuf-feedback', 'dmabuf-v4l', 'dmabuf-egl' or 'all' +SIMPLECLIENTS ?= "all" + # # Compositor choices # @@ -67,11 +66,11 @@ PACKAGECONFIG[x11] = "-Dbackend-x11=true,-Dbackend-x11=false,virtual/libx11 libx # Headless Weston PACKAGECONFIG[headless] = "-Dbackend-headless=true,-Dbackend-headless=false" # Weston on framebuffer -PACKAGECONFIG[fbdev] = "-Dbackend-fbdev=true,-Dbackend-fbdev=false,udev mtdev" +PACKAGECONFIG[fbdev] = "-Ddeprecated-backend-fbdev=true,-Ddeprecated-backend-fbdev=false,udev mtdev" # Weston on RDP PACKAGECONFIG[rdp] = "-Dbackend-rdp=true,-Dbackend-rdp=false,freerdp" # weston-launch -PACKAGECONFIG[launch] = "-Dweston-launch=true,-Dweston-launch=false,drm" +PACKAGECONFIG[launch] = "-Ddeprecated-weston-launch=true,-Ddeprecated-weston-launch=false,drm" # VA-API desktop recorder PACKAGECONFIG[vaapi] = "-Dbackend-drm-screencast-vaapi=true,-Dbackend-drm-screencast-vaapi=false,libva" # Weston with EGL support @@ -87,11 +86,9 @@ PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false" # colord CMS support PACKAGECONFIG[colord] = "-Dcolor-management-colord=true,-Dcolor-management-colord=false,colord" # Clients support -PACKAGECONFIG[clients] = "-Dsimple-clients=all -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false" +PACKAGECONFIG[clients] = "-Dsimple-clients=${SIMPLECLIENTS} -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false" # Virtual remote output with GStreamer on DRM backend PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer1.0 gstreamer1.0-plugins-base" -# Weston with PAM support -PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam" # Weston with screen-share support PACKAGECONFIG[screenshare] = "-Dscreenshare=true,-Dscreenshare=false" # Traditional desktop shell @@ -102,6 +99,8 @@ PACKAGECONFIG[shell-fullscreen] = "-Dshell-fullscreen=true,-Dshell-fullscreen=fa PACKAGECONFIG[shell-ivi] = "-Dshell-ivi=true,-Dshell-ivi=false" # JPEG image loading support PACKAGECONFIG[image-jpeg] = "-Dimage-jpeg=true,-Dimage-jpeg=false, jpeg" +# support libseat based launch +PACKAGECONFIG[launcher-libseat] = "-Dlauncher-libseat=true,-Dlauncher-libseat=false,seatd" do_install:append() { # Weston doesn't need the .la files to load modules, so wipe them @@ -156,16 +155,17 @@ GROUPADD_PARAM:${PN} = "--system weston-launch" SUMMARY = "Weston, a Wayland compositor, i.MX fork" +LIC_FILES_CHKSUM:remove = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70" +LIC_FILES_CHKSUM:append = "file://LICENSE;md5=d79ee9e66bb0f95d3386a7acae780b70" + DEFAULT_PREFERENCE = "-1" -SRCBRANCH = "weston-imx-9.0" -SRC_URI:remove = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ - file://0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch \ -" -SRC_URI:prepend = "git://source.codeaurora.org/external/imx/weston-imx.git;protocol=https;branch=${SRCBRANCH} \ - file://0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch \ -" -SRCREV = "7859a762617682bd804e210ad3bda6bdcd3ea24a" +SRC_URI:remove = "https://gitlab.freedesktop.org/wayland/weston/-/releases/${PV}/downloads/${BPN}-${PV}.tar.xz" +SRC_URI:prepend = "git://github.com/nxp-imx/weston-imx.git;protocol=https;branch=${SRCBRANCH} " +SRC_URI += "file://0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch \ + file://0001-g2d-renderer.c-Include-sys-stat.h.patch" +SRCBRANCH = "weston-imx-10.0.4" +SRCREV = "6210a8f1302252273b50cc3c0ff55ec680dda479" S = "${WORKDIR}/git" # Disable OpenGL for parts with GPU support for 2D but not 3D @@ -176,7 +176,8 @@ PACKAGECONFIG_OPENGL = "opengl" PACKAGECONFIG_OPENGL:imxgpu2d = "" PACKAGECONFIG_OPENGL:imxgpu3d = "opengl" -PACKAGECONFIG:remove = "wayland x11" +PACKAGECONFIG_IMX_REMOVALS ?= "wayland x11" +PACKAGECONFIG:remove = "${PACKAGECONFIG_IMX_REMOVALS}" PACKAGECONFIG:append = " ${@bb.utils.filter('DISTRO_FEATURES', '${PACKAGECONFIG_OPENGL}', d)}" PACKAGECONFIG:remove:imxfbdev = "kms" @@ -184,11 +185,10 @@ PACKAGECONFIG:append:imxfbdev = " fbdev clients" PACKAGECONFIG:append:imxgpu = " imxgpu" PACKAGECONFIG:append:imxgpu2d = " imxg2d" -# Clients support -SIMPLE_CLIENTS = "all" -SIMPLE_CLIENTS:imxfbdev = "damage,im,egl,shm,touch,dmabuf-v4l" -PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false,libxcursor" -PACKAGECONFIG[clients] = "-Dsimple-clients=${SIMPLE_CLIENTS} -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false" +SIMPLECLIENTS:imxfbdev = "damage,im,egl,shm,touch,dmabuf-v4l" + +# Override +PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false,libxcursor xwayland" # Weston with i.MX GPU support PACKAGECONFIG[imxgpu] = "-Dimxgpu=true,-Dimxgpu=false,virtual/egl" # Weston with i.MX G2D renderer @@ -196,6 +196,15 @@ PACKAGECONFIG[imxg2d] = "-Drenderer-g2d=true,-Drenderer-g2d=false,virtual/libg2d # Weston with OpenGL support PACKAGECONFIG[opengl] = "-Dopengl=true,-Dopengl=false" +PACKAGECONFIG[fbdev] = "-Dbackend-fbdev=true,-Dbackend-fbdev=false,udev mtdev libdrm" +EXTRA_OEMESON:append:imxfbdev = " -Dbackend-default=fbdev" + +EXTRA_OEMESON += "-Ddeprecated-wl-shell=true" + +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + PACKAGE_ARCH = "${MACHINE_SOCARCH}" COMPATIBLE_MACHINE = "(imxfbdev|imxgpu)" diff --git a/recipes-graphics/wayland/weston_11.0.3.imx.bb b/recipes-graphics/wayland/weston_11.0.3.imx.bb new file mode 100644 index 00000000..67eae268 --- /dev/null +++ b/recipes-graphics/wayland/weston_11.0.3.imx.bb @@ -0,0 +1,188 @@ +# This recipe is for the i.MX fork of weston. For ease of +# maintenance, the top section is a verbatim copy of an OE-core +# recipe. The second section customizes the recipe for i.MX. + +########### OE-core copy ################## +# Upstream hash: 7f1932cb5a408320a5b542e20ba2807718349e8f + +SUMMARY = "Weston, a Wayland compositor" +DESCRIPTION = "Weston is the reference implementation of a Wayland compositor" +HOMEPAGE = "http://wayland.freedesktop.org" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \ + file://libweston/compositor.c;endline=27;md5=eb6d5297798cabe2ddc65e2af519bcf0 \ + " + +SRC_URI = "https://gitlab.freedesktop.org/wayland/weston/uploads/f5648c818fba5432edc3ea63c4db4813/${BPN}-${PV}.tar.xz \ + file://weston.png \ + file://weston.desktop \ + file://xwayland.weston-start \ + file://systemd-notify.weston-start \ + " + +SRC_URI[sha256sum] = "a413f68c252957fc3191c3650823ec356ae8c124ccc0cb440da5cdc4e2cb9e57" + +UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" +UPSTREAM_CHECK_REGEX = "weston-(?P<pver>\d+\.\d+\.(?!9\d+)\d+)" + +inherit meson pkgconfig useradd + +# depends on virtual/egl +# +require ${THISDIR}/required-distro-features.inc + +DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0" +DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native" + +LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'lto', '-Wl,-z,undefs', '', d)}" + +WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}" + +EXTRA_OEMESON += "-Dpipewire=false" + +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms wayland egl clients', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \ + ${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \ + ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'sysvinit', 'launcher-libseat', '', d)} \ + image-jpeg \ + screenshare \ + shell-desktop \ + shell-fullscreen \ + shell-ivi \ + shell-kiosk \ + " + +# Can be 'damage', 'im', 'egl', 'shm', 'touch', 'dmabuf-feedback', 'dmabuf-v4l', 'dmabuf-egl' or 'all' +SIMPLECLIENTS ?= "all" + +# +# Compositor choices +# +# Weston on KMS +PACKAGECONFIG[kms] = "-Dbackend-drm=true,-Dbackend-drm=false,drm udev virtual/egl virtual/libgles2 virtual/libgbm mtdev" +# Weston on Wayland (nested Weston) +PACKAGECONFIG[wayland] = "-Dbackend-wayland=true,-Dbackend-wayland=false,virtual/egl virtual/libgles2" +# Weston on X11 +PACKAGECONFIG[x11] = "-Dbackend-x11=true,-Dbackend-x11=false,virtual/libx11 libxcb libxcb libxcursor cairo" +# Headless Weston +PACKAGECONFIG[headless] = "-Dbackend-headless=true,-Dbackend-headless=false" +# Weston on RDP +PACKAGECONFIG[rdp] = "-Dbackend-rdp=true,-Dbackend-rdp=false,freerdp" +# VA-API desktop recorder +PACKAGECONFIG[vaapi] = "-Dbackend-drm-screencast-vaapi=true,-Dbackend-drm-screencast-vaapi=false,libva" +# Weston with EGL support +PACKAGECONFIG[egl] = "-Drenderer-gl=true,-Drenderer-gl=false,virtual/egl" +# Weston with lcms support +PACKAGECONFIG[lcms] = "-Dcolor-management-lcms=true,-Dcolor-management-lcms=false,lcms" +# Weston with webp support +PACKAGECONFIG[webp] = "-Dimage-webp=true,-Dimage-webp=false,libwebp" +# Weston with systemd-login support +PACKAGECONFIG[systemd] = "-Dsystemd=true -Dlauncher-logind=true,-Dsystemd=false -Dlauncher-logind=false,systemd dbus" +# Weston with Xwayland support (requires X11 and Wayland) +PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false,xwayland" +# colord CMS support +PACKAGECONFIG[colord] = "-Ddeprecated-color-management-colord=true,-Ddeprecated-color-management-colord=false,colord" +# Clients support +PACKAGECONFIG[clients] = "-Dsimple-clients=${SIMPLECLIENTS} -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false" +# Virtual remote output with GStreamer on DRM backend +PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer1.0 gstreamer1.0-plugins-base" +# Weston with screen-share support +PACKAGECONFIG[screenshare] = "-Dscreenshare=true,-Dscreenshare=false" +# Traditional desktop shell +PACKAGECONFIG[shell-desktop] = "-Dshell-desktop=true,-Dshell-desktop=false" +# Fullscreen shell +PACKAGECONFIG[shell-fullscreen] = "-Dshell-fullscreen=true,-Dshell-fullscreen=false" +# In-Vehicle Infotainment (IVI) shell +PACKAGECONFIG[shell-ivi] = "-Dshell-ivi=true,-Dshell-ivi=false" +# Kiosk shell +PACKAGECONFIG[shell-kiosk] = "-Dshell-kiosk=true,-Dshell-kiosk=false" +# JPEG image loading support +PACKAGECONFIG[image-jpeg] = "-Dimage-jpeg=true,-Dimage-jpeg=false, jpeg" +# support libseat based launch +PACKAGECONFIG[launcher-libseat] = "-Dlauncher-libseat=true,-Dlauncher-libseat=false,seatd" + +do_install:append() { + # Weston doesn't need the .la files to load modules, so wipe them + rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la + + # If X11, ship a desktop file to launch it + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then + install -d ${D}${datadir}/applications + install ${WORKDIR}/weston.desktop ${D}${datadir}/applications + + install -d ${D}${datadir}/icons/hicolor/48x48/apps + install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then + install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'yes', 'no', d)}" = "yes" ]; then + install -Dm 644 ${WORKDIR}/systemd-notify.weston-start ${D}${datadir}/weston-start/systemd-notify + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'launch', 'yes', 'no', d)}" = "yes" ]; then + chmod u+s ${D}${bindir}/weston-launch + fi +} + +PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \ + libweston-${WESTON_MAJOR_VERSION} ${PN}-examples" + +FILES:${PN}-dev += "${libdir}/${BPN}/libexec_weston.so" +FILES:${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so* ${datadir}" + +FILES:libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so" +SUMMARY:libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'." + +FILES:${PN}-examples = "${bindir}/*" + +FILES:${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so" +RDEPENDS:${PN}-xwayland += "xwayland" + +RDEPENDS:${PN} += "xkeyboard-config" +RRECOMMENDS:${PN} = "weston-init liberation-fonts" +RRECOMMENDS:${PN}-dev += "wayland-protocols" + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM:${PN} = "--system weston-launch" + +########### End of OE-core copy ########### + +########### i.MX overrides ################ + +SUMMARY = "Weston, a Wayland compositor, i.MX fork" +LIC_FILES_CHKSUM:remove = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70" +LIC_FILES_CHKSUM += "file://LICENSE;md5=d79ee9e66bb0f95d3386a7acae780b70" + +DEFAULT_PREFERENCE = "-1" + +SRC_URI:remove = "https://gitlab.freedesktop.org/wayland/weston/uploads/f5648c818fba5432edc3ea63c4db4813/${BPN}-${PV}.tar.xz" +SRC_URI:prepend = "git://github.com/nxp-imx/weston-imx.git;protocol=https;branch=${SRCBRANCH} " +SRC_URI += "file://0001-Revert-protocol-no-found-wayland-scanner-with-Yocto-.patch" +SRCBRANCH = "weston-imx-11.0.3" +SRCREV = "a509c319b7bfc72638c9b9d8f5e4b6259aba0ab7" +S = "${WORKDIR}/git" + +PACKAGECONFIG_IMX_REMOVALS ?= "wayland x11" +PACKAGECONFIG:remove = "${PACKAGECONFIG_IMX_REMOVALS}" + +PACKAGECONFIG:append:imxgpu2d = " imxg2d" +PACKAGECONFIG:append:mx93-nxp-bsp = " imxg2d" + +# Override +PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false,libxcursor xwayland" + +# Weston with i.MX G2D renderer +PACKAGECONFIG[imxg2d] = "-Drenderer-g2d=true,-Drenderer-g2d=false,virtual/libg2d" + +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + +PACKAGE_ARCH = "${MACHINE_SOCARCH}" +COMPATIBLE_MACHINE = "(imx-nxp-bsp)" + +########### End of i.MX overrides ######### diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0001-Allow-to-enable-atomic-in-modesetting-DDX.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0001-Allow-to-enable-atomic-in-modesetting-DDX.patch index caf2fcd6..71e045b2 100644 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0001-Allow-to-enable-atomic-in-modesetting-DDX.patch +++ b/recipes-graphics/xorg-xserver/xserver-xorg/0001-Allow-to-enable-atomic-in-modesetting-DDX.patch @@ -1,4 +1,4 @@ -From 9c8b815520bf52caf780dc4defea0fe2fe8e33a3 Mon Sep 17 00:00:00 2001 +From 8f50f62cf9030d1839e23a7f1ff9688dec2063e4 Mon Sep 17 00:00:00 2001 From: Daniel Abrecht <public@danielabrecht.ch> Date: Wed, 21 Oct 2020 21:13:30 +0200 Subject: [PATCH] Allow to enable atomic in modesetting DDX @@ -11,17 +11,19 @@ anymore. This change doesn't enable atomic by default, but it allows a user to enabled it again. +Upstream-Status: Pending Signed-off-by: Daniel Abrecht <public@danielabrecht.ch> + --- hw/xfree86/drivers/modesetting/driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c -index 6549ef8e1..bd8576f81 100644 +index 535f49d..58a1c67 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c -@@ -1216,7 +1216,7 @@ PreInit(ScrnInfoPtr pScrn, int flags) - } +@@ -1236,7 +1236,7 @@ PreInit(ScrnInfoPtr pScrn, int flags) + ms->atomic_modeset_capable = (ret == 0); if (xf86ReturnOptValBool(ms->drmmode.Options, OPTION_ATOMIC, FALSE)) { - ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1); diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0001-MGS-5186-Per-Specification-EGL_NATIVE_PIXMAP_KHR-req.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0001-MGS-5186-Per-Specification-EGL_NATIVE_PIXMAP_KHR-req.patch deleted file mode 100644 index 6f232589..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0001-MGS-5186-Per-Specification-EGL_NATIVE_PIXMAP_KHR-req.patch +++ /dev/null @@ -1,30 +0,0 @@ -From ed3c55fa6260ad125a32f9ac67f9e44a9bce7cf1 Mon Sep 17 00:00:00 2001 -From: Prabhu Sundararaj <prabhu.sundararaj@nxp.com> -Date: Mon, 11 May 2020 19:12:51 -0500 -Subject: [PATCH] MGS-5186 Per Specification EGL_NATIVE_PIXMAP_KHR requires - EGL_NO_CONTEXT - -https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_image_pixmap.txt - -Per Specification EGL_NATIVE_PIXMAP_KHR requires EGL_NO_CONTEXT. -So passing context will result in error. - -Upstream-Status: Pending -Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com> ---- - hw/xwayland/xwayland-glamor-gbm.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: xorg-server-1.20.8/hw/xwayland/xwayland-glamor-gbm.c -=================================================================== ---- xorg-server-1.20.8.orig/hw/xwayland/xwayland-glamor-gbm.c -+++ xorg-server-1.20.8/hw/xwayland/xwayland-glamor-gbm.c -@@ -167,7 +167,7 @@ xwl_glamor_gbm_create_pixmap_for_bo(Scre - xwl_pixmap->bo = bo; - xwl_pixmap->buffer = NULL; - xwl_pixmap->image = eglCreateImageKHR(xwl_screen->egl_display, -- xwl_screen->egl_context, -+ EGL_NO_CONTEXT, - EGL_NATIVE_PIXMAP_KHR, - xwl_pixmap->bo, NULL); - if (xwl_pixmap->image == EGL_NO_IMAGE_KHR) diff --git a/recipes-graphics/xwayland/xwayland/0002-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch index 1c6cf2ec..960bf3b5 100644 --- a/recipes-graphics/xwayland/xwayland/0002-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch +++ b/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch @@ -1,24 +1,23 @@ -From 4508e54dae9d2884b2d6ccca13450b25d509cc9a Mon Sep 17 00:00:00 2001 +From c76f5d2c0a0dda534888025d7236465202884665 Mon Sep 17 00:00:00 2001 From: Xianzhong <xianzhong.li@nxp.com> Date: Thu, 5 Aug 2021 16:57:43 +0800 -Subject: [PATCH 3/3] glamor: Fix fbo pixmap format with GL_BGRA_EXT +Subject: [PATCH] glamor: Fix fbo pixmap format with GL_BGRA_EXT Red and Blue channels are swizzled in GLES path, Fix color inverse problem with ximagesink command: gst-launch-1.0 videotestsrc pattern=6 num-buffers=1 ! video/x-raw,format=BGRx ! videoconvert ! ximagesink display=:0 -v -This fix requires GL_EXT_texture_format_BGRA8888 extension, not applicable for upstream. +This fix requires GL_EXT_texture_format_BGRA8888 extention, not applicable for upstream. + +Upstream-Status: Inappropriate -Upstream-Status: Inappropriate [embedded specific] Signed-off-by: Xianzhong <xianzhong.li@nxp.com> --- glamor/glamor.c | 7 +++++++ 1 file changed, 7 insertions(+) -Index: xwayland-21.1.4/glamor/glamor.c -=================================================================== ---- xwayland-21.1.4.orig/glamor/glamor.c -+++ xwayland-21.1.4/glamor/glamor.c +--- a/glamor/glamor.c ++++ b/glamor/glamor.c @@ -586,10 +586,17 @@ glamor_setup_formats(ScreenPtr screen) if (glamor_priv->is_gles) { diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor-glamor_egl.c-EGL_NATIVE_PIXMAP_KHR-do-not-req.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor-glamor_egl.c-EGL_NATIVE_PIXMAP_KHR-do-not-req.patch deleted file mode 100644 index c8f1ae73..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0001-glamor-glamor_egl.c-EGL_NATIVE_PIXMAP_KHR-do-not-req.patch +++ /dev/null @@ -1,34 +0,0 @@ -From cc05c01925755310f027c61daa29648a10155f96 Mon Sep 17 00:00:00 2001 -From: Rohan Garg <rohan@garg.io> -Date: Thu, 13 Dec 2018 19:15:01 +0100 -Subject: [PATCH] glamor/glamor_egl.c: EGL_NATIVE_PIXMAP_KHR do not require - contexts - -From https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_image_pixmap.txt - - * If <target> is EGL_NATIVE_PIXMAP_KHR, and <ctx> is not EGL_NO_CONTEXT, - the error EGL_BAD_PARAMETER is generated. - -Fixes: a5321ea4 ("Allow to create textured pixmaps from gbm_bo without using gem names") ---- - glamor/glamor_egl.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Upstream-Status: Backport [cc05c01925755310f027c61daa29648a10155f96] - -diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c -index 0f4edb5a3..69844d4e2 100644 ---- a/glamor/glamor_egl.c -+++ b/glamor/glamor_egl.c -@@ -233,7 +233,7 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, - glamor_make_current(glamor_priv); - - image = eglCreateImageKHR(glamor_egl->display, -- glamor_egl->context, -+ EGL_NO_CONTEXT, - EGL_NATIVE_PIXMAP_KHR, bo, NULL); - if (image == EGL_NO_IMAGE_KHR) { - glamor_set_pixmap_type(pixmap, GLAMOR_DRM_ONLY); --- -2.17.1 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0001-hw-xwayland-Makefile.am-fix-build-without-glx.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0001-hw-xwayland-Makefile.am-fix-build-without-glx.patch deleted file mode 100644 index 48f271ae..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0001-hw-xwayland-Makefile.am-fix-build-without-glx.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 836f93de99b35050d78d61d3654f7c5655184144 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine <fontaine.fabrice@gmail.com> -Date: Fri, 19 Apr 2019 10:19:50 +0200 -Subject: [PATCH] hw/xwayland/Makefile.am: fix build without glx - -Commit d8ec33fe0542141aed1d9016d2ecaf52da944b4b added libglxvnd.la to -Xwayland_LDFLAGS but GLX can be disabled through --disable-glx. -In this case, build fails on: - -make[3]: *** No rule to make target '../../glx/libglxvnd.la', needed by 'Xwayland'. Stop. -make[3]: *** Waiting for unfinished jobs.... - -Fixes: - - http://autobuild.buildroot.org/results/397f8098c57fc6c88aa12dc8d35ebb1b933d52ef - -Upstream-Status: Backport [836f93de99b35050d78d61d3654f7c5655184144] -Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> ---- - hw/xwayland/Makefile.am | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am -index bc1cb8506..502879e2a 100644 ---- a/hw/xwayland/Makefile.am -+++ b/hw/xwayland/Makefile.am -@@ -21,10 +21,14 @@ Xwayland_SOURCES = \ - $(top_srcdir)/Xi/stubs.c \ - $(top_srcdir)/mi/miinitext.c - -+if GLX -+GLXVND_LIB = $(top_builddir)/glx/libglxvnd.la -+endif -+ - Xwayland_LDADD = \ - $(glamor_lib) \ - $(XWAYLAND_LIBS) \ -- $(top_builddir)/glx/libglxvnd.la \ -+ $(GLXVND_LIB) \ - $(XWAYLAND_SYS_LIBS) \ - $(top_builddir)/Xext/libXvidmode.la \ - $(XSERVER_SYS_LIBS) --- -2.17.1 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0001-prefer-to-use-GLES2-for-glamor-EGL-config.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0001-prefer-to-use-GLES2-for-glamor-EGL-config.patch deleted file mode 100644 index 6e140eaa..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0001-prefer-to-use-GLES2-for-glamor-EGL-config.patch +++ /dev/null @@ -1,49 +0,0 @@ -From a99ff39b3b6095a16977fbb13b2b453a7359850f Mon Sep 17 00:00:00 2001 -From: Xianzhong <xianzhong.li@nxp.com> -Date: Mon, 11 Jan 2021 11:53:29 +0800 -Subject: [PATCH] prefer to use GLES2 for glamor EGL config - -created the initial patch for xorg/xserver 1.20.8 - -Upstream-Status: Pending -Signed-off-by: Xianzhong <xianzhong.li@nxp.com> ---- - hw/xwayland/xwayland-glamor-gbm.c | 13 ++++--------- - 1 file changed, 4 insertions(+), 9 deletions(-) - -diff --git a/hw/xwayland/xwayland-glamor-gbm.c b/hw/xwayland/xwayland-glamor-gbm.c -index dce782fc3..1fdf45490 100644 ---- a/hw/xwayland/xwayland-glamor-gbm.c -+++ b/hw/xwayland/xwayland-glamor-gbm.c -@@ -912,13 +912,8 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen) - struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen); - EGLint major, minor; - Bool egl_initialized = FALSE; -- static const EGLint config_attribs_core[] = { -- EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR, -- EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR, -- EGL_CONTEXT_MAJOR_VERSION_KHR, -- GLAMOR_GL_CORE_VER_MAJOR, -- EGL_CONTEXT_MINOR_VERSION_KHR, -- GLAMOR_GL_CORE_VER_MINOR, -+ static const EGLint config_attribs_gles2[] = { -+ EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE - }; - const GLubyte *renderer; -@@ -947,10 +942,10 @@ xwl_glamor_gbm_init_egl(struct xwl_screen *xwl_screen) - goto error; - } - -- eglBindAPI(EGL_OPENGL_API); -+ eglBindAPI(EGL_OPENGL_ES_API); - - xwl_screen->egl_context = eglCreateContext( -- xwl_screen->egl_display, NULL, EGL_NO_CONTEXT, config_attribs_core); -+ xwl_screen->egl_display, NULL, EGL_NO_CONTEXT, config_attribs_gles2); - if (xwl_screen->egl_context == EGL_NO_CONTEXT) { - xwl_screen->egl_context = eglCreateContext( - xwl_screen->egl_display, NULL, EGL_NO_CONTEXT, NULL); --- -2.17.1 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0001-xfree86-define-FOURCC_NV12-and-XVIMAGE_NV12.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0001-xfree86-define-FOURCC_NV12-and-XVIMAGE_NV12.patch deleted file mode 100644 index e0958558..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0001-xfree86-define-FOURCC_NV12-and-XVIMAGE_NV12.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 3a6fe85a5f123f53319b5be8a69666174cad09cf Mon Sep 17 00:00:00 2001 -From: Julien Isorce <julien.isorce@gmail.com> -Date: Thu, 6 Sep 2018 15:38:13 -0700 -Subject: [PATCH 1/8] xfree86: define FOURCC_NV12 and XVIMAGE_NV12 - -Useful for glamor. - -Upstream-Status: Backport -Signed-off-by: Julien Isorce <jisorce@oblong.com> -Tested-by: Olivier Fourdan <ofourdan@redhat.com> -Reviewed-by: Alex Deucher <alexander.deucher@amd.com> ---- - hw/xfree86/common/fourcc.h | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/hw/xfree86/common/fourcc.h b/hw/xfree86/common/fourcc.h -index e6126b7fe..a19e6869e 100644 ---- a/hw/xfree86/common/fourcc.h -+++ b/hw/xfree86/common/fourcc.h -@@ -156,4 +156,24 @@ - XvTopToBottom \ - } - -+#define FOURCC_NV12 0x3231564e -+#define XVIMAGE_NV12 \ -+ { \ -+ FOURCC_NV12, \ -+ XvYUV, \ -+ LSBFirst, \ -+ {'N','V','1','2', \ -+ 0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \ -+ 12, \ -+ XvPlanar, \ -+ 2, \ -+ 0, 0, 0, 0, \ -+ 8, 8, 8, \ -+ 1, 2, 2, \ -+ 1, 2, 2, \ -+ {'Y','U','V', \ -+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \ -+ XvTopToBottom \ -+ } -+ - #endif /* _XF86_FOURCC_H_ */ --- -2.17.1 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0002-glamor-add-support-for-GL_RG.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0002-glamor-add-support-for-GL_RG.patch deleted file mode 100644 index 78988373..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0002-glamor-add-support-for-GL_RG.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 7f46b31e3d80ca769f68a4ffb201d0fc4801ea93 Mon Sep 17 00:00:00 2001 -From: Julien Isorce <julien.isorce@gmail.com> -Date: Thu, 6 Sep 2018 15:38:14 -0700 -Subject: [PATCH 2/8] glamor: add support for GL_RG - -Allow to upload the CbCr plane of an NV12 image into a GL texture. - -Upstream-Status: Backport -Signed-off-by: Julien Isorce <jisorce@oblong.com> -Tested-by: Olivier Fourdan <ofourdan@redhat.com> -Reviewed-by: Alex Deucher <alexander.deucher@amd.com> ---- - glamor/glamor.c | 2 ++ - glamor/glamor.h | 1 + - glamor/glamor_priv.h | 4 +++- - glamor/glamor_transfer.c | 10 ++++++++-- - glamor/glamor_utils.h | 4 ++++ - 5 files changed, 18 insertions(+), 3 deletions(-) - -diff --git a/glamor/glamor.c b/glamor/glamor.c -index abefef614..3e9cf284c 100644 ---- a/glamor/glamor.c -+++ b/glamor/glamor.c -@@ -222,6 +222,8 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, - - pixmap_priv = glamor_get_pixmap_private(pixmap); - -+ pixmap_priv->is_cbcr = (usage == GLAMOR_CREATE_FORMAT_CBCR); -+ - format = gl_iformat_for_pixmap(pixmap); - - pitch = (((w * pixmap->drawable.bitsPerPixel + 7) / 8) + 3) & ~3; -diff --git a/glamor/glamor.h b/glamor/glamor.h -index be04bf858..e5992aa56 100644 ---- a/glamor/glamor.h -+++ b/glamor/glamor.h -@@ -129,6 +129,7 @@ extern _X_EXPORT Bool glamor_destroy_pixmap(PixmapPtr pixmap); - #define GLAMOR_CREATE_FBO_NO_FBO 0x103 - #define GLAMOR_CREATE_NO_LARGE 0x105 - #define GLAMOR_CREATE_PIXMAP_NO_TEXTURE 0x106 -+#define GLAMOR_CREATE_FORMAT_CBCR 0x107 - - /* @glamor_egl_exchange_buffers: Exchange the underlying buffers(KHR image,fbo). - * -diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h -index 4353a99f1..a14aaf624 100644 ---- a/glamor/glamor_priv.h -+++ b/glamor/glamor_priv.h -@@ -380,6 +380,8 @@ typedef struct glamor_pixmap_private { - * names. - */ - glamor_pixmap_fbo **fbo_array; -+ -+ Bool is_cbcr; - } glamor_pixmap_private; - - extern DevPrivateKeyRec glamor_pixmap_private_key; -@@ -902,7 +904,7 @@ int glamor_xv_put_image(glamor_port_private *port_priv, - Bool sync, - RegionPtr clipBoxes); - void glamor_xv_core_init(ScreenPtr screen); --void glamor_xv_render(glamor_port_private *port_priv); -+void glamor_xv_render(glamor_port_private *port_priv, int id); - - #include "glamor_utils.h" - -diff --git a/glamor/glamor_transfer.c b/glamor/glamor_transfer.c -index ebb5101d1..421ed3a5f 100644 ---- a/glamor/glamor_transfer.c -+++ b/glamor/glamor_transfer.c -@@ -27,6 +27,7 @@ - void - glamor_format_for_pixmap(PixmapPtr pixmap, GLenum *format, GLenum *type) - { -+ glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); - switch (pixmap->drawable.depth) { - case 24: - case 32: -@@ -38,8 +39,13 @@ glamor_format_for_pixmap(PixmapPtr pixmap, GLenum *format, GLenum *type) - *type = GL_UNSIGNED_INT_2_10_10_10_REV; - break; - case 16: -- *format = GL_RGB; -- *type = GL_UNSIGNED_SHORT_5_6_5; -+ if (priv->is_cbcr) { -+ *format = priv->fbo->format; -+ *type = GL_UNSIGNED_BYTE; -+ } else { -+ *format = GL_RGB; -+ *type = GL_UNSIGNED_SHORT_5_6_5; -+ } - break; - case 15: - *format = GL_BGRA; -diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h -index 0d5674d63..1890c1fe5 100644 ---- a/glamor/glamor_utils.h -+++ b/glamor/glamor_utils.h -@@ -613,10 +613,14 @@ gl_iformat_for_pixmap(PixmapPtr pixmap) - { - glamor_screen_private *glamor_priv = - glamor_get_screen_private((pixmap)->drawable.pScreen); -+ glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - - if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && - ((pixmap)->drawable.depth == 1 || (pixmap)->drawable.depth == 8)) { - return glamor_priv->one_channel_format; -+ } else if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && -+ (pixmap)->drawable.depth == 16 && pixmap_priv->is_cbcr) { -+ return GL_RG; - } else if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && - (pixmap)->drawable.depth == 30) { - return GL_RGB10_A2; --- -2.17.1 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch deleted file mode 100644 index beed6cb4..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0003-Remove-check-for-useSIGIO-option.patch +++ /dev/null @@ -1,47 +0,0 @@ -From cf407b16cd65ad6e26a9c8e5984e163409a5c0f7 Mon Sep 17 00:00:00 2001 -From: Prabhu Sundararaj <prabhu.sundararaj@nxp.com> -Date: Mon, 30 Jan 2017 16:32:06 -0600 -Subject: [PATCH] Remove check for useSIGIO option - -Commit 6a5a4e60373c1386b311b2a8bb666c32d68a9d99 removes the configure of useSIGIO -option. - -As the xfree86 SIGIO support is reworked to use internal versions of OsBlockSIGIO -and OsReleaseSIGIO. - -No longer the check for useSIGIO is needed - -Upstream-Status: Pending - -Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com> ---- - hw/xfree86/os-support/shared/sigio.c | 6 ------ - 1 file changed, 6 deletions(-) - -diff --git a/hw/xfree86/os-support/shared/sigio.c b/hw/xfree86/os-support/shared/sigio.c -index 884a71c..be76498 100644 ---- a/hw/xfree86/os-support/shared/sigio.c -+++ b/hw/xfree86/os-support/shared/sigio.c -@@ -185,9 +185,6 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) - int i; - int installed = FALSE; - -- if (!xf86Info.useSIGIO) -- return 0; -- - for (i = 0; i < MAX_FUNCS; i++) { - if (!xf86SigIOFuncs[i].f) { - if (xf86IsPipe(fd)) -@@ -256,9 +253,6 @@ xf86RemoveSIGIOHandler(int fd) - int max; - int ret; - -- if (!xf86Info.useSIGIO) -- return 0; -- - max = 0; - ret = 0; - for (i = 0; i < MAX_FUNCS; i++) { --- -2.7.4 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0003-glamor-add-support-for-NV12-in-Xv.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0003-glamor-add-support-for-NV12-in-Xv.patch deleted file mode 100644 index 855d1938..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0003-glamor-add-support-for-NV12-in-Xv.patch +++ /dev/null @@ -1,322 +0,0 @@ -From 17a3528162304f1586329aabd606d3498bfe48a5 Mon Sep 17 00:00:00 2001 -From: Julien Isorce <julien.isorce@gmail.com> -Date: Tue, 11 Sep 2018 10:28:33 -0700 -Subject: [PATCH 3/8] glamor: add support for NV12 in Xv - -Useful when video decoders only output NV12. Currently -glamor Xv only supports I420 and YV12. - -Note that Intel's sna supports I420, YV12, YUY2, UYVY, NV12. - -Test: xvinfo | grep NV12 -Test: gst-launch-1.0 videotestsrc ! video/x-raw, format=NV12 ! xvimagesink - -v2: Combine the two texture2Ds on u_sampler. - -Upstream-Status: Backport -Signed-off-by: Julien Isorce <jisorce@oblong.com> -Tested-by: Olivier Fourdan <ofourdan@redhat.com> -Reviewed-by: Alex Deucher <alexander.deucher@amd.com> ---- - glamor/glamor_xv.c | 180 ++++++++++++++++++++++++++++++++++++++------- - 1 file changed, 155 insertions(+), 25 deletions(-) - -diff --git a/glamor/glamor_xv.c b/glamor/glamor_xv.c -index 62fc4fff5..6fef6ed0d 100644 ---- a/glamor/glamor_xv.c -+++ b/glamor/glamor_xv.c -@@ -59,8 +59,40 @@ typedef struct tagREF_TRANSFORM { - #define RTFContrast(a) (1.0 + ((a)*1.0)/1000.0) - #define RTFHue(a) (((a)*3.1416)/1000.0) - --static const glamor_facet glamor_facet_xv_planar = { -- .name = "xv_planar", -+static const glamor_facet glamor_facet_xv_planar_2 = { -+ .name = "xv_planar_2", -+ -+ .version = 120, -+ -+ .source_name = "v_texcoord0", -+ .vs_vars = ("attribute vec2 position;\n" -+ "attribute vec2 v_texcoord0;\n" -+ "varying vec2 tcs;\n"), -+ .vs_exec = (GLAMOR_POS(gl_Position, position) -+ " tcs = v_texcoord0;\n"), -+ -+ .fs_vars = ("uniform sampler2D y_sampler;\n" -+ "uniform sampler2D u_sampler;\n" -+ "uniform vec4 offsetyco;\n" -+ "uniform vec4 ucogamma;\n" -+ "uniform vec4 vco;\n" -+ "varying vec2 tcs;\n"), -+ .fs_exec = ( -+ " float sample;\n" -+ " vec2 sample_uv;\n" -+ " vec4 temp1;\n" -+ " sample = texture2D(y_sampler, tcs).w;\n" -+ " temp1.xyz = offsetyco.www * vec3(sample) + offsetyco.xyz;\n" -+ " sample_uv = texture2D(u_sampler, tcs).xy;\n" -+ " temp1.xyz = ucogamma.xyz * vec3(sample_uv.x) + temp1.xyz;\n" -+ " temp1.xyz = clamp(vco.xyz * vec3(sample_uv.y) + temp1.xyz, 0.0, 1.0);\n" -+ " temp1.w = 1.0;\n" -+ " gl_FragColor = temp1;\n" -+ ), -+}; -+ -+static const glamor_facet glamor_facet_xv_planar_3 = { -+ .name = "xv_planar_3", - - .version = 120, - -@@ -110,26 +142,50 @@ Atom glamorBrightness, glamorContrast, glamorSaturation, glamorHue, - XvImageRec glamor_xv_images[] = { - XVIMAGE_YV12, - XVIMAGE_I420, -+ XVIMAGE_NV12 - }; - int glamor_xv_num_images = ARRAY_SIZE(glamor_xv_images); - - static void --glamor_init_xv_shader(ScreenPtr screen) -+glamor_init_xv_shader(ScreenPtr screen, int id) - { - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - GLint sampler_loc; -+ const glamor_facet *glamor_facet_xv_planar = NULL; -+ -+ switch (id) { -+ case FOURCC_YV12: -+ case FOURCC_I420: -+ glamor_facet_xv_planar = &glamor_facet_xv_planar_3; -+ break; -+ case FOURCC_NV12: -+ glamor_facet_xv_planar = &glamor_facet_xv_planar_2; -+ break; -+ default: -+ break; -+ } - - glamor_build_program(screen, - &glamor_priv->xv_prog, -- &glamor_facet_xv_planar, NULL, NULL, NULL); -+ glamor_facet_xv_planar, NULL, NULL, NULL); - - glUseProgram(glamor_priv->xv_prog.prog); - sampler_loc = glGetUniformLocation(glamor_priv->xv_prog.prog, "y_sampler"); - glUniform1i(sampler_loc, 0); - sampler_loc = glGetUniformLocation(glamor_priv->xv_prog.prog, "u_sampler"); - glUniform1i(sampler_loc, 1); -- sampler_loc = glGetUniformLocation(glamor_priv->xv_prog.prog, "v_sampler"); -- glUniform1i(sampler_loc, 2); -+ -+ switch (id) { -+ case FOURCC_YV12: -+ case FOURCC_I420: -+ sampler_loc = glGetUniformLocation(glamor_priv->xv_prog.prog, "v_sampler"); -+ glUniform1i(sampler_loc, 2); -+ break; -+ case FOURCC_NV12: -+ break; -+ default: -+ break; -+ } - - } - -@@ -227,6 +283,21 @@ glamor_xv_query_image_attributes(int id, - offsets[2] = size; - size += tmp; - break; -+ case FOURCC_NV12: -+ *w = ALIGN(*w, 2); -+ *h = ALIGN(*h, 2); -+ size = ALIGN(*w, 4); -+ if (pitches) -+ pitches[0] = size; -+ size *= *h; -+ if (offsets) -+ offsets[1] = offsets[2] = size; -+ tmp = ALIGN(*w, 4); -+ if (pitches) -+ pitches[1] = pitches[2] = tmp; -+ tmp *= (*h >> 1); -+ size += tmp; -+ break; - } - return size; - } -@@ -240,7 +311,7 @@ static REF_TRANSFORM trans[2] = { - }; - - void --glamor_xv_render(glamor_port_private *port_priv) -+glamor_xv_render(glamor_port_private *port_priv, int id) - { - ScreenPtr screen = port_priv->pPixmap->drawable.pScreen; - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); -@@ -264,7 +335,7 @@ glamor_xv_render(glamor_port_private *port_priv) - int dst_box_index; - - if (!glamor_priv->xv_prog.prog) -- glamor_init_xv_shader(screen); -+ glamor_init_xv_shader(screen, id); - - cont = RTFContrast(port_priv->contrast); - bright = RTFBrightness(port_priv->brightness); -@@ -293,6 +364,8 @@ glamor_xv_render(glamor_port_private *port_priv) - glamor_get_pixmap_private(port_priv->src_pix[i]); - pixmap_priv_get_scale(src_pixmap_priv[i], &src_xscale[i], - &src_yscale[i]); -+ } else { -+ src_pixmap_priv[i] = NULL; - } - } - glamor_make_current(glamor_priv); -@@ -319,12 +392,21 @@ glamor_xv_render(glamor_port_private *port_priv) - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - -- glActiveTexture(GL_TEXTURE2); -- glBindTexture(GL_TEXTURE_2D, src_pixmap_priv[2]->fbo->tex); -- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); -- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -+ switch (id) { -+ case FOURCC_YV12: -+ case FOURCC_I420: -+ glActiveTexture(GL_TEXTURE2); -+ glBindTexture(GL_TEXTURE_2D, src_pixmap_priv[2]->fbo->tex); -+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); -+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); -+ break; -+ case FOURCC_NV12: -+ break; -+ default: -+ break; -+ } - - glEnableVertexAttribArray(GLAMOR_VERTEX_POS); - glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE); -@@ -336,7 +418,7 @@ glamor_xv_render(glamor_port_private *port_priv) - /* Set up a single primitive covering the area being drawn. We'll - * clip it to port_priv->clip using GL scissors instead of just - * emitting a GL_QUAD per box, because this way we hopefully avoid -- * diagonal tearing between the two trangles used to rasterize a -+ * diagonal tearing between the two triangles used to rasterize a - * GL_QUAD. - */ - i = 0; -@@ -417,6 +499,7 @@ glamor_xv_put_image(glamor_port_private *port_priv, - RegionPtr clipBoxes) - { - ScreenPtr pScreen = pDrawable->pScreen; -+ glamor_screen_private *glamor_priv = glamor_get_screen_private(pScreen); - int srcPitch, srcPitch2; - int top, nlines; - int s2offset, s3offset, tmp; -@@ -425,9 +508,16 @@ glamor_xv_put_image(glamor_port_private *port_priv, - s2offset = s3offset = srcPitch2 = 0; - - if (!port_priv->src_pix[0] || -- (width != port_priv->src_pix_w || height != port_priv->src_pix_h)) { -+ (width != port_priv->src_pix_w || height != port_priv->src_pix_h) || -+ (port_priv->src_pix[2] && id == FOURCC_NV12) || -+ (!port_priv->src_pix[2] && id != FOURCC_NV12)) { - int i; - -+ if (glamor_priv->xv_prog.prog) { -+ glDeleteProgram(glamor_priv->xv_prog.prog); -+ glamor_priv->xv_prog.prog = 0; -+ } -+ - for (i = 0; i < 3; i++) - if (port_priv->src_pix[i]) - glamor_destroy_pixmap(port_priv->src_pix[i]); -@@ -435,17 +525,34 @@ glamor_xv_put_image(glamor_port_private *port_priv, - port_priv->src_pix[0] = - glamor_create_pixmap(pScreen, width, height, 8, - GLAMOR_CREATE_FBO_NO_FBO); -- port_priv->src_pix[1] = -- glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, -- GLAMOR_CREATE_FBO_NO_FBO); -- port_priv->src_pix[2] = -- glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, -- GLAMOR_CREATE_FBO_NO_FBO); -+ -+ switch (id) { -+ case FOURCC_YV12: -+ case FOURCC_I420: -+ port_priv->src_pix[1] = -+ glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, -+ GLAMOR_CREATE_FBO_NO_FBO); -+ port_priv->src_pix[2] = -+ glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, -+ GLAMOR_CREATE_FBO_NO_FBO); -+ if (!port_priv->src_pix[2]) -+ return BadAlloc; -+ break; -+ case FOURCC_NV12: -+ port_priv->src_pix[1] = -+ glamor_create_pixmap(pScreen, width >> 1, height >> 1, 16, -+ GLAMOR_CREATE_FBO_NO_FBO | -+ GLAMOR_CREATE_FORMAT_CBCR); -+ port_priv->src_pix[2] = NULL; -+ break; -+ default: -+ return BadMatch; -+ } -+ - port_priv->src_pix_w = width; - port_priv->src_pix_h = height; - -- if (!port_priv->src_pix[0] || !port_priv->src_pix[1] || -- !port_priv->src_pix[2]) -+ if (!port_priv->src_pix[0] || !port_priv->src_pix[1]) - return BadAlloc; - } - -@@ -489,6 +596,29 @@ glamor_xv_put_image(glamor_port_private *port_priv, - 0, 0, 0, 0, - buf + s3offset, srcPitch2); - break; -+ case FOURCC_NV12: -+ srcPitch = ALIGN(width, 4); -+ s2offset = srcPitch * height; -+ s2offset += ((top >> 1) * srcPitch); -+ -+ full_box.x1 = 0; -+ full_box.y1 = 0; -+ full_box.x2 = width; -+ full_box.y2 = nlines; -+ -+ half_box.x1 = 0; -+ half_box.y1 = 0; -+ half_box.x2 = width; -+ half_box.y2 = (nlines + 1) >> 1; -+ -+ glamor_upload_boxes(port_priv->src_pix[0], &full_box, 1, -+ 0, 0, 0, 0, -+ buf + (top * srcPitch), srcPitch); -+ -+ glamor_upload_boxes(port_priv->src_pix[1], &half_box, 1, -+ 0, 0, 0, 0, -+ buf + s2offset, srcPitch); -+ break; - default: - return BadMatch; - } -@@ -511,7 +641,7 @@ glamor_xv_put_image(glamor_port_private *port_priv, - port_priv->w = width; - port_priv->h = height; - port_priv->pDraw = pDrawable; -- glamor_xv_render(port_priv); -+ glamor_xv_render(port_priv, id); - return Success; - } - --- -2.17.1 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0004-glamor-Remove-unused-format_for_pixmap-helper.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0004-glamor-Remove-unused-format_for_pixmap-helper.patch deleted file mode 100644 index c116576f..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0004-glamor-Remove-unused-format_for_pixmap-helper.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 69892ca6a623057ed4e3be0c22cb7fd812425024 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com> -Date: Wed, 19 Dec 2018 10:11:22 +0100 -Subject: [PATCH 4/8] glamor: Remove unused format_for_pixmap helper - -Upstream-Status: Backport -Reviewed-by: Eric Anholt <eric@anholt.net> ---- - glamor/glamor_utils.h | 6 ------ - 1 file changed, 6 deletions(-) - -diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h -index 1890c1fe5..8a147ca7e 100644 ---- a/glamor/glamor_utils.h -+++ b/glamor/glamor_utils.h -@@ -629,12 +629,6 @@ gl_iformat_for_pixmap(PixmapPtr pixmap) - } - } - --static inline CARD32 --format_for_pixmap(PixmapPtr pixmap) --{ -- return format_for_depth((pixmap)->drawable.depth); --} -- - #define REVERT_NONE 0 - #define REVERT_NORMAL 1 - #define REVERT_UPLOADING_A1 3 --- -2.17.1 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0005-glamor-Stop-trying-to-store-the-pixmap-s-format-in-g.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0005-glamor-Stop-trying-to-store-the-pixmap-s-format-in-g.patch deleted file mode 100644 index 9a0aa7ab..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0005-glamor-Stop-trying-to-store-the-pixmap-s-format-in-g.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 2498f6712c3b551c4d8104628aff78246b5cd6c8 Mon Sep 17 00:00:00 2001 -From: Eric Anholt <eric@anholt.net> -Date: Tue, 26 Mar 2019 15:58:59 -0700 -Subject: [PATCH 5/8] glamor: Stop trying to store the pixmap's "format" in - glamor_pixmap_fbo. - -"format" is a bit of a confused term (internalformat vs GL format), -and all we really needed was "is this GL_RED?" - -Upstream-Status: Backport -Signed-off-by: Eric Anholt <eric@anholt.net> ---- - glamor/glamor.c | 3 +-- - glamor/glamor_fbo.c | 7 ++++--- - glamor/glamor_priv.h | 13 ++----------- - glamor/glamor_render.c | 2 +- - glamor/glamor_transfer.c | 2 +- - 5 files changed, 9 insertions(+), 18 deletions(-) - -diff --git a/glamor/glamor.c b/glamor/glamor.c -index 3e9cf284c..c36b6ea74 100644 ---- a/glamor/glamor.c -+++ b/glamor/glamor.c -@@ -184,8 +184,7 @@ glamor_bind_texture(glamor_screen_private *glamor_priv, GLenum texture, - /* Is the operand a GL_RED fbo? - */ - -- if (glamor_fbo_red_is_alpha(glamor_priv, fbo)) { -- -+ if (fbo->is_red) { - /* If destination is also GL_RED, then preserve the bits in - * the R channel */ - -diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c -index f939a6c2f..58eb97bf4 100644 ---- a/glamor/glamor_fbo.c -+++ b/glamor/glamor_fbo.c -@@ -95,7 +95,7 @@ glamor_pixmap_ensure_fb(glamor_screen_private *glamor_priv, - - glamor_pixmap_fbo * - glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, -- int w, int h, GLenum format, GLint tex, int flag) -+ int w, int h, Bool is_red, GLint tex, int flag) - { - glamor_pixmap_fbo *fbo; - -@@ -106,7 +106,7 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, - fbo->tex = tex; - fbo->width = w; - fbo->height = h; -- fbo->format = format; -+ fbo->is_red = is_red; - - if (flag != GLAMOR_CREATE_FBO_NO_FBO) { - if (glamor_pixmap_ensure_fb(glamor_priv, fbo) != 0) { -@@ -163,7 +163,8 @@ glamor_create_fbo(glamor_screen_private *glamor_priv, - if (!tex) /* Texture creation failed due to GL_OUT_OF_MEMORY */ - return NULL; - -- return glamor_create_fbo_from_tex(glamor_priv, w, h, format, tex, flag); -+ return glamor_create_fbo_from_tex(glamor_priv, w, h, format == GL_RED, -+ tex, flag); - } - - /** -diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h -index a14aaf624..e70d349da 100644 ---- a/glamor/glamor_priv.h -+++ b/glamor/glamor_priv.h -@@ -317,8 +317,7 @@ typedef struct glamor_pixmap_fbo { - GLuint fb; /**< GL FBO name */ - int width; /**< width in pixels */ - int height; /**< height in pixels */ -- GLenum format; /**< GL format used to create the texture. */ -- GLenum type; /**< GL type used to create the texture. */ -+ Bool is_red; - } glamor_pixmap_fbo; - - typedef struct glamor_pixmap_clipped_regions { -@@ -533,7 +532,7 @@ glamor_pixmap_fbo *glamor_pixmap_detach_fbo(glamor_pixmap_private * - void glamor_pixmap_attach_fbo(PixmapPtr pixmap, glamor_pixmap_fbo *fbo); - glamor_pixmap_fbo *glamor_create_fbo_from_tex(glamor_screen_private * - glamor_priv, int w, int h, -- GLenum format, GLint tex, -+ Bool is_red, GLint tex, - int flag); - glamor_pixmap_fbo *glamor_create_fbo(glamor_screen_private *glamor_priv, int w, - int h, GLenum format, int flag); -@@ -549,14 +548,6 @@ static inline Bool glamor_picture_is_alpha(PicturePtr picture) - return picture->format == PICT_a1 || picture->format == PICT_a8; - } - --/* Return whether 'fbo' is storing alpha bits in the red channel */ --static inline Bool --glamor_fbo_red_is_alpha(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo) --{ -- /* True when the format is GL_RED (that can only happen when our one channel format is GL_RED */ -- return fbo->format == GL_RED; --} -- - /* Return whether 'picture' is storing alpha bits in the red channel */ - static inline Bool - glamor_picture_red_is_alpha(PicturePtr picture) -diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c -index d5737018f..6db6bfbc3 100644 ---- a/glamor/glamor_render.c -+++ b/glamor/glamor_render.c -@@ -529,7 +529,7 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, - * sometimes get zero bits in the R channel, which is harmless. - */ - glamor_bind_texture(glamor_priv, GL_TEXTURE0 + unit, fbo, -- glamor_fbo_red_is_alpha(glamor_priv, dest_priv->fbo)); -+ dest_priv->fbo->is_red); - repeat_type = picture->repeatType; - switch (picture->repeatType) { - case RepeatNone: -diff --git a/glamor/glamor_transfer.c b/glamor/glamor_transfer.c -index 421ed3a5f..215752d7b 100644 ---- a/glamor/glamor_transfer.c -+++ b/glamor/glamor_transfer.c -@@ -40,7 +40,7 @@ glamor_format_for_pixmap(PixmapPtr pixmap, GLenum *format, GLenum *type) - break; - case 16: - if (priv->is_cbcr) { -- *format = priv->fbo->format; -+ *format = GL_RG; - *type = GL_UNSIGNED_BYTE; - } else { - *format = GL_RGB; --- -2.17.1 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0006-glamor-Plumb-the-pixmap-through-fbo-creation-instead.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0006-glamor-Plumb-the-pixmap-through-fbo-creation-instead.patch deleted file mode 100644 index 66d2877c..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0006-glamor-Plumb-the-pixmap-through-fbo-creation-instead.patch +++ /dev/null @@ -1,265 +0,0 @@ -From 3c14a16e1b4277aa00a2b23d5758d99dc20ca819 Mon Sep 17 00:00:00 2001 -From: Eric Anholt <eric@anholt.net> -Date: Tue, 26 Mar 2019 16:57:24 -0700 -Subject: [PATCH 6/8] glamor: Plumb the pixmap through fbo creation instead of - a "format" - -For GLES, we're going to need a lot more logic for picking the -iformat/format/type of texture setup, so we'll want the pixmap's depth -and is_cbcr flag. - -Upstream-Status: Backport -Signed-off-by: Eric Anholt <eric@anholt.net> ---- - glamor/glamor.c | 20 +++++++------------- - glamor/glamor_fbo.c | 33 +++++++++++++++++++-------------- - glamor/glamor_picture.c | 2 +- - glamor/glamor_priv.h | 12 ++++++------ - 4 files changed, 33 insertions(+), 34 deletions(-) - -diff --git a/glamor/glamor.c b/glamor/glamor.c -index c36b6ea74..f618c2128 100644 ---- a/glamor/glamor.c -+++ b/glamor/glamor.c -@@ -106,7 +106,6 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) - glamor_pixmap_private *pixmap_priv; - glamor_screen_private *glamor_priv; - glamor_pixmap_fbo *fbo; -- GLenum format; - - glamor_priv = glamor_get_screen_private(screen); - pixmap_priv = glamor_get_pixmap_private(pixmap); -@@ -116,9 +115,9 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) - glamor_destroy_fbo(glamor_priv, fbo); - } - -- format = gl_iformat_for_pixmap(pixmap); -- fbo = glamor_create_fbo_from_tex(glamor_priv, pixmap->drawable.width, -- pixmap->drawable.height, format, tex, 0); -+ fbo = glamor_create_fbo_from_tex(glamor_priv, pixmap, -+ pixmap->drawable.width, -+ pixmap->drawable.height, tex, 0); - - if (fbo == NULL) { - ErrorF("XXX fail to create fbo.\n"); -@@ -204,7 +203,6 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - glamor_pixmap_fbo *fbo = NULL; - int pitch; -- GLenum format; - - if (w > 32767 || h > 32767) - return NullPixmap; -@@ -223,8 +221,6 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, - - pixmap_priv->is_cbcr = (usage == GLAMOR_CREATE_FORMAT_CBCR); - -- format = gl_iformat_for_pixmap(pixmap); -- - pitch = (((w * pixmap->drawable.bitsPerPixel + 7) / 8) + 3) & ~3; - screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, pitch, NULL); - -@@ -238,12 +234,12 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, - glamor_check_fbo_size(glamor_priv, w, h)) - { - glamor_init_pixmap_private_small(pixmap, pixmap_priv); -- fbo = glamor_create_fbo(glamor_priv, w, h, format, usage); -+ fbo = glamor_create_fbo(glamor_priv, pixmap, w, h, usage); - } else { - int tile_size = glamor_priv->max_fbo_size; - DEBUGF("Create LARGE pixmap %p width %d height %d, tile size %d\n", - pixmap, w, h, tile_size); -- fbo = glamor_create_fbo_array(glamor_priv, w, h, format, usage, -+ fbo = glamor_create_fbo_array(glamor_priv, pixmap, usage, - tile_size, tile_size, pixmap_priv); - } - -@@ -860,8 +856,7 @@ _glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, - switch (pixmap_priv->type) { - case GLAMOR_TEXTURE_DRM: - case GLAMOR_TEXTURE_ONLY: -- if (!glamor_pixmap_ensure_fbo(pixmap, pixmap->drawable.depth == 30 ? -- GL_RGB10_A2 : GL_RGBA, 0)) -+ if (!glamor_pixmap_ensure_fbo(pixmap, 0)) - return 0; - - if (modifier) { -@@ -937,8 +932,7 @@ glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size) - switch (pixmap_priv->type) { - case GLAMOR_TEXTURE_DRM: - case GLAMOR_TEXTURE_ONLY: -- if (!glamor_pixmap_ensure_fbo(pixmap, pixmap->drawable.depth == 30 ? -- GL_RGB10_A2 : GL_RGBA, 0)) -+ if (!glamor_pixmap_ensure_fbo(pixmap, 0)) - return -1; - return glamor_egl_fd_name_from_pixmap(pixmap->drawable.pScreen, - pixmap, stride, size); -diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c -index 58eb97bf4..75f7e2baa 100644 ---- a/glamor/glamor_fbo.c -+++ b/glamor/glamor_fbo.c -@@ -95,8 +95,9 @@ glamor_pixmap_ensure_fb(glamor_screen_private *glamor_priv, - - glamor_pixmap_fbo * - glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, -- int w, int h, Bool is_red, GLint tex, int flag) -+ PixmapPtr pixmap, int w, int h, GLint tex, int flag) - { -+ GLenum format = gl_iformat_for_pixmap(pixmap); - glamor_pixmap_fbo *fbo; - - fbo = calloc(1, sizeof(*fbo)); -@@ -106,7 +107,7 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, - fbo->tex = tex; - fbo->width = w; - fbo->height = h; -- fbo->is_red = is_red; -+ fbo->is_red = format == GL_RED; - - if (flag != GLAMOR_CREATE_FBO_NO_FBO) { - if (glamor_pixmap_ensure_fb(glamor_priv, fbo) != 0) { -@@ -120,13 +121,15 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, - - static int - _glamor_create_tex(glamor_screen_private *glamor_priv, -- int w, int h, GLenum format) -+ PixmapPtr pixmap, int w, int h) - { -+ GLenum iformat = gl_iformat_for_pixmap(pixmap); -+ GLenum format = iformat; - unsigned int tex; -- GLenum iformat = format; - - if (format == GL_RGB10_A2) - format = GL_RGBA; -+ - glamor_make_current(glamor_priv); - glGenTextures(1, &tex); - glBindTexture(GL_TEXTURE_2D, tex); -@@ -156,14 +159,14 @@ _glamor_create_tex(glamor_screen_private *glamor_priv, - - glamor_pixmap_fbo * - glamor_create_fbo(glamor_screen_private *glamor_priv, -- int w, int h, GLenum format, int flag) -+ PixmapPtr pixmap, int w, int h, int flag) - { -- GLint tex = _glamor_create_tex(glamor_priv, w, h, format); -+ GLint tex = _glamor_create_tex(glamor_priv, pixmap, w, h); - - if (!tex) /* Texture creation failed due to GL_OUT_OF_MEMORY */ - return NULL; - -- return glamor_create_fbo_from_tex(glamor_priv, w, h, format == GL_RED, -+ return glamor_create_fbo_from_tex(glamor_priv, pixmap, w, h, - tex, flag); - } - -@@ -173,10 +176,12 @@ glamor_create_fbo(glamor_screen_private *glamor_priv, - */ - glamor_pixmap_fbo * - glamor_create_fbo_array(glamor_screen_private *glamor_priv, -- int w, int h, GLenum format, int flag, -+ PixmapPtr pixmap, int flag, - int block_w, int block_h, - glamor_pixmap_private *priv) - { -+ int w = pixmap->drawable.width; -+ int h = pixmap->drawable.height; - int block_wcnt; - int block_hcnt; - glamor_pixmap_fbo **fbo_array; -@@ -216,8 +221,8 @@ glamor_create_fbo_array(glamor_screen_private *glamor_priv, - box_array[i * block_wcnt + j].x2 - box_array[i * block_wcnt + - j].x1; - fbo_array[i * block_wcnt + j] = glamor_create_fbo(glamor_priv, -+ pixmap, - fbo_w, fbo_h, -- format, - GLAMOR_CREATE_PIXMAP_FIXUP); - if (fbo_array[i * block_wcnt + j] == NULL) - goto cleanup; -@@ -315,7 +320,7 @@ glamor_pixmap_destroy_fbo(PixmapPtr pixmap) - } - - Bool --glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag) -+glamor_pixmap_ensure_fbo(PixmapPtr pixmap, int flag) - { - glamor_screen_private *glamor_priv; - glamor_pixmap_private *pixmap_priv; -@@ -325,8 +330,8 @@ glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag) - pixmap_priv = glamor_get_pixmap_private(pixmap); - if (pixmap_priv->fbo == NULL) { - -- fbo = glamor_create_fbo(glamor_priv, pixmap->drawable.width, -- pixmap->drawable.height, format, flag); -+ fbo = glamor_create_fbo(glamor_priv, pixmap, pixmap->drawable.width, -+ pixmap->drawable.height, flag); - if (fbo == NULL) - return FALSE; - -@@ -336,8 +341,8 @@ glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag) - /* We do have a fbo, but it may lack of fb or tex. */ - if (!pixmap_priv->fbo->tex) - pixmap_priv->fbo->tex = -- _glamor_create_tex(glamor_priv, pixmap->drawable.width, -- pixmap->drawable.height, format); -+ _glamor_create_tex(glamor_priv, pixmap, pixmap->drawable.width, -+ pixmap->drawable.height); - - if (flag != GLAMOR_CREATE_FBO_NO_FBO && pixmap_priv->fbo->fb == 0) - if (glamor_pixmap_ensure_fb(glamor_priv, pixmap_priv->fbo) != 0) -diff --git a/glamor/glamor_picture.c b/glamor/glamor_picture.c -index 685d8d618..e6d387d42 100644 ---- a/glamor/glamor_picture.c -+++ b/glamor/glamor_picture.c -@@ -340,7 +340,7 @@ glamor_upload_picture_to_texture(PicturePtr picture) - else - iformat = format; - -- if (!glamor_pixmap_ensure_fbo(pixmap, iformat, GLAMOR_CREATE_FBO_NO_FBO)) { -+ if (!glamor_pixmap_ensure_fbo(pixmap, GLAMOR_CREATE_FBO_NO_FBO)) { - ret = FALSE; - goto fail; - } -diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h -index e70d349da..a87caec9b 100644 ---- a/glamor/glamor_priv.h -+++ b/glamor/glamor_priv.h -@@ -531,11 +531,11 @@ glamor_pixmap_fbo *glamor_pixmap_detach_fbo(glamor_pixmap_private * - pixmap_priv); - void glamor_pixmap_attach_fbo(PixmapPtr pixmap, glamor_pixmap_fbo *fbo); - glamor_pixmap_fbo *glamor_create_fbo_from_tex(glamor_screen_private * -- glamor_priv, int w, int h, -- Bool is_red, GLint tex, -+ glamor_priv, PixmapPtr pixmap, -+ int w, int h, GLint tex, - int flag); --glamor_pixmap_fbo *glamor_create_fbo(glamor_screen_private *glamor_priv, int w, -- int h, GLenum format, int flag); -+glamor_pixmap_fbo *glamor_create_fbo(glamor_screen_private *glamor_priv, -+ PixmapPtr pixmap, int w, int h, int flag); - void glamor_destroy_fbo(glamor_screen_private *glamor_priv, - glamor_pixmap_fbo *fbo); - void glamor_pixmap_destroy_fbo(PixmapPtr pixmap); -@@ -563,7 +563,7 @@ void glamor_bind_texture(glamor_screen_private *glamor_priv, - Bool destination_red); - - glamor_pixmap_fbo *glamor_create_fbo_array(glamor_screen_private *glamor_priv, -- int w, int h, GLenum format, -+ PixmapPtr pixmap, - int flag, int block_w, int block_h, - glamor_pixmap_private *); - -@@ -673,7 +673,7 @@ glamor_put_vbo_space(ScreenPtr screen); - * the fbo has valid texture and attach to a valid fb. - * If the fbo already has a valid glfbo then do nothing. - */ --Bool glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag); -+Bool glamor_pixmap_ensure_fbo(PixmapPtr pixmap, int flag); - - glamor_pixmap_clipped_regions * - glamor_compute_clipped_regions(PixmapPtr pixmap, --- -2.17.1 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0007-glamor-Switch-the-gl_flavor-to-a-boolean-is_gles.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0007-glamor-Switch-the-gl_flavor-to-a-boolean-is_gles.patch deleted file mode 100644 index f2947f32..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0007-glamor-Switch-the-gl_flavor-to-a-boolean-is_gles.patch +++ /dev/null @@ -1,287 +0,0 @@ -From 3a03576d672d24f19fdb930b08afde9a3a3f55da Mon Sep 17 00:00:00 2001 -From: Eric Anholt <eric@anholt.net> -Date: Tue, 26 Mar 2019 15:02:38 -0700 -Subject: [PATCH 7/8] glamor: Switch the gl_flavor to a boolean is_gles. - -There are only 2 flavors we are distinguishing -- GL versions are -handled separately. - -Upstream-Status: Backport -Signed-off-by: Eric Anholt <eric@anholt.net> ---- - glamor/glamor.c | 20 +++++++++----------- - glamor/glamor_picture.c | 22 +++++++++++----------- - glamor/glamor_pixmap.c | 2 +- - glamor/glamor_priv.h | 7 +------ - glamor/glamor_program.c | 2 +- - glamor/glamor_render.c | 2 +- - glamor/glamor_utils.h | 6 +++--- - 7 files changed, 27 insertions(+), 34 deletions(-) - -diff --git a/glamor/glamor.c b/glamor/glamor.c -index f618c2128..019edbbb1 100644 ---- a/glamor/glamor.c -+++ b/glamor/glamor.c -@@ -505,10 +505,8 @@ glamor_init(ScreenPtr screen, unsigned int flags) - - glamor_make_current(glamor_priv); - -- if (epoxy_is_desktop_gl()) -- glamor_priv->gl_flavor = GLAMOR_GL_DESKTOP; -- else -- glamor_priv->gl_flavor = GLAMOR_GL_ES2; -+ if (!epoxy_is_desktop_gl()) -+ glamor_priv->is_gles = TRUE; - - gl_version = epoxy_gl_version(); - -@@ -540,7 +538,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) - } - glamor_priv->glsl_version = glsl_major * 100 + glsl_minor; - -- if (glamor_priv->gl_flavor == GLAMOR_GL_ES2) { -+ if (glamor_priv->is_gles) { - /* Force us back to the base version of our programs on an ES - * context, anyway. Basically glamor only uses desktop 1.20 - * or 1.30 currently. 1.30's new features are also present in -@@ -564,7 +562,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) - * have support for it, with most of the ones lacking it being on - * Windows with Intel 4-series (G45) graphics or older. - */ -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { -+ if (!glamor_priv->is_gles) { - if (gl_version < 21) { - ErrorF("Require OpenGL version 2.1 or later.\n"); - goto fail; -@@ -610,7 +608,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) - } - - glamor_priv->has_rw_pbo = FALSE; -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) -+ if (!glamor_priv->is_gles) - glamor_priv->has_rw_pbo = TRUE; - - glamor_priv->has_khr_debug = epoxy_has_gl_extension("GL_KHR_debug"); -@@ -628,11 +626,11 @@ glamor_init(ScreenPtr screen, unsigned int flags) - glamor_priv->has_nv_texture_barrier = - epoxy_has_gl_extension("GL_NV_texture_barrier"); - glamor_priv->has_unpack_subimage = -- glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP || -+ !glamor_priv->is_gles || - epoxy_gl_version() >= 30 || - epoxy_has_gl_extension("GL_EXT_unpack_subimage"); - glamor_priv->has_pack_subimage = -- glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP || -+ !glamor_priv->is_gles || - epoxy_gl_version() >= 30 || - epoxy_has_gl_extension("GL_NV_pack_subimage"); - glamor_priv->has_dual_blend = -@@ -643,7 +641,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) - - glamor_setup_debug_output(screen); - -- glamor_priv->use_quads = (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) && -+ glamor_priv->use_quads = !glamor_priv->is_gles && - !glamor_priv->is_core_profile; - - /* Driver-specific hack: Avoid using GL_QUADS on VC4, where -@@ -665,7 +663,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) - - glamor_priv->has_texture_swizzle = - (epoxy_has_gl_extension("GL_ARB_texture_swizzle") || -- (glamor_priv->gl_flavor != GLAMOR_GL_DESKTOP && gl_version >= 30)); -+ (glamor_priv->is_gles && gl_version >= 30)); - - glamor_priv->one_channel_format = GL_ALPHA; - if (epoxy_has_gl_extension("GL_ARB_texture_rg") && -diff --git a/glamor/glamor_picture.c b/glamor/glamor_picture.c -index e6d387d42..ed2decc83 100644 ---- a/glamor/glamor_picture.c -+++ b/glamor/glamor_picture.c -@@ -90,7 +90,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - - case PICT_b8g8r8x8: - case PICT_b8g8r8a8: -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { -+ if (!glamor_priv->is_gles) { - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_INT_8_8_8_8; - } else { -@@ -109,7 +109,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - - case PICT_x8r8g8b8: - case PICT_a8r8g8b8: -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { -+ if (!glamor_priv->is_gles) { - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; - } else { -@@ -128,7 +128,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - case PICT_x8b8g8r8: - case PICT_a8b8g8r8: - *tex_format = GL_RGBA; -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { -+ if (!glamor_priv->is_gles) { - *tex_type = GL_UNSIGNED_INT_8_8_8_8_REV; - } else { - *tex_format = GL_RGBA; -@@ -141,7 +141,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - - case PICT_x2r10g10b10: - case PICT_a2r10g10b10: -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { -+ if (!glamor_priv->is_gles) { - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; - } else { -@@ -151,7 +151,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - - case PICT_x2b10g10r10: - case PICT_a2b10g10r10: -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { -+ if (!glamor_priv->is_gles) { - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_INT_2_10_10_10_REV; - } else { -@@ -165,7 +165,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - break; - case PICT_b5g6r5: - *tex_format = GL_RGB; -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { -+ if (!glamor_priv->is_gles) { - *tex_type = GL_UNSIGNED_SHORT_5_6_5_REV; - } else { - *tex_type = GL_UNSIGNED_SHORT_5_6_5; -@@ -177,7 +177,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - case PICT_x1b5g5r5: - case PICT_a1b5g5r5: - *tex_format = GL_RGBA; -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { -+ if (!glamor_priv->is_gles) { - *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - } else { - return FALSE; -@@ -186,7 +186,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - - case PICT_x1r5g5b5: - case PICT_a1r5g5b5: -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { -+ if (!glamor_priv->is_gles) { - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; - } else { -@@ -201,7 +201,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - - case PICT_x4r4g4b4: - case PICT_a4r4g4b4: -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { -+ if (!glamor_priv->is_gles) { - *tex_format = GL_BGRA; - *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; - } else { -@@ -213,7 +213,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - - case PICT_x4b4g4r4: - case PICT_a4b4g4r4: -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) { -+ if (!glamor_priv->is_gles) { - *tex_format = GL_RGBA; - *tex_type = GL_UNSIGNED_SHORT_4_4_4_4_REV; - } else { -@@ -335,7 +335,7 @@ glamor_upload_picture_to_texture(PicturePtr picture) - stride = pixman_image_get_stride(converted_image); - } - -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) -+ if (!glamor_priv->is_gles) - iformat = gl_iformat_for_pixmap(pixmap); - else - iformat = format; -diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c -index 166bde509..9aa169cdc 100644 ---- a/glamor/glamor_pixmap.c -+++ b/glamor/glamor_pixmap.c -@@ -124,7 +124,7 @@ glamor_set_alu(ScreenPtr screen, unsigned char alu) - { - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - -- if (glamor_priv->gl_flavor == GLAMOR_GL_ES2) { -+ if (glamor_priv->is_gles) { - if (alu != GXcopy) - return FALSE; - else -diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h -index a87caec9b..8e8433ff3 100644 ---- a/glamor/glamor_priv.h -+++ b/glamor/glamor_priv.h -@@ -155,11 +155,6 @@ enum gradient_shader { - struct glamor_screen_private; - struct glamor_pixmap_private; - --enum glamor_gl_flavor { -- GLAMOR_GL_DESKTOP, // OPENGL API -- GLAMOR_GL_ES2 // OPENGL ES2.0 API --}; -- - #define GLAMOR_COMPOSITE_VBO_VERT_CNT (64*1024) - - struct glamor_saved_procs { -@@ -185,7 +180,7 @@ struct glamor_saved_procs { - }; - - typedef struct glamor_screen_private { -- enum glamor_gl_flavor gl_flavor; -+ Bool is_gles; - int glsl_version; - Bool has_pack_invert; - Bool has_fbo_blit; -diff --git a/glamor/glamor_program.c b/glamor/glamor_program.c -index 830deb38b..b0a9d07a4 100644 ---- a/glamor/glamor_program.c -+++ b/glamor/glamor_program.c -@@ -459,7 +459,7 @@ glamor_set_blend(CARD8 op, glamor_program_alpha alpha, PicturePtr dst) - break; - } - -- if (glamor_priv->gl_flavor != GLAMOR_GL_ES2) -+ if (!glamor_priv->is_gles) - glDisable(GL_COLOR_LOGIC_OP); - - if (op == PictOpSrc) -diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c -index 6db6bfbc3..d3859e4d1 100644 ---- a/glamor/glamor_render.c -+++ b/glamor/glamor_render.c -@@ -1091,7 +1091,7 @@ glamor_composite_set_shader_blend(glamor_screen_private *glamor_priv, - } - } - -- if (glamor_priv->gl_flavor != GLAMOR_GL_ES2) -+ if (!glamor_priv->is_gles) - glDisable(GL_COLOR_LOGIC_OP); - - if (op_info->source_blend == GL_ONE && op_info->dest_blend == GL_ZERO) { -diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h -index 8a147ca7e..cbb808294 100644 ---- a/glamor/glamor_utils.h -+++ b/glamor/glamor_utils.h -@@ -615,13 +615,13 @@ gl_iformat_for_pixmap(PixmapPtr pixmap) - glamor_get_screen_private((pixmap)->drawable.pScreen); - glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); - -- if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && -+ if (!glamor_priv->is_gles && - ((pixmap)->drawable.depth == 1 || (pixmap)->drawable.depth == 8)) { - return glamor_priv->one_channel_format; -- } else if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && -+ } else if (!glamor_priv->is_gles && - (pixmap)->drawable.depth == 16 && pixmap_priv->is_cbcr) { - return GL_RG; -- } else if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP && -+ } else if (!glamor_priv->is_gles && - (pixmap)->drawable.depth == 30) { - return GL_RGB10_A2; - } else { --- -2.17.1 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg/0008-glamor-Introduce-a-central-place-for-our-pixmap-form.patch b/recipes-graphics/xorg-xserver/xserver-xorg/0008-glamor-Introduce-a-central-place-for-our-pixmap-form.patch deleted file mode 100644 index dd82340a..00000000 --- a/recipes-graphics/xorg-xserver/xserver-xorg/0008-glamor-Introduce-a-central-place-for-our-pixmap-form.patch +++ /dev/null @@ -1,669 +0,0 @@ -From b75296bee6ab3578f3a13cfb6de5d77ec02b9047 Mon Sep 17 00:00:00 2001 -From: Eric Anholt <eric@anholt.net> -Date: Tue, 26 Mar 2019 15:10:49 -0700 -Subject: [PATCH 8/8] glamor: Introduce a central place for our pixmap - format/type handling. - -We had various helper functions trying to come up with the -internalformat/format/type/render formats for pixmaps, and it's much -nicer to just detect what those should be once at startup. This gives -us a chance to do the right thing for GLES. - -It also, notably, fixes our format/type for depth 15 and 16 setup for -desktop GL, so that we actually allocate 16bpp (GL_RGB/565) on most -drivers instead of 32bpp (GL_RGB/UBYTE). - -GLES still has regressions over desktop (2 regressions in llvmpipe -XTS, many in rendercheck), but I think this is a good baseline. - -Upstream-Status: Backport -Signed-off-by: Eric Anholt <eric@anholt.net> ---- - glamor/glamor.c | 167 ++++++++++++++++++++++++++++++++++++-- - glamor/glamor_fbo.c | 16 ++-- - glamor/glamor_picture.c | 7 +- - glamor/glamor_priv.h | 22 ++++- - glamor/glamor_render.c | 7 +- - glamor/glamor_spans.c | 14 ++-- - glamor/glamor_transfer.c | 56 ++----------- - glamor/glamor_transfer.h | 3 - - glamor/glamor_transform.c | 5 +- - glamor/glamor_utils.h | 57 ------------- - 10 files changed, 209 insertions(+), 145 deletions(-) - -diff --git a/glamor/glamor.c b/glamor/glamor.c -index 019edbbb1..3450113e0 100644 ---- a/glamor/glamor.c -+++ b/glamor/glamor.c -@@ -212,7 +212,7 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, - w <= glamor_priv->glyph_max_dim && - h <= glamor_priv->glyph_max_dim) - || (w == 0 && h == 0) -- || !glamor_check_pixmap_fbo_depth(depth))) -+ || !glamor_priv->formats[depth].format)) - return fbCreatePixmap(screen, w, h, depth, usage); - else - pixmap = fbCreatePixmap(screen, 0, 0, depth, usage); -@@ -440,6 +440,165 @@ glamor_setup_debug_output(ScreenPtr screen) - glEnable(GL_DEBUG_OUTPUT); - } - -+const struct glamor_format * -+glamor_format_for_pixmap(PixmapPtr pixmap) -+{ -+ ScreenPtr pScreen = pixmap->drawable.pScreen; -+ glamor_screen_private *glamor_priv = glamor_get_screen_private(pScreen); -+ glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); -+ -+ if (pixmap_priv->is_cbcr) -+ return &glamor_priv->cbcr_format; -+ else -+ return &glamor_priv->formats[pixmap->drawable.depth]; -+} -+ -+static void -+glamor_add_format(ScreenPtr screen, int depth, CARD32 render_format, -+ GLenum internalformat, GLenum format, GLenum type) -+{ -+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); -+ struct glamor_format *f = &glamor_priv->formats[depth]; -+ -+ /* If we're trying to run on GLES, make sure that we get the read -+ * formats that we're expecting, since glamor_transfer relies on -+ * them matching to get data back out. To avoid this limitation, we -+ * would need to have a more general glReadPixels() path in -+ * glamor_transfer that re-encoded the bits to the pixel format that -+ * we intended after. -+ * -+ * Note that we can't just create a pixmap because we're in -+ * screeninit. -+ */ -+ if (glamor_priv->is_gles) { -+ unsigned fbo, tex; -+ int read_format, read_type; -+ GLenum status; -+ -+ glGenTextures(1, &tex); -+ glBindTexture(GL_TEXTURE_2D, tex); -+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); -+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); -+ glTexImage2D(GL_TEXTURE_2D, 0, internalformat, 1, 1, 0, -+ format, type, NULL); -+ -+ glGenFramebuffers(1, &fbo); -+ glBindFramebuffer(GL_FRAMEBUFFER, fbo); -+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, -+ GL_TEXTURE_2D, tex, 0); -+ status = glCheckFramebufferStatus(GL_FRAMEBUFFER); -+ if (status != GL_FRAMEBUFFER_COMPLETE) { -+ ErrorF("glamor: Test fbo for depth %d incomplete. " -+ "Falling back to software.\n", depth); -+ glDeleteTextures(1, &tex); -+ glDeleteFramebuffers(1, &fbo); -+ return; -+ } -+ -+ glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &read_format); -+ glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &read_type); -+ -+ glDeleteTextures(1, &tex); -+ glDeleteFramebuffers(1, &fbo); -+ -+ if (format != read_format || type != read_type) { -+ ErrorF("glamor: Implementation returned 0x%x/0x%x read format/type " -+ "for depth %d, expected 0x%x/0x%x. " -+ "Falling back to software.\n", -+ read_format, read_type, depth, format, type); -+ return; -+ } -+ } -+ -+ f->depth = depth; -+ f->render_format = render_format; -+ f->internalformat = internalformat; -+ f->format = format; -+ f->type = type; -+} -+ -+/* Set up the GL format/types that glamor will use for the various depths -+ * -+ * X11's pixel data doesn't have channels, but to store our data in GL -+ * we have to pick some sort of format to move X11 pixel data in and -+ * out with in glamor_transfer.c. For X11 core operations, other than -+ * GL logic ops (non-GXcopy GC ops) what the driver chooses internally -+ * doesn't matter as long as it doesn't drop any bits (we expect them -+ * to generally expand, if anything). For Render, we can expect -+ * clients to tend to render with PictFormats matching our channel -+ * layouts here since ultimately X11 pixels tend to end up on the -+ * screen. The render implementation will fall back to fb if the -+ * channels don't match. -+ * -+ * Note that these formats don't affect what glamor_egl.c or -+ * Xwayland's EGL layer choose for surfaces exposed through DRI or -+ * scanout. For now, those layers need to match what we're choosing -+ * here, or channels will end up swizzled around. Similarly, the -+ * driver's visual masks also need to match what we're doing here. -+ */ -+static void -+glamor_setup_formats(ScreenPtr screen) -+{ -+ glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); -+ -+ /* Prefer r8 textures since they're required by GLES3 and core, -+ * only falling back to a8 if we can't do them. -+ */ -+ if (glamor_priv->is_gles || epoxy_has_gl_extension("GL_ARB_texture_rg")) { -+ glamor_add_format(screen, 8, PICT_a8, -+ GL_R8, GL_RED, GL_UNSIGNED_BYTE); -+ } else { -+ glamor_add_format(screen, 8, PICT_a8, -+ GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE); -+ } -+ -+ if (glamor_priv->is_gles) { -+ /* For 15bpp, GLES supports format/type RGBA/5551, rather than -+ * bgra/1555_rev. GL_EXT_bgra lets the impl say the color -+ * read format/type is bgra/1555 even if we had to create it -+ * with rgba/5551, with Mesa does. That means we can't use -+ * the same format/type for TexSubImage and readpixels. -+ * -+ * Instead, just store 16 bits using the trusted 565 path, and -+ * disable render accel for now. -+ */ -+ glamor_add_format(screen, 15, PICT_x1r5g5b5, -+ GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1); -+ } else { -+ glamor_add_format(screen, 15, PICT_x1r5g5b5, -+ GL_RGBA, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV); -+ } -+ -+ glamor_add_format(screen, 16, PICT_r5g6b5, -+ GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5); -+ -+ if (glamor_priv->is_gles) { -+ assert(X_BYTE_ORDER == X_LITTLE_ENDIAN); -+ glamor_add_format(screen, 24, PICT_x8b8g8r8, -+ GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE); -+ glamor_add_format(screen, 32, PICT_a8b8g8r8, -+ GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE); -+ } else { -+ glamor_add_format(screen, 24, PICT_x8r8g8b8, -+ GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV); -+ glamor_add_format(screen, 32, PICT_a8r8g8b8, -+ GL_RGBA, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV); -+ } -+ -+ if (glamor_priv->is_gles) { -+ glamor_add_format(screen, 30, PICT_x2b10g10r10, -+ GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV); -+ } else { -+ glamor_add_format(screen, 30, PICT_x2r10g10b10, -+ GL_RGB10_A2, GL_BGRA, GL_UNSIGNED_INT_2_10_10_10_REV); -+ } -+ -+ glamor_priv->cbcr_format.depth = 16; -+ glamor_priv->cbcr_format.internalformat = GL_RG8; -+ glamor_priv->cbcr_format.format = GL_RG; -+ glamor_priv->cbcr_format.type = GL_UNSIGNED_BYTE; -+} -+ - /** Set up glamor for an already-configured GL context. */ - Bool - glamor_init(ScreenPtr screen, unsigned int flags) -@@ -665,11 +824,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) - (epoxy_has_gl_extension("GL_ARB_texture_swizzle") || - (glamor_priv->is_gles && gl_version >= 30)); - -- glamor_priv->one_channel_format = GL_ALPHA; -- if (epoxy_has_gl_extension("GL_ARB_texture_rg") && -- glamor_priv->has_texture_swizzle) { -- glamor_priv->one_channel_format = GL_RED; -- } -+ glamor_setup_formats(screen); - - glamor_set_debug_level(&glamor_debug_level); - -diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c -index 75f7e2baa..dfb3f754d 100644 ---- a/glamor/glamor_fbo.c -+++ b/glamor/glamor_fbo.c -@@ -97,7 +97,7 @@ glamor_pixmap_fbo * - glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, - PixmapPtr pixmap, int w, int h, GLint tex, int flag) - { -- GLenum format = gl_iformat_for_pixmap(pixmap); -+ const struct glamor_format *f = glamor_format_for_pixmap(pixmap); - glamor_pixmap_fbo *fbo; - - fbo = calloc(1, sizeof(*fbo)); -@@ -107,7 +107,7 @@ glamor_create_fbo_from_tex(glamor_screen_private *glamor_priv, - fbo->tex = tex; - fbo->width = w; - fbo->height = h; -- fbo->is_red = format == GL_RED; -+ fbo->is_red = f->format == GL_RED; - - if (flag != GLAMOR_CREATE_FBO_NO_FBO) { - if (glamor_pixmap_ensure_fb(glamor_priv, fbo) != 0) { -@@ -123,23 +123,19 @@ static int - _glamor_create_tex(glamor_screen_private *glamor_priv, - PixmapPtr pixmap, int w, int h) - { -- GLenum iformat = gl_iformat_for_pixmap(pixmap); -- GLenum format = iformat; -+ const struct glamor_format *f = glamor_format_for_pixmap(pixmap); - unsigned int tex; - -- if (format == GL_RGB10_A2) -- format = GL_RGBA; -- - glamor_make_current(glamor_priv); - glGenTextures(1, &tex); - glBindTexture(GL_TEXTURE_2D, tex); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); -- if (format == glamor_priv->one_channel_format && format == GL_RED) -+ if (f->format == GL_RED) - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_RED); - glamor_priv->suppress_gl_out_of_memory_logging = true; -- glTexImage2D(GL_TEXTURE_2D, 0, iformat, w, h, 0, -- format, GL_UNSIGNED_BYTE, NULL); -+ glTexImage2D(GL_TEXTURE_2D, 0, f->internalformat, w, h, 0, -+ f->format, f->type, NULL); - glamor_priv->suppress_gl_out_of_memory_logging = false; - - if (glGetError() == GL_OUT_OF_MEMORY) { -diff --git a/glamor/glamor_picture.c b/glamor/glamor_picture.c -index ed2decc83..33b3bebd9 100644 ---- a/glamor/glamor_picture.c -+++ b/glamor/glamor_picture.c -@@ -83,7 +83,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - - switch (format) { - case PICT_a1: -- *tex_format = glamor_priv->one_channel_format; -+ *tex_format = glamor_priv->formats[1].format; - *tex_type = GL_UNSIGNED_BYTE; - *temp_format = PICT_a8; - break; -@@ -195,7 +195,7 @@ glamor_get_tex_format_type_from_pictformat(ScreenPtr pScreen, - break; - - case PICT_a8: -- *tex_format = glamor_priv->one_channel_format; -+ *tex_format = glamor_priv->formats[8].format; - *tex_type = GL_UNSIGNED_BYTE; - break; - -@@ -286,6 +286,7 @@ glamor_upload_picture_to_texture(PicturePtr picture) - Bool ret = TRUE; - Bool needs_swizzle; - pixman_image_t *converted_image = NULL; -+ const struct glamor_format *f = glamor_format_for_pixmap(pixmap); - - assert(glamor_pixmap_is_memory(pixmap)); - assert(!pixmap_priv->fbo); -@@ -336,7 +337,7 @@ glamor_upload_picture_to_texture(PicturePtr picture) - } - - if (!glamor_priv->is_gles) -- iformat = gl_iformat_for_pixmap(pixmap); -+ iformat = f->internalformat; - else - iformat = format; - -diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h -index 8e8433ff3..b8e2b932e 100644 ---- a/glamor/glamor_priv.h -+++ b/glamor/glamor_priv.h -@@ -157,6 +157,21 @@ struct glamor_pixmap_private; - - #define GLAMOR_COMPOSITE_VBO_VERT_CNT (64*1024) - -+struct glamor_format { -+ /** X Server's "depth" value */ -+ int depth; -+ /** GL internalformat for creating textures of this type */ -+ GLenum internalformat; -+ /** GL format transferring pixels in/out of textures of this type. */ -+ GLenum format; -+ /** GL type transferring pixels in/out of textures of this type. */ -+ GLenum type; -+ /* Render PICT_* matching GL's channel layout for pixels -+ * transferred using format/type. -+ */ -+ CARD32 render_format; -+}; -+ - struct glamor_saved_procs { - CloseScreenProcPtr close_screen; - CreateGCProcPtr create_gc; -@@ -199,7 +214,8 @@ typedef struct glamor_screen_private { - Bool can_copyplane; - int max_fbo_size; - -- GLuint one_channel_format; -+ struct glamor_format formats[33]; -+ struct glamor_format cbcr_format; - - /* glamor point shader */ - glamor_program point_prog; -@@ -537,6 +553,8 @@ void glamor_pixmap_destroy_fbo(PixmapPtr pixmap); - Bool glamor_pixmap_fbo_fixup(ScreenPtr screen, PixmapPtr pixmap); - void glamor_pixmap_clear_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo); - -+const struct glamor_format *glamor_format_for_pixmap(PixmapPtr pixmap); -+ - /* Return whether 'picture' is alpha-only */ - static inline Bool glamor_picture_is_alpha(PicturePtr picture) - { -@@ -549,7 +567,7 @@ glamor_picture_red_is_alpha(PicturePtr picture) - { - /* True when the picture is alpha only and the screen is using GL_RED for alpha pictures */ - return glamor_picture_is_alpha(picture) && -- glamor_get_screen_private(picture->pDrawable->pScreen)->one_channel_format == GL_RED; -+ glamor_get_screen_private(picture->pDrawable->pScreen)->formats[8].format == GL_RED; - } - - void glamor_bind_texture(glamor_screen_private *glamor_priv, -diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c -index d3859e4d1..a8dc3924b 100644 ---- a/glamor/glamor_render.c -+++ b/glamor/glamor_render.c -@@ -772,12 +772,15 @@ static Bool - glamor_render_format_is_supported(PicturePtr picture) - { - PictFormatShort storage_format; -+ glamor_screen_private *glamor_priv; - - /* Source-only pictures should always work */ - if (!picture->pDrawable) - return TRUE; - -- storage_format = format_for_depth(picture->pDrawable->depth); -+ glamor_priv = glamor_get_screen_private(picture->pDrawable->pScreen); -+ storage_format = -+ glamor_priv->formats[picture->pDrawable->depth].render_format; - - switch (picture->format) { - case PICT_x2r10g10b10: -@@ -898,7 +901,7 @@ glamor_composite_choose_shader(CARD8 op, - } - - if (dest_pixmap->drawable.bitsPerPixel <= 8 && -- glamor_priv->one_channel_format == GL_RED) { -+ glamor_priv->formats[8].format == GL_RED) { - key.dest_swizzle = SHADER_DEST_SWIZZLE_ALPHA_TO_RED; - } else { - key.dest_swizzle = SHADER_DEST_SWIZZLE_DEFAULT; -diff --git a/glamor/glamor_spans.c b/glamor/glamor_spans.c -index b3c028d67..b5f297d2f 100644 ---- a/glamor/glamor_spans.c -+++ b/glamor/glamor_spans.c -@@ -187,9 +187,8 @@ glamor_get_spans_gl(DrawablePtr drawable, int wmax, - int box_index; - int n; - char *d; -- GLenum type; -- GLenum format; - int off_x, off_y; -+ const struct glamor_format *f = glamor_format_for_pixmap(pixmap); - - pixmap_priv = glamor_get_pixmap_private(pixmap); - if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) -@@ -197,8 +196,6 @@ glamor_get_spans_gl(DrawablePtr drawable, int wmax, - - glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); - -- glamor_format_for_pixmap(pixmap, &format, &type); -- - glamor_make_current(glamor_priv); - - glamor_pixmap_loop(pixmap_priv, box_index) { -@@ -234,7 +231,8 @@ glamor_get_spans_gl(DrawablePtr drawable, int wmax, - if (y >= box->y2) - continue; - -- glReadPixels(x1 - box->x1, y - box->y1, x2 - x1, 1, format, type, l); -+ glReadPixels(x1 - box->x1, y - box->y1, x2 - x1, 1, -+ f->format, f->type, l); - } - } - -@@ -269,11 +267,10 @@ glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src, - glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); - PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); - glamor_pixmap_private *pixmap_priv; -+ const struct glamor_format *f = glamor_format_for_pixmap(pixmap); - int box_index; - int n; - char *s; -- GLenum type; -- GLenum format; - int off_x, off_y; - - pixmap_priv = glamor_get_pixmap_private(pixmap); -@@ -287,7 +284,6 @@ glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src, - goto bail; - - glamor_get_drawable_deltas(drawable, pixmap, &off_x, &off_y); -- glamor_format_for_pixmap(pixmap, &format, &type); - - glamor_make_current(glamor_priv); - -@@ -348,7 +344,7 @@ glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src, - - glTexSubImage2D(GL_TEXTURE_2D, 0, - x1 - box->x1, y1 - box->y1, x2 - x1, 1, -- format, type, -+ f->format, f->type, - l); - } - s += PixmapBytePad(w, drawable->depth); -diff --git a/glamor/glamor_transfer.c b/glamor/glamor_transfer.c -index 215752d7b..e706e0fb4 100644 ---- a/glamor/glamor_transfer.c -+++ b/glamor/glamor_transfer.c -@@ -23,44 +23,6 @@ - #include "glamor_priv.h" - #include "glamor_transfer.h" - --/* XXX a kludge for now */ --void --glamor_format_for_pixmap(PixmapPtr pixmap, GLenum *format, GLenum *type) --{ -- glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); -- switch (pixmap->drawable.depth) { -- case 24: -- case 32: -- *format = GL_BGRA; -- *type = GL_UNSIGNED_INT_8_8_8_8_REV; -- break; -- case 30: -- *format = GL_BGRA; -- *type = GL_UNSIGNED_INT_2_10_10_10_REV; -- break; -- case 16: -- if (priv->is_cbcr) { -- *format = GL_RG; -- *type = GL_UNSIGNED_BYTE; -- } else { -- *format = GL_RGB; -- *type = GL_UNSIGNED_SHORT_5_6_5; -- } -- break; -- case 15: -- *format = GL_BGRA; -- *type = GL_UNSIGNED_SHORT_1_5_5_5_REV; -- break; -- case 8: -- *format = glamor_get_screen_private(pixmap->drawable.pScreen)->one_channel_format; -- *type = GL_UNSIGNED_BYTE; -- break; -- default: -- FatalError("Invalid pixmap depth %d\n", pixmap->drawable.depth); -- break; -- } --} -- - /* - * Write a region of bits into a pixmap - */ -@@ -75,10 +37,7 @@ glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, - glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); - int box_index; - int bytes_per_pixel = pixmap->drawable.bitsPerPixel >> 3; -- GLenum type; -- GLenum format; -- -- glamor_format_for_pixmap(pixmap, &format, &type); -+ const struct glamor_format *f = glamor_format_for_pixmap(pixmap); - - glamor_make_current(glamor_priv); - -@@ -116,14 +75,14 @@ glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, - glTexSubImage2D(GL_TEXTURE_2D, 0, - x1 - box->x1, y1 - box->y1, - x2 - x1, y2 - y1, -- format, type, -+ f->format, f->type, - bits + ofs); - } else { - for (; y1 < y2; y1++, ofs += byte_stride) - glTexSubImage2D(GL_TEXTURE_2D, 0, - x1 - box->x1, y1 - box->y1, - x2 - x1, 1, -- format, type, -+ f->format, f->type, - bits + ofs); - } - } -@@ -178,10 +137,7 @@ glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, - glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); - int box_index; - int bytes_per_pixel = pixmap->drawable.bitsPerPixel >> 3; -- GLenum type; -- GLenum format; -- -- glamor_format_for_pixmap(pixmap, &format, &type); -+ const struct glamor_format *f = glamor_format_for_pixmap(pixmap); - - glamor_make_current(glamor_priv); - -@@ -216,10 +172,10 @@ glamor_download_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, - - if (glamor_priv->has_pack_subimage || - x2 - x1 == byte_stride / bytes_per_pixel) { -- glReadPixels(x1 - box->x1, y1 - box->y1, x2 - x1, y2 - y1, format, type, bits + ofs); -+ glReadPixels(x1 - box->x1, y1 - box->y1, x2 - x1, y2 - y1, f->format, f->type, bits + ofs); - } else { - for (; y1 < y2; y1++, ofs += byte_stride) -- glReadPixels(x1 - box->x1, y1 - box->y1, x2 - x1, 1, format, type, bits + ofs); -+ glReadPixels(x1 - box->x1, y1 - box->y1, x2 - x1, 1, f->format, f->type, bits + ofs); - } - } - } -diff --git a/glamor/glamor_transfer.h b/glamor/glamor_transfer.h -index de8186a70..a6137b3ff 100644 ---- a/glamor/glamor_transfer.h -+++ b/glamor/glamor_transfer.h -@@ -23,9 +23,6 @@ - #ifndef _GLAMOR_TRANSFER_H_ - #define _GLAMOR_TRANSFER_H_ - --void --glamor_format_for_pixmap(PixmapPtr pixmap, GLenum *format, GLenum *type); -- - void - glamor_upload_boxes(PixmapPtr pixmap, BoxPtr in_boxes, int in_nbox, - int dx_src, int dy_src, -diff --git a/glamor/glamor_transform.c b/glamor/glamor_transform.c -index 2d5a634a8..348d00be1 100644 ---- a/glamor/glamor_transform.c -+++ b/glamor/glamor_transform.c -@@ -121,10 +121,9 @@ glamor_set_color_depth(ScreenPtr pScreen, - - glamor_get_rgba_from_pixel(pixel, - &color[0], &color[1], &color[2], &color[3], -- format_for_depth(depth)); -+ glamor_priv->formats[depth].render_format); - -- if ((depth == 1 || depth == 8) && -- glamor_priv->one_channel_format == GL_RED) -+ if ((depth <= 8) && glamor_priv->formats[8].format == GL_RED) - color[0] = color[3]; - - glUniform4fv(uniform, 1, color); -diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h -index cbb808294..651faf2fe 100644 ---- a/glamor/glamor_utils.h -+++ b/glamor/glamor_utils.h -@@ -570,65 +570,8 @@ - && (_w_) <= _glamor_->max_fbo_size \ - && (_h_) <= _glamor_->max_fbo_size) - --/* For 1bpp pixmap, we don't store it as texture. */ --#define glamor_check_pixmap_fbo_depth(_depth_) ( \ -- _depth_ == 8 \ -- || _depth_ == 15 \ -- || _depth_ == 16 \ -- || _depth_ == 24 \ -- || _depth_ == 30 \ -- || _depth_ == 32) -- - #define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) (pixmap_priv->gl_fbo == GLAMOR_FBO_NORMAL) - --/** -- * Borrow from uxa. -- */ --static inline CARD32 --format_for_depth(int depth) --{ -- switch (depth) { -- case 1: -- return PICT_a1; -- case 4: -- return PICT_a4; -- case 8: -- return PICT_a8; -- case 15: -- return PICT_x1r5g5b5; -- case 16: -- return PICT_r5g6b5; -- default: -- case 24: -- return PICT_x8r8g8b8; -- case 30: -- return PICT_x2r10g10b10; -- case 32: -- return PICT_a8r8g8b8; -- } --} -- --static inline GLenum --gl_iformat_for_pixmap(PixmapPtr pixmap) --{ -- glamor_screen_private *glamor_priv = -- glamor_get_screen_private((pixmap)->drawable.pScreen); -- glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); -- -- if (!glamor_priv->is_gles && -- ((pixmap)->drawable.depth == 1 || (pixmap)->drawable.depth == 8)) { -- return glamor_priv->one_channel_format; -- } else if (!glamor_priv->is_gles && -- (pixmap)->drawable.depth == 16 && pixmap_priv->is_cbcr) { -- return GL_RG; -- } else if (!glamor_priv->is_gles && -- (pixmap)->drawable.depth == 30) { -- return GL_RGB10_A2; -- } else { -- return GL_RGBA; -- } --} -- - #define REVERT_NONE 0 - #define REVERT_NORMAL 1 - #define REVERT_UPLOADING_A1 3 --- -2.17.1 - diff --git a/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend b/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend index c956245b..cf1c3a50 100644 --- a/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend +++ b/recipes-graphics/xorg-xserver/xserver-xorg_%.bbappend @@ -1,21 +1,8 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" SRC_URI:append:use-mainline-bsp = " file://0001-Allow-to-enable-atomic-in-modesetting-DDX.patch" -SRC_URI:append:imxgpu = " \ - file://0003-Remove-check-for-useSIGIO-option.patch \ - file://0001-MGS-5186-Per-Specification-EGL_NATIVE_PIXMAP_KHR-req.patch \ - file://0001-glamor-glamor_egl.c-EGL_NATIVE_PIXMAP_KHR-do-not-req.patch \ - file://0001-prefer-to-use-GLES2-for-glamor-EGL-config.patch \ - file://0001-hw-xwayland-Makefile.am-fix-build-without-glx.patch \ - file://0001-xfree86-define-FOURCC_NV12-and-XVIMAGE_NV12.patch \ - file://0002-glamor-add-support-for-GL_RG.patch \ - file://0003-glamor-add-support-for-NV12-in-Xv.patch \ - file://0004-glamor-Remove-unused-format_for_pixmap-helper.patch \ - file://0005-glamor-Stop-trying-to-store-the-pixmap-s-format-in-g.patch \ - file://0006-glamor-Plumb-the-pixmap-through-fbo-creation-instead.patch \ - file://0007-glamor-Switch-the-gl_flavor-to-a-boolean-is_gles.patch \ - file://0008-glamor-Introduce-a-central-place-for-our-pixmap-form.patch \ -" + +SRC_URI:append:imxgpu = " file://0001-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch" IMX_OPENGL_PKGCONFIGS_REMOVE = "" IMX_OPENGL_PKGCONFIGS_REMOVE:imxgpu = "glamor" diff --git a/recipes-graphics/xwayland/xwayland_23.1.1.imx.bb b/recipes-graphics/xwayland/xwayland_23.1.1.imx.bb new file mode 100644 index 00000000..a9705a23 --- /dev/null +++ b/recipes-graphics/xwayland/xwayland_23.1.1.imx.bb @@ -0,0 +1,53 @@ +# This recipe copy helps keep meta-freescale master branch compatible +# with Yocto langdale. +# (From OE-Core rev: 35fdbd0ea81650a0421d50fb53989d96c5956331) + +SUMMARY = "XWayland is an X Server that runs under Wayland." +DESCRIPTION = "XWayland is an X Server running as a Wayland client, \ +and thus is capable of displaying native X11 client applications in a \ +Wayland compositor environment. The goal of XWayland is to facilitate \ +the transition from X Window System to Wayland environments, providing \ +a way to run unported applications in the meantime." +HOMEPAGE = "https://fedoraproject.org/wiki/Changes/XwaylandStandalone" + +DEFAULT_PREFERENCE = "-1" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880" + +SRC_URI = "https://www.x.org/archive/individual/xserver/${BP_ORIGINAL}.tar.xz" +BP_ORIGINAL = "${BPN}-23.1.1" +SRC_URI[sha256sum] = "fb9461f5cb9fea5e07e91882311b0c88b43e8843b017ebac05eb5af69aa34c15" +S = "${WORKDIR}/${BP_ORIGINAL}" + +UPSTREAM_CHECK_REGEX = "xwayland-(?P<pver>\d+(\.(?!90\d)\d+)+)\.tar" + +inherit meson features_check pkgconfig +REQUIRED_DISTRO_FEATURES = "x11 opengl" + +DEPENDS += "xorgproto xtrans pixman libxkbfile libxfont2 wayland wayland-native wayland-protocols libdrm libepoxy libxcvt" + +OPENGL_PKGCONFIGS = "glx glamor dri3" +PACKAGECONFIG ??= "${XORG_CRYPTO} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '${OPENGL_PKGCONFIGS}', '', d)} \ +" +PACKAGECONFIG[dri3] = "-Ddri3=true,-Ddri3=false,libxshmfence" +PACKAGECONFIG[glx] = "-Dglx=true,-Dglx=false,virtual/libgl virtual/libx11" +PACKAGECONFIG[glamor] = "-Dglamor=true,-Dglamor=false,libepoxy virtual/libgbm,libegl" +PACKAGECONFIG[unwind] = "-Dlibunwind=true,-Dlibunwind=false,libunwind" +PACKAGECONFIG[xinerama] = "-Dxinerama=true,-Dxinerama=false" + +# Xorg requires a SHA1 implementation, pick one +XORG_CRYPTO ??= "openssl" +PACKAGECONFIG[openssl] = "-Dsha1=libcrypto,,openssl" +PACKAGECONFIG[nettle] = "-Dsha1=libnettle,,nettle" +PACKAGECONFIG[gcrypt] = "-Dsha1=libgcrypt,,libgcrypt" + +do_install:append() { + # remove files not needed and clashing with xserver-xorg + rm -rf ${D}/${libdir}/xorg/ +} + +FILES:${PN} += "${libdir}/xorg/protocol.txt" + +RDEPENDS:${PN} += "xkbcomp" diff --git a/recipes-graphics/xwayland/xwayland_%.bbappend b/recipes-graphics/xwayland/xwayland_23.1.1.imx.bbappend index 69063121..e1708a96 100644 --- a/recipes-graphics/xwayland/xwayland_%.bbappend +++ b/recipes-graphics/xwayland/xwayland_23.1.1.imx.bbappend @@ -2,7 +2,6 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" SRC_URI:append:imxgpu = " \ file://0001-Prefer-to-create-GLES2-context-for-glamor-EGL.patch \ - file://0002-glamor-Fix-fbo-pixmap-format-with-GL_BGRA_EXT.patch \ " OPENGL_PKGCONFIGS:remove:imxgpu = "${OPENGL_PKGCONFIGS_REMOVE_IMXGPU}" @@ -10,3 +9,12 @@ OPENGL_PKGCONFIGS_REMOVE_IMXGPU = "" OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx6-nxp-bsp = "glamor glx" OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx7-nxp-bsp = "glamor glx" OPENGL_PKGCONFIGS_REMOVE_IMXGPU:mx8-nxp-bsp = "glx" + + +# links with imx-gpu libs which are pre-built for glibc +# gcompat will address it during runtime +LDFLAGS:append:imxgpu:libc-musl = " -Wl,--allow-shlib-undefined" + +RDEPENDS:${PN}:append:imxgpu:libc-musl = " gcompat" + +PACKAGE_ARCH = "${MACHINE_SOCARCH}" |