Complete Yocto mirror with license table for TQMa6UL (2038-compliance)

- 264 license table entries with exact download URLs (224/264 resolved)
- Complete sources/ directory with all BitBake recipes
- Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl)
- Full traceability for Softwarefreigabeantrag
- GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4
- License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
This commit is contained in:
Siggi (OpenClaw Agent)
2026-03-01 20:58:18 +00:00
commit 16accb6b24
15086 changed files with 1292356 additions and 0 deletions

View File

@@ -0,0 +1,631 @@
# Changelog
All notable changes to this project will be documented in this file.
Releases are named with the following scheme:
`<Yocto Project version name>.<TQ module family>.BSP.SW.<version number>`
[[_TOC_]]
## Next Release
## scarthgap.TQ.ARM.BSP.0006
## scarthgap.TQ.ARM.BSP.0005
### Added
* Added zstd to `DISTRO_EXTRA_RRECOMMEND`
### Changed
* packagegroup-sysutils: add cpupower package since cpufrequtils is not maintained anymore and
shall be removed after next release.
### Fixes
* lmsensors: build fix to compile without enabling sensord. Fix can be removed once meta-openembedded
contains backport of fix in scarthgap.
## scarthgap.TQ.ARM.BSP.0004
### Changed
* Re-added weston patch to support TQMa335x variants with GPU
* tq-image-small: remove `kernel-devicetree` and `kernel-image` from `IMAGE_INSTALL`
These package dependencies should be declared by machines.
* distros:
* INHERIT `tq-buildinfo` to generate `etc/buildinfo` and
"${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.buildinfo
* enable `wifi` as `DISTRO_FEATURE` for all distros based on `dumpling`
this will automatically install packages needed via predefined packagegroups.
### Added
* class `tq-buildinfo` as an extension of `buildinfo` class. This class is
intended to be used for CI and image indentification.
## scarthgap.TQ.ARM.BSP.0003
### Added
* dynamic-layers: add support for `meta-qt6`
Provide support for Qt6 demo images. The debug version contains also the built examples.
Reuse the `packagegroup-qt6-essentials` and add support for more features based on
`DISTRO_FEATURES`.
* Add support for separate data partition
The data partition is mounted from the same device as the rootfs during boot
when the `tq-mount-data` package is installed (default with "rauc" in
`DISTRO_FEATURES`)
* Add example RAUC config
This includes an example certificate and key, `system.conf` variants for
mmc0 and mmc1 (automatically selected during boot), and an example bundle
recipe `tq-bundle`.
* Automatically select `fw_env.config` based on the boot medium
This is currently supported on the TQMa62xx/TQMa64xxL, which provide separate
config files for each boot medium. The selection makes the assumption that
the bootloader environment is stored on the same medium that the rootfs is
mounted from, which may not be the case if `boot_targets` is modified in the
environment.
### Fixed
* Reenable installation of U-Boot environment utils in root file system.
After switching to use libubootenv as dependency the binaries were not
longer installed.
* Avoid duplicate installation of "persistent-storage-mtd" udev rules in
dumpling distros
### Changed
* procps: lower `console_loglevel` in `sysctl.conf` to `KERN_ERR`
* distros:
* enforce usage of `sysctl` from `procps`package
* use `armv8a-crc-crypto` as tuning for all ARM64 based machines to allow
more artifact reuse when building for multiple machines.
* move DISTRO_FEATURES `pam`, `wayland`, `vulkan` from distro definition
files to shared `dumpling.inc` include to prevent copies of the same settings
in multiple nearly identical distro definitions.
### Removed
* dynamic-layers: remove support for `meta-qt5`
* distros: remove `dumpling`, `dumpling-nxp` and `dumpling-ti` as they are identical
to their wayland distros counterparts.
## scarthgap.TQ.ARM.BSP.0002
### Added
* TQMa93xx: Add NPU support for scarthgap
* TQMa8MPxL: Add NPU support for scarthgap
### Fixed
* systemd: Fix predictable network interface names on TQMa64xxL/TQMa62xx[L]
Ethernet interfaces are now renamed to `endX` based on `ethernetX` Device
Tree aliases on linux-ti-tq-6.6.
* weston: Fix start on TQMa93xx due to insufficient privileges
Note: `weston` now starts as root
### Removed
* Custom patches for NXP patched gstreamer-plugins-good/gstreamer-plugins-bad
which are already included in updated version
## scarthgap.TQ.ARM.BSP.0001
### Added
* chromium-ozone-wayland (meta-browser): Include configuration and
hardware-specific patch for GPU support on TQMa62xx when the
dumpling-wayland-ti distro is used
The patch currently applies cleanly to Chromium 126.
* chromium-ozone-wayland (meta-browser): Add hardware-specific patches
for NXP based platforms using imx-nxp-bsp
### Changed
* distro: move distro includes to subfolder and include them with
complete path
* distro/spaetzle: Do not depend on `poky-tiny` from `meta-poky`.
This prevents the hard assumtions from `poky-tiny` and allows
overwrites from local.conf. Since the primary goal of `spaetzle`
is a small system that can be run from a SPI-NOR the distro now
uses the same busybox configuration as other poky based distros.
* weston-init: Unconditionally disabling blanking the screen on idle
Make idle handling consistent on all hardware. Also works around Weston
crashing when reenabling the display on some platforms.
* Modernize psplash support to use png file directly
## kirkstone.TQ.ARM.BSP.0019
### Module BSP Revisions
* kirkstone.TQMLS1028A.BSP.SW.0110
### Added
* packagegroups: packagegroup-npu: add support for NPU on TQMa93xx
This change requires usage of the master branch of meta-freescale-ml.
### Changed
* distros: use linux-tq as preferred kernel for TQMLS1043A / TQMLS1046A / TQMLS1088A /
TQMLX2160A in Layerscape based distros
## kirkstone.TQ.ARM.BSP.0018
### Module BSP Revisions
* kirkstone.TQMa93xx.BSP.SW.0002
## kirkstone.TQ.ARM.BSP.0017
### Module BSP Revisions
* kirkstone.TQMa57xx.BSP.SW.0015
### Added
* distros: dumpling: add `ppp` to `DISTRO_FEATURES`. This will install `ppp` and dependencies
unconditionally through the selection of `packagegroup-base-ppp`. This allows easy testing
of modem cards for GSM/LTE for IoT communication with default images.
* README.md: add license and copyright header
* Add Tensorflow Lite VX delegate for i.MX8M Plus platforms
* distro: dumpling: Add 'npu' DISTRO_FEATURE
* add packagegroup and machine feature for NPU
### Changed
* README.md: update patches section
### Removed
* busybox: To prevent conflicts with `chat` program which can be installed as
dependency of `ppp` in `DISTRO_FEATURES`the selection of the `chat` applet
is removed from `busybox` config patches.
## kirkstone.TQ.ARM.BSP.0016
### Module BSP Revisions
* kirkstone.TQMa93xx.BSP.SW.0001
### Fixed
* Fixed compatiblity Weston with the AM335x SGX GPU driver
Import a patch from TI's meta-arago to make the `GL_EXT_unpack_subimage`
dependency optional again.
## kirkstone.TQ.ARM.BSP.0015
### Module BSP Revisions
* kirkstone.TQMa62xx.BSP.SW.0001
## kirkstone.TQ.ARM.BSP.0014
### Module BSP Revisions
* kirkstone.TQMa6x.BSP.SW.0123
## kirkstone.TQ.ARM.BSP.0012
### Module BSP Revisions
* kirkstone.TQMa64xxL.BSP.SW.0006
## kirkstone.TQ.ARM.BSP.0011
### Module BSP Revisions
* kirkstone.TQMLS10xxA.BSP.SW.0106
## kirkstone.TQ.ARM.BSP.0010
### Module BSP Revisions
* kirkstone.TQMa64xxL.BSP.SW.0005
## kirkstone.TQ.ARM.BSP.0009
### Module BSP Revisions
* kirkstone.TQMa8.BSP.SW.0092
## kirkstone.TQ.ARM.BSP.0008
### Module BSP Revisions
* kirkstone.TQMLS1028A.BSP.SW.0109
### Added
* TQMLS104xA: Append wic.bootonly and wic.bootonly.pblvariant to IMAGE_FSTYPES to
build images for RAM variants.
* TQMLS1088A: Append wic.bootonly to IMAGE_FSTYPES
## kirkstone.TQ.ARM.BSP.0007
### Module BSP Revisions
* kirkstone.TQMLX2160A.BSP.SW.0010
## kirkstone.TQ.ARM.BSP.0006
### Module BSP Revisions
* kirkstone.TQMa8.BSP.SW.0091
### Added
* dumpling-ls and spaetzle-ls distro for Layerscape modules.
* image_type_pblvariant to build bootonly image with alternative pbl for
Layerscape modules.
## kirkstone.TQ.ARM.BSP.0005
### Module BSP Revisions
* kirkstone.TQMa8.BSP.SW.0090
* kirkstone.TQMa64xxL.BSP.SW.0004
## kirkstone.TQ.ARM.BSP.0004
### Module BSP Revisions
* kirkstone.TQMa64xxL.BSP.SW.0003
* kirkstone.TQMa8.BSP.SW.0089
### Added
* Added initial support for TQMT10xx machines
### Changed
* dynamic-layers/meta-ti:
* Update for compatibility with latest meta-ti kirkstone (as of
commit 38941472e1e3 "meta-ti-bsp: add BeagleBone AI-64 support"). Our
ti-sgx-ddk-um initialization fix has been upstreamed and is removed from
meta-dumpling.
* Check for `screen` instead of `display` in `MACHINE_FEATURES` since `screen`
is used in Yocto Project / OpenEmbedded to test for display support of
current `MACHINE`
* dynamic-layers/qt5-layer:
* Split package groups for Qt5, so that examples etc. can be left out for
release images.
* Rewrite bbappend for qtbase. Use `PACKAGECONFIG_<abc>` variables provided by
qtbase recipe from meta-qt5 to have some structure and provide a better set
of defaults.
* Add qtwayland and QPA plugin if `wayland` is in `DISTRO_FEATURES`
* Add `eglfs` QPA plugin if `imxgpu3d` is in `MACHINEOVERRIDES`
* Use glibc in spaetzle distro for tqmt10xx machines
### Fixed
* dynamic-layers/qt5-layer: Move Qt5 bbappends to correct location. This
allows bitbake to use them.
## kirkstone.TQ.ARM.BSP.0003
### Module BSP Revisions
* kirkstone.TQMa335x.BSP.SW.0125
* kirkstone.TQMa64xxL.BSP.SW.0002
* kirkstone.TQMa65xx.BSP.SW.0009
* kirkstone.TQMa8.BSP.SW.0088
### Removed
* gengetopt: remove recipe, we depend on openembedded-layer which provides this
recipe
### Fixed
* Fix ti-sgx-ddk-um initialization on systemd-based distros. This allows
Weston to work on TQMa65xx.
## kirkstone.TQMa335x.BSP.SW.0124
## kirkstone.TQMLS1012AL.BSP.SW.0012
## kirkstone.TQMLS102xA.BSP.SW.0116
## kirkstone.TQMa8.BSP.SW.0087
## kirkstone.TQMa6x.BSP.SW.0121
## kirkstone.TQMa7x.BSP.SW.0115
## kirkstone.TQMa6UL.BSP.SW.0117
### Changed
* distros: use busybox ping instead of inetutils version to
have more complete commandline args for some use cases
* distros: disable dhcpcd systemd units by default
* distros: build small SD / e-MMC boot image for SOM with TI CPU
* treewide: syntax conversion for honister
* treewide: recipe changes for building with honister
### Added
* distros: dumpling: enable bluetooth as DISTRO_FEATURE by default
* doc: paragraph for SDK usage
### Fixed
* recipes-graphics/kmscube: Fix optional GLES3 support
backport new upstream fixes and make sure kmscube will be installed
* Fix missing `WAYLAND_DISPLAY` environment variable. Allows access for
members of `wayland` group
* gstreamer1.0-plugins-good: fix patch fuzz warning
* images: tq-image-weston-debug: bbappend for image did not work after
splitting image recipes. IMX gstreamer packages were missing when using
meta-freescale together with `use-nxp-bsp`
* distros: fix broken SDK build (due to a wrong named variable)
__Start of porting to kirkstone__
------------------------------------------------------------------------
### Changed
* distros
* spaetzle: force using busybox utils
* dumpling: prefer full featured util-linux utils
* packagegroup-testutils:
* improve package handling for opengl related stuff
* optimize utils selection if `MACHINE_FEATURES` contains `display`
* packagegroup-hwutils: improve handling of usb related packages. usb-modeswitch
is now provided as new subpackage. This is not used by default because it is
rarely needed but depends on tcl
* treewide: syntax conversion for honister
* treewide: recipe changes for building with honister
__Start of porting to honister__
------------------------------------------------------------------------
## hardknott.TQMLS1028A.BSP.SW.0107
### Changed
* images: reduce size of debug images. `IMAGE_FEATURES` with tools-testapps
have complex dependencies causing large image sizes.
### Added
* image: recipe for PREEMPT RT use case
### Fixed
* base-files: issue.net handling
* output only for interactive sessions
* prevent escape codes in issue.net
* packagegroup-testutils: fix build for DISTRO_FEATURES without "opengl"
* distros: enable kernel provider override for PREEMPT RT use case
## hardknott.TQMa7x.BSP.SW.0114
## hardknott.TQMa6x.BSP.SW.0120
## hardknott.TQMa6UL.BSP.SW.0116
### Changed
* distro: unbundle dumpling / spatzle distros from using buildhistory and
buildstats. This should be done in buildspace local.conf or auto.conf rather
then in distro config.
* rng.tools: do not start rngd if HW RNG is available. Modern kernels already use
the entropy from a HW RNG itself. Also starting rngd using libjitterentropy
introduces a huge but useless CPU usage upon startup.
### Fixed
* rng.tools: remove outdated recipe that was needed for zeus and older to include
libjitterentropy support. Switch to use current upstream from poky.
* lmsensors: default packageconfig installs sensord with complex dependencies.
Fix it to prevent massive rootfs size increase and installment of otherwise
not needed packages
### Added
* image recipes:
* recipes are split, so that every image has a conjugated
-debug enabled recipe. This enables to distinguish debug and release builds
easily
* add a postprocess command for -debug images that adds a hint regarding
security to etc/issue\[.net\]
* packagegroup-testutils:
* add alsabat if alsa is enabled
* RRECOMMEND openssh-sftp-server (useful for QtCreator, eclipse etc.)
* alsa-utils: add bbappend to allow compilation of alsabat
* base-files: customize /etc/issue[.net] to have some branding
## hardknott.TQMa65xx.BSP.SW.0008
## hardknott.TQMa8.BSP.SW.0084
### Changed
* make sure hwclock from util-linux gets installed
* add coreutils to images not built for spaetzle
### Changed
* packagegroup-can: install also subpackage can-utils-cantest
* alsa packages: use COMBINED_FEATURES for optional install
* dependencies: meta-openembedded/meta-oe is now a dependency, remove from
dynamic-layers and fold bbappends in normal directories and recipes.
## hardknott.TQMa8.BSP.SW.0083
### Fixed
* packagegroup-wifi: bbappend for hostapd in dynamic-layers to prevent build
failure without meta-openembedded
* kmscube: missing dependency (already fixed upstream)
* recipes-image: fix installing kmscube and glmark2 for different setups
* distro spaetzle* / image tq-image-small: fix to use initscripts from within
busybox. Otherwise no start / stop scripts are installed at all
### Changed
* rename packagegroup-camera to packagegroup-v4l2 and install also, if
`MACHINE_FEATURES` contains `vpu`
* glmark2: enable install multiple flavours
* distro:
* enable mesa libs as virtual providers for mainline based distros
* refactor include hierarchy
* tq-image-small:
* install kernel and dtbs into image for using the rootfs in UBI
images on MTD devices like QSPI NOR
* install packagroup-netutils for basic network support
### Removed
* perf: scripting scripting doesn't need to be disabled anymore, remove bbappend
file
## hardknott.TQMa8.BSP.SW.0080
### Added
* busybox: defconfig: enable extendend features / parameters for enabled applets
* packagegroup-wifi: add hostapd
* port from zeus-tqma8
* camera package group
* camera support recipes
* wifi package group
* psplash branding and systemd support
* add recipe for small sized image capable for UBI
* add recipe for qt5 demo image
* add distro support
* small / normal and wayland based
* support for building with vendor layers
### Fixed
* distros: fix spelling of TQ-Systems
* packagegroup-hwutils: enable libgpiod-tools - libgpiod has been split into
subpackages in newer versions
* busybox: defconfig: restore extendend parameters for `dd`
* allow kmscube to run in background
* packagegroup-fsutils: fix ubi support
* build fixes for musl and UTF8 / unicode
### Changed
* switch to hardknott
## zeus.TQMLS1028A.BSP.SW.0105
### Fixed
* Correct the spelling of TQ-Systems
## zeus.TQMLS1028A.BSP.SW.0103
### Added
* packagegroup-testutils: add various additional utilities from
meta-openembedded
### Changed
* gstreamer1.0-plugins-bad: build without OpenCV by default to reduce
build time
## zeus.TQ.Yocto.BSP.SW.0001
This is a joint release for multiple TQMaxx and TQMLSxx module families. It can
also be found under the following tag names:
* zeus.TQMa6x.BSP.SW.0118
* zeus.TQMa7x.BSP.SW.0111
* zeus.TQMa6ULx.BSP.SW.0113
* zeus.TQMLS1012AL.BSP.SW.0007
* zeus.TQMLS102xA.BSP.SW.0115
* zeus.TQMLS1028A.BSP.SW.0102
### Added
* tq-image-weston: added new image based on tq-image-generic, incorporating
Wayland/Weston and Gstreamer support
* packagegroup-fsutils: added UBI, JFFS2 and misc mtd-utils
## zeus.TQMa6x.BSP.SW.0117 / zeus.TQMa7x.BSP.SW.0110 / zeus.TQMa6ULx.BSP.SW.0112 / zeus.TQMLS1012AL.BSP.SW.0006 / zeus.TQMLS102xA.BSP.SW.0114 / zeus.TQMLS1028A.BSP.SW.0101
### Added
* packagegroup-hwutils: added minicom, screen and libgpiod
* packagegroup-netutils: added iproute2
* packagegroup-systemd: added systemd-serialgetty
### Changed
* rng-tools: updated to 6.9 and enabled libjitterentropy on devices without
dedicated hardware RNG
* busybox: removed telnet and ftp applets, enable full TFTP features
* All packagegroups were restructed to make better use of dynamic-layers
## warrior.MBa6ULxL.BSP.SW.0101
### Added
* add a Changelog
### Changed
* doc: README as Markdown
* doc: improve README
### Removed
* perf: remove bbappend needed for linux 4.1.x
## warrior.TQMa6ULx.BSP.SW.0107 / warrior.TQMa7x.BSP.SW.0108 /
warrior.TQMLS102xA.BSP.SW.0111 / arrior.TQMLS102xA.BSP.SW.0112
### Fixed
* tq-image-generic: add missing packagegroup-base
* tq-image-generic: append IMAGE_LINGUAS instead of hard setting
* bbappend fsl-image-multimedia-full from meta-freesacale-distro
### Changed
* tq-image-generic: use new packagegroup-systemd
### Added
* add packagegroup for systemd relevant packages
## warrior.TQMLS1046A.BSP.SW.0003
### Changed
* layer.conf: mark compatibility for warrior
* packagegroup-hwutils: add spitools package
* tq-image-generic: force openssh instead of dropbear
* packagegroup-hwutil: let pciutils depend on MACHINE_FEATURE pci
* packagegroup-hwutils: add can-utils if openembedded-layer is present
* images: use new packagegroup-audio
* images: add new can packagegroup if can is in machine features
### Added
* layers.conf: prepare dynamic layers
* add new packagegroup for packages needed for can support
* add new packagegroup for basic audio support
### Fixed
* busybox: add missing dd 3rd status line config
* packagegroup-fsl-gstreamer1.0: fix upstream sumo gstreamer change
## Older releases

View File

@@ -0,0 +1,395 @@
Attribution 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.†The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.

View File

@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,13 @@
The components built by the recipes in this layer are under different licenses
See the `LICENSE` variable set inside the recipes.
All recipe metadata is MIT licensed unless otherwise stated.
Source code and binaries included in tree for individual recipes
are under the `LICENSE` stated in the associated recipe
(*.bb / *.bbappend / *.inc / *.bbclass files) unless otherwise stated.
All documentation data is licensed under CC-BY-4.0 (Creative Commons
Attribution 4.0 International Public License)
License information for any other files is either explicitly stated
or defaults to GPL version 2.

View File

@@ -0,0 +1,210 @@
<!---
SPDX-License-Identifier: CC-BY-4.0
Copyright (c) 2018-2024 TQ-Systems GmbH <oss@ew.tq-group.com>,
D-82229 Seefeld, Germany.
--->
# OpenEmbedded / Yocto Project evaluation BSP layer for TQ-Systems ARM SOM
This README file contains information on the content of the meta-dumpling layer.
Please see the corresponding sections below for details.
[[_TOC_]]
## Overview
### Abstract
This layer provides recipes to generate images to help evaluation of
TQ-Systems CPU modules and Starterkits. This layer additionally contains
optional fixes and extensions for other layers as far as is needed / useful
for TQ-Systems SOM and some initial example distro support.
### Dependencies
This layer in the checked out branch depends on:
URI: https://git.yoctoproject.org/poky
branch: scarthgap
layers: meta
URI: https://github.com/openembedded/meta-openembedded.git
branch: scarthgap
layers: meta-oe
URI: https://github.com/tq-systems/meta-tq.git
branch: scarthgap
layers: meta-tq
When using one of the distros definded in this layer you need
additionally the `meta-poky` layer from the poky repo that defines
`poky` which the distros defined in this layer depend on.
**Note** Recipes and bbappends in this layer do not depend on `meta-poky`
URI: https://git.yoctoproject.org/poky
branch: scarthgap
layers: meta-poky
This layer additionally contains optional fixes and extensions for other layers
as far as needed or useful for TQ-Systems SOM. Most of these bbappends
are implemented under dynamic-layers and are only visible, if the original
layer is in your bblayer.conf. For details look for `BBFILES_DYNAMIC` in
Yocto Project documentation.
### Coding style
It is recommended to use the [Format_Guidelines](https://www.openembedded.org/wiki/Styleguide#Format_Guidelines)
from openembedded.
### Patches
Please submit patches against the meta-dumpling layer via github's collaboration
features.
Additionally, you can send patches to the maintenance team by email:
<oss@ew.tq-group.com>
## Usage
### Adding the meta-dumpling layer to your build
Run 'bitbake-layers add-layer <path-to-meta-dumpling>/meta-dumpling'
Assuming the tq layer exists in subdir sources at the top-level of your
yocto build tree, you can add it to the build system by adding the
location of the tq layer to bblayers.conf, along with any
other layers needed. e.g.:
```
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"
BBLAYERS ?= "\
...
${BSPDIR}/sources/poky/meta \
${BSPDIR}/sources/poky/meta-poky \
${BSPDIR}/sources/poky/meta-openembedded/meta-oe \
${BSPDIR}/sources/meta-tq \
...
"
```
### Image recipes
The meta-dumpling layer defines images recipes for test / evaluation of
TQ-Systems SOM:
| image | intended use |
| ------------------------- | ---------------------------------------------------------------- |
| tq-image-small | based on poky core-image-minimal, usable for UBI rootfs |
| tq-image-small-debug | based on poky tq-image-small, added debug features |
| tq-image-generic | based on poky core-image-minimal |
| tq-image-generic-debug | based on tq-image-generic, added debug features and packages |
| tq-image-generic-rt | based on poky core-image-minimal, PREEMPT_RT kernel |
| tq-image-generic-rt-debug | based on tq-image-generic-rt, added debug features and packages |
| tq-image-weston | based on poky core-image-weston |
| tq-image-weston-debug | based on tq-image-weston, added debug features and packages |
| tq-image-qt6 | based on tq-image-weston, added Qt6 support |
| tq-image-qt6-debug | based on tq-image-qt6, added debug features and examples |
**Attention:** These image recipes can be used as a starting point for own customization.
Every recipe comes in two flavours. The images suffixed with `debug` add `debug-tweaks` to
the `IMAGE_FEATURES` to have an open root login for console and ssh for ease of development
and testing. The non suffixed images simply define a base feature set for the use case
and contain a lot of test utils, to evaluate and test TQ-Systems starterkits.
Because of the intended use case, these image recipes are intended as a starting point
for development but should not be used directly for production images.
Depending on the actual project, security must be taken in account.
**Note:** Out of the box (without `debug-tweaks` in `IMAGE_FEATURES`) the images
without `-debug` suffix do not allow user login. This should be default for the vast
majority of embedded systems. If one need an user that can login, see poky documentation
for `extrausers.bbclass` and following example:
```
# add user <username> with password <passwd> and force password change at first login
IMAGE_CLASSES += "extrausers"
USERADDEXTENSION = "useradd-staticids"
USERADD_UID_TABLES = "files/passwd"
USERADD_GID_TABLES = "files/group"
EXTRA_USERS_PARAMS = "\
useradd <username> ; \
usermod -P <passwd> <username>; \
passwd-expire <username>; \
"
```
### Example distros
The meta-dumpling layer defines distros as starting point for own customization.
These distros are also available for usage together with vendor based kernel /
vendor hardware support layer.
| distro name | purpose |
| -------------------- | ----------------------------------------------------------------------- |
| spaetzle | size optimized for \[Q\]SPI-NOR, kernel based on linux-stable |
| spaetzle-ls | size optimized for \[Q\]SPI-NOR for Layerscape ARM |
| spaetzle-nxp | size optimized for \[Q\]SPI-NOR, packages based on meta-freescale + NXP |
| spaetzle-ti | size optimized for \[Q\]SPI-NOR, packages based on meta-ti-bsp |
| dumpling-ls | systemd, features depends on machine settings for Layerscape ARM |
| dumpling-wayland | systemd, wayland / weston, kernel based on linux-stable |
| dumpling-wayland-nxp | systemd, wayland / weston, packages based on meta-freescale + NXP |
| dumpling-wayland-ti | systemd, wayland / weston, packages based on meta-ti-bsp |
**Attention:** These distro configs can be used as a starting point for own
customization. Because of the intended usage, they are focused on demonstration.
These configs should not go into a production usage without thorough review.
Depending on the actual project, security must be taken in account.
### SDK usage
For each of the distros an SDK can be built. The SDK contains everything
needed for cross application development for the target hardware. To build
the SDK along with the image, run
```
bitbake <image> -c populate_sdk
```
After building the SDK, an installation script can be found in
`${TMPDIR}/deploy/sdk`. Simply run the script to install the SDK on your
development host. The script will provide you with a default install path,
but it can be customized when needed. Depending on your installation path
you will possibly need root access to install the SDK.
#### Developing in SDK environment
Source the bash script located inside your chosen installation path, starting
with `environment-setup` followed by some architecture specifications. For
example:
```
source <path/to/sdk/installation>/environment-setup-cortexa53-crypto-tq-linux
```
Inside the SDK environment you can now develop your application using the
cross compiler tools. To verify the environment run `env` or display the
value of `CC`:
```
echo ${CC}
```
#### Direct usage of SDK cross toolchain
You can also invoke the cross compile tools directly. They are
located in the SDK installation path in the `sysroots` folder. In this
folder you will find two more folders. One sysroot for your target
hardware, containing cross compiled libraries and headers among others
and one sysroot for your development host architecture (typically
x86_64). This second sysroot contains the cross compile tools in
`<path/to/sdk/installation>/sysroots/<host_architecture>/usr/bin/<target_architecture>`.
### Known issues
* tq-image-small\[-debug\]:
* DHCP is not working
* restricted support for hardware
* some warnings from init scripts

View File

@@ -0,0 +1,75 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany
#
# Reuse and extend image-buildinfo.bbclass to generate '/etc/buildinfo' with SCM
# information for the built BSP and configuration information for machine / distro / image
# Additionally the image specific buildinfo is generated in DEPLOY_DIR_IMAGE using
# IMAGE_NAME and IMAGE_LINK_NAME
#
# Usage: add INHERIT += "tq-buildinfo" to your conf file
#
# support creating /etc/buildinfo in image
inherit image-buildinfo
# define what to put in /etc/buildinfo
IMAGE_BUILDINFO_VARS += "DISTRO"
IMAGE_BUILDINFO_VARS += "MACHINE"
IMAGE_BUILDINFO_VARS += "DEFAULTTUNE"
IMAGE_BUILDINFO_VARS += "MACHINE_FEATURES"
IMAGE_BUILDINFO_VARS += "DISTRO_FEATURES"
IMAGE_BUILDINFO_VARS += "COMBINED_FEATURES"
IMAGE_BUILDINFO_VARS += "IMAGE_FEATURES"
IMAGE_BUILDINFO_VARS += "MACHINEOVERRIDES"
IMAGE_BUILDINFO_VARS += "DISTROOVERRIDES"
# use functions from oe.buildcfg to get information about the
# build space project. This assumes, that the build directory is
# located inside the checked out build space repository. 'TOPDIR' resolves to the
# top level build directory
def topproject_revision(d):
topdir = d.getVar('TOPDIR')
bspdir = d.getVar('BSPDIR')
if bspdir is None :
bb.warn("BSPDIR is not set. Unknown build configuration.")
git_description = oe.buildcfg.get_metadata_git_revision(topdir)
if git_description != '<unknown>':
git_description = oe.buildcfg.get_metadata_git_describe(topdir)
return git_description
# set variable to the SCM revision information of our build space repository
TOPPROJECT_REVISION = "${@topproject_revision(d)}"
# we want this information in our /etc/buildinfo
IMAGE_BUILDINFO_VARS += "TOPPROJECT_REVISION"
# Extend the image-buildinfo class to store the information in ${DEPLOY_DIR_IMAGE},
# too
TQ_IMAGE_BUILDINFO_FILE = "${IMAGE_NAME}.buildinfo"
TQ_IMAGE_BUILDINFO_LINK = "${IMAGE_LINK_NAME}.buildinfo"
python tq_buildinfo_build () {
deploy_dir = d.getVar("DEPLOY_DIR_IMAGE")
d.setVar("BUILDINFODEST", deploy_dir)
d.setVar("IMAGE_BUILDINFO_FILE", "/" + d.getVar("TQ_IMAGE_BUILDINFO_FILE"))
bb.build.exec_func("buildinfo", d)
dst = os.path.join(deploy_dir, d.getVar("TQ_IMAGE_BUILDINFO_LINK"))
src = d.getVar("TQ_IMAGE_BUILDINFO_FILE")
if os.path.exists(os.path.join(deploy_dir, d.getVar("TQ_IMAGE_BUILDINFO_FILE"))):
bb.note("Creating symlink: %s -> %s" % (dst, src))
if os.path.islink(dst):
os.remove(dst)
os.symlink(src, dst)
else:
bb.note("Skipping symlink, source does not exist: %s -> %s" % (dst, src))
}
# add trigger to generate ${DEPLOY_DIR_IMAGE}/${MACHINE}-buildinfo-${SOURCE_DATE_EPOCH}
IMAGE_POSTPROCESS_COMMAND += "tq_buildinfo_build"

View File

@@ -0,0 +1,5 @@
require conf/distro/include/dumpling.inc
require conf/distro/include/tq-provider-ls.inc
DISTRO = "dumpling-ls"
DISTRO_NAME = "Dumpling (TQ-Systems Dumpling Distribution) for TQ-Systems Layerscape BSP"

View File

@@ -0,0 +1,6 @@
require conf/distro/include/dumpling.inc
require conf/distro/include/tq-provider-imx.inc
DISTRO = "dumpling-wayland-nxp"
DISTRO_NAME = "Dumpling Wayland (TQ-Systems Dumpling Wayland Distribution)"

View File

@@ -0,0 +1,5 @@
require conf/distro/include/dumpling.inc
require conf/distro/include/tq-provider-ti.inc
DISTRO = "dumpling-wayland-ti"
DISTRO_NAME = "Dumpling Wayland (TQ-Systems Dumpling Wayland Distribution for TI BSP)"

View File

@@ -0,0 +1,5 @@
require conf/distro/include/dumpling.inc
require conf/distro/include/tq-provider-mainline.inc
DISTRO = "dumpling-wayland"
DISTRO_NAME = "Dumpling Wayland (TQ-Systems Dumpling Wayland Distribution)"

View File

@@ -0,0 +1,44 @@
require conf/distro/poky.conf
require tq-common.inc
DISTRO_SHORT_NAME = "dumpling"
DISTRO_FEATURES_DEFAULT:remove = "argp irda pcmcia zeroconf x11"
DISTRO_FEATURES = "${DISTRO_FEATURES_DEFAULT}"
DISTRO_FEATURES += "npu"
DISTRO_FEATURES += "opengl"
DISTRO_FEATURES += "pam"
DISTRO_FEATURES += "ppp"
DISTRO_FEATURES += "vulkan"
DISTRO_FEATURES += "wayland"
DISTRO_FEATURES += "wifi"
# add some locales per default
IMAGE_LINGUAS:append = " de-de en-us"
# point some runtime providers to full fledged packages
PREFERRED_PROVIDER_virtual/base-utils = "packagegroup-core-base-utils"
VIRTUAL-RUNTIME_base-utils = "packagegroup-core-base-utils"
VIRTUAL-RUNTIME_base-utils-hwclock = "util-linux-hwclock"
VIRTUAL-RUNTIME_base-utils-lscpu = "util-linux-lscpu"
# strip some unused stuff to lower dependencies, work in progress:
# we do not have firewire support
PACKAGECONFIG_pn_gstreamer1.0-plugin-good:remove = "dv1394"
# at the moment gtk is not used
PACKAGECONFIG_pn_gstreamer1.0-plugin-good:remove = "gtk"
# Conflicts with systemd-networkd
SYSTEMD_AUTO_ENABLE:dhcpcd = "disable"
# TODO: cairo and gdk-pixbuf are default on - if not gstreamer dependencies
# can be removed.
# this is needed for FIT image signature generation
# to actually enable signature generation, you must add
# UBOOT_SIGN_ENABLE = "1"
# to your local.conf
UBOOT_SIGN_KEYDIR ?= "${DUMPLING_LAYERDIR}/files/keys/u-boot"
UBOOT_SIGN_KEYNAME ?= "dev"
UBOOT_MKIMAGE_DTCOPTS = "--in-format dts --out-format dtb"

View File

@@ -0,0 +1,129 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
###############################################################################
###############################################################################
# Shared distribution definitions for spaetzle and derived distros
#
# Based on poky-tiny.conf from meta-poky to circumvent hard assignments:
# PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-tiny"
# IMAGE_FSTYPES = "cpio.gz"
#
# This file needs to evaluated at updates of the distro definitions in poky
###############################################################################
# based on conf/distro/poky-tiny.conf:
require conf/distro/poky.conf
require conf/distro/include/gcsections.inc
DISTRO ?= "spaetzle"
DISTRO_NAME ?= "Spaetzle (TQ-Systems GmbH Spaetzle - a tiny example distribution)"
# This is needed for branding 'etc/issue[.net]' (figlet ascii graphics in recipe base-files)
DISTRO_SHORT_NAME = "spaetzle"
DISTROOVERRIDES = "poky:spaetzle"
TCLIBC = "musl"
# musl libc does not work for PowerPC E5500 cores with 64 Bit mode. Build with glibc
# instead. See
# https://git.musl-libc.org/cgit/musl/tree/src/setjmp/powerpc64/setjmp.s#n74
# https://git.musl-libc.org/cgit/musl/commit/?id=7be59733d71ada3a32a98622507399253f1d5e48
TCLIBC:e5500-64b = "glibc"
FULL_OPTIMIZATION="-Os -pipe ${DEBUG_FLAGS}"
# do not overwrite the kernel provider and version here
# empty this to prevent packages slipping in from poky
POKY_DEFAULT_EXTRA_RRECOMMENDS = ""
# This is already set by poky
# TCLIBCAPPEND = ""
# as log as we do not use ncurses we do not care for wide character support
# ENABLE_WIDEC = "false"
# ENABLE_WIDEC:class-native = "true"
# Drop native language support. This removes the
# eglibc->bash->gettext->libc-posix-clang-wchar dependency.
USE_NLS = "no"
# As we don't have native language support, don't install locales into images
IMAGE_LINGUAS = ""
# Define a small set of distro features. A sane base is ext2 and pci
DISTRO_FEATURES = "ext2 pci"
# basic network support
DISTRO_FEATURES += "ipv4 ipv6"
# usb support
DISTRO_FEATURES += "usbhost"
# Make sure we have sysvinit in the list. Needed to get tasks injected by
# update-rc.d.bbclass. This will bring in the initscripts from different
# packages
DISTRO_FEATURES:append = " sysvinit"
# add a new "tiny" feature, maybe this will be supported in OE core in future, too
# this will give a chance to select / unselect in packagegroups and the like.
DISTRO_FEATURES += " tiny"
# The following features are not enabled, mostly for their dependencies
# that usually cause increase of rootfs size
# * alsa
# * usbgadget
# * wifi
# * bluetooth
DISTRO_FEATURES:class-native = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}"
DISTRO_FEATURES:class-nativesdk = "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES}"
# FIXME: Consider adding "modules" to MACHINE_FEATURES and using that in
# packagegroup-core-base to select modutils-initscripts or not. Similar with "net" and
# netbase.
# do not overwrite the IMAGE_FSTYPES list here
# do not overwrite MACHINE_ESSENTIAL_EXTRA_RDEPENDS list here
# We have some images that can't be built with spaetzle
SKIP_RECIPE[build-appliance-image] = "not buildable with spaetzle"
SKIP_RECIPE[core-image-rt] = "not buildable with spaetzle"
SKIP_RECIPE[core-image-rt-sdk] = "not buildable with spaetzle"
SKIP_RECIPE[core-image-sato] = "not buildable with spaetzle"
SKIP_RECIPE[core-image-sato-dev] = "not buildable with spaetzle"
SKIP_RECIPE[core-image-sato-sdk] = "not buildable with spaetzle"
SKIP_RECIPE[core-image-x11] = "not buildable with spaetzle"
SKIP_RECIPE[core-image-weston] = "not buildable with spaetzle"
SKIP_RECIPE[tq-image-generic] = "not buildable with spaetzle: use tq-image-small"
SKIP_RECIPE[tq-image-weston] = "not buildable with spaetzle: use tq-image-small"
SKIP_RECIPE[tq-image-qt6] = "not buildable with spaetzle: use tq-image-small"
# Disable python usage in opkg-utils since it won't build with tiny config
PACKAGECONFIG:remove:pn-opkg-utils = "python"
require conf/distro/include/tq-common.inc
# tinification of tq-common.inc (mostly similar to init-manager-mdev-busybox.inc).
# start with default ...
INIT_MANAGER = "none"
# some modification of settings from INIT_MANAGER = "mdev-busybox"
# force removal of systemd from DISTRO_FEATURES
# take care when updating yocto, at the moment sysvinit must not be removed,
# see above
DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " systemd"
VIRTUAL-RUNTIME_dev_manager = "eudev"
VIRTUAL-RUNTIME_login_manager = "busybox"
VIRTUAL-RUNTIME_init_manager = "busybox"
VIRTUAL-RUNTIME_initscripts = "initscripts"
VIRTUAL-RUNTIME_keymaps = "keymaps"
# include additional udev rules for eudev
DISTRO_EXTRA_RDEPENDS += "tq-udev-rules"
# point some runtime providers to busybox
PREFERRED_PROVIDER_virtual/base-utils = "busybox"
VIRTUAL-RUNTIME_base-utils = "busybox"
VIRTUAL-RUNTIME_base-utils-hwclock = "busybox-hwclock"
IMAGE_FSTYPES += "${@bb.utils.contains('MACHINE_FEATURES', 'ubi', 'ubi', '', d)}"

View File

@@ -0,0 +1,92 @@
VENDOR_SHORT_NAME = "tq"
VENDOR_LONG_NAME = "TQ-Systems"
TARGET_VENDOR = "-${VENDOR_SHORT_NAME}"
# should be set to a useful name as soon as we want to go away from
# poky/meta-poky/conf/distro/poky.conf
DISTRO_VERSION ??= "${VENDOR_SHORT_NAME}.0.1"
# The bundle version interacts with the downgrade barrier.
# "r0" as version, disables the downgrade barrier. If a
# downgrade barrier is set with r1, you have to increase
# the version for every update. In that way old security
# vulnerabilities cannot be exploited.
RAUC_BUNDLE_VERSION ?= "r0"
SKIP_RECIPE[rauc-conf] = "replaced with tq-rauc-conf"
# RAUC example key - located under (and used by recipes in) dynamic-layers/rauc
RAUC_KEYRING_FILE ?= "example.cert.pem"
RAUC_CERT_FILE ?= "example.cert.pem"
RAUC_KEY_FILE ?= "example.key.pem"
# RAUC upgrades are possible between images that use the same
# `RAUC_BUNDLE_COMPATIBLE`. The reference distros in meta-dumpling always use
# "dumpling-${MACHINE}", so upgrades between dumpling and spaetzle are supported.
RAUC_BUNDLE_COMPATIBLE ?= "dumpling-${MACHINE}"
SDK_VENDOR = "-${VENDOR_SHORT_NAME}sdk"
SDK_VERSION := "${DISTRO_VERSION}"
SDK_NAME = "${VENDOR_SHORT_NAME}-${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}"
SDKPATH = "/opt/${VENDOR_SHORT_NAME}-${DISTRO}/${SDK_VERSION}"
# include the config checker
INHERIT += "sanity"
# run QA tests
INHERIT += "insane"
QA_LOG = "1"
# generate 'etc/buildinfo' in image and in 'DEPLOY_DIR_IMAGE' folder
INHERIT += "tq-buildinfo"
DISTRO_EXTRA_RDEPENDS += "os-release u-boot-env-tq"
DISTRO_EXTRA_RRECOMMENDS += " \
zstd \
${@bb.utils.contains('DISTRO_FEATURES', 'rauc', 'tq-mount-data', '', d)} \
"
# listed checks from ERROR_QA to WARN_QA (from insane.bbclass)
ERROR_TO_WARN_QA = "version-going-backwards"
INIT_MANAGER = "systemd"
# home for root is '/root' and nothing else
ROOT_HOME ?= "/root"
#
# busybox has prio 50 per default, inetutils has 79
# ping from iputils should have same features as full featured
# busybox ping and has priority of 100
# to prevent installing a crippled ping, decrease prio for inetutils
# implementation, so that we have
# inetutils.ping < busybox.ping < iputils.ping
#
ALTERNATIVE_PRIORITY_inetutils-ping[ping] = "27"
ALTERNATIVE_PRIORITY_inetutils-ping6[ping6] = "27"
ALTERNATIVE_PRIORITY_busybox-sysctl[sysctl] = "27"
# Set a more generic tuning for code reuse across parts.
# The machine definitions should include the best available
# tune flavour. Therefore 'DEFAULTTUNE' may already have been
# assigned by the mentioned tuning include.
# Hence we cannot use a default assignment here but reassign.
DEFAULTTUNE:am62xx = "armv8a-crc-crypto"
DEFAULTTUNE:am64xx = "armv8a-crc-crypto"
DEFAULTTUNE:am65xx = "armv8a-crc-crypto"
DEFAULTTUNE:j722s = "armv8a-crc-crypto"
DEFAULTTUNE:ls1012a = "armv8a-crc-crypto"
DEFAULTTUNE:ls1028a = "armv8a-crc-crypto"
DEFAULTTUNE:ls1043a = "armv8a-crc-crypto"
DEFAULTTUNE:ls1046a = "armv8a-crc-crypto"
DEFAULTTUNE:ls1088a = "armv8a-crc-crypto"
DEFAULTTUNE:lx2160a = "armv8a-crc-crypto"
DEFAULTTUNE:mx8-generic-bsp = "armv8a-crc-crypto"
DEFAULTTUNE:mx8m-generic-bsp = "armv8a-crc-crypto"
DEFAULTTUNE:mx8qm-generic-bsp = "armv8a-crc-crypto"
DEFAULTTUNE:mx8x-generic-bsp = "armv8a-crc-crypto"
DEFAULTTUNE:mx8ulp-generic-bsp = "armv8a-crc-crypto"
DEFAULTTUNE:mx9-generic-bsp = "armv8a-crc-crypto"
DEFAULTTUNE:mx91-generic-bsp = "armv8a-crc-crypto"
DEFAULTTUNE:mx93-generic-bsp = "armv8a-crc-crypto"
DEFAULTTUNE:mx95-generic-bsp = "armv8a-crc-crypto"

View File

@@ -0,0 +1,17 @@
# This file is used for all distro configs based on imx / fslc-imx kernel and
# vendor software stacks. To make it usable also with distros based on
# poky-tiny we need to add a specific PREFERRED_PROVIDER for virtual/kernel
# since poky-tiny has a hard assignment for linux-yocto-tiny
# variable from meta-freescale
# TODO: QORIQ_DEFAULT_BSP
IMX_DEFAULT_BSP = "nxp"
IMX_DEFAULT_KERNEL = "linux-imx-tq"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-imx-tq"
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-imx-tq"
# machine without drm/kms in fslc BSP have no libgbm
PREFERRED_PROVIDER_virtual/libgbm = ""
PREFERRED_PROVIDER_virtual/libgbm:mx8-nxp-bsp = "imx-gpu-viv"

View File

@@ -0,0 +1,8 @@
PREFERRED_PROVIDER_virtual/kernel:tqmls1012al ?= "linux-imx-tq"
PREFERRED_PROVIDER_virtual/kernel:tqmls1028a ?= "linux-imx-tq"
PREFERRED_PROVIDER_virtual/kernel:tqmls10xxa ?= "linux-tq"
PREFERRED_PROVIDER_virtual/kernel:tqmlx2160a ?= "linux-tq"
PREFERRED_PROVIDER_virtual/kernel:tqmt10xx ?= "linux-tqmt"
QORIQ_DEFAULT_BSP:tqmls102xa = "mainline"
QORIQ_DEFAULT_BSP:tqmls1028a = "mainline"

View File

@@ -0,0 +1,16 @@
# This file is used for all distro configs based on mainline kernel and / or
# mainline software stacks. To make it usable also with distros based on
# poky-tiny we need to add a specific PREFERRED_PROVIDER for virtual/kernel
# since poky-tiny has a hard assignment for linux-yocto-tiny
# set for meta-freescale to enforce mainline kernel / graphic stack
IMX_DEFAULT_BSP = "mainline"
DISTRO_FEATURES += "tq-mainline"
PREFERRED_PROVIDER_virtual/kernel ?= "linux-tq"
PREFERRED_PROVIDER_virtual/egl = "mesa"
PREFERRED_PROVIDER_virtual/libgl = "mesa"
PREFERRED_PROVIDER_virtual/libgles1 = "mesa"
PREFERRED_PROVIDER_virtual/libgles2 = "mesa"
PREFERRED_PROVIDER_virtual/libgbm = "mesa"

View File

@@ -0,0 +1,2 @@
# Workaround for incorrect SIGGEN_EXCLUDERECIPES_ABISAFE in meta-ti
SIGGEN_EXCLUDERECIPES_ABISAFE:remove = "mesa-pvr"

View File

@@ -0,0 +1,5 @@
require conf/distro/include/spaetzle.inc
require conf/distro/include/tq-provider-ls.inc
DISTRO = "spaetzle-ls"
DISTRO_NAME = "Spaetzle (TQ-Systems Spaetzle Distribution) for TQ-Systems Layerscape BSP"

View File

@@ -0,0 +1,5 @@
require conf/distro/include/spaetzle.inc
require conf/distro/include/tq-provider-imx.inc
DISTRO = "spaetzle-nxp"
DISTRO_NAME = "Spaetzle (TQ-Systems Spaetzle Distribution) for NXP BSP"

View File

@@ -0,0 +1,5 @@
require conf/distro/include/spaetzle.inc
require conf/distro/include/tq-provider-ti.inc
DISTRO = "spaetzle-ti"
DISTRO_NAME = "Spaetzle (TQ-Systems Spaetzle Distribution) for TI BSP"

View File

@@ -0,0 +1,5 @@
require conf/distro/include/spaetzle.inc
require conf/distro/include/tq-provider-mainline.inc
DISTRO = "spaetzle"
DISTRO_NAME = "Spaetzle (TQ-Systems Spaetzle Distribution)"

View File

@@ -0,0 +1,35 @@
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "dumpling"
BBFILE_PATTERN_dumpling = "^${LAYERDIR}/"
BBFILE_PRIORITY_dumpling = "7"
LAYERDEPENDS_dumpling = "core openembedded-layer tq-layer"
LAYERSERIES_COMPAT_dumpling = "scarthgap"
BBFILES_DYNAMIC += "\
chromium-browser-layer:${LAYERDIR}/dynamic-layers/chromium-browser-layer/recipes-*/*/*.bbappend \
chromium-browser-layer:${LAYERDIR}/dynamic-layers/chromium-browser-layer/recipes-*/*/*.bb \
freescale-layer:${LAYERDIR}/dynamic-layers/freescale-layer/recipes-*/*/*.bbappend \
freescale-layer:${LAYERDIR}/dynamic-layers/freescale-layer/recipes-*/*/*.bb \
qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/recipes-*/*/*.bbappend \
qt6-layer:${LAYERDIR}/dynamic-layers/qt6-layer/recipes-*/*/*.bb \
rauc:${LAYERDIR}/dynamic-layers/rauc/recipes-*/*/*.bbappend \
rauc:${LAYERDIR}/dynamic-layers/rauc/recipes-*/*/*.bb \
"
# keep LAYERRECOMMENDS in sync with dynamic layers
# to prevent parsing errors from layer index
LAYERRECOMMENDS_tq-layer = "\
chromium-browser-layer \
freescale-layer \
qt6-layer \
rauc \
"
DUMPLING_LAYERDIR := "${LAYERDIR}"

View File

@@ -0,0 +1,34 @@
From dc5f1312aec01a20f14c822f8db351e98274941a Mon Sep 17 00:00:00 2001
From: Wujian Sun <wujian.sun_1@nxp.com>
Date: Wed, 1 Nov 2023 18:19:23 +0800
Subject: [PATCH 1/4] Fixed chromium flicker with g2d-renderer
chromium V89 reland linux_explicit_synchronization_protocol for
in-fence feature caused the flicker.
The rootcasue is that weston can not acquire fence fd.
A workaround no checking supports_acquire_fence supported.
Upstream-Status: Inappropriate [i.MX specific]
Signed-off-by: Wujian Sun <wujian.sun_1@nxp.com>
---
ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.cc b/ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.cc
index acb4a60ba0..e93533ceca 100644
--- a/ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.cc
+++ b/ui/ozone/platform/wayland/gpu/gbm_surfaceless_wayland.cc
@@ -208,8 +208,7 @@ void GbmSurfacelessWayland::Present(SwapCompletionCallback completion_callback,
unsubmitted_frames_.back()->configs.reserve(frame->configs.size());
// If Wayland server supports linux_explicit_synchronization_protocol, fences
// should be shipped with buffers. Otherwise, we will wait for fences.
- if (buffer_manager_->supports_acquire_fence() || !use_egl_fence_sync_ ||
- !frame->schedule_planes_succeeded) {
+ if (!use_egl_fence_sync_ || !frame->schedule_planes_succeeded) {
frame->ready = true;
MaybeSubmitFrames();
return;
--
2.25.1

View File

@@ -0,0 +1,77 @@
From 352d0c30aac32339a7139d321a3d95a8f342e17f Mon Sep 17 00:00:00 2001
From: Darren Etheridge <a0867391@uda0393673-1.dhcp.ti.com>
Date: Mon, 20 May 2024 15:48:36 -0500
Subject: [PATCH] chromium: gpu: sandbox: allow access to PowerVR GPU from
sandbox
Upstream-Status: Pending [not strictly necessary, but reduces
permissions warnings on console]
Chromium runs in a sandbox to limit access to the system, however
the PowerVR drivers for the Imagination GPU used on TI hardware need
some extra libraries along with the DRM device nodes to be opened up.
This patch opens up the necessary pieces.
Signed-off-by: Darren Etheridge <detheridge@ti.com>
---
content/common/gpu_pre_sandbox_hook_linux.cc | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/content/common/gpu_pre_sandbox_hook_linux.cc b/content/common/gpu_pre_sandbox_hook_linux.cc
index f5df3c667d..ad7b26aec7 100644
--- a/content/common/gpu_pre_sandbox_hook_linux.cc
+++ b/content/common/gpu_pre_sandbox_hook_linux.cc
@@ -67,6 +67,11 @@ inline bool UseChromecastSandboxAllowlist() {
#endif
}
+inline bool IsGPUIMGRogue() {
+ return true;
+}
+
+
inline bool IsArchitectureArm() {
#if defined(ARCH_CPU_ARM_FAMILY)
return true;
@@ -495,6 +500,11 @@ std::vector<BrokerFilePermission> FilePermissionsForGpu(
AddVulkanICDPermissions(&permissions);
+ if (IsGPUIMGRogue()) {
+ // Add standard DRM permissions for snapdragon/PowerVR:
+ AddDrmGpuPermissions(&permissions);
+ }
+
if (IsChromeOS()) {
// Permissions are additive, there can be multiple GPUs in the system.
AddStandardChromeOsPermissions(&permissions);
@@ -573,6 +583,8 @@ void LoadArmGpuLibraries() {
DRI_DRIVER_DIR "/mediatek_dri.so",
DRI_DRIVER_DIR "/rockchip_dri.so",
DRI_DRIVER_DIR "/asahi_dri.so",
+ DRI_DRIVER_DIR "/pvr_dri.so",
+ DRI_DRIVER_DIR "/tidss_dri.so",
#else
"/usr/lib64/dri/msm_dri.so",
"/usr/lib64/dri/panfrost_dri.so",
@@ -580,6 +592,8 @@ void LoadArmGpuLibraries() {
"/usr/lib64/dri/rockchip_dri.so",
"/usr/lib64/dri/asahi_dri.so",
"/usr/lib/dri/msm_dri.so",
+ "/usr/lib/dri/tidss_dri.so",
+ "/usr/lib/dri/pvr_dri.so",
"/usr/lib/dri/panfrost_dri.so",
"/usr/lib/dri/mediatek_dri.so",
"/usr/lib/dri/rockchip_dri.so",
@@ -677,7 +691,7 @@ sandbox::syscall_broker::BrokerCommandSet CommandSetForGPU(
command_set.set(sandbox::syscall_broker::COMMAND_ACCESS);
command_set.set(sandbox::syscall_broker::COMMAND_OPEN);
command_set.set(sandbox::syscall_broker::COMMAND_STAT);
- if (IsChromeOS() &&
+ if ((IsGPUIMGRogue() || IsChromeOS()) &&
(options.use_amd_specific_policies ||
options.use_intel_specific_policies ||
options.use_nvidia_specific_policies ||
--
2.45.2

View File

@@ -0,0 +1,34 @@
From a328a5a561ffd405c6f81d7cab377811b02fdb84 Mon Sep 17 00:00:00 2001
From: Wujian Sun <wujian.sun_1@nxp.com>
Date: Wed, 10 Nov 2021 17:28:22 +0800
Subject: [PATCH 2/4] chromium met EGL API GetProcAddress failures
Wayland not use SwANGLE as below commit, so no need
build SwANGLE on wayland platform.
commit 97f919dd8b544b583b772664f0d7b8e6b6d8da2e
Reland "Use SwANGLE on all Ozone platforms, except Wayland"
Upstream-Status: Inappropriate [i.MX-specific]
Signed-off-by: Wujian Sun <wujian.sun_1@nxp.com>
---
ui/gl/BUILD.gn | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn
index 5b68e7d051..8ba11ca00a 100644
--- a/ui/gl/BUILD.gn
+++ b/ui/gl/BUILD.gn
@@ -240,7 +240,7 @@ component("gl") {
}
if (use_ozone) {
- if (use_egl && !is_fuchsia) {
+ if (use_egl && !is_fuchsia && !ozone_platform_wayland) {
data_deps += [
"//third_party/angle:libEGL",
"//third_party/angle:libGLESv2",
--
2.25.1

View File

@@ -0,0 +1,54 @@
From 99b7f0b617e0169c90e7f98246ac92ab00afd262 Mon Sep 17 00:00:00 2001
From: Wujian Sun <wujian.sun_1@nxp.com>
Date: Mon, 23 Oct 2023 15:21:53 +0800
Subject: [PATCH 3/4] Disable dri for imx gpu
Upstream-Status: Inappropriate [i.MX-specific]
Signed-off-by: Wujian Sun <wujian.sun_1@nxp.com>
---
content/gpu/BUILD.gn | 7 ++++++-
media/gpu/sandbox/BUILD.gn | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn
index 098082510e..9befdb8c01 100644
--- a/content/gpu/BUILD.gn
+++ b/content/gpu/BUILD.gn
@@ -8,6 +8,11 @@ import("//build/config/ui.gni")
import("//gpu/vulkan/features.gni")
import("//media/media_options.gni")
+declare_args() {
+ # Checks if i.MX GPU is being used
+ use_imxgpu = false
+}
+
# See //content/BUILD.gn for how this works.
group("gpu") {
visibility = [ "//content/*" ] # This is an internal content API.
@@ -128,7 +133,7 @@ target(link_target_type, "gpu_sources") {
# Use DRI on desktop Linux builds.
if (current_cpu != "s390x" && current_cpu != "ppc64" && is_linux &&
- !is_castos) {
+ !is_castos && !use_imxgpu) {
configs += [ "//build/config/linux/dri" ]
}
}
diff --git a/media/gpu/sandbox/BUILD.gn b/media/gpu/sandbox/BUILD.gn
index cfcb7fa80e..de7e70c3bf 100644
--- a/media/gpu/sandbox/BUILD.gn
+++ b/media/gpu/sandbox/BUILD.gn
@@ -31,7 +31,7 @@ source_set("sandbox") {
deps += [ "//media/gpu/v4l2" ]
}
if (current_cpu != "s390x" && current_cpu != "ppc64" && is_linux &&
- !is_castos) {
+ !is_castos && !true) {
# For DRI_DRIVER_DIR.
configs += [ "//build/config/linux/dri" ]
}
--
2.25.1

View File

@@ -0,0 +1,46 @@
From a8f5c1646362c0fb3e60d711cd5edf07c9ef0fa7 Mon Sep 17 00:00:00 2001
From: Wujian Sun <wujian.sun_1@nxp.com>
Date: Wed, 18 Oct 2023 15:56:59 +0800
Subject: [PATCH 4/4] Fix chromium build failure
| aarch64-poky-linux-ld.lld: error: undefined symbol:
gl::NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(gl::GLDisplayEGL*,
void*, std::__1::unique_ptr<gfx::VSyncProvider,
std::__1::default_deletegfx::VSyncProvider >)
| >>> referenced by gl_surface_wayland.cc:35
(./../../ui/ozone/platform/wayland/gpu/gl_surface_wayland.cc:35)
| >>>
thinlto-cache/Thin-7f2605.tmp.o:(ui::GLSurfaceWayland::GLSurfaceWayland(gl::GLDisplayEGL*,
std::__1::unique_ptr<wl_egl_window, ui::EGLWindowDeleter>,
ui::WaylandWindow*))
Upstream-Status: Inappropriate [i.MX-specific]
Signed-off-by: Wujian Sun <wujian.sun_1@nxp.com>
---
ui/gl/BUILD.gn | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn
index 8ba11ca00a..0d511776ba 100644
--- a/ui/gl/BUILD.gn
+++ b/ui/gl/BUILD.gn
@@ -249,6 +249,15 @@ component("gl") {
data_deps += [ "//third_party/vulkan-deps/vulkan-loader/src:libvulkan" ]
}
}
+ if(ozone_platform_wayland) {
+ defines += [ "WAYLAND_GBM" ]
+
+ deps += [
+ "//third_party/minigbm",
+ "//ui/gfx:memory_buffer",
+ "//ui/gfx/linux:gbm",
+ ]
+ }
}
if (ozone_platform_x11) {
--
2.25.1

View File

@@ -0,0 +1,82 @@
From a2489f733bb842ee6aa222a97b108e18521e5ee1 Mon Sep 17 00:00:00 2001
From: Wujian Sun <wujian.sun_1@nxp.com>
Date: Wed, 22 Nov 2023 16:52:59 +0800
Subject: [PATCH 6/6] Fixed chromium crash after upgrading
Native display fail to get GBM platform,
add EGL_PLATFORM_GBM_KHR for WAYLAND_GBM.
Upstream-Status: Inappropriate [i.MX-specific]
Signed-off-by: Xianzhong Li <xianzhong.li@nxp.com
Signed-off-by: Wujian Sun <wujian.sun_1@nxp.com>
---
ui/gfx/linux/gbm_device.h | 2 ++
ui/gfx/linux/gbm_wrapper.cc | 2 ++
.../platform/wayland/gpu/wayland_buffer_manager_gpu.cc | 2 --
.../platform/wayland/gpu/wayland_surface_factory.cc | 10 ++++++++++
4 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/ui/gfx/linux/gbm_device.h b/ui/gfx/linux/gbm_device.h
index 8fd34e8c7d..fa5e6a5854 100644
--- a/ui/gfx/linux/gbm_device.h
+++ b/ui/gfx/linux/gbm_device.h
@@ -34,6 +34,8 @@ class GbmDevice {
gfx::NativePixmapHandle handle) = 0;
virtual bool CanCreateBufferForFormat(uint32_t format) = 0;
+
+ virtual gbm_device* get() = 0;
};
} // namespace ui
diff --git a/ui/gfx/linux/gbm_wrapper.cc b/ui/gfx/linux/gbm_wrapper.cc
index 8d60e2c720..499ad5d9ec 100644
--- a/ui/gfx/linux/gbm_wrapper.cc
+++ b/ui/gfx/linux/gbm_wrapper.cc
@@ -462,6 +462,8 @@ class Device final : public ui::GbmDevice {
}
#endif
+ gbm_device* get() override {return device_.get();};
+
private:
std::vector<uint64_t> GetFilteredModifiers(
uint32_t format,
diff --git a/ui/ozone/platform/wayland/gpu/wayland_buffer_manager_gpu.cc b/ui/ozone/platform/wayland/gpu/wayland_buffer_manager_gpu.cc
index 4e725c5814..0258548fd8 100644
--- a/ui/ozone/platform/wayland/gpu/wayland_buffer_manager_gpu.cc
+++ b/ui/ozone/platform/wayland/gpu/wayland_buffer_manager_gpu.cc
@@ -363,8 +363,6 @@ GbmDevice* WaylandBufferManagerGpu::GetGbmDevice() {
if (!supports_dmabuf_ || (!gl::GLSurfaceEGL::GetGLDisplayEGL()
->ext->b_EGL_EXT_image_dma_buf_import &&
!use_fake_gbm_device_for_test_)) {
- supports_dmabuf_ = false;
- return nullptr;
}
if (gbm_device_ || use_fake_gbm_device_for_test_)
diff --git a/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc b/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc
index b6e99324c0..410c2e9288 100644
--- a/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc
+++ b/ui/ozone/platform/wayland/gpu/wayland_surface_factory.cc
@@ -171,6 +171,16 @@ scoped_refptr<gl::GLSurface> GLOzoneEGLWayland::CreateOffscreenGLSurface(
}
gl::EGLDisplayPlatform GLOzoneEGLWayland::GetNativeDisplay() {
+#if defined(WAYLAND_GBM)
+ GbmDevice* const device = buffer_manager_->GetGbmDevice();
+ if (device != nullptr) {
+ gbm_device* gbm = device->get();
+ if (gbm) {
+ return gl::EGLDisplayPlatform(
+ reinterpret_cast<EGLNativeDisplayType>(gbm), EGL_PLATFORM_GBM_KHR);
+ }
+ }
+#endif
if (connection_) {
return gl::EGLDisplayPlatform(
reinterpret_cast<EGLNativeDisplayType>(connection_->display()));
--
2.25.1

View File

@@ -0,0 +1,35 @@
From 88167a0bb3665834cdcdacee2b5c8afdb8555db9 Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Wed, 17 Aug 2022 16:57:11 +0800
Subject: [PATCH 101/120] V4L2VDA: Switch to use VDA instead of direct
VideoDecoder
commit b7f3a9e8058f593d7d88b6b6cafa71957aa3f1a1 aims to default
enable "direct VideoDecoder" support on Linux. So need to switch
to use VDA path iff:
1. kVaapiVideoDecodeLinux is enabled (disabled by default);
2. kUseChromeOSDirectVideoDecoder is disabled (enabled by default);
3. GL is used;
Upstream-Status: Inappropriate [NXP specific]
---
media/base/media_switches.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
index 58025f50ce..77011a3e84 100644
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -1252,7 +1252,7 @@ BASE_FEATURE(kChromeOSHWVBREncoding,
// TODO(b/159825227): remove when the direct video decoder is fully launched.
BASE_FEATURE(kUseChromeOSDirectVideoDecoder,
"UseChromeOSDirectVideoDecoder",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ base::FEATURE_DISABLED_BY_DEFAULT);
#endif // !BUILDFLAG(USE_VAAPI)
// Limit the number of concurrent hardware decoder instances on ChromeOS.
--
2.25.1

View File

@@ -0,0 +1,31 @@
From e609e5db0a02dff77475beddc9e616818ed0f892 Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Wed, 1 Nov 2023 18:55:31 +0900
Subject: [PATCH 102/120] GenericV4L2Device: Correct v4l2 decoder device path
Change decoder device pattern to /dev/video, and select one
correct device path /dev/videox where x is an integer.
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/v4l2/v4l2_device.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/media/gpu/v4l2/v4l2_device.cc b/media/gpu/v4l2/v4l2_device.cc
index e9fc02a472..326a39273a 100644
--- a/media/gpu/v4l2/v4l2_device.cc
+++ b/media/gpu/v4l2/v4l2_device.cc
@@ -849,8 +849,8 @@ void V4L2Device::CloseDevice() {
}
void V4L2Device::EnumerateDevicesForType(Type type) {
- static const std::string kDecoderDevicePattern = "/dev/video-dec";
- static const std::string kEncoderDevicePattern = "/dev/video-enc";
+ static const std::string kDecoderDevicePattern = "/dev/video";
+ static const std::string kEncoderDevicePattern = "/dev/video";
static const std::string kImageProcessorDevicePattern = "/dev/image-proc";
static const std::string kJpegDecoderDevicePattern = "/dev/jpeg-dec";
static const std::string kJpegEncoderDevicePattern = "/dev/jpeg-enc";
--
2.25.1

View File

@@ -0,0 +1,233 @@
From 41142ef256f7f58adf944ab4e910586bcce5dcaf Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Fri, 2 Sep 2022 13:18:34 +0800
Subject: [PATCH 103/120] V4L2VDA: Add macro use_linux_v4l2
Upstream-Status: Inappropriate [NXP specific]
---
.../gpu_mjpeg_decode_accelerator_factory.cc | 3 +-
media/gpu/BUILD.gn | 1 +
media/gpu/args.gni | 4 +++
.../gpu_video_decode_accelerator_factory.h | 2 ++
media/gpu/v4l2/BUILD.gn | 19 +++++++++----
media/gpu/v4l2/v4l2_utils.cc | 28 +++++++++++++++++++
media/gpu/v4l2/v4l2_video_decoder.cc | 8 ++++++
7 files changed, 58 insertions(+), 7 deletions(-)
diff --git a/components/chromeos_camera/gpu_mjpeg_decode_accelerator_factory.cc b/components/chromeos_camera/gpu_mjpeg_decode_accelerator_factory.cc
index 8e8ad4a848..156b6bd256 100644
--- a/components/chromeos_camera/gpu_mjpeg_decode_accelerator_factory.cc
+++ b/components/chromeos_camera/gpu_mjpeg_decode_accelerator_factory.cc
@@ -14,7 +14,8 @@
#include "media/base/media_switches.h"
#include "media/gpu/buildflags.h"
-#if BUILDFLAG(USE_V4L2_CODEC) && defined(ARCH_CPU_ARM_FAMILY)
+#if BUILDFLAG(USE_V4L2_CODEC) && defined(ARCH_CPU_ARM_FAMILY) && \
+ !BUILDFLAG(USE_LINUX_V4L2)
#define USE_V4L2_MJPEG_DECODE_ACCELERATOR
#endif
diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn
index 0bb5edad02..a55fbd2325 100644
--- a/media/gpu/BUILD.gn
+++ b/media/gpu/BUILD.gn
@@ -22,6 +22,7 @@ buildflag_header("buildflags") {
"USE_VAAPI_IMAGE_CODECS=$use_vaapi_image_codecs",
"USE_V4L2_CODEC=$use_v4l2_codec",
"USE_LIBV4L2=$use_v4lplugin",
+ "USE_LINUX_V4L2=$use_linux_v4l2_only",
]
}
diff --git a/media/gpu/args.gni b/media/gpu/args.gni
index 37751112e3..49939b896e 100644
--- a/media/gpu/args.gni
+++ b/media/gpu/args.gni
@@ -14,6 +14,10 @@ declare_args() {
use_v4l2_codec =
is_chromeos_lacros && (target_cpu == "arm" || target_cpu == "arm64")
+ # Indicates that only definitions available in the mainline linux kernel
+ # will be used.
+ use_linux_v4l2_only = false
+
# Indicates if VA-API-based hardware acceleration is to be used. This
# is typically the case on x86-based ChromeOS devices.
# VA-API should also be compiled by default on x11/wayland linux devices
diff --git a/media/gpu/gpu_video_decode_accelerator_factory.h b/media/gpu/gpu_video_decode_accelerator_factory.h
index 27ed3a8c90..27c06e2506 100644
--- a/media/gpu/gpu_video_decode_accelerator_factory.h
+++ b/media/gpu/gpu_video_decode_accelerator_factory.h
@@ -94,11 +94,13 @@ class MEDIA_GPU_EXPORT GpuVideoDecodeAcceleratorFactory {
const gpu::GpuDriverBugWorkarounds& workarounds,
const gpu::GpuPreferences& gpu_preferences,
MediaLog* media_log) const;
+#if !BUILDFLAG(USE_LINUX_V4L2)
std::unique_ptr<VideoDecodeAccelerator> CreateV4L2SliceVDA(
const gpu::GpuDriverBugWorkarounds& workarounds,
const gpu::GpuPreferences& gpu_preferences,
MediaLog* media_log) const;
#endif
+#endif
#if BUILDFLAG(IS_APPLE)
std::unique_ptr<VideoDecodeAccelerator> CreateVTVDA(
const gpu::GpuDriverBugWorkarounds& workarounds,
diff --git a/media/gpu/v4l2/BUILD.gn b/media/gpu/v4l2/BUILD.gn
index cf469a68cd..a790c4910a 100644
--- a/media/gpu/v4l2/BUILD.gn
+++ b/media/gpu/v4l2/BUILD.gn
@@ -34,9 +34,6 @@ source_set("v4l2") {
"stateless/vp8_delegate.h",
"stateless/vp9_delegate.cc",
"stateless/vp9_delegate.h",
- "v4l2_decode_surface.cc",
- "v4l2_decode_surface.h",
- "v4l2_decode_surface_handler.h",
"v4l2_device.cc",
"v4l2_device.h",
"v4l2_device_poller.cc",
@@ -59,6 +56,17 @@ source_set("v4l2") {
"v4l2_video_decoder_backend.h",
"v4l2_video_decoder_backend_stateful.cc",
"v4l2_video_decoder_backend_stateful.h",
+ "v4l2_video_encode_accelerator.cc",
+ "v4l2_video_encode_accelerator.h",
+ "v4l2_vp9_helpers.cc",
+ "v4l2_vp9_helpers.h",
+ ]
+
+ if (!use_linux_v4l2_only) {
+ sources += [
+ "v4l2_decode_surface.cc",
+ "v4l2_decode_surface.h",
+ "v4l2_decode_surface_handler.h",
"v4l2_video_decoder_backend_stateless.cc",
"v4l2_video_decoder_backend_stateless.h",
"v4l2_video_decoder_delegate_h264.cc",
@@ -67,9 +75,8 @@ source_set("v4l2") {
"v4l2_video_decoder_delegate_vp8.h",
"v4l2_video_decoder_delegate_vp9.cc",
"v4l2_video_decoder_delegate_vp9.h",
- "v4l2_vp9_helpers.cc",
- "v4l2_vp9_helpers.h",
- ]
+ ]
+ }
if (enable_hevc_parser_and_hw_decoder) {
sources += [
diff --git a/media/gpu/v4l2/v4l2_utils.cc b/media/gpu/v4l2/v4l2_utils.cc
index f0dfacdf62..afea7a870a 100644
--- a/media/gpu/v4l2/v4l2_utils.cc
+++ b/media/gpu/v4l2/v4l2_utils.cc
@@ -315,15 +315,23 @@ using v4l2_enum_type = decltype(V4L2_PIX_FMT_H264);
static const std::map<v4l2_enum_type, v4l2_enum_type>
kV4L2CodecPixFmtToProfileCID = {
{V4L2_PIX_FMT_H264, V4L2_CID_MPEG_VIDEO_H264_PROFILE},
+#if !BUILDFLAG(USE_LINUX_V4L2)
{V4L2_PIX_FMT_H264_SLICE, V4L2_CID_MPEG_VIDEO_H264_PROFILE},
+#endif
#if BUILDFLAG(ENABLE_HEVC_PARSER_AND_HW_DECODER)
{V4L2_PIX_FMT_HEVC, V4L2_CID_MPEG_VIDEO_HEVC_PROFILE},
+#if !BUILDFLAG(USE_LINUX_V4L2)
{V4L2_PIX_FMT_HEVC_SLICE, V4L2_CID_MPEG_VIDEO_HEVC_PROFILE},
+#endif
#endif // BUILDFLAG(ENABLE_HEVC_PARSER_AND_HW_DECODER)
{V4L2_PIX_FMT_VP8, V4L2_CID_MPEG_VIDEO_VP8_PROFILE},
+#if !BUILDFLAG(USE_LINUX_V4L2)
{V4L2_PIX_FMT_VP8_FRAME, V4L2_CID_MPEG_VIDEO_VP8_PROFILE},
+#endif
{V4L2_PIX_FMT_VP9, V4L2_CID_MPEG_VIDEO_VP9_PROFILE},
+#if !BUILDFLAG(USE_LINUX_V4L2)
{V4L2_PIX_FMT_VP9_FRAME, V4L2_CID_MPEG_VIDEO_VP9_PROFILE},
+#endif
#if BUILDFLAG(IS_CHROMEOS)
{V4L2_PIX_FMT_AV1, V4L2_CID_MPEG_VIDEO_AV1_PROFILE},
{V4L2_PIX_FMT_AV1_FRAME, V4L2_CID_MPEG_VIDEO_AV1_PROFILE},
@@ -478,7 +486,27 @@ uint32_t VideoCodecProfileToV4L2PixFmt(VideoCodecProfile profile,
<< "Unsupported profile: " << GetProfileName(profile);
const auto& v4l2_pix_fmt = kVideoCodecProfileToV4L2CodecPixFmt.at(profile);
+#if BUILDFLAG(USE_LINUX_V4L2)
+ if (slice_based) {
+ LOG(ERROR) << "Unsupported slice";
+ return 0;
+ }
+
+ if (profile >= H264PROFILE_MIN && profile <= H264PROFILE_MAX) {
+ return V4L2_PIX_FMT_H264;
+ } else if (profile >= VP8PROFILE_MIN && profile <= VP8PROFILE_MAX) {
+ return V4L2_PIX_FMT_VP8;
+ } else if (profile >= VP9PROFILE_MIN && profile <= VP9PROFILE_MAX) {
+ return V4L2_PIX_FMT_VP9;
+ } else if (profile == HEVCPROFILE_MAIN) {
+ return V4L2_PIX_FMT_HEVC;
+ } else {
+ DVLOGF(1) << "Unsupported profile: " << GetProfileName(profile);
+ return 0;
+ }
+#else
return slice_based ? v4l2_pix_fmt.first : v4l2_pix_fmt.second;
+#endif
}
base::TimeDelta TimeValToTimeDelta(const struct timeval& timeval) {
diff --git a/media/gpu/v4l2/v4l2_video_decoder.cc b/media/gpu/v4l2/v4l2_video_decoder.cc
index 1ba50a5aa6..c6c5d4cb6c 100644
--- a/media/gpu/v4l2/v4l2_video_decoder.cc
+++ b/media/gpu/v4l2/v4l2_video_decoder.cc
@@ -32,7 +32,9 @@
#include "media/gpu/v4l2/v4l2_status.h"
#include "media/gpu/v4l2/v4l2_utils.h"
#include "media/gpu/v4l2/v4l2_video_decoder_backend_stateful.h"
+#if !BUILDFLAG(USE_LINUX_V4L2)
#include "media/gpu/v4l2/v4l2_video_decoder_backend_stateless.h"
+#endif
#include "mojo/public/cpp/bindings/callback_helpers.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -68,6 +70,7 @@ constexpr size_t kInputBufferMaxSizeFor4k = 2 * kInputBufferMaxSizeFor1080p;
// Input format V4L2 fourccs this class supports.
const std::vector<uint32_t> kSupportedInputFourccs = {
// V4L2 stateless formats
+#if !BUILDFLAG(USE_LINUX_V4L2)
V4L2_PIX_FMT_H264_SLICE,
#if BUILDFLAG(ENABLE_HEVC_PARSER_AND_HW_DECODER)
V4L2_PIX_FMT_HEVC_SLICE,
@@ -76,13 +79,16 @@ const std::vector<uint32_t> kSupportedInputFourccs = {
V4L2_PIX_FMT_VP9_FRAME,
V4L2_PIX_FMT_AV1_FRAME,
// V4L2 stateful formats
+#endif
V4L2_PIX_FMT_H264,
#if BUILDFLAG(ENABLE_HEVC_PARSER_AND_HW_DECODER)
V4L2_PIX_FMT_HEVC,
#endif // BUILDFLAG(ENABLE_HEVC_PARSER_AND_HW_DECODER)
V4L2_PIX_FMT_VP8,
V4L2_PIX_FMT_VP9,
+#if !BUILDFLAG(USE_LINUX_V4L2)
V4L2_PIX_FMT_AV1,
+#endif
};
// These values are logged to UMA. Entries should not be renumbered and numeric
@@ -471,6 +477,7 @@ V4L2Status V4L2VideoDecoder::InitializeBackend() {
<< " and fourcc: " << FourccToString(input_format_fourcc_);
backend_ = std::make_unique<V4L2StatefulVideoDecoderBackend>(
this, device_, profile_, color_space_, decoder_task_runner_);
+#if !BUILDFLAG(USE_LINUX_V4L2)
} else {
DCHECK_EQ(preferred_api_and_format.first, kStateless);
VLOGF(1) << "Using a stateless API for profile: "
@@ -479,6 +486,7 @@ V4L2Status V4L2VideoDecoder::InitializeBackend() {
backend_ = std::make_unique<V4L2StatelessVideoDecoderBackend>(
this, device_, profile_, color_space_, decoder_task_runner_,
cdm_context_ref_ ? cdm_context_ref_->GetCdmContext() : nullptr);
+#endif
}
if (!backend_->Initialize()) {
--
2.25.1

View File

@@ -0,0 +1,148 @@
From ea21db0b46091c76a2e389874617c64b69c768ce Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Wed, 1 Nov 2023 23:20:47 +0900
Subject: [PATCH 104/120] V4L2VDA: Create single/multi plane queues
Decide to create single-plane queue or multi-plane queue according to
the capabilities returned by VIDIOC_QUERYCAP.
Upstream-Status: Inappropriate [NXP specific]
---
.../legacy/v4l2_video_decode_accelerator.cc | 28 +++++++++++++-----
media/gpu/v4l2/v4l2_device.cc | 29 ++++++++++++++-----
2 files changed, 42 insertions(+), 15 deletions(-)
diff --git a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
index 0269d7ca74..ad73ac674e 100644
--- a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
+++ b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
@@ -324,21 +324,35 @@ bool V4L2VideoDecodeAccelerator::CheckConfig(const Config& config) {
// Capabilities check.
struct v4l2_capability caps;
- const __u32 kCapsRequired = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_STREAMING;
- IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_QUERYCAP, &caps);
- if ((caps.capabilities & kCapsRequired) != kCapsRequired) {
- VLOGF(1) << "ioctl() failed: VIDIOC_QUERYCAP"
- << ", caps check failed: 0x" << std::hex << caps.capabilities;
+ unsigned int device_caps;
+ enum v4l2_buf_type input_type, output_type;
+ if (device_->Ioctl(VIDIOC_QUERYCAP, &caps) != 0) {
+ VPLOGF(1) << "ioctl() failed: VIDIOC_QUERYCAP"
+ << ", caps check failed: 0x" << std::hex << caps.capabilities;
return false;
}
+ if (caps.capabilities & V4L2_CAP_DEVICE_CAPS)
+ device_caps = caps.device_caps;
+ else
+ device_caps = caps.capabilities;
+
+ if (device_caps & (V4L2_CAP_VIDEO_OUTPUT_MPLANE | V4L2_CAP_VIDEO_M2M_MPLANE))
+ input_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ else
+ input_type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+ if (device_caps & (V4L2_CAP_VIDEO_CAPTURE_MPLANE | V4L2_CAP_VIDEO_M2M_MPLANE))
+ output_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ else
+ output_type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+
output_mode_ = config.output_mode;
- input_queue_ = device_->GetQueue(V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
+ input_queue_ = device_->GetQueue(input_type);
if (!input_queue_)
return false;
- output_queue_ = device_->GetQueue(V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
+ output_queue_ = device_->GetQueue(output_type);
if (!output_queue_)
return false;
diff --git a/media/gpu/v4l2/v4l2_device.cc b/media/gpu/v4l2/v4l2_device.cc
index 326a39273a..daea76c9b6 100644
--- a/media/gpu/v4l2/v4l2_device.cc
+++ b/media/gpu/v4l2/v4l2_device.cc
@@ -93,6 +93,8 @@ scoped_refptr<V4L2Queue> V4L2Device::GetQueue(enum v4l2_buf_type type) {
// Supported queue types.
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
+ case V4L2_BUF_TYPE_VIDEO_OUTPUT:
+ case V4L2_BUF_TYPE_VIDEO_CAPTURE:
break;
default:
VLOGF(1) << "Unsupported V4L2 queue type: " << type;
@@ -539,9 +541,17 @@ V4L2Device::EnumerateSupportedDecodeProfiles(
const std::vector<uint32_t>& pixelformats) {
VideoDecodeAccelerator::SupportedProfiles profiles;
- const auto v4l2_codecs_as_pix_fmts =
+ std::vector<uint32_t> enumerated_pixelformats;
+ enumerated_pixelformats =
EnumerateSupportedPixFmts(base::BindRepeating(&V4L2Device::Ioctl, this),
- V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
+ V4L2_BUF_TYPE_VIDEO_OUTPUT);
+ if (enumerated_pixelformats.empty()) {
+ VLOG(1) << "empty.... Try Multi-plane";
+ enumerated_pixelformats =
+ EnumerateSupportedPixFmts(base::BindRepeating(&V4L2Device::Ioctl, this),
+ V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
+ }
+ const auto v4l2_codecs_as_pix_fmts = enumerated_pixelformats;
for (uint32_t pixelformat : v4l2_codecs_as_pix_fmts) {
if (!base::Contains(pixelformats, pixelformat)) {
@@ -856,27 +866,28 @@ void V4L2Device::EnumerateDevicesForType(Type type) {
static const std::string kJpegEncoderDevicePattern = "/dev/jpeg-enc";
std::string device_pattern;
- v4l2_buf_type buf_type;
+ std::vector<v4l2_buf_type> candidate_buf_types;
switch (type) {
case Type::kDecoder:
device_pattern = kDecoderDevicePattern;
- buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ candidate_buf_types.push_back(V4L2_BUF_TYPE_VIDEO_OUTPUT);
+ candidate_buf_types.push_back(V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
break;
case Type::kEncoder:
device_pattern = kEncoderDevicePattern;
- buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ candidate_buf_types.push_back(V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
break;
case Type::kImageProcessor:
device_pattern = kImageProcessorDevicePattern;
- buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ candidate_buf_types.push_back(V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
break;
case Type::kJpegDecoder:
device_pattern = kJpegDecoderDevicePattern;
- buf_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ candidate_buf_types.push_back(V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);
break;
case Type::kJpegEncoder:
device_pattern = kJpegEncoderDevicePattern;
- buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ candidate_buf_types.push_back(V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE);
break;
}
@@ -896,6 +907,7 @@ void V4L2Device::EnumerateDevicesForType(Type type) {
Devices devices;
for (const auto& path : candidate_paths) {
+ for (const auto& buf_type : candidate_buf_types){
if (!OpenDevicePath(path)) {
continue;
}
@@ -909,6 +921,7 @@ void V4L2Device::EnumerateDevicesForType(Type type) {
CloseDevice();
}
+ }
DCHECK_EQ(devices_by_type_.count(type), 0u);
devices_by_type_[type] = devices;
--
2.25.1

View File

@@ -0,0 +1,97 @@
From d004057743fcb63fa6b0e28ad2c3dfd945c7c7d2 Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Wed, 1 Nov 2023 23:27:25 +0900
Subject: [PATCH 105/120] V4L2Buffer: Allocate correct v4l2 buffers for queues
For single plane queue, need to fill v4l2_planes_[0] with
correct size quried from v4l2 driver.
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/v4l2/v4l2_queue.cc | 39 +++++++++++++++++++++++++-----------
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/media/gpu/v4l2/v4l2_queue.cc b/media/gpu/v4l2/v4l2_queue.cc
index 2e93c0bd8b..cae8d72a1d 100644
--- a/media/gpu/v4l2/v4l2_queue.cc
+++ b/media/gpu/v4l2/v4l2_queue.cc
@@ -236,24 +236,28 @@ V4L2Buffer::V4L2Buffer(const IoctlAsCallback& ioctl_cb,
DCHECK(V4L2_TYPE_IS_MULTIPLANAR(type));
DCHECK_LE(format.fmt.pix_mp.num_planes, std::size(v4l2_planes_));
- memset(&v4l2_buffer_, 0, sizeof(v4l2_buffer_));
- memset(v4l2_planes_, 0, sizeof(v4l2_planes_));
- v4l2_buffer_.m.planes = v4l2_planes_;
- // Just in case we got more planes than we want.
- v4l2_buffer_.length =
- std::min(static_cast<size_t>(format.fmt.pix_mp.num_planes),
- std::size(v4l2_planes_));
+ if (V4L2_TYPE_IS_MULTIPLANAR(type)) {
+ memset(&v4l2_buffer_, 0, sizeof(v4l2_buffer_));
+ memset(v4l2_planes_, 0, sizeof(v4l2_planes_));
+ v4l2_buffer_.m.planes = v4l2_planes_;
+ // Just in case we got more planes than we want.
+ v4l2_buffer_.length =
+ std::min(static_cast<size_t>(format.fmt.pix_mp.num_planes),
+ std::size(v4l2_planes_));
+ }
v4l2_buffer_.index = buffer_id;
v4l2_buffer_.type = type;
v4l2_buffer_.memory = memory;
- plane_mappings_.resize(v4l2_buffer_.length);
+ plane_mappings_.resize(V4L2_TYPE_IS_MULTIPLANAR(type) ? v4l2_buffer_.length : 1);
}
V4L2Buffer::~V4L2Buffer() {
if (v4l2_buffer_.memory == V4L2_MEMORY_MMAP) {
for (size_t i = 0; i < plane_mappings_.size(); i++) {
if (plane_mappings_[i] != nullptr) {
- munmap(plane_mappings_[i], v4l2_buffer_.m.planes[i].length);
+ unsigned int length = V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type) ?
+ v4l2_buffer_.m.planes[i].length : v4l2_buffer_.length;
+ munmap(plane_mappings_[i], length);
}
}
}
@@ -267,6 +271,13 @@ bool V4L2Buffer::Query() {
return false;
}
+ if (!V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type)) {
+ v4l2_planes_[0].bytesused = v4l2_buffer_.bytesused;
+ v4l2_planes_[0].length = v4l2_buffer_.length;
+ v4l2_planes_[0].data_offset = 0;
+ memcpy (&v4l2_planes_[0].m, &v4l2_buffer_.m, sizeof (v4l2_buffer_.m));
+ }
+
DCHECK(plane_mappings_.size() == v4l2_buffer_.length);
return true;
@@ -290,9 +301,13 @@ void* V4L2Buffer::GetPlaneMapping(const size_t plane) {
return nullptr;
}
- p = mmap_cb_.Run(nullptr, v4l2_buffer_.m.planes[plane].length,
+ unsigned int length = V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type) ?
+ v4l2_buffer_.m.planes[plane].length : v4l2_planes_[plane].length;
+ unsigned int mem_offset = V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type) ?
+ v4l2_buffer_.m.planes[plane].m.mem_offset : v4l2_planes_[plane].m.mem_offset;
+ p = mmap_cb_.Run(nullptr, length,
PROT_READ | PROT_WRITE, MAP_SHARED,
- v4l2_buffer_.m.planes[plane].m.mem_offset);
+ mem_offset);
if (p == MAP_FAILED) {
VPLOGF(1) << "mmap() failed: ";
return nullptr;
@@ -1177,7 +1192,7 @@ size_t V4L2Queue::AllocateBuffers(size_t count,
VQLOGF(1) << "Cannot get format.";
return 0;
}
- planes_count_ = format->fmt.pix_mp.num_planes;
+ planes_count_ = V4L2_TYPE_IS_MULTIPLANAR(format->type) ? format->fmt.pix_mp.num_planes : 1;
DCHECK_LE(planes_count_, static_cast<size_t>(VIDEO_MAX_PLANES));
__u8 flags = incoherent ? V4L2_MEMORY_FLAG_NON_COHERENT : 0;
--
2.25.1

View File

@@ -0,0 +1,155 @@
From e284a3ab9ce5aef1c2fcc3e4feed4b4963b0340d Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Wed, 1 Nov 2023 23:41:23 +0900
Subject: [PATCH 106/120] V4L2VDA: Create videoframe according to v4l2buffer
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/v4l2/v4l2_queue.cc | 7 ++--
media/gpu/v4l2/v4l2_utils.cc | 63 ++++++++++++++++++++++++------------
2 files changed, 48 insertions(+), 22 deletions(-)
diff --git a/media/gpu/v4l2/v4l2_queue.cc b/media/gpu/v4l2/v4l2_queue.cc
index cae8d72a1d..df91ef0169 100644
--- a/media/gpu/v4l2/v4l2_queue.cc
+++ b/media/gpu/v4l2/v4l2_queue.cc
@@ -333,7 +333,7 @@ scoped_refptr<VideoFrame> V4L2Buffer::CreateVideoFrame() {
}
std::vector<base::ScopedFD> dmabuf_fds = GetDmabufsForV4L2Buffer(
- ioctl_cb_, v4l2_buffer_.index, v4l2_buffer_.length,
+ ioctl_cb_, v4l2_buffer_.index, V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type) ? v4l2_buffer_.length : 1,
static_cast<enum v4l2_buf_type>(v4l2_buffer_.type));
if (dmabuf_fds.empty()) {
VLOGF(1) << "Failed to get DMABUFs of V4L2 buffer";
@@ -360,7 +360,10 @@ scoped_refptr<VideoFrame> V4L2Buffer::CreateVideoFrame() {
dmabuf_fds.emplace_back(duped_fd);
}
- gfx::Size size(format_.fmt.pix_mp.width, format_.fmt.pix_mp.height);
+ if (V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type))
+ gfx::Size size(format_.fmt.pix_mp.width, format_.fmt.pix_mp.height);
+ else
+ gfx::Size size(format_.fmt.pix.width, format_.fmt.pix.height);
return VideoFrame::WrapExternalDmabufs(
*layout, gfx::Rect(size), size, std::move(dmabuf_fds), base::TimeDelta());
diff --git a/media/gpu/v4l2/v4l2_utils.cc b/media/gpu/v4l2/v4l2_utils.cc
index afea7a870a..7131cba379 100644
--- a/media/gpu/v4l2/v4l2_utils.cc
+++ b/media/gpu/v4l2/v4l2_utils.cc
@@ -217,13 +217,9 @@ size_t GetNumPlanesOfV4L2PixFmt(uint32_t pix_fmt) {
std::optional<VideoFrameLayout> V4L2FormatToVideoFrameLayout(
const struct v4l2_format& format) {
- if (!V4L2_TYPE_IS_MULTIPLANAR(format.type)) {
- VLOGF(1) << "v4l2_buf_type is not multiplanar: " << std::hex << "0x"
- << format.type;
- return std::nullopt;
- }
const v4l2_pix_format_mplane& pix_mp = format.fmt.pix_mp;
- const uint32_t& pix_fmt = pix_mp.pixelformat;
+ const v4l2_pix_format& pix = format.fmt.pix;
+ const uint32_t& pix_fmt = V4L2_TYPE_IS_MULTIPLANAR(format.type) ? pix_mp.pixelformat : pix.pixelformat;
const auto video_fourcc = Fourcc::FromV4L2PixFmt(pix_fmt);
if (!video_fourcc) {
VLOGF(1) << "Failed to convert pixel format to VideoPixelFormat: "
@@ -231,7 +227,7 @@ std::optional<VideoFrameLayout> V4L2FormatToVideoFrameLayout(
return std::nullopt;
}
const VideoPixelFormat video_format = video_fourcc->ToVideoPixelFormat();
- const size_t num_buffers = pix_mp.num_planes;
+ const size_t num_buffers = V4L2_TYPE_IS_MULTIPLANAR(format.type) ? format.fmt.pix_mp.num_planes : 1;
const size_t num_color_planes = VideoFrame::NumPlanes(video_format);
if (num_color_planes == 0) {
VLOGF(1) << "Unsupported video format for NumPlanes(): "
@@ -249,9 +245,17 @@ std::optional<VideoFrameLayout> V4L2FormatToVideoFrameLayout(
std::vector<ColorPlaneLayout> planes;
planes.reserve(num_color_planes);
for (size_t i = 0; i < num_buffers; ++i) {
- const v4l2_plane_pix_format& plane_format = pix_mp.plane_fmt[i];
- planes.emplace_back(static_cast<int32_t>(plane_format.bytesperline), 0u,
- plane_format.sizeimage);
+ if (V4L2_TYPE_IS_MULTIPLANAR(format.type)) {
+ if(i==0)
+ planes.emplace_back(static_cast<int32_t>(pix_mp.width), 0u,
+ pix_mp.width*pix_mp.height);
+ else
+ planes.emplace_back(static_cast<int32_t>(pix_mp.width), 0u,
+ pix_mp.width*pix_mp.height/2);
+ } else {
+ planes.emplace_back(static_cast<int32_t>(pix.bytesperline), 0u,
+ pix.sizeimage);
+ }
}
// For the case that #color planes > #buffers, it fills stride of color
// plane which does not map to buffer.
@@ -265,8 +269,12 @@ std::optional<VideoFrameLayout> V4L2FormatToVideoFrameLayout(
case V4L2_PIX_FMT_NV12:
// The stride of UV is the same as Y in NV12.
// The height is half of Y plane.
- planes.emplace_back(y_stride, y_stride_abs * pix_mp.height,
- y_stride_abs * pix_mp.height / 2);
+ if (V4L2_TYPE_IS_MULTIPLANAR(format.type))
+ planes.emplace_back(y_stride, y_stride_abs * pix_mp.height,
+ y_stride_abs * pix_mp.height / 2);
+ else
+ planes.emplace_back(y_stride, y_stride_abs * pix.height,
+ y_stride_abs * pix.height / 2);
DCHECK_EQ(2u, planes.size());
break;
case V4L2_PIX_FMT_YUV420:
@@ -274,13 +282,18 @@ std::optional<VideoFrameLayout> V4L2FormatToVideoFrameLayout(
// The spec claims that two Cx rows (including padding) is exactly as
// long as one Y row (including padding). So stride of Y must be even
// number.
- if (y_stride % 2 != 0 || pix_mp.height % 2 != 0) {
+ if (V4L2_TYPE_IS_MULTIPLANAR(format.type) && (y_stride % 2 != 0 || pix_mp.height % 2 != 0)) {
VLOGF(1) << "Plane-Y stride and height should be even; stride: "
<< y_stride << ", height: " << pix_mp.height;
return std::nullopt;
}
+ else if (!V4L2_TYPE_IS_MULTIPLANAR(format.type) && (y_stride % 2 != 0 || pix.height % 2 != 0)){
+ VLOGF(1) << "Plane-Y stride and height should be even; stride: "
+ << y_stride << ", height: " << pix.height;
+ return std::nullopt;
+ }
const int32_t half_stride = y_stride / 2;
- const size_t plane_0_area = y_stride_abs * pix_mp.height;
+ const size_t plane_0_area = y_stride_abs * (V4L2_TYPE_IS_MULTIPLANAR(format.type) ? pix_mp.height : pix.height);
const size_t plane_1_area = plane_0_area / 4;
planes.emplace_back(half_stride, plane_0_area, plane_1_area);
planes.emplace_back(half_stride, plane_0_area + plane_1_area,
@@ -299,13 +312,23 @@ std::optional<VideoFrameLayout> V4L2FormatToVideoFrameLayout(
// such devices individually, so set this as a video frame layout property.
constexpr size_t buffer_alignment = 0x1000;
if (num_buffers == 1) {
- return VideoFrameLayout::CreateWithPlanes(
- video_format, gfx::Size(pix_mp.width, pix_mp.height), std::move(planes),
- buffer_alignment);
+ if (V4L2_TYPE_IS_MULTIPLANAR(format.type))
+ return VideoFrameLayout::CreateWithPlanes(
+ video_format, gfx::Size(pix_mp.width, pix_mp.height), std::move(planes),
+ buffer_alignment);
+ else
+ return VideoFrameLayout::CreateWithPlanes(
+ video_format, gfx::Size(pix.width, pix.height), std::move(planes),
+ buffer_alignment);
} else {
- return VideoFrameLayout::CreateMultiPlanar(
- video_format, gfx::Size(pix_mp.width, pix_mp.height), std::move(planes),
- buffer_alignment);
+ if (V4L2_TYPE_IS_MULTIPLANAR(format.type))
+ return VideoFrameLayout::CreateMultiPlanar(
+ video_format, gfx::Size(pix_mp.width, pix_mp.height), std::move(planes),
+ buffer_alignment);
+ else
+ return VideoFrameLayout::CreateMultiPlanar(
+ video_format, gfx::Size(pix.width, pix.height), std::move(planes),
+ buffer_alignment);
}
}
--
2.25.1

View File

@@ -0,0 +1,184 @@
From f292a840f85cd97ef1f39dd5a929e65b252d9cdc Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Wed, 1 Nov 2023 23:47:31 +0900
Subject: [PATCH 107/120] V4L2VDA: Add function IsMultiQueue for S_FMT and
G_FMT
Function IsMultiQueue() is used to set correct fotmat type for
8M and 8Q.
Upstream-Status: Inappropriate [NXP specific]
---
.../legacy/v4l2_video_decode_accelerator.cc | 49 +++++++++++++++----
media/gpu/v4l2/v4l2_queue.cc | 36 +++++++++++---
media/gpu/v4l2/v4l2_queue.h | 1 +
3 files changed, 68 insertions(+), 18 deletions(-)
diff --git a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
index ad73ac674e..aa7253928a 100644
--- a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
+++ b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
@@ -2056,12 +2056,30 @@ bool V4L2VideoDecodeAccelerator::GetFormatInfo(struct v4l2_format* format,
}
// Make sure we are still getting the format we set on initialization.
- if (format->fmt.pix_mp.pixelformat != output_format_fourcc_->ToV4L2PixFmt()) {
+ unsigned int pixelformat = V4L2_TYPE_IS_MULTIPLANAR(format->type) ?
+ format->fmt.pix_mp.pixelformat : format->fmt.pix.pixelformat;
+ if (pixelformat != output_format_fourcc_->ToV4L2PixFmt()) {
VLOGF(1) << "Unexpected format from G_FMT on output";
return false;
}
- gfx::Size coded_size(format->fmt.pix_mp.width, format->fmt.pix_mp.height);
+ int width, height;
+ if (V4L2_TYPE_IS_MULTIPLANAR(format->type)) {
+ width = format->fmt.pix_mp.width;
+ height = format->fmt.pix_mp.height;
+ if ((format->fmt.pix_mp.width == 0) && (format->fmt.pix_mp.height == 0))
+ {
+ *again = true;
+ VLOG(1)<<"As got width=height=0 again";
+ } else {
+ VLOG(1)<<"format wxh" << format->fmt.pix_mp.width << "x" << format->fmt.pix_mp.height;
+ }
+ } else {
+ width = format->fmt.pix.width;
+ height = format->fmt.pix.height;
+ }
+
+ gfx::Size coded_size(width, height);
if (visible_size != nullptr)
*visible_size = GetVisibleSize(coded_size);
@@ -2168,7 +2186,7 @@ bool V4L2VideoDecodeAccelerator::SetupFormats() {
struct v4l2_fmtdesc fmtdesc;
memset(&fmtdesc, 0, sizeof(fmtdesc));
- fmtdesc.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ fmtdesc.type = input_queue_->IsMultiQueue() ? V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE : V4L2_BUF_TYPE_VIDEO_OUTPUT;
bool is_format_supported = false;
while (device_->Ioctl(VIDIOC_ENUM_FMT, &fmtdesc) == 0) {
if (fmtdesc.pixelformat == input_format_fourcc_) {
@@ -2186,10 +2204,16 @@ bool V4L2VideoDecodeAccelerator::SetupFormats() {
struct v4l2_format format;
memset(&format, 0, sizeof(format));
- format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- format.fmt.pix_mp.pixelformat = input_format_fourcc_;
- format.fmt.pix_mp.plane_fmt[0].sizeimage = input_size;
- format.fmt.pix_mp.num_planes = 1;
+ if (input_queue_->IsMultiQueue()) {
+ format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ format.fmt.pix_mp.pixelformat = input_format_fourcc_;
+ format.fmt.pix_mp.plane_fmt[0].sizeimage = input_size;
+ format.fmt.pix_mp.num_planes = 1;
+ } else {
+ format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+ format.fmt.pix.pixelformat = input_format_fourcc_;
+ format.fmt.pix.sizeimage = input_size;
+ }
IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_S_FMT, &format);
DCHECK_EQ(format.fmt.pix_mp.pixelformat, input_format_fourcc_);
@@ -2197,7 +2221,7 @@ bool V4L2VideoDecodeAccelerator::SetupFormats() {
// changing it once we start streaming; whether it can support our chosen
// output format or not may depend on the input format.
memset(&fmtdesc, 0, sizeof(fmtdesc));
- fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ fmtdesc.type = output_queue_->IsMultiQueue() ? V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE : V4L2_BUF_TYPE_VIDEO_CAPTURE;
while (device_->Ioctl(VIDIOC_ENUM_FMT, &fmtdesc) == 0) {
auto fourcc = Fourcc::FromV4L2PixFmt(fmtdesc.pixelformat);
if (fourcc && device_->CanCreateEGLImageFrom(*fourcc)) {
@@ -2244,8 +2268,13 @@ bool V4L2VideoDecodeAccelerator::SetupFormats() {
// Just set the fourcc for output; resolution, etc., will come from the
// driver once it extracts it from the stream.
memset(&format, 0, sizeof(format));
- format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- format.fmt.pix_mp.pixelformat = output_format_fourcc_->ToV4L2PixFmt();
+ if (output_queue_->IsMultiQueue()) {
+ format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ format.fmt.pix_mp.pixelformat = output_format_fourcc_->ToV4L2PixFmt();
+ } else {
+ format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ format.fmt.pix.pixelformat = output_format_fourcc_->ToV4L2PixFmt();
+ }
IOCTL_OR_ERROR_RETURN_FALSE(VIDIOC_S_FMT, &format);
DCHECK_EQ(format.fmt.pix_mp.pixelformat,
output_format_fourcc_->ToV4L2PixFmt());
diff --git a/media/gpu/v4l2/v4l2_queue.cc b/media/gpu/v4l2/v4l2_queue.cc
index df91ef0169..3d08149929 100644
--- a/media/gpu/v4l2/v4l2_queue.cc
+++ b/media/gpu/v4l2/v4l2_queue.cc
@@ -40,11 +40,18 @@ struct v4l2_format BuildV4L2Format(const enum v4l2_buf_type type,
struct v4l2_format format;
memset(&format, 0, sizeof(format));
format.type = type;
- format.fmt.pix_mp.pixelformat = fourcc;
- format.fmt.pix_mp.width = size.width();
- format.fmt.pix_mp.height = size.height();
- format.fmt.pix_mp.num_planes = GetNumPlanesOfV4L2PixFmt(fourcc);
- format.fmt.pix_mp.plane_fmt[0].sizeimage = buffer_size;
+ if (V4L2_TYPE_IS_MULTIPLANAR(type)) {
+ format.fmt.pix_mp.pixelformat = fourcc;
+ format.fmt.pix_mp.width = size.width();
+ format.fmt.pix_mp.height = size.height();
+ format.fmt.pix_mp.num_planes = GetNumPlanesOfV4L2PixFmt(fourcc);
+ format.fmt.pix_mp.plane_fmt[0].sizeimage = buffer_size;
+ } else {
+ format.fmt.pix.pixelformat = fourcc;
+ format.fmt.pix.width = size.width();
+ format.fmt.pix.height = size.height();
+ format.fmt.pix.sizeimage = buffer_size;
+ }
return format;
}
@@ -506,9 +513,13 @@ V4L2BufferRefBase::V4L2BufferRefBase(const struct v4l2_buffer& v4l2_buffer,
DCHECK(return_to_);
memcpy(&v4l2_buffer_, &v4l2_buffer, sizeof(v4l2_buffer_));
- memcpy(v4l2_planes_, v4l2_buffer.m.planes,
- sizeof(struct v4l2_plane) * v4l2_buffer.length);
- v4l2_buffer_.m.planes = v4l2_planes_;
+ if (V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer.type)) {
+ memcpy(v4l2_planes_, v4l2_buffer.m.planes,
+ sizeof(struct v4l2_plane) * v4l2_buffer.length);
+ v4l2_buffer_.m.planes = v4l2_planes_;
+ } else {
+ memcpy(&v4l2_planes_[0].m, &v4l2_buffer.m, sizeof(v4l2_buffer.m));
+ }
}
V4L2BufferRefBase::~V4L2BufferRefBase() {
@@ -1566,6 +1577,15 @@ bool V4L2Queue::Streamoff() {
return true;
}
+bool V4L2Queue::IsMultiQueue() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+
+ if (type_ == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE || type_ == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
+ return true;
+ else
+ return false;
+}
+
size_t V4L2Queue::AllocatedBuffersCount() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/media/gpu/v4l2/v4l2_queue.h b/media/gpu/v4l2/v4l2_queue.h
index b71ae14495..532b991f68 100644
--- a/media/gpu/v4l2/v4l2_queue.h
+++ b/media/gpu/v4l2/v4l2_queue.h
@@ -534,6 +534,7 @@ class MEDIA_GPU_EXPORT V4L2Queue
// still be using them.
[[nodiscard]] bool Streamoff();
+ [[nodiscard]] bool IsMultiQueue();
// Returns the number of buffers currently allocated for this queue.
[[nodiscard]] size_t AllocatedBuffersCount() const;
// Returns the number of currently free buffers on this queue.
--
2.25.1

View File

@@ -0,0 +1,43 @@
From 65e24611d443dbc8132c8be94cd8630041b90cd3 Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Wed, 1 Nov 2023 23:48:55 +0900
Subject: [PATCH 108/120] V4L2VDA: Use correct size to allocate CAPTURE buffer
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
index aa7253928a..32b7e97338 100644
--- a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
+++ b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
@@ -2092,7 +2092,10 @@ bool V4L2VideoDecodeAccelerator::CreateBuffersForFormat(
DCHECK(decoder_thread_.task_runner()->BelongsToCurrentThread());
size_t egl_image_planes_count;
- coded_size_.SetSize(format.fmt.pix_mp.width, format.fmt.pix_mp.height);
+ if (V4L2_TYPE_IS_MULTIPLANAR(format.type))
+ coded_size_.SetSize(format.fmt.pix_mp.width, format.fmt.pix_mp.height);
+ else
+ coded_size_.SetSize(format.fmt.pix.width, format.fmt.pix.height);
visible_size_ = visible_size;
egl_image_size_ = coded_size_;
if (image_processor_device_) {
@@ -2110,11 +2113,11 @@ bool V4L2VideoDecodeAccelerator::CreateBuffersForFormat(
// In practice, this applies to all Image Processors, i.e. Mediatek devices.
DCHECK_EQ(coded_size_, output_size);
} else {
- egl_image_planes_count = format.fmt.pix_mp.num_planes;
+ egl_image_planes_count = V4L2_TYPE_IS_MULTIPLANAR(format.type) ? format.fmt.pix_mp.num_planes : 1;
}
VLOGF(2) << "new resolution: " << coded_size_.ToString()
<< ", visible size: " << visible_size_.ToString()
- << ", decoder output planes count: " << format.fmt.pix_mp.num_planes
+ << ", decoder output planes count: " << egl_image_planes_count
<< ", EGLImage size: " << egl_image_size_.ToString()
<< ", EGLImage plane count: " << egl_image_planes_count;
--
2.25.1

View File

@@ -0,0 +1,65 @@
From 0112d7345d0aa44f83b3f23e0ed6d8c975c2d14c Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Wed, 1 Nov 2023 23:53:06 +0900
Subject: [PATCH 109/120] V4L2VDA: Use correct plane size and bytesused
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/v4l2/v4l2_queue.cc | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/media/gpu/v4l2/v4l2_queue.cc b/media/gpu/v4l2/v4l2_queue.cc
index 3d08149929..41403f4e73 100644
--- a/media/gpu/v4l2/v4l2_queue.cc
+++ b/media/gpu/v4l2/v4l2_queue.cc
@@ -851,7 +851,10 @@ size_t V4L2WritableBufferRef::GetPlaneSize(const size_t plane) const {
return 0;
}
- return buffer_data_->v4l2_buffer_.m.planes[plane].length;
+ if (V4L2_TYPE_IS_MULTIPLANAR(buffer_data_->v4l2_buffer_.type))
+ return buffer_data_->v4l2_buffer_.m.planes[plane].length;
+ else
+ return buffer_data_->v4l2_buffer_.length;
}
void V4L2WritableBufferRef::SetPlaneSize(const size_t plane,
@@ -911,7 +914,10 @@ void V4L2WritableBufferRef::SetPlaneBytesUsed(const size_t plane,
return;
}
- buffer_data_->v4l2_buffer_.m.planes[plane].bytesused = bytes_used;
+ if (V4L2_TYPE_IS_MULTIPLANAR(buffer_data_->v4l2_buffer_.type))
+ buffer_data_->v4l2_buffer_.m.planes[plane].bytesused = bytes_used;
+ else
+ buffer_data_->v4l2_buffer_.bytesused = bytes_used;
}
size_t V4L2WritableBufferRef::GetPlaneBytesUsed(const size_t plane) const {
@@ -923,7 +929,10 @@ size_t V4L2WritableBufferRef::GetPlaneBytesUsed(const size_t plane) const {
return 0;
}
- return buffer_data_->v4l2_buffer_.m.planes[plane].bytesused;
+ if (V4L2_TYPE_IS_MULTIPLANAR(buffer_data_->v4l2_buffer_.type))
+ return buffer_data_->v4l2_buffer_.m.planes[plane].bytesused;
+ else
+ return buffer_data_->v4l2_buffer_.bytesused;
}
void V4L2WritableBufferRef::SetPlaneDataOffset(const size_t plane,
@@ -1029,7 +1038,10 @@ size_t V4L2ReadableBuffer::GetPlaneBytesUsed(const size_t plane) const {
return 0;
}
- return buffer_data_->v4l2_planes_[plane].bytesused;
+ if (V4L2_TYPE_IS_MULTIPLANAR(buffer_data_->v4l2_buffer_.type))
+ return buffer_data_->v4l2_planes_[plane].bytesused;
+ else
+ return buffer_data_->v4l2_buffer_.bytesused;
}
size_t V4L2ReadableBuffer::GetPlaneDataOffset(const size_t plane) const {
--
2.25.1

View File

@@ -0,0 +1,76 @@
From 57c6104b5cd7a2c35caa40cf19c176eb66ab2ee8 Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Thu, 2 Nov 2023 00:03:11 +0900
Subject: [PATCH 110/120] V4L2VDA: Add hevc format support
Upstream-Status: Inappropriate [NXP specific]
---
media/base/supported_types.cc | 2 +-
media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc | 1 +
media/gpu/v4l2/v4l2_utils.cc | 4 +++-
media/media_options.gni | 2 +-
4 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/media/base/supported_types.cc b/media/base/supported_types.cc
index 7737099b6a..49cf1beb3f 100644
--- a/media/base/supported_types.cc
+++ b/media/base/supported_types.cc
@@ -373,7 +373,7 @@ bool IsDefaultSupportedVideoType(const VideoType& type) {
case VideoCodec::kVP9:
return IsVp9ProfileSupported(type);
case VideoCodec::kHEVC:
- return IsHevcProfileSupported(type);
+ return true;
case VideoCodec::kMPEG4:
return IsMPEG4Supported();
case VideoCodec::kDolbyVision:
diff --git a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
index 32b7e97338..05f10ee979 100644
--- a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
+++ b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
@@ -90,6 +90,7 @@ static const std::vector<uint32_t> kSupportedInputFourCCs = {
V4L2_PIX_FMT_H264,
V4L2_PIX_FMT_VP8,
V4L2_PIX_FMT_VP9,
+ V4L2_PIX_FMT_HEVC,
};
// static
diff --git a/media/gpu/v4l2/v4l2_utils.cc b/media/gpu/v4l2/v4l2_utils.cc
index 7131cba379..1c275257df 100644
--- a/media/gpu/v4l2/v4l2_utils.cc
+++ b/media/gpu/v4l2/v4l2_utils.cc
@@ -478,7 +478,7 @@ void GetSupportedResolution(const IoctlAsCallback& ioctl_cb,
uint32_t pixelformat,
gfx::Size* min_resolution,
gfx::Size* max_resolution) {
- constexpr gfx::Size kDefaultMaxCodedSize(1920, 1088);
+ constexpr gfx::Size kDefaultMaxCodedSize(4096, 4096);
*max_resolution = kDefaultMaxCodedSize;
constexpr gfx::Size kDefaultMinCodedSize(16, 16);
*min_resolution = kDefaultMinCodedSize;
@@ -521,6 +521,8 @@ uint32_t VideoCodecProfileToV4L2PixFmt(VideoCodecProfile profile,
return V4L2_PIX_FMT_VP8;
} else if (profile >= VP9PROFILE_MIN && profile <= VP9PROFILE_MAX) {
return V4L2_PIX_FMT_VP9;
+ } else if (profile >= HEVCPROFILE_MIN && profile <= HEVCPROFILE_MAX) {
+ return V4L2_PIX_FMT_HEVC;
} else if (profile == HEVCPROFILE_MAIN) {
return V4L2_PIX_FMT_HEVC;
} else {
diff --git a/media/media_options.gni b/media/media_options.gni
index 156eaebf5d..67b184d3b3 100644
--- a/media/media_options.gni
+++ b/media/media_options.gni
@@ -138,7 +138,7 @@ declare_args() {
# applies to video-capable devices.
enable_platform_hevc =
proprietary_codecs && (enable_hevc_parser_and_hw_decoder ||
- is_cast_media_device || is_chromeos_lacros)
+ is_cast_media_device || is_chromeos_lacros || use_v4l2_codec)
enable_mse_mpeg2ts_stream_parser =
proprietary_codecs &&
--
2.25.1

View File

@@ -0,0 +1,31 @@
From 63e308a5c17c022a682ab7cd1376b7e167d0cc6a Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Thu, 18 Aug 2022 12:20:33 +0800
Subject: [PATCH 111/120] V4L2VDA: fix vp9 crash caused by
DequeueResolutionChangeEvent
Handle source change event only when decoder receives driver reported
source change event.
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
index 05f10ee979..d372bd8abc 100644
--- a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
+++ b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
@@ -1140,8 +1140,7 @@ void V4L2VideoDecodeAccelerator::ServiceDeviceTask(bool event_pending) {
gfx::Size visible_size;
bool again;
if (GetFormatInfo(&format, &visible_size, &again) && !again) {
- resolution_change_pending = true;
- DequeueResolutionChangeEvent();
+ resolution_change_pending = DequeueResolutionChangeEvent();
}
}
--
2.25.1

View File

@@ -0,0 +1,85 @@
From 341cb82e43f4bbe5702372f30b2fd13f87d42ce9 Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Thu, 2 Nov 2023 11:26:12 +0900
Subject: [PATCH 112/120] V4L2VDA: Add fps in SkiaOutputSurfaceImplOnGpu by
VLOG(1)
Upstream-Status: Inappropriate [NXP specific]
---
.../skia_output_surface_impl_on_gpu.cc | 18 ++++++++++++++++++
.../skia_output_surface_impl_on_gpu.h | 1 +
2 files changed, 19 insertions(+)
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc
index 00178b9cd0..6974a30bf7 100644
--- a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc
+++ b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc
@@ -9,6 +9,7 @@
#include <string>
#include <utility>
#include <vector>
+#include <sys/time.h>
#include "base/debug/crash_logging.h"
#include "base/debug/dump_without_crashing.h"
@@ -133,6 +134,15 @@
#include "components/viz/service/display_embedder/output_presenter_fuchsia.h"
#endif
+static uint64_t start_time = 0;
+static uint64_t stop_time = 0;
+
+uint64_t NowMicros() {
+ struct timeval tv;
+ gettimeofday(&tv, nullptr);
+ return static_cast<uint64_t>(tv.tv_sec) * 1e6 + tv.tv_usec;
+}
+
namespace viz {
namespace {
@@ -337,6 +347,7 @@ SkiaOutputSurfaceImplOnGpu::SkiaOutputSurfaceImplOnGpu(
async_read_result_lock_(base::MakeRefCounted<AsyncReadResultLock>()) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ swap_buffers_number_ = 0;
weak_ptr_ = weak_ptr_factory_.GetWeakPtr();
buffer_presented_callback_ = CreateSafeRepeatingCallback(
weak_ptr_, std::move(buffer_presented_callback));
@@ -600,7 +611,13 @@ void SkiaOutputSurfaceImplOnGpu::SwapBuffers(OutputSurfaceFrame frame) {
TRACE_EVENT0("viz", "SkiaOutputSurfaceImplOnGpu::SwapBuffers");
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ if ( swap_buffers_number_ == 0)
+ start_time = NowMicros();
+
+ swap_buffers_number_++;
+ stop_time = NowMicros();
SwapBuffersInternal(std::move(frame));
+ VLOG(1) << "total showed " << swap_buffers_number_ << " frames, total time " << (stop_time - start_time) << " ms, fps is " << swap_buffers_number_*1e6/(stop_time - start_time) << std::endl;
}
void SkiaOutputSurfaceImplOnGpu::EnsureMinNumberOfBuffers(int n) {
@@ -2103,6 +2120,7 @@ bool SkiaOutputSurfaceImplOnGpu::Initialize() {
context_state_->AddContextLostObserver(this);
}
+ start_time = NowMicros();
return true;
}
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.h b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.h
index f3847a7826..f8b833d985 100644
--- a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.h
+++ b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.h
@@ -539,6 +539,7 @@ class SkiaOutputSurfaceImplOnGpu
ScheduleGpuTaskCallback schedule_gpu_task_;
AddChildWindowToBrowserCallback add_child_window_to_browser_callback_;
SkiaOutputDevice::ReleaseOverlaysCallback release_overlays_callback_;
+ size_t swap_buffers_number_;
// ImplOnGpu::CopyOutput can create SharedImages via ImplOnGpu's
// SharedImageFactory. Clients can use these images via CopyOutputResult and
--
2.25.1

View File

@@ -0,0 +1,113 @@
From 18e15e665dfd17787841898be4bcf2c4940dbc9e Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Thu, 2 Nov 2023 14:31:34 +0900
Subject: [PATCH 113/120] V4L2VDA: Comment some unused ioctl
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/v4l2/v4l2_queue.cc | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/media/gpu/v4l2/v4l2_queue.cc b/media/gpu/v4l2/v4l2_queue.cc
index 41403f4e73..1c16e87084 100644
--- a/media/gpu/v4l2/v4l2_queue.cc
+++ b/media/gpu/v4l2/v4l2_queue.cc
@@ -1101,10 +1101,12 @@ V4L2Queue::V4L2Queue(const IoctlAsCallback& ioctl_cb,
weak_this_factory_(this) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+#if !BUILDFLAG(USE_LINUX_V4L2)
struct v4l2_requestbuffers reqbufs = {
.count = 0, .type = type_, .memory = V4L2_MEMORY_MMAP};
supports_requests_ = (ioctl_cb_.Run(VIDIOC_REQBUFS, &reqbufs) == kIoctlOk) &&
(reqbufs.capabilities & V4L2_BUF_CAP_SUPPORTS_REQUESTS);
+#endif
// Stateful backends for example do not support requests.
VPLOG_IF(4, supports_requests_)
@@ -1754,10 +1756,14 @@ bool V4L2Request::ApplyCtrls(struct v4l2_ext_controls* ctrls) {
return false;
}
+#if !BUILDFLAG(USE_LINUX_V4L2)
ctrls->which = V4L2_CTRL_WHICH_REQUEST_VAL;
ctrls->request_fd = request_fd_.get();
return true;
+#else
+ return false;
+#endif
}
bool V4L2Request::ApplyQueueBuffer(struct v4l2_buffer* buffer) {
@@ -1769,10 +1775,14 @@ bool V4L2Request::ApplyQueueBuffer(struct v4l2_buffer* buffer) {
return false;
}
+#if !BUILDFLAG(USE_LINUX_V4L2)
buffer->flags |= V4L2_BUF_FLAG_REQUEST_FD;
buffer->request_fd = request_fd_.get();
return true;
+#else
+ return false;
+#endif
}
bool V4L2Request::Submit() {
@@ -1783,12 +1793,16 @@ bool V4L2Request::Submit() {
return false;
}
+#if !BUILDFLAG(USE_LINUX_V4L2)
if (HANDLE_EINTR(ioctl(request_fd_.get(), MEDIA_REQUEST_IOC_QUEUE)) != 0) {
RecordMediaIoctlUMA(MediaIoctlRequests::kMediaRequestIocQueue);
return false;
}
return true;
+#else
+ return false;
+#endif
}
bool V4L2Request::IsCompleted() {
@@ -1830,6 +1844,7 @@ bool V4L2Request::Reset() {
return false;
}
+#if !BUILDFLAG(USE_LINUX_V4L2)
// Reinit the request to make sure we can use it for a new submission.
if (HANDLE_EINTR(ioctl(request_fd_.get(), MEDIA_REQUEST_IOC_REINIT)) < 0) {
RecordMediaIoctlUMA(MediaIoctlRequests::kMediaRequestIocReinit);
@@ -1838,6 +1853,9 @@ bool V4L2Request::Reset() {
}
return true;
+#else
+ return false;
+#endif
}
V4L2RequestRefBase::V4L2RequestRefBase(V4L2RequestRefBase&& req_base) {
@@ -1914,6 +1932,7 @@ V4L2RequestsQueue::~V4L2RequestsQueue() {
std::optional<base::ScopedFD> V4L2RequestsQueue::CreateRequestFD() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+#if !BUILDFLAG(USE_LINUX_V4L2)
int request_fd;
int ret = HANDLE_EINTR(
ioctl(media_fd_.get(), MEDIA_IOC_REQUEST_ALLOC, &request_fd));
@@ -1924,6 +1943,9 @@ std::optional<base::ScopedFD> V4L2RequestsQueue::CreateRequestFD() {
}
return base::ScopedFD(request_fd);
+#else
+ return std::nullopt;
+#endif
}
std::optional<V4L2RequestRef> V4L2RequestsQueue::GetFreeRequest() {
--
2.25.1

View File

@@ -0,0 +1,76 @@
From 8c4da3a34c47cbf8fab2dfd6d928843e53a13ad8 Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Thu, 2 Nov 2023 14:34:11 +0900
Subject: [PATCH 114/120] V4L2VDA: Set OUTPUT format with parsed resolution for
amphion
For VP8, VC1l, rv, Amphion needs to set correct resolution for OUTPUT
queue as it will be added to amphion customized header.
Upstream-Status: Inappropriate [NXP specific]
---
.../v4l2/legacy/v4l2_video_decode_accelerator.cc | 13 +++++++++++--
.../gpu/v4l2/legacy/v4l2_video_decode_accelerator.h | 2 +-
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
index d372bd8abc..84a9b2f4d7 100644
--- a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
+++ b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
@@ -323,6 +323,9 @@ bool V4L2VideoDecodeAccelerator::CheckConfig(const Config& config) {
return false;
}
+ int width, height;
+ height = config.initial_expected_coded_size.height();
+ width = config.initial_expected_coded_size.width();
// Capabilities check.
struct v4l2_capability caps;
unsigned int device_caps;
@@ -357,7 +360,7 @@ bool V4L2VideoDecodeAccelerator::CheckConfig(const Config& config) {
if (!output_queue_)
return false;
- if (!SetupFormats())
+ if (!SetupFormats(width, height))
return false;
// We have confirmed that |config| is supported, tell the good news to the
@@ -2171,7 +2174,7 @@ bool V4L2VideoDecodeAccelerator::CreateInputBuffers() {
return true;
}
-bool V4L2VideoDecodeAccelerator::SetupFormats() {
+bool V4L2VideoDecodeAccelerator::SetupFormats(int width, int height) {
DCHECK(decoder_thread_.task_runner()->BelongsToCurrentThread());
DCHECK_EQ(decoder_state_, kInitialized);
DCHECK(!input_queue_->IsStreaming());
@@ -2212,6 +2215,12 @@ bool V4L2VideoDecodeAccelerator::SetupFormats() {
format.fmt.pix_mp.pixelformat = input_format_fourcc_;
format.fmt.pix_mp.plane_fmt[0].sizeimage = input_size;
format.fmt.pix_mp.num_planes = 1;
+ // For VP8, VC1l, rv, Amphion needs to set correct resolution for
+ // OUTPUT queue as it will be added to amphion customized header.
+ if(V4L2_PIX_FMT_VP8 == input_format_fourcc_){
+ format.fmt.pix_mp.width = width;
+ format.fmt.pix_mp.height = height;
+ }
} else {
format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
format.fmt.pix.pixelformat = input_format_fourcc_;
diff --git a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.h b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.h
index 60ee8ef7f8..8ae19f53de 100644
--- a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.h
+++ b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.h
@@ -386,7 +386,7 @@ class MEDIA_GPU_EXPORT V4L2VideoDecodeAccelerator
bool DestroyOutputBuffers();
// Set input and output formats before starting decode.
- bool SetupFormats();
+ bool SetupFormats(int, int);
// Reset image processor and drop all processing frames.
bool ResetImageProcessor();
--
2.25.1

View File

@@ -0,0 +1,109 @@
From f31fe999af5a2c7ce9270781236d23e19b8b6e6e Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Thu, 2 Nov 2023 15:19:32 +0900
Subject: [PATCH 115/120] V4L2VDA: Add V4L2_PIX_FMT_NV12M_8L128 format for
amphion
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/chromeos/fourcc.cc | 2 ++
media/gpu/chromeos/fourcc.h | 4 ++++
media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc | 9 +++++++--
media/gpu/v4l2/v4l2_device.cc | 1 +
media/gpu/v4l2/v4l2_device.h | 6 ++++++
5 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/media/gpu/chromeos/fourcc.cc b/media/gpu/chromeos/fourcc.cc
index 175cb3eb8e..bf10308c5c 100644
--- a/media/gpu/chromeos/fourcc.cc
+++ b/media/gpu/chromeos/fourcc.cc
@@ -24,6 +24,7 @@ std::optional<Fourcc> Fourcc::FromUint32(uint32_t fourcc) {
case YM12:
case YM21:
case YUYV:
+ case NA12:
case NV12:
case NV21:
case NM12:
@@ -164,6 +165,7 @@ VideoPixelFormat Fourcc::ToVideoPixelFormat() const {
return PIXEL_FORMAT_YUY2;
case NV12:
case NM12:
+ case NA12:
return PIXEL_FORMAT_NV12;
case NV21:
case NM21:
diff --git a/media/gpu/chromeos/fourcc.h b/media/gpu/chromeos/fourcc.h
index 6f08dba1de..12b71cbb8f 100644
--- a/media/gpu/chromeos/fourcc.h
+++ b/media/gpu/chromeos/fourcc.h
@@ -69,6 +69,10 @@ class MEDIA_GPU_EXPORT Fourcc {
// Maps to PIXEL_FORMAT_NV21, V4L2_PIX_FMT_NV21M.
NM21 = ComposeFourcc('N', 'M', '2', '1'),
+ // Tiled YUV formats, non contiguous planes.
+ // Maps to V4L2_PIX_FMT_NV12M_8L128.
+ NA12 = ComposeFourcc('N', 'A', '1', '2'),
+
// YUV422 single-planar format.
// https://linuxtv.org/downloads/v4l-dvb-apis-new/userspace-api/v4l/pixfmt-yuv422p.html
// Maps to PIXEL_FORMAT_I422, V4L2_PIX_FMT_YUV422P.
diff --git a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
index 84a9b2f4d7..9791a69765 100644
--- a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
+++ b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.cc
@@ -1249,8 +1249,9 @@ void V4L2VideoDecodeAccelerator::Enqueue() {
// yet. Also, V4L2VDA calls STREAMOFF and STREAMON after resolution
// change. They implicitly send a V4L2_DEC_CMD_STOP and V4L2_DEC_CMD_START
// to the decoder.
- if (input_queue_->QueuedBuffersCount() > 0)
- break;
+ if (input_queue_->QueuedBuffersCount() > 0) {
+ // break;
+ }
if (coded_size_.IsEmpty() || !input_queue_->IsStreaming()) {
// In these situations, we should call NotifyFlushDone() immediately:
@@ -1392,6 +1393,10 @@ bool V4L2VideoDecodeAccelerator::DequeueOutputBuffer() {
// Dequeue a completed output (VIDEO_CAPTURE) buffer, and queue to the
// completed queue.
auto ret = output_queue_->DequeueBuffer();
+ if (errno == EPIPE) {
+ VLOG(1) << "Got eos";
+ flush_awaiting_last_output_buffer_ = false;
+ }
if (ret.first == false) {
LOG(ERROR) << "Error in Dequeue output buffer";
NOTIFY_ERROR(PLATFORM_FAILURE);
diff --git a/media/gpu/v4l2/v4l2_device.cc b/media/gpu/v4l2/v4l2_device.cc
index daea76c9b6..6a77f5dd8f 100644
--- a/media/gpu/v4l2/v4l2_device.cc
+++ b/media/gpu/v4l2/v4l2_device.cc
@@ -43,6 +43,7 @@ uint32_t V4L2PixFmtToDrmFormat(uint32_t format) {
switch (format) {
case V4L2_PIX_FMT_NV12:
case V4L2_PIX_FMT_NV12M:
+ case V4L2_PIX_FMT_NV12M_8L128:
return DRM_FORMAT_NV12;
case V4L2_PIX_FMT_YUV420:
diff --git a/media/gpu/v4l2/v4l2_device.h b/media/gpu/v4l2/v4l2_device.h
index 620dbd5237..45075e40ee 100644
--- a/media/gpu/v4l2/v4l2_device.h
+++ b/media/gpu/v4l2/v4l2_device.h
@@ -64,6 +64,12 @@
v4l2_fourcc('Q', '1', '0', 'C') /* Qualcomm 10-bit compressed */
#endif
+/* Tiled YUV formats, non contiguous planes */
+#ifndef V4L2_PIX_FMT_NV12M_8L128
+#define V4L2_PIX_FMT_NV12M_8L128 \
+ v4l2_fourcc('N', 'A', '1', '2') /* Y/CbCr 4:2:0 8x128 tiles */
+#endif
+
#define V4L2_PIX_FMT_INVALID v4l2_fourcc('0', '0', '0', '0')
namespace media {
--
2.25.1

View File

@@ -0,0 +1,311 @@
From d59e1fe890fc5815fa4466b8dc0044ce83d750ac Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Thu, 2 Nov 2023 15:29:30 +0900
Subject: [PATCH 116/120] V4L2VDA: Support tile to linear transform for amphion
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/v4l2/BUILD.gn | 1 +
media/gpu/v4l2/v4l2_queue.cc | 189 ++++++++++++++++++++++++++++++++++-
media/gpu/v4l2/v4l2_queue.h | 1 +
3 files changed, 186 insertions(+), 5 deletions(-)
diff --git a/media/gpu/v4l2/BUILD.gn b/media/gpu/v4l2/BUILD.gn
index a790c4910a..8c96e9a926 100644
--- a/media/gpu/v4l2/BUILD.gn
+++ b/media/gpu/v4l2/BUILD.gn
@@ -114,6 +114,7 @@ source_set("v4l2") {
"EGL",
"GLESv2",
]
+ libs += [ "g2d" ]
configs += [ "//third_party/libyuv:libyuv_config" ]
diff --git a/media/gpu/v4l2/v4l2_queue.cc b/media/gpu/v4l2/v4l2_queue.cc
index 1c16e87084..90a9db1367 100644
--- a/media/gpu/v4l2/v4l2_queue.cc
+++ b/media/gpu/v4l2/v4l2_queue.cc
@@ -19,6 +19,11 @@
#include "media/gpu/chromeos/video_frame_resource.h"
#include "media/gpu/macros.h"
+#include "g2d.h"
+#include "g2dExt.h"
+#include <linux/dma-buf.h>
+#include <time.h>
+
namespace media {
namespace {
@@ -188,6 +193,11 @@ class V4L2Buffer {
size_t GetMemoryUsage() const;
const struct v4l2_buffer& v4l2_buffer() const { return v4l2_buffer_; }
const scoped_refptr<FrameResource>& GetFrameResource();
+ std::pair<int, int> GetSavedmafd();
+ std::pair<unsigned int, unsigned int> GetSavedphys();
+ std::pair<int, int> Getg2dbufphys();
+ std::pair<void *, void *> Getg2dbufvirs();
+ const struct v4l2_format& GetFmt() const {return format_;}
private:
V4L2Buffer(const IoctlAsCallback& ioctl_cb,
@@ -202,6 +212,12 @@ class V4L2Buffer {
const IoctlAsCallback ioctl_cb_;
const MmapAsCallback mmap_cb_;
std::vector<void*> plane_mappings_;
+ int dmafd0;
+ int dmafd1;
+ unsigned long phys_0;
+ unsigned long phys_1;
+ struct g2d_buf *g2dbuf_p0;
+ struct g2d_buf *g2dbuf_p1;
// V4L2 data as queried by QUERYBUF.
struct v4l2_buffer v4l2_buffer_;
@@ -256,6 +272,9 @@ V4L2Buffer::V4L2Buffer(const IoctlAsCallback& ioctl_cb,
v4l2_buffer_.type = type;
v4l2_buffer_.memory = memory;
plane_mappings_.resize(V4L2_TYPE_IS_MULTIPLANAR(type) ? v4l2_buffer_.length : 1);
+ dmafd0 = dmafd1 = -1;
+ phys_0 = phys_1 = 0;
+ g2dbuf_p0 = g2dbuf_p1 = NULL;
}
V4L2Buffer::~V4L2Buffer() {
@@ -268,6 +287,32 @@ V4L2Buffer::~V4L2Buffer() {
}
}
}
+ if(g2d_free && g2dbuf_p0 && g2dbuf_p1) {
+ g2d_free(g2dbuf_p0);
+ g2d_free(g2dbuf_p1);
+ }
+}
+
+std::pair<int, int> V4L2Buffer::GetSavedmafd() {
+ return std::make_pair(dmafd0, dmafd1);
+}
+
+std::pair<unsigned int, unsigned int> V4L2Buffer::GetSavedphys() {
+ return std::make_pair(phys_0, phys_1);
+}
+
+std::pair<int, int> V4L2Buffer::Getg2dbufphys() {
+ if(g2dbuf_p0 && g2dbuf_p1)
+ return std::make_pair(g2dbuf_p0->buf_paddr, g2dbuf_p1->buf_paddr);
+ else
+ return std::make_pair(-1, -1);
+}
+
+std::pair<void*, void*> V4L2Buffer::Getg2dbufvirs() {
+ if(g2dbuf_p0 && g2dbuf_p1)
+ return std::make_pair(g2dbuf_p0->buf_vaddr, g2dbuf_p1->buf_vaddr);
+ else
+ return std::make_pair(nullptr, nullptr);
}
bool V4L2Buffer::Query() {
@@ -353,6 +398,66 @@ scoped_refptr<VideoFrame> V4L2Buffer::CreateVideoFrame() {
DLOG(ERROR) << "Fail to get DMABUFs of V4L2 buffer - invalid fd";
return nullptr;
}
+ if(dmafd0 == -1)
+ dmafd0 = dmabuf_fd.get();
+ else
+ dmafd1 = dmabuf_fd.get();
+ }
+
+ std::vector<base::ScopedFD> g2dbufs_fds;
+ if (V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type)) {
+ struct dma_buf_phys{
+ unsigned long phys;
+ };
+ #define DMA_BUF_IOCTL_PHYS _IOW(DMA_BUF_BASE, 10, struct dma_buf_phys)
+ struct dma_buf_phys query0, query1;
+ int ret = ioctl(dmafd0, DMA_BUF_IOCTL_PHYS, &query0);
+ if(ret != 0) {
+ DLOG(ERROR)<< "DMA_BUF_IOCTL_PHYS failed at dmafd" << dmafd0;
+ return nullptr;
+ }
+ else
+ phys_0 = query0.phys;
+
+ ret = ioctl(dmafd1, DMA_BUF_IOCTL_PHYS, &query1);
+ if(ret != 0) {
+ DLOG(ERROR)<< "DMA_BUF_IOCTL_PHYS failed at dmafd" << dmafd1;
+ return nullptr;
+ }
+ else
+ phys_1 = query1.phys;
+
+ if (g2d_alloc) {
+ g2dbuf_p0 = g2d_alloc(format_.fmt.pix_mp.width * format_.fmt.pix_mp.height, 0);
+ g2dbuf_p1 = g2d_alloc(format_.fmt.pix_mp.width * format_.fmt.pix_mp.height / 2, 0);
+ }
+ if((!g2dbuf_p0) || (!g2dbuf_p1)){
+ DLOG(ERROR)<<"g2d buf alloc failed";
+ return nullptr;
+ }
+
+ int tmpfd = -1;
+ if (g2d_buf_export_fd)
+ tmpfd = g2d_buf_export_fd(g2dbuf_p0);
+ tmpfd = dup(tmpfd);
+ if(tmpfd > 0)
+ g2dbufs_fds.push_back(base::ScopedFD(tmpfd));
+ else if(tmpfd == -1)
+ {
+ DLOG(ERROR) << "Failed duplicating g2d fd";
+ return nullptr;
+ }
+
+ if (g2d_buf_export_fd)
+ tmpfd = g2d_buf_export_fd(g2dbuf_p1);
+ tmpfd = dup(tmpfd);
+ if(tmpfd>0)
+ g2dbufs_fds.push_back(base::ScopedFD(tmpfd));
+ else if(tmpfd == -1)
+ {
+ DLOG(ERROR) << "Failed duplicating g2d fd";
+ return nullptr;
+ }
}
// Duplicate the fd of the last v4l2 plane until the number of fds are the
@@ -367,13 +472,16 @@ scoped_refptr<VideoFrame> V4L2Buffer::CreateVideoFrame() {
dmabuf_fds.emplace_back(duped_fd);
}
- if (V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type))
+ if (V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type)) {
gfx::Size size(format_.fmt.pix_mp.width, format_.fmt.pix_mp.height);
- else
+ return VideoFrame::WrapExternalDmabufs(
+ *layout, gfx::Rect(size), size, std::move(g2dbufs_fds), base::TimeDelta());
+ }
+ else {
gfx::Size size(format_.fmt.pix.width, format_.fmt.pix.height);
-
- return VideoFrame::WrapExternalDmabufs(
- *layout, gfx::Rect(size), size, std::move(dmabuf_fds), base::TimeDelta());
+ return VideoFrame::WrapExternalDmabufs(
+ *layout, gfx::Rect(size), size, std::move(dmabuf_fds), base::TimeDelta());
+ }
}
const scoped_refptr<FrameResource>& V4L2Buffer::GetFrameResource() {
@@ -1112,6 +1220,10 @@ V4L2Queue::V4L2Queue(const IoctlAsCallback& ioctl_cb,
VPLOG_IF(4, supports_requests_)
<< "This queue does " << (supports_requests_ ? "" : "not")
<< " support requests.";
+
+ g2d_handle = NULL;
+ if(g2d_open && g2d_open(&g2d_handle))
+ VLOGF(1) << "g2d_open fail";
}
V4L2Queue::~V4L2Queue() {
@@ -1127,6 +1239,9 @@ V4L2Queue::~V4L2Queue() {
VQLOGF(1) << "Failed to deallocate queue buffers";
}
+ if(g2d_close && g2d_handle)
+ g2d_close(g2d_handle);
+
std::move(destroy_cb_).Run();
}
@@ -1170,6 +1285,8 @@ std::pair<std::optional<struct v4l2_format>, int> V4L2Queue::GetFormat() {
VPQLOGF(2) << "Failed to get format";
return std::make_pair(std::nullopt, errno);
}
+ if (type_ == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
+ format.fmt.pix_mp.width = format.fmt.pix_mp.plane_fmt[0].bytesperline;
return std::make_pair(format, 0);
}
@@ -1529,6 +1646,68 @@ std::pair<bool, V4L2ReadableBufferRef> V4L2Queue::DequeueBuffer() {
}
DCHECK(free_buffers_);
+
+ if(type_ == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE &&
+ buffers_[v4l2_buffer.index]->GetFmt().fmt.pix_mp.pixelformat == V4L2_PIX_FMT_NV12M_8L128)
+ {
+ std::pair<unsigned int, unsigned int> v4l_phys = buffers_[v4l2_buffer.index]->GetSavedphys();
+ int width = buffers_[v4l2_buffer.index]->GetFmt().fmt.pix_mp.width;
+ int height = buffers_[v4l2_buffer.index]->GetFmt().fmt.pix_mp.height;
+ int stride = buffers_[v4l2_buffer.index]->GetFmt().fmt.pix_mp.plane_fmt[0].bytesperline;
+ bool interlaced = false;
+ switch (buffers_[v4l2_buffer.index]->GetFmt().fmt.pix_mp.field) {
+ case V4L2_FIELD_INTERLACED:
+ case V4L2_FIELD_INTERLACED_TB:
+ case V4L2_FIELD_INTERLACED_BT:
+ case V4L2_FIELD_SEQ_TB:
+ interlaced = true;
+ break;
+ default:
+ break;
+ };
+ struct g2d_surfaceEx srcEx, dstEx;
+ struct g2d_surface *src = &srcEx.base;
+ struct g2d_surface *dst = &dstEx.base;
+
+ dst->format = G2D_NV12;
+ dst->planes[0] = buffers_[v4l2_buffer.index]->Getg2dbufphys().first;
+ dst->planes[1] = buffers_[v4l2_buffer.index]->Getg2dbufphys().second;
+ dstEx.tiling = G2D_LINEAR;
+ dst->left = 0;
+ dst->top = 0;
+ dst->right = dst->left + width;
+ dst->bottom = dst->top + height;
+ dst->stride= width;
+ dst->width = width;
+ dst->height = height;
+ dst->rot = G2D_ROTATION_0;
+ dst->global_alpha = 0xff;
+ dst->blendfunc = G2D_ONE_MINUS_SRC_ALPHA;
+ dst->clrcolor = 0;
+
+ src->format = G2D_NV12;
+ src->planes[0] = v4l_phys.first;
+ src->planes[1] = v4l_phys.second;
+ srcEx.tiling = G2D_AMPHION_TILED;
+ if (interlaced) {
+ srcEx.tiling = static_cast<g2d_tiling>(0x18); //G2D_AMPHION_TILED | G2D_AMPHION_INTERLACED;
+ DVLOGF(4)<<"interlaced video convert";
+ }
+ src->left = 0;
+ src->top = 0;
+ src->right = src->left + width;
+ src->bottom = src->top + height;
+ src->stride= stride;
+ src->width = width;
+ src->height = height;
+ src->rot = G2D_ROTATION_0;
+ src->global_alpha = 0xff;
+ src->blendfunc = G2D_ONE;
+
+ if (g2d_blitEx)
+ g2d_blitEx(g2d_handle, &srcEx, &dstEx);
+ }
+
return std::make_pair(true, V4L2BufferRefFactory::CreateReadableRef(
v4l2_buffer, weak_this_factory_.GetWeakPtr(),
std::move(queued_frame)));
diff --git a/media/gpu/v4l2/v4l2_queue.h b/media/gpu/v4l2/v4l2_queue.h
index 532b991f68..976ebc329c 100644
--- a/media/gpu/v4l2/v4l2_queue.h
+++ b/media/gpu/v4l2/v4l2_queue.h
@@ -584,6 +584,7 @@ class MEDIA_GPU_EXPORT V4L2Queue
std::optional<struct v4l2_format> current_format_;
std::vector<std::unique_ptr<V4L2Buffer>> buffers_;
+ void* g2d_handle;
// Buffers that are available for client to get and submit.
// Buffers in this list are not referenced by anyone else than ourselves.
--
2.25.1

View File

@@ -0,0 +1,29 @@
From 796cf27bef13a731f1f36f3c95894fe1db8a4b25 Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Thu, 2 Nov 2023 16:21:06 +0900
Subject: [PATCH 117/120] V4L2VDA: Enlarge input buffer count to 16
Some stream can decode one frame only after queuing over 8 buffers.
So enlarge input buffer count to 16 to avoid such stream cannot play.
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.h b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.h
index 8ae19f53de..b7d43fce53 100644
--- a/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.h
+++ b/media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.h
@@ -157,7 +157,7 @@ class MEDIA_GPU_EXPORT V4L2VideoDecodeAccelerator
private:
// These are rather subjectively tuned.
enum {
- kInputBufferCount = 8,
+ kInputBufferCount = 16,
// TODO(posciak): determine input buffer size based on level limits.
// See http://crbug.com/255116.
// Input bitstream buffer size for up to 1080p streams.
--
2.25.1

View File

@@ -0,0 +1,236 @@
From 2831164cc20184e5f470d3eecb99f32a4e330d24 Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Thu, 2 Nov 2023 17:41:28 +0900
Subject: [PATCH 118/120] V4L2VDA: Use dlopen to dynamically use g2d api
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/v4l2/BUILD.gn | 1 -
media/gpu/v4l2/v4l2_queue.cc | 183 ++++++++++++++++++++++++++++++++++-
2 files changed, 181 insertions(+), 3 deletions(-)
diff --git a/media/gpu/v4l2/BUILD.gn b/media/gpu/v4l2/BUILD.gn
index 8c96e9a926..a790c4910a 100644
--- a/media/gpu/v4l2/BUILD.gn
+++ b/media/gpu/v4l2/BUILD.gn
@@ -114,7 +114,6 @@ source_set("v4l2") {
"EGL",
"GLESv2",
]
- libs += [ "g2d" ]
configs += [ "//third_party/libyuv:libyuv_config" ]
diff --git a/media/gpu/v4l2/v4l2_queue.cc b/media/gpu/v4l2/v4l2_queue.cc
index 90a9db1367..f717f945ee 100644
--- a/media/gpu/v4l2/v4l2_queue.cc
+++ b/media/gpu/v4l2/v4l2_queue.cc
@@ -19,10 +19,11 @@
#include "media/gpu/chromeos/video_frame_resource.h"
#include "media/gpu/macros.h"
-#include "g2d.h"
-#include "g2dExt.h"
+// #include "g2d.h"
+// #include "g2dExt.h"
#include <linux/dma-buf.h>
#include <time.h>
+#include <dlfcn.h>
namespace media {
@@ -159,6 +160,159 @@ std::vector<base::ScopedFD> GetDmabufsForV4L2Buffer(
} // namespace
+/* g2d.h g2dExt.h */
+enum g2d_format
+{
+//rgb formats
+ G2D_RGB565 = 0, /* [0:4] Blue; [5:10] Green; [11:15] Red */
+ G2D_RGBA8888 = 1, /* [0:7] Red; [8:15] Green; [16:23] Blue; [23:31] Alpha */
+ G2D_RGBX8888 = 2, /* [0:7] Red; [8:15] Green; [16:23] Blue; [23:31] don't care */
+ G2D_BGRA8888 = 3, /* [0:7] Blue; [8:15] Green; [16:23] Red; [23:31] Alpha */
+ G2D_BGRX8888 = 4, /* [0:7] Blue; [8:15] Green; [16:23] Red; [23:31] don't care */
+ G2D_BGR565 = 5, /* [0:4] Red; [5:10] Green; [11:15] Blue */
+
+ G2D_ARGB8888 = 6, /* [0:7] Alpha; [8:15] Red; [16:23] Green; [23:31] Blue */
+ G2D_ABGR8888 = 7, /* [0:7] Alpha; [8:15] Blue; [16:23] Green; [23:31] Red */
+ G2D_XRGB8888 = 8, /* [0:7] don't care; [8:15] Red; [16:23] Green; [23:31] Blue */
+ G2D_XBGR8888 = 9, /* [0:7] don't care; [8:15] Blue; [16:23] Green; [23:31] Red */
+ G2D_RGB888 = 10, /* [0:7] Red; [8:15] Green; [16:23] Blue */
+ G2D_BGR888 = 11, /* [0:7] Blue; [8:15] Green; [16:23] Red */
+
+ G2D_RGBA5551 = 12, /* [0:4] Red; [5:9] Green; [10:14] Blue; [15] Alpha */
+ G2D_RGBX5551 = 13, /* [0:4] Red; [5:9] Green; [10:14] Blue; [15] don't care */
+ G2D_BGRA5551 = 14, /* [0:4] Blue; [5:9] Green; [10:14] Red; [15] Alpha */
+ G2D_BGRX5551 = 15, /* [0:4] Blue; [5:9] Green; [10:14] Red; [15] don't care */
+
+//yuv formats
+ G2D_NV12 = 20, /* 2 plane 420 format; plane 1: [0:7] Y ; plane 2: [0:7] U; [8:15] V */
+ G2D_I420 = 21, /* 3 plane 420 format; plane 1: [0:7] Y ; plane 2: [0:7] U; plane 3: [0:7] V */
+ G2D_YV12 = 22, /* 3 plane 420 format; plane 1: [0:7] Y ; plane 2: [0:7] V; plane 3: [0:7] U */
+ G2D_NV21 = 23, /* 2 plane 420 format; plane 1: [0:7] Y ; plane 2: [0:7] V; [8:15] U */
+ G2D_YUYV = 24, /* 1 plane 422 format; [0:7] Y; [8:15; U; [16:23] Y; [24:31] V */
+ G2D_YVYU = 25, /* 1 plane 422 format; [0:7] Y; [8:15; V; [16:23] Y; [24:31] U */
+ G2D_UYVY = 26, /* 1 plane 422 format; [0:7] U; [8:15; Y; [16:23] V; [24:31] Y */
+ G2D_VYUY = 27, /* 1 plane 422 format; [0:7] V; [8:15; Y; [16:23] U; [24:31] Y */
+ G2D_NV16 = 28, /* 2 plane 422 format; plane 1: [0:7] Y ; plane 2: [0:7] U; [8:15] V */
+ G2D_NV61 = 29, /* 2 plane 422 format; plane 1: [0:7] Y ; plane 2: [0:7] V; [8:15] U */
+};
+
+enum g2d_tiling
+{
+ G2D_LINEAR = 0x1,
+ G2D_TILED = 0x2,
+ G2D_SUPERTILED = 0x4,
+ G2D_AMPHION_TILED = 0x8,
+ G2D_AMPHION_INTERLACED = 0x10,
+ G2D_TILED_STATUS = 0x20,
+ G2D_AMPHION_TILED_10BIT = 0x40,
+};
+
+struct g2d_tile_status
+{
+ unsigned int ts_addr;
+
+ unsigned int fc_enabled;
+ unsigned int fc_value;
+ unsigned int fc_value_upper;
+};
+
+struct g2d_buf
+{
+ void *buf_handle;
+ void *buf_vaddr;
+ int buf_paddr;
+ int buf_size;
+};
+
+enum g2d_blend_func
+{
+//basic blend
+ G2D_ZERO = 0,
+ G2D_ONE = 1,
+ G2D_SRC_ALPHA = 2,
+ G2D_ONE_MINUS_SRC_ALPHA = 3,
+ G2D_DST_ALPHA = 4,
+ G2D_ONE_MINUS_DST_ALPHA = 5,
+
+// extensive blend is set with basic blend together,
+// such as, G2D_ONE | G2D_PRE_MULTIPLIED_ALPHA
+ G2D_PRE_MULTIPLIED_ALPHA = 0x10,
+ G2D_DEMULTIPLY_OUT_ALPHA = 0x20,
+};
+
+enum g2d_rotation
+{
+ G2D_ROTATION_0 = 0,
+ G2D_ROTATION_90 = 1,
+ G2D_ROTATION_180 = 2,
+ G2D_ROTATION_270 = 3,
+ G2D_FLIP_H = 4,
+ G2D_FLIP_V = 5,
+};
+
+struct g2d_surface
+{
+ enum g2d_format format;
+
+ int planes[3];//surface buffer addresses are set in physical planes separately
+ //RGB: planes[0] - RGB565/RGBA8888/RGBX8888/BGRA8888/BRGX8888
+ //NV12: planes[0] - Y, planes[1] - packed UV
+ //I420: planes[0] - Y, planes[1] - U, planes[2] - V
+ //YV12: planes[0] - Y, planes[1] - V, planes[2] - U
+ //NV21: planes[0] - Y, planes[1] - packed VU
+ //YUYV: planes[0] - packed YUYV
+ //YVYU: planes[0] - packed YVYU
+ //UYVY: planes[0] - packed UYVY
+ //VYUY: planes[0] - packed VYUY
+ //NV16: planes[0] - Y, planes[1] - packed UV
+ //NV61: planes[0] - Y, planes[1] - packed VU
+
+ //blit rectangle in surface
+ int left;
+ int top;
+ int right;
+ int bottom;
+ int stride; ///< buffer stride, in Pixels
+ int width; ///< surface width, in Pixels
+ int height; ///< surface height, in Pixels
+ enum g2d_blend_func blendfunc; ///< alpha blending parameters
+ int global_alpha; ///< value is 0 ~ 255
+ //clrcolor format is RGBA8888, used as dst for clear, as src for blend dim
+ int clrcolor;
+
+ //rotation degree
+ enum g2d_rotation rot;
+};
+
+struct g2d_surfaceEx
+{
+ struct g2d_surface base;
+ enum g2d_tiling tiling;
+
+ struct g2d_tile_status ts;
+ int reserved[8];
+};
+
+void *dl_handle = NULL;
+
+typedef int (*g2d_api_open)(void **handle);
+typedef int (*g2d_api_close)(void *handle);
+typedef int (*g2d_api_free)(struct g2d_buf *buf);
+typedef struct g2d_buf* (*g2d_api_alloc)(int size, int cacheable);
+typedef int (*g2d_api_buf_export_fd)(struct g2d_buf *);
+typedef int (*g2d_api_blitEx)(void *handle, struct g2d_surfaceEx *srcEx, struct g2d_surfaceEx *dstEx);
+
+#define G2D_LIB_NAME "/usr/lib/libg2d.so.2"
+#define G2D_API_SYM(name) g2d_api_##name g2d_##name = nullptr
+G2D_API_SYM(open);
+G2D_API_SYM(close);
+G2D_API_SYM(free);
+G2D_API_SYM(alloc);
+G2D_API_SYM(buf_export_fd);
+G2D_API_SYM(blitEx);
+#undef G2D_API_SYM
+/* g2d.h g2dExt.h */
+
V4L2ExtCtrl::V4L2ExtCtrl(uint32_t id) {
memset(&ctrl, 0, sizeof(ctrl));
ctrl.id = id;
@@ -1221,6 +1375,31 @@ V4L2Queue::V4L2Queue(const IoctlAsCallback& ioctl_cb,
<< "This queue does " << (supports_requests_ ? "" : "not")
<< " support requests.";
+ if (dl_handle == NULL) {
+ dl_handle = dlopen(G2D_LIB_NAME,
+ RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE | RTLD_LAZY);
+ if (!dl_handle) {
+ VLOGF(1) << "Failed to dlopen " << G2D_LIB_NAME;
+ return;
+ }
+
+#define G2D_API_DLSYM(lib, name) \
+ do { \
+ g2d_##name = reinterpret_cast<g2d_api_##name>(dlsym(lib, "g2d_" #name)); \
+ if (!(g2d_##name)) \
+ VLOGF(1) << "Failed to dlsym g2d_" #name; \
+ } while (0)
+
+ G2D_API_DLSYM(dl_handle, open);
+ G2D_API_DLSYM(dl_handle, close);
+ G2D_API_DLSYM(dl_handle, free);
+ G2D_API_DLSYM(dl_handle, alloc);
+ G2D_API_DLSYM(dl_handle, buf_export_fd);
+ G2D_API_DLSYM(dl_handle, blitEx);
+
+ dlclose(dl_handle);
+ }
+
g2d_handle = NULL;
if(g2d_open && g2d_open(&g2d_handle))
VLOGF(1) << "g2d_open fail";
--
2.25.1

View File

@@ -0,0 +1,71 @@
From 4a730e50db3f7d845d667f7b07104d4d8a068baa Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Mon, 6 Nov 2023 17:31:56 +0900
Subject: [PATCH 119/120] V4L2VDA: Add back legacy VideoDecoderType kVda
Upstream-Status: Inappropriate [NXP specific]
---
.../services/gpu_mojo_media_client_linux.cc | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/media/mojo/services/gpu_mojo_media_client_linux.cc b/media/mojo/services/gpu_mojo_media_client_linux.cc
index 1cde275dac..9f11a10e0a 100644
--- a/media/mojo/services/gpu_mojo_media_client_linux.cc
+++ b/media/mojo/services/gpu_mojo_media_client_linux.cc
@@ -13,6 +13,7 @@
#include "media/gpu/chromeos/mailbox_video_frame_converter.h"
#include "media/gpu/chromeos/platform_video_frame_pool.h"
#include "media/gpu/chromeos/video_decoder_pipeline.h"
+#include "media/gpu/ipc/service/vda_video_decoder.h"
namespace media {
@@ -35,6 +36,10 @@ VideoDecoderType GetPreferredLinuxDecoderImplementation() {
break;
}
+ if (!base::FeatureList::IsEnabled(kUseChromeOSDirectVideoDecoder)) {
+ return VideoDecoderType::kVda;
+ }
+
#if BUILDFLAG(USE_VAAPI)
return VideoDecoderType::kVaapi;
#elif BUILDFLAG(USE_V4L2_CODEC)
@@ -67,6 +72,11 @@ VideoDecoderType GetActualPlatformDecoderImplementation(
return VideoDecoderType::kUnknown;
case VideoDecoderType::kOutOfProcess:
return VideoDecoderType::kOutOfProcess;
+ case VideoDecoderType::kVda: {
+ return gpu_preferences.gr_context_type == gpu::GrContextType::kGL
+ ? VideoDecoderType::kVda
+ : VideoDecoderType::kUnknown;
+ }
case VideoDecoderType::kV4L2:
return VideoDecoderType::kV4L2;
case VideoDecoderType::kVaapi: {
@@ -168,6 +178,13 @@ class GpuMojoMediaClientLinux final : public GpuMojoMediaClient {
traits.media_log->Clone(), /*oop_video_decoder=*/{},
/*in_video_decoder_process=*/false);
}
+ case VideoDecoderType::kVda: {
+ return VdaVideoDecoder::Create(
+ traits.task_runner, gpu_task_runner_, traits.media_log->Clone(),
+ *traits.target_color_space, gpu_preferences_,
+ gpu_workarounds_, traits.get_command_buffer_stub_cb,
+ VideoDecodeAccelerator::Config::OutputMode::kAllocate);
+ }
default:
return nullptr;
}
@@ -198,6 +215,8 @@ class GpuMojoMediaClientLinux final : public GpuMojoMediaClient {
base::UmaHistogramEnumeration("Media.VaapiLinux.SupportedVideoDecoder",
decoder_implementation);
switch (decoder_implementation) {
+ case VideoDecoderType::kVda:
+ return std::move(get_vda_configs).Run();
case VideoDecoderType::kOutOfProcess:
case VideoDecoderType::kVaapi:
case VideoDecoderType::kV4L2:
--
2.25.1

View File

@@ -0,0 +1,40 @@
From f8ef4fca6fc488019a00218a370131e8e011f393 Mon Sep 17 00:00:00 2001
From: Hou Qi <qi.hou@nxp.com>
Date: Wed, 29 Nov 2023 11:00:59 +0900
Subject: [PATCH 120/120] V4L2Buffer: Add support for imx95
Imx95 allocate capture buffers using NV12 format, while
amphion allocate capture buffers using NV12M format.
Upstream-Status: Inappropriate [NXP specific]
---
media/gpu/v4l2/v4l2_queue.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/media/gpu/v4l2/v4l2_queue.cc b/media/gpu/v4l2/v4l2_queue.cc
index f717f945ee..7b37b874fa 100644
--- a/media/gpu/v4l2/v4l2_queue.cc
+++ b/media/gpu/v4l2/v4l2_queue.cc
@@ -559,7 +559,8 @@ scoped_refptr<VideoFrame> V4L2Buffer::CreateVideoFrame() {
}
std::vector<base::ScopedFD> g2dbufs_fds;
- if (V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type)) {
+ if (V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type) &&
+ format_.fmt.pix_mp.pixelformat == V4L2_PIX_FMT_NV12M_8L128) {
struct dma_buf_phys{
unsigned long phys;
};
@@ -626,7 +627,8 @@ scoped_refptr<VideoFrame> V4L2Buffer::CreateVideoFrame() {
dmabuf_fds.emplace_back(duped_fd);
}
- if (V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type)) {
+ if (V4L2_TYPE_IS_MULTIPLANAR(v4l2_buffer_.type) &&
+ format_.fmt.pix_mp.pixelformat == V4L2_PIX_FMT_NV12M_8L128) {
gfx::Size size(format_.fmt.pix_mp.width, format_.fmt.pix_mp.height);
return VideoFrame::WrapExternalDmabufs(
*layout, gfx::Rect(size), size, std::move(g2dbufs_fds), base::TimeDelta());
--
2.25.1

View File

@@ -0,0 +1,88 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
#
# "0001-chromium-gpu-sandbox-allow-access-to-PowerVR-GPU-fro.patch" based
# on original patch and configuration by Texas Instruments, found in
# https://git.ti.com/cgit/arago-project/meta-arago/
#
# The patch was verified to work on Chromium versions
# 126.0.6478.126 to 129.0.6668.100.
#
# The bbappend does not limit it to a specific version, as
# meta-browser-chromium is updated too frequently, and the patch will
# usually apply just fine to newer versions as well (and working around a
# non-applicable patch using :remove is easier than working around a
# non-applicable bbappend).
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
CHROMIUM_EXTRA_ARGS:remove:dumpling-wayland-ti = " --use-gl=egl"
CHROMIUM_EXTRA_ARGS:append:dumpling-wayland-ti = " --use-gl=angle"
SRC_URI:append:dumpling-wayland-ti = " \
file://0001-chromium-gpu-sandbox-allow-access-to-PowerVR-GPU-fro.patch \
"
SRC_URI:append:imx-nxp-bsp = " \
file://0001-Fixed-chromium-flicker-with-g2d-renderer.patch \
file://0002-chromium-met-EGL-API-GetProcAddress-failures.patch \
file://0003-Disable-dri-for-imx-gpu.patch \
file://0004-Fix-chromium-build-failure.patch \
file://0006-Fixed-chromium-crash-after-upgrading.patch \
"
VDA_PATCH_SET = " \
file://0101-V4L2VDA-Switch-to-use-VDA-instead-of-direct-VideoDec.patch \
file://0102-GenericV4L2Device-Correct-v4l2-decoder-device-path.patch \
file://0103-V4L2VDA-Add-macro-use_linux_v4l2.patch \
file://0104-V4L2VDA-Create-single-multi-plane-queues.patch \
file://0105-V4L2Buffer-Allocate-correct-v4l2-buffers-for-queues.patch \
file://0106-V4L2VDA-Create-videoframe-according-to-v4l2buffer.patch \
file://0107-V4L2VDA-Add-function-IsMultiQueue-for-S_FMT-and-G_FM.patch \
file://0108-V4L2VDA-Use-correct-size-to-allocate-CAPTURE-buffer.patch \
file://0109-V4L2VDA-Use-correct-plane-size-and-bytesused.patch \
file://0110-V4L2VDA-Add-hevc-format-support.patch \
file://0111-V4L2VDA-fix-vp9-crash-caused-by-DequeueResolutionCha.patch \
file://0112-V4L2VDA-Add-fps-in-SkiaOutputSurfaceImplOnGpu-by-VLO.patch \
file://0113-V4L2VDA-Comment-some-unused-ioctl.patch \
file://0114-V4L2VDA-Set-OUTPUT-format-with-parsed-resolution-for.patch \
file://0115-V4L2VDA-Add-V4L2_PIX_FMT_NV12M_8L128-format-for-amph.patch \
file://0116-V4L2VDA-Support-tile-to-linear-transform-for-amphion.patch \
file://0117-V4L2VDA-Enlarge-input-buffer-count-to-16.patch \
file://0118-V4L2VDA-Use-dlopen-to-dynamically-use-g2d-api.patch \
file://0119-V4L2VDA-Add-back-legacy-VideoDecoderType-kVda.patch \
file://0120-V4L2Buffer-Add-support-for-imx95.patch \
"
SRC_URI:append:mx8-nxp-bsp = " ${VDA_PATCH_SET}"
SRC_URI:append:mx95-nxp-bsp = " ${VDA_PATCH_SET}"
GN_ARGS_DISABLE_GBM = ""
GN_ARGS_DISABLE_GBM:mx6-nxp-bsp = "use_system_minigbm=false use_wayland_gbm=false"
GN_ARGS_DISABLE_GBM:mx7-nxp-bsp = "${GN_ARGS_DISABLE_GBM:mx6-nxp-bsp}"
GN_ARGS_USE_IMXGPU = "use_imxgpu=false"
GN_ARGS_USE_IMXGPU:imxgpu = "use_imxgpu=true"
GN_ARGS_ENABLE_PROPRIETARY_CODECS = ""
GN_ARGS_FFMPEG_BRANDING = ""
GN_ARGS_USE_V4L2_CODEC = ""
GN_ARGS_USE_V4L2_CODEC:mx8-nxp-bsp = "use_v4l2_codec=true"
GN_ARGS_USE_V4L2_CODEC:mx95-nxp-bsp = "use_v4l2_codec=true"
GN_ARGS_USE_LINUX_V4L2_ONLY = ""
GN_ARGS_USE_LINUX_V4L2_ONLY:mx8-nxp-bsp = "use_linux_v4l2_only=true"
GN_ARGS_USE_LINUX_V4L2_ONLY:mx95-nxp-bsp = "use_linux_v4l2_only=true"
GN_ARGS:append:imx-nxp-bsp = " \
${GN_ARGS_DISABLE_GBM} \
${GN_ARGS_USE_IMXGPU} \
${GN_ARGS_ENABLE_PROPRIETARY_CODECS} \
${GN_ARGS_FFMPEG_BRANDING} \
${GN_ARGS_USE_V4L2_CODEC} \
${GN_ARGS_USE_LINUX_V4L2_ONLY} \
"
CHROMIUM_EXTRA_ARGS:append:imx-nxp-bsp = " --disable-features=VizDisplayCompositor --in-process-gpu --disable-gpu-rasterization"
#Remove installed ANGLE libraries
do_install:append:imx-nxp-bsp() {
rm -rf ${D}${libdir}/chromium/libEGL.so
rm -rf ${D}${libdir}/chromium/libGLESv2.so
rm -rf ${D}${libdir}/chromium/libvulkan.so.1
}

View File

@@ -0,0 +1,10 @@
# from meta-freescale
MACHINE_GSTREAMER_1_0_PLUGIN ?= ""
# plugins depending on the machine SOC
RDEPENDS:${PN}-base += "\
${MACHINE_GSTREAMER_1_0_PLUGIN} \
${@bb.utils.contains("MACHINE_GSTREAMER_1_0_PLUGIN", "imx-gst1.0-plugin", "imx-gst1.0-plugin-gplay", "", d)} \
${@bb.utils.contains("MACHINE_GSTREAMER_1_0_PLUGIN", "imx-gst1.0-plugin", "imx-gst1.0-plugin-grecorder", "", d)} \
"

View File

@@ -0,0 +1,13 @@
require tq-image-qt6.bb
require recipes-images/images/tq-image-debug.inc
SUMMARY = "This is a Qt6 image for TQ SOM with test and debug features."
DESCRIPTION = "Demo image based on tq-image-qt6 and selection of packages \
and IMAGE_FEATURES usually needed for development, debugging and testing. \
This creates a fairly large image, that must not be used for production - \
especially from the aspect of security."
IMAGE_INSTALL += "\
packagegroup-qt6-demos \
"

View File

@@ -0,0 +1,13 @@
require recipes-images/images/tq-image-weston.bb
inherit populate_sdk_qt6
SUMMARY = "This is a weston image for TQ SOM with some test features and basic Qt6 support."
DESCRIPTION = "Demo image based on tq-image-weston and Qt6. \
This creates a large image and includes also test tools, not \
directly suitable for production - also from the aspect of security."
IMAGE_INSTALL += "\
packagegroup-qt6-libs \
"

View File

@@ -0,0 +1,32 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2020-2023 TQ-Systems GmbH <oss@ew.tq-group.com>,
# D-82229 Seefeld, Germany.
# Author: Markus Niebel
DESCRIPTION = "Package group for Qt6 demos"
LICENSE = "MIT"
#
# Config of Qt may depend on MACHINE and/or MACHINE_FEATURES
# See bbappend for qtbase in meta-freescale and PACKAGE_ARCH assignments in
# packagegroup recipes im meta-qt6
#
PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit packagegroup
RDEPENDS:${PN} = "\
packagegroup-qt6-libs \
qtbase-examples \
qtmultimedia-examples \
"
QT6_OPENGL_DEMOS ="\
qt3d-examples \
qtquick3d-examples \
"
RDEPENDS:${PN} += "\
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', "${QT6_OPENGL_DEMOS}", '', d)} \
"

View File

@@ -0,0 +1,41 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2020-2024 TQ-Systems GmbH <oss@ew.tq-group.com>,
# D-82229 Seefeld, Germany.
# Author: Markus Niebel
DESCRIPTION = "Package group for Qt6 librararies"
LICENSE = "MIT"
#
# Config of Qt may depend on MACHINE and/or MACHINE_FEATURES
# See bbappend for qtbase in meta-freescale and PACKAGE_ARCH assignments in
# packagegroup recipes im meta-qt6
#
PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit packagegroup
RDEPENDS:${PN} = "\
packagegroup-qt6-essentials \
qtbase-plugins \
qtmultimedia \
"
RDEPENDS:${PN} += "\
ttf-dejavu-sans \
ttf-dejavu-sans-condensed \
ttf-dejavu-sans-mono \
ttf-dejavu-serif \
ttf-dejavu-serif-condensed \
ttf-dejavu-mathtexgyre \
ttf-dejavu-common \
"
RDEPENDS:${PN} += "\
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', "qtwayland qtwayland-plugins", '', d)} \
"
RDEPENDS:${PN} += "\
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', "qt3d qtquick3d qtquick3d-dev", '', d)} \
"

View File

@@ -0,0 +1,7 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2023 TQ-Systems GmbH <oss@ew.tq-group.com>,
# D-82229 Seefeld, Germany.
# Author: Markus Niebel
PACKAGECONFIG:append:class-target = " examples"

View File

@@ -0,0 +1,34 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2023 TQ-Systems GmbH <oss@ew.tq-group.com>,
# D-82229 Seefeld, Germany.
# Author: Markus Niebel
PACKAGECONFIG:append:class-target = " examples"
# From meta-freescale: linuxfb missing in meta-freescale for imx91 / imx93
# current linuxfb plugin can handle DRM framebuffer, too
PACKAGECONFIG_GRAPHICS:imxpxp += "\
linuxfb \
"
# From meta-freescale: we want eglfs QPA plugin even when we have wayland
# and / or X11. This way we can use this for testing without display server
# based on MACHINEOVERRIDES for imx:
PACKAGECONFIG_PLATFORM_EGLFS:imxgpu3d += "eglfs"
# From meta-freescale: we want eglfs and linuxfb QPA plugin even when we have
# wayland and / or X11. This way we can use this for testing without
# display server
PACKAGECONFIG_GRAPHICS:use-mainline-bsp += "\
linuxfb \
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'eglfs', '', d)} \
"
# collect everything we expect from libs on system
# it is better to use these libs than to rely on the builtin versions
# if Qt provides such.
PACKAGECONFIG_SYSTEM += "\
mtdev \
tslib \
"

View File

@@ -0,0 +1,7 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2023 TQ-Systems GmbH <oss@ew.tq-group.com>,
# D-82229 Seefeld, Germany.
# Author: Markus Niebel
PACKAGECONFIG:append:class-target = " examples"

View File

@@ -0,0 +1,7 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2023 TQ-Systems GmbH <oss@ew.tq-group.com>,
# D-82229 Seefeld, Germany.
# Author: Markus Niebel
PACKAGECONFIG:append:class-target = " examples"

View File

@@ -0,0 +1,7 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2023 TQ-Systems GmbH <oss@ew.tq-group.com>,
# D-82229 Seefeld, Germany.
# Author: Markus Niebel
PACKAGECONFIG:append:class-target = " examples"

View File

@@ -0,0 +1,30 @@
-----BEGIN CERTIFICATE-----
MIIFETCCAvmgAwIBAgIUJHHkhqzO24Jgafn0ISfXwYyJc48wDQYJKoZIhvcNAQEL
BQAwFzEVMBMGA1UEAwwMcmF1Yy1leGFtcGxlMCAXDTI0MTIxMjA5NTkxNVoYDzIx
MjQxMjEzMDk1OTE1WjAXMRUwEwYDVQQDDAxyYXVjLWV4YW1wbGUwggIiMA0GCSqG
SIb3DQEBAQUAA4ICDwAwggIKAoICAQC20YAJLo+km06dzHE+mhT7TwNukByrTH7J
koPEnLStCLmLnONjOEXi0ji2ejkSwayJ4JVuDc66GcpBZcPGAJSbJDoEpppgYs1u
Kl/8i71EDuVyo/u2M1Gar0oijvoMriMdhCBKaXuMo/Saummhyh1J9mBKHBQRUP9y
LFH/FPlp/IpO0idcps14EiIJocxSALzpfDF64UrKoSEv9ZQ8MFWlG1k/8plEnQuz
xDW8subdZ4iTDCIkmpIVrnGVYWdR12YPlPgY8FMNuEqLKaBlqq84wtPFYMje2KGV
oFkI9xu+fHPW9Y+/veTqNiM7sYESxP6q6EUykaPWQLg0KNBgl8OCyoOhVXY3Qlfx
6cMp8rD2sleFW4zqgoOIHpqFBXKCI6JJSFSSu+q8uFDcsDe1xWPLaHHGtyBur1p1
CbfsAhvI8vmVoVi2YcybjUfYSw+4FBviNN2uCsIIX0SDerm9TvDByYr3UFoFIZOG
4N8f/9GxL16OPmtirBM+7hyMOpjwKxatGPg6Tg5ByHHwaaUzMMyNCOZyY3LbnMuV
BWdGKnV0vn/34nfmAks4E7MxgUJ+YAv3LbBGeYOOagi6fqo+r2V+SCCf31+ODtkv
tb33Gy+BAhhR9tSsPZP97QDr0aTUiZ1Pm+ARFp8aIbBbSwdmsKKEXrcxRiuCGFWn
xHci9vaVbQIDAQABo1MwUTAdBgNVHQ4EFgQUWNiJ4f9cmP91OsiY41IqMxUKFUUw
HwYDVR0jBBgwFoAUWNiJ4f9cmP91OsiY41IqMxUKFUUwDwYDVR0TAQH/BAUwAwEB
/zANBgkqhkiG9w0BAQsFAAOCAgEAdtsvSZKeu/r5yP9WddQ9NrhLYAZyhNwiZMYh
OBYKMFDI1BjiaXxWfxb8xRZ4b88UJA8PCGX5eHh02+GFfYx7RGNa0A9/MucQS9lw
27OfTqvIJJ9irNqRP+i1d11MelCK/hrVnLfu8OnRUY5KxIGb9yXCx9zWwxNfzpDE
ElaAYVE/2e2HV90Tb3gU5esEqmy4XP93u4XEzHV9ZqDUX60Plp4ZV6nyLeNEZfNY
lODZ8dLIxGShf5xAfgP+yC/YBt7atBZb/qxWcJKheBdPokkmzxUQ+vLklJngnjnl
m1k2gwRnr5WxcHrZOVqf5cmKxwUG/YNytMti5tKKwGrMnsZHvTsxXW5Z5jBKvqqM
Z7cWwp0Kld4tG2rxl79skouYHjiAJJKC+vDDl2xPLoPNOlffod9K4Tkep2/PpIye
cHS7atCmX5MdGQfcKD+diPYAZpEvIhwF4NfWx0NTydMJ6B3ppk2lXk6I4xcmZ9fE
Gp8VtgbMamiYrBDyJC+6j6O48OnpCdhMu3z48U8Qhghf5OW1lfheEsJ7XWgYj8kB
swABGHeGuo49AGX+mu3DAfjjNJNsN/sFUfBqzAFEMINOZPIIxdROBAWoVA54ISw+
JNCH+2bMqqI6I9ZFyzEbXTRW1mzzlFQdXLq+d6cAS1fjYew37MIiPvgjLqRNro0T
7cSy9tE=
-----END CERTIFICATE-----

View File

@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQC20YAJLo+km06d
zHE+mhT7TwNukByrTH7JkoPEnLStCLmLnONjOEXi0ji2ejkSwayJ4JVuDc66GcpB
ZcPGAJSbJDoEpppgYs1uKl/8i71EDuVyo/u2M1Gar0oijvoMriMdhCBKaXuMo/Sa
ummhyh1J9mBKHBQRUP9yLFH/FPlp/IpO0idcps14EiIJocxSALzpfDF64UrKoSEv
9ZQ8MFWlG1k/8plEnQuzxDW8subdZ4iTDCIkmpIVrnGVYWdR12YPlPgY8FMNuEqL
KaBlqq84wtPFYMje2KGVoFkI9xu+fHPW9Y+/veTqNiM7sYESxP6q6EUykaPWQLg0
KNBgl8OCyoOhVXY3Qlfx6cMp8rD2sleFW4zqgoOIHpqFBXKCI6JJSFSSu+q8uFDc
sDe1xWPLaHHGtyBur1p1CbfsAhvI8vmVoVi2YcybjUfYSw+4FBviNN2uCsIIX0SD
erm9TvDByYr3UFoFIZOG4N8f/9GxL16OPmtirBM+7hyMOpjwKxatGPg6Tg5ByHHw
aaUzMMyNCOZyY3LbnMuVBWdGKnV0vn/34nfmAks4E7MxgUJ+YAv3LbBGeYOOagi6
fqo+r2V+SCCf31+ODtkvtb33Gy+BAhhR9tSsPZP97QDr0aTUiZ1Pm+ARFp8aIbBb
SwdmsKKEXrcxRiuCGFWnxHci9vaVbQIDAQABAoICAFilxJpvL+rm/huJL15mM4da
nHTnv2cWvCH9ABT90aRX5zS6Gg6aElU2j5Z4NKWSMRpYQs0vN89Iwyir8l7YGDcU
PWfU62WScz+Yn5ujnN5cBMlul5cVUlwZ5G5WewxcAh4FW+0JMgYT2H+Qpbj0evhK
1g0JiXeOGZegww/X+Ur50I0A3WJRZa9zx3p5MMyQnAnxlUKa7PvNXvzU7ZCz9UuO
s9vMxKIfLrX4DgCWlVjFo9V93C54nx6RTHVdWk62jkA/AYCCRBuSgd7yC9tQhQ+W
dT6vvCdGzy9xJcsxm4vl5/vTbeVRbKdfIf2HiGl0CXMRFsC7G0FAd7GfGs/Dt2Kp
7ESBi2x5k9LluDhFNSirkVi9MNcvligRm3Y4TPUkIs71CW+VzBxj+SW0y+lhZfne
ts215dJqNTJWaoGNQ0B4fIQW6pnYk+RcjX0HCzp9YFdE+M5eM3GqwFLy6bXSyfTJ
Xss+xQAm4eadR/awPIxErRVvRJzj2/6mDa1nPDZfN+ZAmMjLDk7L9vISXxy8lWTK
nfcQlZM2B+2UliILouNiYT4rdYKdi2WV6hisOKPcflehfuO7ylu5k5KxnftDPhnD
Pc3j4YAQxgofWFoCRuVyIz6SmlrtOXjh700SHLHX2l1Zf1Qis5D1jlGfY57qX+yc
NpjnNXQoVNc7zg0G5r/3AoIBAQDfWeEGBJEg28CViDEVE/D/A7GL+i8g8En70O27
nEDe4vtI5Vjw0OB+diAQlAMsnXqZAUSTeiFvbXf0ZuT3Oc8XQ1TRpKQOXcBw1SNQ
DOORO2PYBLfFRRmH7nlLlbR/wfCbyhbkn/MR3dHhlz1f+yRFxVOfpMuUh0wyNuyA
msZ/M64PmALzfbxHtuW4oQa+GO3+Trun1w73u6uCDxv+cVybIXHCOjRekbppTdL8
zOCfAkc0pVyldDpBnNhnlmMN3CgYG2yS6iVtVqENyCVRs+SiitHag+H5yT1oy7sK
rUReodHh7H7MUIgogiuw8BL3Ya3lG6jqh7wlndgrYk8dpT/LAoIBAQDRitPmQJv+
HCDBAqiN6g1slOUz8oMNRNSp6RgroWO1z2+C0RYOXntTm8BbnqMfiWAt3iLC7pA9
veHWeINZSoBsfXvN4ZrLB+2NG+39qdJeGH7/H0Ua5QrsBfriZGoFr5eEWSI1KcbB
zl6oea6jkOVxiWP1pQhcOAwgFn6bIVl3gYaaYA5VympYPYx/28sSjRJIcVSmR6Nz
ZrtzOiTVNCBoxcpTCw8OyBEVYhDOEgnODedRNGgiGGU3bEFttTMeaPC9FpZyjiHc
5GY6rAWWrQoIMtTGG4FJeu027nDWWv3jESKkGECVn2Rx+3xOpJcleLyhi9z+TH15
5+EOwvt7zuinAoIBAQCAkh6k9jAM+DNOYM3QUmBijF/CMky661fLa6POYc49/++j
MNMYHUV9xsYChRGmtyiBt2cgdieVGzD4MdsQLej2fT3wSJRf6LwEt8zSIflF+ygo
i9614mcmBrMwPYdgG+ZD5/txtFmaKVTORd+AxvNEbqkKtzSx1YiZR2CxT2eAheFm
/JyGShT+O1zWAWv+Nh+aSvxfS79EAHZkMgptWBh0/LWdlx/aaI0kXTZdbBrJregL
eD1yyQtYBc/VIY73xYoXBoJjuAG/hSTE6DgDZkjxAHR5E34b6io9jzmmlcNLrl9B
bIA5YQpgNz6rZiek3EfcISYFjAlUph5wKvFcIWotAoIBAD+4ILG+6fC+6vLmdQ0a
pFRlfsFqOJHbYXP9rtztqd2Ko9U68aMS9hu5nCgAOIiJhNbN2vI+C1zLFhba9M49
SoozKmez+BdPZNxpJtjhQFheyJeaEbCY/9ZAB0e600bBW6jiVfWmq4sZz00aG5If
qLX62ovDUKSCYqWLUZqo7ITbvWvKU/GgqPAGX2guFTWh8nJXDC+4TyrzjYL/pl2z
CTvzEZBpJ34ONquy83tGnvaq4bGe5x+fHYBaChdrZ40SykolyUAymneKeM/Uqapl
Gkzd8DgB+zG2ENaIcYWti9D1z/voaBNXsfq7R9S+VjwN2Aaj+mLWLb3ZVmXfwwum
IrcCggEANb++yV2dspk5UjLIgCdvzrQeX7qZw3XCjT5f25Z9bHY+8yfnKGj6i8rV
takaIFTTMpXJ2wALi0adhJUwdHFVyVaG/e3riX4qNFN0mYVAQOsrqoM54WHj9T98
ahmPJ7BiF4Lfmb0VZg3UH2geUP+0rgq6rDSwct/eVfC+gh6zfehP3jHnj+r/NuoB
seihKfQeFIsa/0Kl2Akcj+A1BP7NbWEP7E8km9+oCgBXPbIKT7/Wr/K6tuTZtNBv
d+o5PdLWgUvnyEzv29SVo+ItinpiI5CRu0yRyCbsvFRzgMa1468Rb9alKsIWZyWR
/AT+R1QirSxJqyHwghAo8L34W1RlYA==
-----END PRIVATE KEY-----

View File

@@ -0,0 +1,47 @@
#!/bin/sh
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
set -e
RUNTIME_CONFIG=/run/tq/rauc/system.conf
get_root_dev () {
findmnt --evaluate --first-only --noheadings --output SOURCE --mountpoint /
}
get_config_suffix () {
case "$(get_root_dev)" in
/dev/mmcblk0p*)
echo mmc0
;;
/dev/mmcblk1p*)
echo mmc1
;;
ubi0:*)
echo spi
;;
esac
}
get_system_config () {
echo "/etc/rauc/system.conf-$(get_config_suffix)"
}
main () {
local config
config=$(get_system_config)
if ! [ -r "$config" ]; then
config=/dev/null
fi
mkdir -p "$(dirname "$RUNTIME_CONFIG")"
ln -sfn "$config" "$RUNTIME_CONFIG"
}
main "$@"

View File

@@ -0,0 +1,22 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
[system]
compatible=@RAUC_BUNDLE_COMPATIBLE@
bootloader=uboot
bundle-formats=-plain
[keyring]
path=@RAUC_KEYRING_FILE@
[slot.rootfs.0]
device=/dev/mmcblk0p2
type=ext4
bootname=A
[slot.rootfs.1]
device=/dev/mmcblk0p3
type=ext4
bootname=B

View File

@@ -0,0 +1,22 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
[system]
compatible=@RAUC_BUNDLE_COMPATIBLE@
bootloader=uboot
bundle-formats=-plain
[keyring]
path=@RAUC_KEYRING_FILE@
[slot.rootfs.0]
device=/dev/mmcblk1p2
type=ext4
bootname=A
[slot.rootfs.1]
device=/dev/mmcblk1p3
type=ext4
bootname=B

View File

@@ -0,0 +1,8 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
[Unit]
Wants=tq-rauc-conf.service
After=tq-rauc-conf.service

View File

@@ -0,0 +1,17 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
[Unit]
Description=RAUC system.conf selection
DefaultDependencies=no
Before=sysinit.target
[Service]
ExecStart=@LIBEXECDIR@/tq/rauc-conf.sh
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target

View File

@@ -0,0 +1,30 @@
inherit bundle
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
RAUC_KEY_URI ??= "file://${RAUC_KEY_FILE}"
RAUC_CERT_URI ??= "file://${RAUC_CERT_FILE}"
RAUC_KEYRING_URI ??= "file://${RAUC_KEYRING_FILE}"
SRC_URI = " \
${RAUC_KEY_URI} \
${RAUC_CERT_URI} \
${RAUC_KEYRING_URI} \
"
RAUC_BUNDLE_FORMAT = "verity"
RAUC_BUNDLE_SLOTS = "rootfs"
# Smaller bundles can be achieved using a more modern compression algorithm like XZ or ZSTD
RAUC_SLOT_rootfs ?= "tq-image-generic-debug"
RAUC_SLOT_rootfs[fstype] ?= "tar.gz"
do_bundle:prepend () {
(
cd "${WORKDIR}" && for file in "${RAUC_KEY_FILE}" "${RAUC_CERT_FILE}" "${RAUC_KEYRING_FILE}"; do
mkdir -p "$(dirname "${B}/${file}")"
cp "${file}" "${B}/${file}"
done
)
}

View File

@@ -0,0 +1,69 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
#
# Based on rauc-conf.bb from meta-rauc.
SUMMARY = "RAUC system configuration & verification keyring (TQ example config)"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
RAUC_KEYRING_URI ??= "file://${RAUC_KEYRING_FILE}"
RDEPENDS:${PN} += "util-linux-findmnt"
RPROVIDES:${PN} += "virtual-rauc-conf"
INHIBIT_DEFAULT_DEPS = "1"
do_compile[noexec] = "1"
RAUC_SYSTEM_CONF_VARIANTS = "mmc0 mmc1"
SRC_URI = " \
${RAUC_KEYRING_URI} \
file://rauc-conf.sh \
file://system.conf-mmc0 \
file://system.conf-mmc1 \
file://tq-rauc-conf.conf \
file://tq-rauc-conf.service \
"
inherit systemd update-rc.d
SYSTEMD_SERVICE:${PN} = "tq-rauc-conf.service"
INITSCRIPT_NAME = "tq-rauc-conf.sh"
INITSCRIPT_PARAMS = "start 10 S ."
do_install () {
install -d "${D}${sysconfdir}/rauc"
install -m 0644 "${WORKDIR}/${RAUC_KEYRING_FILE}" "${D}${sysconfdir}/rauc/"
ln -s /run/tq/rauc/system.conf "${D}${sysconfdir}/rauc/system.conf"
for variant in ${RAUC_SYSTEM_CONF_VARIANTS}; do
install -m 0644 "${WORKDIR}/system.conf-${variant}" "${D}${sysconfdir}/rauc/"
sed -i \
-e "s!@RAUC_BUNDLE_COMPATIBLE@!${RAUC_BUNDLE_COMPATIBLE}!g" \
-e "s!@RAUC_KEYRING_FILE@!$(basename "${RAUC_KEYRING_FILE}")!g" \
"${D}${sysconfdir}/rauc/system.conf-${variant}"
done
install -Dm 0755 "${WORKDIR}/rauc-conf.sh" "${D}${libexecdir}/tq/rauc-conf.sh"
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/init.d/
ln -s ${libexecdir}/tq/rauc-conf.sh ${D}${sysconfdir}/init.d/tq-rauc-conf.sh
fi
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -Dm 0644 "${WORKDIR}/tq-rauc-conf.service" "${D}${systemd_system_unitdir}/tq-rauc-conf.service"
sed -i -e "s,@LIBEXECDIR@,${libexecdir},g" "${D}${systemd_system_unitdir}/tq-rauc-conf.service"
install -Dm 0644 "${WORKDIR}/tq-rauc-conf.conf" "${D}${systemd_system_unitdir}/rauc.service.d/10-tq-rauc-conf.conf"
install -Dm 0644 "${WORKDIR}/tq-rauc-conf.conf" "${D}${systemd_system_unitdir}/rauc-mark-good.service.d/10-tq-rauc-conf.conf"
fi
}
FILES:${PN} += "${systemd_system_unitdir}"
PACKAGE_ARCH = "${MACHINE_ARCH}"

View File

@@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDIzCCAgugAwIBAgIURp95PIHriTQyGn+2DgSp7rpMyuEwDQYJKoZIhvcNAQEL
BQAwITEfMB0GA1UEAwwWVFEtU3lzdGVtcyBFeGFtcGxlIEtleTAeFw0yNTAxMTYx
MzE1NThaFw00NTAxMTYxMzE1NThaMCExHzAdBgNVBAMMFlRRLVN5c3RlbXMgRXhh
bXBsZSBLZXkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQChSuMGYGIf
UVCbTpDRcGQ/4WCSG3QZKx91SV4OQz+ZYB8q68AGnkBc+YoRSapj0p1xCL0063jE
hmouA6V+qDw6OiyreF05zv9nzd0tzYlZkLJJ5YjiW3a6plA0G/EZg0xWTJWm64l1
oNb7Fo6OwU9INmYjHn3LKvJj2J1qfqapjmBIZaj6d+pOHQMqlr2ba+l2IoqbT9Sf
onLERqlfPYVNrjmZv10URvSpF4DsiGGyiJUVBYsy0wHBq5rbb+lRoCXeTpCF6kxB
Zzfn5xAWHdfAlEHBXkOr91Owtt8BIb+bUd3Ma3ThP6+1NvKtHJ5xC8iLP/PtAdhL
yQoPM/pu2zFvAgMBAAGjUzBRMB0GA1UdDgQWBBTbXFpKsaFotGtSLvZUM1SCvH7d
4TAfBgNVHSMEGDAWgBTbXFpKsaFotGtSLvZUM1SCvH7d4TAPBgNVHRMBAf8EBTAD
AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQA/b1ITPqJUx+BP1ZPZnFyWkQPvyARdzGPO
R0+XhrHs+endKYXVTUeanGZbsxER5EdmlQ7N4wNHeHem3Ktd4jeXiiHUKBhhzidY
QkDiSJ9KrKQgclRV/EgEDALHHYWG/19fh/OFhROafAW49fZMOlNTy/bF+KbIxece
oZKnP7ntWIDfrab0YyAwCcbuc+WHvVa238mgstCM9vdIppasUPI3a5UbgaI6LMt0
xlyr/Poaf8f3z09zBzoFFY6vowMZF9QxEdD5/fNCbHON+kUOCy/hpPlpG9J7J67W
zIx/MBnQ6RYpKmvGuJ9eHfhLudCNSHTOmOg0swaDrRfE46c4pd+h
-----END CERTIFICATE-----

View File

@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQChSuMGYGIfUVCb
TpDRcGQ/4WCSG3QZKx91SV4OQz+ZYB8q68AGnkBc+YoRSapj0p1xCL0063jEhmou
A6V+qDw6OiyreF05zv9nzd0tzYlZkLJJ5YjiW3a6plA0G/EZg0xWTJWm64l1oNb7
Fo6OwU9INmYjHn3LKvJj2J1qfqapjmBIZaj6d+pOHQMqlr2ba+l2IoqbT9SfonLE
RqlfPYVNrjmZv10URvSpF4DsiGGyiJUVBYsy0wHBq5rbb+lRoCXeTpCF6kxBZzfn
5xAWHdfAlEHBXkOr91Owtt8BIb+bUd3Ma3ThP6+1NvKtHJ5xC8iLP/PtAdhLyQoP
M/pu2zFvAgMBAAECggEAF2UnXOtqECTZTk2tD9P/lox4V3kH9AafP4Hu1J7IgNTC
cJVVeyBFMbc4YZ2Py37nO1gLKbvl/ouIpzf8L0zzv3ZkuFJzI0l1Hndr15Lykz07
vyA+JKcjp5ssEwLii9LRpcriAh40CA3WYQE6mFZNy6moUvu/P1Lxaa4n1ySbxAgZ
1F+gjOVuHabxWU8GoeNojdTEzHHaFOmjWE9iTr/uPHAtNsDuz88g+zNFK4WdCliC
0G406x1giSMvJtmpjXhVkJ1fdFEPyCOTMuFFBithi8QhO+dlmrlInECGymeoGrsN
aVz9kdyjzrHZ9Nb9goWGRABanM5wgshXeWs3KzME4QKBgQDP3TpFz86rHhjKqF6c
6J8+xzUCKok33rMFd/o/dPtJl9xvgU+o7ciNb04AbUhn60K8jvRJ74XIkjFjyDXM
ybTtqFt0EuRGO+Q6ONx/xgg7I4BI5wakZlGVnElaPsUaP+Fg3dhnAAE8cCeTgqSo
twV+oMAvet6QepnfBIkP6H5DKQKBgQDGpMLfaMNXjqzU6dZReLyM6zdb6zzSijhm
unpXHTRdTzQmArn9RfM0sg0kGsdQArF7bVFd4ZchNB3xpdBfO97bi3SJXTIvyP1T
lFBQ4Ugx1KvHTNVK3nrw79NlHi6wY2EwD73m+C7W7hWMVh/Hy+6tMa+v1v2Yrtod
eafwHX261wKBgHvW3LHc9c8C9lg+6WdoO//F5THuL6RGnLekXEZUJqYYwK76BoCp
cfO5nWopsZqgEjmOncIy3qy5VI2TKWJhxdZVmG7WFoQ1iGqbl9rUG/FH3FUStuVZ
RD/zRcxrWzihWGBCq3vqB9J/K0T576nIqJBhqz5eYJ0JPgUdiZ8dr6PJAoGAOkrf
ZPA5Ythbn59/ZSkpK7Fa7X56us4U/xB6FlZbp4Y2p3DlY43DcRNPB+lT1Ab2TmIm
Hoa08ul4YBFotIm9PHAQIr9Wmu9AZ+Z+Kz3xEa53OmUxsmbXbRzzzBivWtPPEWuN
Ltpl5Gy5phUf/mG6CNkr1U4h3UxydXPd9HizDMECgYApxOzUkMHF5H4YUv+ng34a
Ntp+AtdeE8hyBQlhjLTougQHAH1ciOvhIpE63U6UoRzdd42ecXdd2bxxHG5VSZtA
O1g+SkyIFUycZXGGgiszAL0dhgQ5VWKmT8TWzhtQFkx97h2kIp11dqetgnuPLupZ
RG3zwTuof/6cs0bRewkx8A==
-----END PRIVATE KEY-----

View File

@@ -0,0 +1,5 @@
# remove rrdtool
# otherwise this causes a complex dependency chain (rddtool / pango / cairo / gles)
# We don't need sensord by default. It rrecommends on lighttpd which builds php and mariadb
PACKAGECONFIG ?= ""

View File

@@ -0,0 +1,16 @@
# remove rrdtool / sensord from packageconfig
# otherwise this causes a complex dependency chain (rddtool / pango / cairo / gles)
# We don't need sensord by default. It rrecommends on lighttpd which builds php and mariadb
PACKAGECONFIG ?= ""
# remove these, since thy depend on perl
RDEPENDS:${PN}:remove = "${PN}-sensorsdetect"
RDEPENDS:${PN}:remove = "${PN}-sensorsconfconvert"
SYSTEMD_AUTO_ENABLE = "enable"
# Workaround for issue in upstream recipe, revert once
# once fc88c96c4e40 (lmsensors: Fix build without sensord) is backported to
# meta-openembedded, branch scarthgap
EXTRA_OEMAKE += 'PROG_EXTRA="sensors ${PACKAGECONFIG_CONFARGS}"'

View File

@@ -0,0 +1,42 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
SUMMARY = "Automatic selection of fw_env.config for TQ platforms"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit systemd update-rc.d
SRC_URI = "\
file://u-boot-env-tq.service \
file://u-boot-env-tq.sh \
"
SYSTEMD_SERVICE:${PN} = "u-boot-env-tq.service"
INITSCRIPT_NAME = "u-boot-env-tq.sh"
INITSCRIPT_PARAMS = "start 10 S ."
RDEPENDS:${PN} += "util-linux-findmnt"
do_install() {
install -Dm 755 "${WORKDIR}/u-boot-env-tq.sh" "${D}${libexecdir}/tq/u-boot-env-tq.sh"
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/init.d/
ln -s ${libexecdir}/tq/u-boot-env-tq.sh ${D}${sysconfdir}/init.d/
fi
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -Dm 0644 "${WORKDIR}/u-boot-env-tq.service" "${D}${systemd_system_unitdir}/u-boot-env-tq.service"
sed -i -e "s,@LIBEXECDIR@,${libexecdir},g" "${D}${systemd_system_unitdir}/u-boot-env-tq.service"
fi
if [ -n "${TQ_FW_ENV_CONFIGS}" ]; then
install -d "${D}${sysconfdir}"
ln -s /run/tq/fw_env.config "${D}${sysconfdir}/fw_env.config"
fi
}
PACKAGE_ARCH = "${MACHINE_ARCH}"

View File

@@ -0,0 +1,17 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
[Unit]
Description=fw_env.config selection
DefaultDependencies=no
Before=sysinit.target
[Service]
ExecStart=@LIBEXECDIR@/tq/u-boot-env-tq.sh
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target

View File

@@ -0,0 +1,47 @@
#!/bin/sh
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
set -e
RUNTIME_CONFIG=/run/tq/fw_env.config
get_root_dev () {
findmnt --evaluate --first-only --noheadings --output SOURCE --mountpoint /
}
get_env_loc () {
case "$(get_root_dev)" in
/dev/mmcblk0p*)
echo mmc0
;;
/dev/mmcblk1p*)
echo mmc1
;;
ubi0:*)
echo spi
;;
esac
}
get_fw_env_config () {
echo "/etc/fw_env.config-$(get_env_loc)"
}
main () {
local config
config=$(get_fw_env_config)
if ! [ -r "$config" ]; then
config=/dev/null
fi
mkdir -p "$(dirname "$RUNTIME_CONFIG")"
ln -sfn "$config" "$RUNTIME_CONFIG"
}
main "$@"

View File

@@ -0,0 +1,12 @@
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 30
"" AT
OK ATE0
OK ATI;+CSUB;+CSQ;+CPIN?;+COPS?;+CGREG?;&D2
OK AT+CGDCONT=1,"IP","@QUECTEL_PPP_APN@",,0,0
OK ATD*99#
CONNECT ''

View File

@@ -0,0 +1,7 @@
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "\nSending break to the modem\n"
"" +++
"" +++
"" +++
SAY "\nGood bye\n"

View File

@@ -0,0 +1,11 @@
@QUECTEL_PPP_TTY@
115200
user ""
password ""
connect 'chat -s -v -f /etc/ppp/peers/quectel-chat-connect'
disconnect 'chat -s -v -f /etc/ppp/peers/quectel-chat-disconnect'
hide-password
noauth
debug
defaultroute
noipdefault

View File

@@ -0,0 +1,63 @@
# These files are based on the details provided in
# Quectel_WCDMA&LTE_Linux_USB_Driver_User_Guide_V1.5.pdf and are shared
# as part of this layer with their permission.
SUMMARY = "PPP Scripts for Basic Quectel Chip Operation"
SECTION = "net"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "\
file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \
"
DESCRIPTION = "A set of Linux PPP scripts that provide connect, disconnect \
and other basic Point-to-Point Protocol functionality for \
Quectel wireless modems."
RDEPENDS_${PN} = "ppp"
SRC_URI = "\
file://quectel-ppp.in \
file://quectel-chat-connect.in \
file://quectel-chat-disconnect \
"
S = "${WORKDIR}"
# set the Access Point Name (APN) of the SIM card
# set this variable in conf/local.conf
QUECTEL_PPP_APN ??= ""
# set the USB UART for AT commands of the wwan card
# default is /dev/ttyUSB2
# set this variable to the correct UART
QUECTEL_PPP_TTY ??= "/dev/ttyUSB2"
do_configure () {
if [ -z "${QUECTEL_PPP_APN}" ]; then
bbwarn "APN of SIM card is not set for quectel-ppp! Set the APN in QUECTEL_PPP_APN."
fi
if [ -z "${QUECTEL_PPP_TTY}" ]; then
bbwarn "USB UART of quectel wwan card is not set! Set the UART in QUECTEL_PPP_TTY."
fi
sed s#@QUECTEL_PPP_APN@#${QUECTEL_PPP_APN}#g ${WORKDIR}/quectel-chat-connect.in > ${S}/quectel-chat-connect
sed s#@QUECTEL_PPP_TTY@#${QUECTEL_PPP_TTY}#g ${WORKDIR}/quectel-ppp.in > ${S}/quectel-ppp
}
inherit allarch
# Install script on target's root filesystem
do_install () {
# Install init script and default settings
# ${sysconfdir}
install -d ${D}${sysconfdir}/
install -d ${D}${sysconfdir}/ppp
install -d ${D}${sysconfdir}/ppp/peers
install -m 0755 ${S}/quectel-ppp ${D}${sysconfdir}/ppp/peers/
install -m 0755 ${S}/quectel-chat-connect ${D}${sysconfdir}/ppp/peers/
install -m 0755 ${S}/quectel-chat-disconnect ${D}${sysconfdir}/ppp/peers/
}
# Mark the files which are part of this package
FILES_${PN} += "{sysconfdir}/ppp/peers/*"

View File

@@ -0,0 +1,3 @@
if [ -n "$SSH_TTY" ]; then
cat /etc/issue.net
fi

View File

@@ -0,0 +1,49 @@
#
# this bbappend is intended to be used with example distros defined in this
# layer. It shows, how to customize the banner files /etc/issue[.net]
#
DEPENDS += "figlet-native"
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
SRC_URI:append = "\
file://handle_issue.sh \
"
dirs755:append = "\
${sysconfdir}/profile.d \
"
# this usually comes from our distro
VENDOR_LONG_NAME ??= "TQ-Systems"
DISTRO_SHORT_NAME ??= "dumpling"
do_install:append() {
install -m 0755 ${WORKDIR}/handle_issue.sh ${D}${sysconfdir}/profile.d/handle_issue.sh
}
do_install_basefilesissue:append() {
# rewrite issue.net to prevent telnetd escape codes in the banner
if [ -n "${DISTRO_NAME}" ]; then
printf "%s" "${DISTRO_NAME}" > ${D}${sysconfdir}/issue.net
if [ -n "${DISTRO_VERSION}" ]; then
distro_version_nodate="${@d.getVar('DISTRO_VERSION').replace('snapshot-${DATE}','snapshot').replace('${DATE}','')}"
printf " %s" "${distro_version_nodate}" >> ${D}${sysconfdir}/issue.net
fi
echo >> ${D}${sysconfdir}/issue.net
fi
figlet -c -d ${RECIPE_SYSROOT_NATIVE}/usr/share/figlet -- "${VENDOR_LONG_NAME}" | \
sed 's,\\,\\\\,g' >> ${D}${sysconfdir}/issue
echo "\n" >> ${D}${sysconfdir}/issue
figlet -c -d ${RECIPE_SYSROOT_NATIVE}/usr/share/figlet -- "${DISTRO_SHORT_NAME}" | \
sed 's,\\,\\\\,g' >> ${D}${sysconfdir}/issue
echo "\n" >> ${D}${sysconfdir}/issue
figlet -c -d ${RECIPE_SYSROOT_NATIVE}/usr/share/figlet -- "${VENDOR_LONG_NAME}" >> \
${D}${sysconfdir}/issue.net
echo "\n" >> ${D}${sysconfdir}/issue.net
figlet -c -d ${RECIPE_SYSROOT_NATIVE}/usr/share/figlet -- "${DISTRO_SHORT_NAME}" >> \
${D}${sysconfdir}/issue.net
echo "\n" >> ${D}${sysconfdir}/issue.net
}

View File

@@ -0,0 +1,17 @@
# look for files in the layer first
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI:append = "\
file://enable-BEEP.cfg \
file://enable-DEVMEM.cfg \
file://enable-VERBOSE_USAGE.cfg \
file://enable-DD_ALL_FEATURES.cfg \
file://enable-TFTP_FULL_FEATURES.cfg \
file://disable-TELNET.cfg \
file://disable-FTP.cfg \
file://tq-busybox-options.cfg \
"
# necessary to prevent above change being reverted during "do_compile"
# BUSYBOX_SPLIT_SUID = "0"

View File

@@ -0,0 +1,2 @@
# CONFIG_FTPGET is not set
# CONFIG_FTPPUT is not set

View File

@@ -0,0 +1 @@
# CONFIG_TELNET is not set

View File

@@ -0,0 +1,3 @@
CONFIG_BEEP=y
CONFIG_FEATURE_BEEP_FREQ=4000
CONFIG_FEATURE_BEEP_LENGTH_MS=30

View File

@@ -0,0 +1,3 @@
CONFIG_FEATURE_DD_THIRD_STATUS_LINE=y
CONFIG_FEATURE_DD_STATUS=y
CONFIG_FEATURE_DD_IBS_OBS=y

View File

@@ -0,0 +1 @@
CONFIG_DEVMEM=y

View File

@@ -0,0 +1,2 @@
CONFIG_FEATURE_TFTP_BLOCKSIZE=y
CONFIG_FEATURE_TFTP_PROGRESS_BAR=y

View File

@@ -0,0 +1 @@
CONFIG_FEATURE_VERBOSE_USAGE=y

View File

@@ -0,0 +1,89 @@
# Fri Jan 7 14:49:22 2022
CONFIG_FEATURE_CATN=y
CONFIG_FEATURE_CATV=y
CONFIG_EXPR_MATH_SUPPORT_64=y
CONFIG_NICE=y
CONFIG_NPROC=y
CONFIG_SEQ=y
CONFIG_TEST2=y
CONFIG_FEATURE_TEST_64=y
CONFIG_TIMEOUT=y
CONFIG_FEATURE_GZIP_LONG_OPTIONS=y
CONFIG_FEATURE_TAR_LONG_OPTIONS=y
CONFIG_FEATURE_TAR_TO_COMMAND=y
CONFIG_FEATURE_TAR_UNAME_GNAME=y
CONFIG_FEATURE_CHOWN_LONG_OPTIONS=y
CONFIG_FEATURE_CP_LONG_OPTIONS=y
CONFIG_FEATURE_CP_REFLINK=y
CONFIG_FEATURE_DATE_ISOFMT=y
CONFIG_FEATURE_DATE_NANO=y
CONFIG_FEATURE_DF_FANCY=y
CONFIG_FEATURE_FANCY_HEAD=y
CONFIG_FEATURE_SYNC_FANCY=y
CONFIG_TR=y
CONFIG_FEATURE_TR_CLASSES=y
CONFIG_FEATURE_TR_EQUIV=y
CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS=y
CONFIG_FEATURE_DIFF_LONG_OPTIONS=y
CONFIG_FEATURE_VI_DOT_CMD=y
CONFIG_FEATURE_VI_READONLY=y
CONFIG_FEATURE_VI_SETOPTS=y
CONFIG_FEATURE_VI_SET=y
CONFIG_FEATURE_VI_ASK_TERMINAL=y
CONFIG_FEATURE_FIND_INUM=y
CONFIG_FEATURE_FIND_DELETE=y
CONFIG_FEATURE_FIND_LINKS=y
CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y
CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
CONFIG_FEATURE_XARGS_SUPPORT_PARALLEL=y
CONFIG_FEATURE_XARGS_SUPPORT_ARGS_FILE=y
CONFIG_FEATURE_ADDUSER_TO_GROUP=y
CONFIG_FEATURE_CHECK_NAMES=y
CONFIG_FEATURE_DEL_USER_FROM_GROUP=y
CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y
CONFIG_FEATURE_GPT_LABEL=y
CONFIG_FEATURE_FDISK_ADVANCED=y
CONFIG_FEATURE_MKSWAP_UUID=y
CONFIG_FEATURE_MOUNT_FAKE=y
CONFIG_FEATURE_MOUNT_VERBOSE=y
CONFIG_FEATURE_MOUNT_HELPERS=y
CONFIG_FEATURE_MOUNT_OTHERTAB=y
CONFIG_FEATURE_SWAPONOFF_LABEL=y
CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y
CONFIG_FEATURE_VOLUMEID_UBIFS=y
CONFIG_FEATURE_DC_BIG=y
CONFIG_FEATURE_BC_INTERACTIVE=y
CONFIG_FEATURE_BC_LONG_OPTIONS=y
CONFIG_FEATURE_LESS_TRUNCATE=y
CONFIG_FEATURE_LESS_MARKS=y
CONFIG_FEATURE_LESS_REGEXP=y
CONFIG_FEATURE_LESS_WINCH=y
CONFIG_FEATURE_LESS_ASK_TERMINAL=y
CONFIG_FEATURE_LESS_DASHCMD=y
CONFIG_FEATURE_LESS_LINENUMS=y
CONFIG_FEATURE_LESS_RAW=y
CONFIG_FEATURE_LESS_ENV=y
CONFIG_FEATURE_IFCONFIG_SLIP=y
CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y
CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
CONFIG_FEATURE_NETSTAT_WIDE=y
CONFIG_FEATURE_NETSTAT_PRG=y
CONFIG_FEATURE_NSLOOKUP_BIG=y
CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y
CONFIG_FEATURE_PIDOF_SINGLE=y
CONFIG_FEATURE_PIDOF_OMIT=y
CONFIG_FEATURE_TOP_INTERACTIVE=y
CONFIG_FEATURE_TOP_SMP_CPU=y
CONFIG_FEATURE_TOP_DECIMALS=y
CONFIG_FEATURE_TOP_SMP_PROCESS=y
CONFIG_FEATURE_TOPMEM=y
CONFIG_FEATURE_UPTIME_UTMP_SUPPORT=y
CONFIG_FEATURE_SHOW_THREADS=y
CONFIG_ASH_BASH_SOURCE_CURDIR=y
CONFIG_FEATURE_SH_MATH=y
CONFIG_FEATURE_SH_MATH_64=y
CONFIG_FEATURE_SH_MATH_BASE=y
CONFIG_UNIQ=y
CONFIG_FEATURE_WC_LARGE=y

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View File

@@ -0,0 +1,3 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SPLASH_IMAGES = "file://psplash-tq-img.png;outsuffix=default"

View File

@@ -0,0 +1,83 @@
From 326947e7b24ea4615e2971fc7cd48e6c1a9245df Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Date: Wed, 7 Aug 2024 12:01:24 +0200
Subject: [PATCH] udev-builtin-net_id: add NAMING_DEVICETREE_PORT_ALIASES to
check of_node of netdevs before their parents
The net_id builtin only checked the of_node of a netdev's parent device,
not that of the netdev itself. While it is common that netdevs don't have
an OF node assigned themselves, as they are derived from some parent
device, this is not always the case. In particular when a single
controller provides multiple ports that can be referenced indiviually in
the Device Tree (both for aliases/MAC address assignment and phandle
references), the correct of_node will be that of the netdev itself, not
that of the parent, so it needs to be checked, too.
A new naming scheme flag NAMING_DEVICETREE_PORT_ALIASES is added to
allow selecting the new behavior.
Upstream-Status: Backport [https://github.com/systemd/systemd/commit/24c2e04e9a3b53bc8a57ac4a7a89d8da8e4feb72]
The new naming scheme flag is not used by default in the backported
patch; it must be enabled using the extra-net-naming-schemes build option.
---
diff --git a/src/shared/netif-naming-scheme.h b/src/shared/netif-naming-scheme.h
index 3f7be08830..904a3b75ff 100644
--- a/src/shared/netif-naming-scheme.h
+++ b/src/shared/netif-naming-scheme.h
@@ -38,9 +38,10 @@ typedef enum NamingSchemeFlags {
NAMING_XEN_VIF = 1 << 13, /* Generate names for Xen netfront devices */
NAMING_BRIDGE_MULTIFUNCTION_SLOT = 1 << 14, /* Use PCI hotplug slot information associated with bridge, but only if PCI device is multifunction.
* This is disabled since v255, as it seems not to work at least for some setups. See issue #28929. */
- NAMING_DEVICETREE_ALIASES = 1 << 15, /* Generate names from devicetree aliases */
+ NAMING_DEVICETREE_ALIASES = 1 << 15, /* Generate names from devicetree aliases of a netdev's parent's OF node */
NAMING_USB_HOST = 1 << 16, /* Generate names for usb host */
NAMING_SR_IOV_R = 1 << 17, /* Use "r" suffix for SR-IOV VF representors */
+ NAMING_DEVICETREE_PORT_ALIASES = 1 << 19, /* Include aliases of OF nodes of a netdev itself, not just its parent. See PR #33958. */
/* And now the masks that combine the features above */
NAMING_V238 = 0,
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index 91b40088f4..faf7dd4940 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -781,7 +781,6 @@ static int names_platform(sd_device *dev, const char *prefix, bool test) {
static int names_devicetree(sd_device *dev, const char *prefix, bool test) {
_cleanup_(sd_device_unrefp) sd_device *aliases_dev = NULL, *ofnode_dev = NULL, *devicetree_dev = NULL;
const char *ofnode_path, *ofnode_syspath, *devicetree_syspath;
- sd_device *parent;
int r;
assert(dev);
@@ -794,14 +793,24 @@ static int names_devicetree(sd_device *dev, const char *prefix, bool test) {
if (!streq(prefix, "en"))
return -EOPNOTSUPP;
- /* check if our direct parent has an of_node */
- r = sd_device_get_parent(dev, &parent);
- if (r < 0)
- return log_device_debug_errno(dev, r, "Failed to get parent device: %m");
+ /* check if the device itself has an of_node */
+ if (naming_scheme_has(NAMING_DEVICETREE_PORT_ALIASES)) {
+ r = sd_device_new_child(&ofnode_dev, dev, "of_node");
+ if (r < 0)
+ log_device_debug_errno(dev, r, "Failed to get device of_node, ignoring: %m");
+ }
+ if (!ofnode_dev) {
+ sd_device *parent;
- r = sd_device_new_child(&ofnode_dev, parent, "of_node");
- if (r < 0)
- return log_device_debug_errno(parent, r, "Failed to get 'of_node' child device: %m");
+ /* check if our direct parent has an of_node as a fallback */
+ r = sd_device_get_parent(dev, &parent);
+ if (r < 0)
+ return log_device_debug_errno(dev, r, "Failed to get parent device: %m");
+
+ r = sd_device_new_child(&ofnode_dev, parent, "of_node");
+ if (r < 0)
+ return log_device_debug_errno(parent, r, "Failed to get device of_node: %m");
+ }
r = sd_device_get_syspath(ofnode_dev, &ofnode_syspath);
if (r < 0)

View File

@@ -0,0 +1,9 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"
SRC_URI += "file://0001-udev-builtin-net_id-add-NAMING_DEVICETREE_PORT_ALIAS.patch"
EXTRA_OEMESON += "-Dextra-net-naming-schemes=latest=v255+devicetree-port-aliases"

View File

@@ -0,0 +1,41 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
SUMMARY = "Automatic mount of a data partition for TQ platforms"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit allarch systemd update-rc.d
SRC_URI = "\
file://tq-mount-data.service \
file://tq-mount-data.sh \
"
TQ_DATA_MOUNT_TARGET ?= "/srv/data"
SYSTEMD_SERVICE:${PN} = "tq-mount-data.service"
INITSCRIPT_NAME = "tq-mount-data.sh"
INITSCRIPT_PARAMS = "start 05 S ."
RDEPENDS:${PN} += "util-linux-findmnt"
do_install() {
install -Dm 755 "${WORKDIR}/tq-mount-data.sh" "${D}${libexecdir}/tq/mount-data.sh"
sed -i -e "s,@TQ_DATA_MOUNT_TARGET@,${TQ_DATA_MOUNT_TARGET},g" "${D}${libexecdir}/tq/mount-data.sh"
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/init.d/
ln -s ${libexecdir}/tq/mount-data.sh ${D}${sysconfdir}/init.d/tq-mount-data.sh
fi
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -Dm 0644 "${WORKDIR}/tq-mount-data.service" "${D}${systemd_system_unitdir}/tq-mount-data.service"
sed -i -e "s,@LIBEXECDIR@,${libexecdir},g" "${D}${systemd_system_unitdir}/tq-mount-data.service"
fi
install -d "${D}${TQ_DATA_MOUNT_TARGET}"
}
FILES:${PN} += "${TQ_DATA_MOUNT_TARGET}"

View File

@@ -0,0 +1,17 @@
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
[Unit]
Description=Data partition mount
DefaultDependencies=no
Before=sysinit.target
[Service]
ExecStart=@LIBEXECDIR@/tq/mount-data.sh
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=sysinit.target

View File

@@ -0,0 +1,40 @@
#!/bin/sh
# SPDX-License-Identifier: MIT
#
# Copyright (c) 2024 TQ-Systems GmbH <oss@ew.tq-group.com>, D-82229 Seefeld, Germany.
# Author: Matthias Schiffer
set -e
TQ_DATA_MOUNT_TARGET='@TQ_DATA_MOUNT_TARGET@'
get_root_dev () {
findmnt --evaluate --first-only --noheadings --output SOURCE --mountpoint /
}
get_data_dev () {
local root_dev
root_dev=$(get_root_dev)
case "${root_dev}" in
# 2 and 3 are possible root partitions in our WKS files for RAUC
/dev/*2|/dev/*3)
# Data is partition 4
echo "${root_dev}" | sed -e 's/.$/4/'
;;
esac
}
main () {
local data_dev
data_dev=$(get_data_dev)
if [ -z "${data_dev}" ]; then
return 0
fi
mount "${data_dev}" "${TQ_DATA_MOUNT_TARGET}"
}
main "$@"

View File

@@ -0,0 +1,14 @@
SUMMARY = "Additinal udev rules for TQ distros"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit allarch
SRC_URI = "\
file://persistent-storage-mtd.rules \
"
do_install() {
install -Dm 644 ${WORKDIR}/persistent-storage-mtd.rules \
${D}${nonarch_base_libdir}/udev/rules.d/60-persistent-storage-mtd.rules
}

View File

@@ -0,0 +1,12 @@
# do not edit this file, it will be overwritten on update
# persistent storage links: /dev/mtd/by-name
ACTION=="remove", GOTO="persistent_storage_mtd_end"
SUBSYSTEM!="mtd", GOTO="persistent_storage_mtd_end"
KERNEL!="mtd[0-9]*", GOTO="persistent_storage_mtd_end"
KERNEL=="mtd[0-9]*ro", GOTO="persistent_storage_mtd_end"
ATTR{name}=="?*", SYMLINK+="mtd/by-name/$attr{name}"
LABEL="persistent_storage_mtd_end"

View File

@@ -0,0 +1,5 @@
# console_loglevel KERN_ERR
# default_message_loglevel KERN_WARNING
# minimum_console_loglevel KERN_EMERG
# default_console_loglevel KERN_DEBUG
kernel.printk = 3 4 1 7

Some files were not shown because too many files have changed in this diff Show More