Commit Graph

850 Commits

Author SHA1 Message Date
Phil Elwell
3c97f769ef userland: dtoverlay: /boot/firmware is a valid path 2023-10-18 14:19:43 +01:00
Tim Gover
153a235deb Assorted clang static analysis fixes 2023-10-18 14:19:43 +01:00
Dom Cobley
eca070c8f4 bcm_host: Update kms/fkms check for pi5 2023-10-18 14:19:43 +01:00
Phil Elwell
06a7618c3e dtoverlay: Support bcm2712 as a platform
Add "bcm2712" as a recognised platform. This will prevent Pi 5 from
loading bcm2711-specific versions, but there's a good chance they
wouldn't work anyway and will require modifications.
2023-10-16 20:46:50 +01:00
Phil Elwell
0489c0728e dtoverlay: Add dtoverlay_first/next_subnode
The dtoverlay wrappers add a DT_BLOB_T type and prevent users having
to import all of libfdt. Add thin veneers of fdt_first_subnode and
fdt_next_subnode.
2023-10-16 20:46:50 +01:00
Phil Elwell
a1c7f81143 dtoverlay: Support literal assignments of path strings
The dtc compiler expands &node1 (as opposed to <&node1>) to the full
path to the node with the label "node1". Note that if this label is on
a node in an overlay that the path will reflect that, even if the
node with the label eventually ends up in the base dtb.

If a parameter of a base dtb is used to make an alias point to another
node in the base dtb, it is nice to be able to specify that replacement
path using a label on that node, rather than have to write it out
longhand. Doing so requires one simple change - treating literal
assignments of empty strings as a special case:

    console_uart0 = <&aliases>, "console=", &uart0;

Prior to this commit, this would have resulted in an error when the
console_uart0 was applied because the start of the &uart0 path string
would have been interpreted as a phandle to the next override target.
With this commit, the parser sees the empty string assigment and
treats the next thing as a string to assign (rather like assigning
a phandle value to an integer property).

A consequence of this change is that intentionally assigning an empty
string (probably a very rare occurrence) requires an explicit empty
string to be added, i.e. "...=","" or that the empty assignment falls
at the end of the list of overrides for that parameter.
2023-10-16 20:46:50 +01:00
Simon Kadisch
44a3953fd1 raspivid: Also flush PTS file if flush is enabled 2023-09-13 10:54:24 +01:00
Phil Elwell
cc1ca18fb0 userland: dtoverlay: Use os_prefix if set
It's helpful if the dtoverlay and dtparam commands look in the right
place for overlays and the README. Make them check for and use
/proc/device-tree/chosen/os_prefix.
2023-04-20 14:36:13 +01:00
Tim Gover
9d5250fd98 libfdt: Add null-ptr check for prop-data to resolve clang --analyzer warning 2023-03-22 14:35:57 +00:00
Dave Stevenson
50527c6f2e mmal: Only include Videocore components if not running on Videocore
Fixes build break from "2ac42ee mmal: Hack to make mmal core register
VideoCore components"
2023-03-22 14:33:23 +00:00
Dom Cobley
df245ea297 tvservice: Update unsupported message to recommend kmsprint 2023-03-22 14:32:03 +00:00
Phil Elwell
de0cfe82ff dtoverlay: Fix clang warnings 2023-03-22 14:30:54 +00:00
Phil Elwell
0182f05daa dtoverlay: Fix various compiler warnings
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2023-03-22 14:29:11 +00:00
Phil Elwell
2a6306b1a0 dtoverlay: Fix path rebasing and exports
There was an off-by-one in the path rebasing code that caused it to
copy overlay-relative paths verbatim instead of rebasing them to
fit the target DTB.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2023-03-22 14:29:10 +00:00
Phil Elwell
d1e92d79e5 dtoverlay: Add support for string escape sequences
Add the ability to embed arbitrary byte data in strings. The change was
motivated by the desire to allow parameters to supply multiple compatible
strings, but there may be other uses.

The acceptable escape sequences are most of the range supported by C, but
with the hexadecimal ('\x??`) escape limited to precisely two digits.

See: https://forums.raspberrypi.com/viewtopic.php?t=330792

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2023-03-22 14:28:49 +00:00
Dom Cobley
b1ee39e50e gencmd: Add a fallback to mailbox interface if vchiq is not available 2023-03-22 14:27:11 +00:00
Dom Cobley
54fd97ae40 hello_pi: Fix some build issues
See: https://github.com/raspberrypi/firmware/issues/1728

Seems to be an issue with library ordering.
I guess it appeared with update to bullseye, or gcc.

Note: these are largely deprectated and several fail to run with kms
(with an error message), but may as well fix build errors
2022-06-16 14:32:08 +01:00
Krawlow
c4fd1b8986 Fix raspicommonsettings_parse_cmdline
Fix raspicommonsettings_parse_cmdline's definition to match declaration
2022-03-24 09:01:46 +00:00
Dave Stevenson
8fa944c740 mmal: Add mapping for IL OMX_IndexParamBrcmEnableIJGTableScaling param
Adds MMAL_PARAMETER_JPEG_IJG_SCALING to map onto the IL parameter
OMX_IndexParamBrcmEnableIJGTableScaling.
2022-02-02 15:10:03 +00:00
Phil Elwell
09570925bf dtoverlay: Don't mix non-fatal errors and offsets
FDT errors are small negative integers, and non-fatal errors are the
positive versions of the same errors. This scheme only works if the
non-fatal error values are never returned from a function where a
positive integer has another interpretation.

dtoverlay_get_target_offset broke this rule, leading eventually to
an invalid DT and failure to boot. Fortunately, finding the offset for
a fragment target is a non-destructive operation and therefore always
non-fatal, so move the NON_FATAL classification to the callers - of
which there are only three.

See: https://github.com/raspberrypi/firmware/issues/1686
2022-02-02 14:58:54 +00:00
Phil Elwell
affef1eb4f dtoverlay: Rebase aliases in overlays like labels
Aliases and labels/symbols are stored in the same way - as path strings.
The overlay application code already knows how to rewrite exported
symbol paths so they are correct in the base DTB (rebasing), so use the
same logic to rebase aliases as they are applied.
2022-02-02 14:58:54 +00:00
Phil Elwell
a70a7428f7 userland: dtoverlay: Handle parameters in overlay_map 2022-02-02 14:58:54 +00:00
Phil Elwell
3ff42d6972 vcos: Add vcos_safe_strncpy and VCOS_SAFE_STRNCPY
Add a src-length-limited version of VCOS_SAFE_STRCPY. For some
reason the vc4 linker complained about not being able to find strnlen,
hence the open-coded version.
2022-02-02 14:58:54 +00:00
Dave Stevenson
14b90ff9d9 mmal: Hack to make mmal core register VideoCore components
The default linker option with Bullseye appears to now set
as-needed, so as the core doesn't call into mmal_vc_client
it is viewed as unnecesary, missing that mmal_vc_client has
a constructor that registers functions with the core.

Move the registration of the component supplier to the core_init.
The linker is therefore satisfied that mmal_vc_client is used,
and actually links to it.

This allows Picamera to work again.

https://github.com/waveform80/picamera/issues/697

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2021-11-25 15:54:17 +00:00
David Plowman
f5404b2fcd raspicam: Check system is running legacy camera stack
If the system is obviously configured for libcamera (for example) by
dint of /dev/video0 being given over to "unicam", complain and abort
immediately. In all other circumstances maintain previous behaviour.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
2021-11-23 19:38:47 +00:00
Dom Cobley
bab9bf8790 hello_fft: Remove unused function declaration 2021-11-08 19:33:25 +00:00
Phil Elwell
705ff8ea01 hello_fft: Update outdated link to V3D spec
See: https://github.com/raspberrypi/firmware/pull/1645
2021-11-08 19:33:24 +00:00
Tim Gover
0093675e4a interface/vcos: Get rid of LLTHREAD cast warning
The cast is safe. Get rid of some compiler noise.
2021-10-25 15:36:16 +01:00
Phil Elwell
7f72bc257d userland: Reduce debug_sym error messages
There are several reasons why /dev/fb0 might not exist, none of them
worrying, and the debug_sym library has fallbacks for those cases.
Suppress error messages for the ENOENT case, and only print one
message for other errors (unless the error keeps changing, which is
unlikely).

See: https://forums.raspberrypi.com/viewtopic.php?f=98&t=322238
2021-10-25 15:34:16 +01:00
Dave Stevenson
6e8f786db2 video_decode: Option to stop decode on aspect ratio & colourspace changes
V4L2 needs to stop on any change that triggers a V4L2_EVENT_SOURCE_CHANGE,
and that includes aspect ratio and colourspace changes.

Add a new parameter to request that behaviour from the RIL component.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2021-09-28 15:19:51 +01:00
Naushir Patuck
5aece5be06 isp: Add SW colour denoise configuration
This change adds a colour denoise config structure to allow us to set the
operating mode of the software colour denoise.  This essentially chooses
between the video and stills colour denoise variants.

The related kernel change is at:
https://github.com/raspberrypi/linux/pull/4069
2021-09-28 15:18:51 +01:00
Tim Gover
fba5ce7d15 vcgencmd: Fix documentation URL
The link was broken during the documentation revamp. Just link
to vcgencmd in the online docs. Related documentation is easy
to find with the online search and reduces the number for links
to update in the future.
2021-09-28 15:12:09 +01:00
popcornmix
ade66719aa tvservice: Add check to warn when running with kms 2021-09-28 15:10:41 +01:00
Dave Stevenson
37030a77e4 dtoverlay: Break on an error when parsing fragment overrides
A misformed string in an override, eg
changeme = <0>, "-1,-2";
would stall the parsing as it didn't know how to handle ','
and kept trying to process it over and over.

Abort on incorrect syntax.
2021-09-28 15:10:08 +01:00
Phil Elwell
97bc8180ad bcm_host: Recognise all Pi 4 variants, add BCM2711
bcm_host_is_model_pi4 should be equivalent to a test that the processor
type is BCM2711, so implement it as such (having added BCM2711 as a
recognised processor type and deprecating the name BCM2838).

See: https://github.com/raspberrypi/userland/issues/695

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2021-06-23 14:17:39 +01:00
doe300
d4a960e781 vcsm: properly handle too many CMA allocation attempts
Fixes #690
2021-05-13 18:55:43 +01:00
Dave Jones
45a0022ac6 Add man-pages for most commands
I've spent a little time going through the excellent raspberry pi
documentation site in order to build some man-pages for most of the
utilities in the suite. Note that not all utilities are covered here
(notably vchiq_test, mmal_vc_diag are missing) but I think it covers the
most commonly used utilities.

I've also included some auxilliary man-pages (in section 7) for
information relevant to utilities like vcmailbox (covering things like
the mailbox info from the wiki-page, and the OTP registers from the
documentation site).
2021-04-26 12:33:16 +01:00
Andrew Scheller
3fd8527eef Update board revision codes
...with info from https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
2021-03-19 11:21:31 +00:00
Dave Stevenson
4a0a19b88b video_decode: Add parameter to disable timestamp validation
Video_decode was always ensuring that timestamps increased in value
during a stream.
V4L2 M2M API wants a direct mapping, so add an option to disable it.
2021-01-11 19:42:05 +00:00
Dave Stevenson
7deff646e8 MMAL/IL: Add support for the 16bpp Bayer/Grey raw 10/12/14 formats
Unicam can unpack to 16bpp, but only using the bottom N bits, and
V4L2 supports them all. It is also far easier for a CPU to process.

Adds support to the framework and to the ISP component (changes the
black level config).
2021-01-11 19:42:05 +00:00
Dave Stevenson
093b30bbc2 RaspiCam: Correct rotation param docs to be 0/90/180/270 2020-11-30 14:51:22 +00:00
popcornmix
9f3f9054a6 Remove vcfiled and vcfilesys 2020-10-27 11:56:13 +00:00
Dave Stevenson
e432bc3400 vec: Support PAL-N.
It's supported as a standard preset within the VEC, but there was
no way of selecting it.
The 2 bits for SDTV mode in enum SDTV_MODE_T were fully utilised,
so add it as a modifier in one of the higher bits if PAL is
selected.

https://github.com/raspberrypi/firmware/issues/811
2020-10-22 16:18:04 +01:00
popcornmix
7b6b0a9295 vc_image_helper: Avoid misaligned exception due to uninitialised pointer
The function parameters were extended without spotting another
user with their own local prototype.
Observed as misaligned exception when using video_render.
2020-10-22 16:14:46 +01:00
popcornmix
f73fca015d vc_service: Fix enum types to string lookup
Success and error had same values but retry was different (1 vs -2)
Only affects logging string, so not critical but fixes a warning
2020-08-13 10:59:40 +01:00
popcornmix
5828e5b768 host_applications: Install debug_sym.h 2020-08-13 10:58:20 +01:00
Dave Stevenson
6d044bc2be MMAL/IL/ISP component: Add support for mono MIPI formats, and Bayer raw 14
MIPI raw 14 wasn't previously defined, so add it for completeness

To support monochrome image sensors, add formats to handle the relevant
packed data formats into the ISP, and disable demosaic.
The Bayer pipeline is still active in Bayer mode, so all 4 channels need
to be programmed with the same data for blocks such as black level and
lens shading.
2020-08-13 10:51:30 +01:00
Dave Stevenson
3e59217bd9 RaspiStillYUV: Add the equivalent "all manual" patch for faster captures.
Adds the equivalent to "Add option to start in burst mode if AE settings
are manual" patch to RaspiStillYUV so it too can drop straight into
capture mode.

See https://github.com/raspberrypi/userland/issues/640
2020-07-28 11:04:12 +01:00
Dave Stevenson
2534d69d0d interface/mmal: Reduce the header bytes alloc in the MMAL examples
The examples read the first 512 bytes of the stream and try stuffing
them into the codec as header bytes.
If running a debug build of MMAL this will fail as the extradata
field of the port format is bigger than MMAL_FORMAT_EXTRADATA_MAX_SIZE

Reduce the header bytes array down to 128bytes to match
MMAL_FORMAT_EXTRADATA_MAX_SIZE.
2020-07-28 11:04:12 +01:00
Dave Stevenson
fdc2102ccf Remove vcfiled and vcfilesys.
Both these libraries/apps were related to the VPU accessing the
host file system over VCHI. This has never been used on the Pi,
and is creating build warnings with the latest versions of gcc.
Remove them from the source tree.
2020-07-28 11:04:12 +01:00