852 Commits

Author SHA1 Message Date
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
John Cox
188d3bfe4a Fix cast warning on vcos_llthread_current
Current header generates warnings of the form "warning: cast from
function call of type ‘pthread_t’ {aka ‘long unsigned int’} to
non-matching type ‘VCOS_LLTHREAD_T *’ {aka ‘struct VCOS_LLTHREAD_T *’}
[-Wbad-function-cast]".  Fix that.
2020-06-26 14:24:31 +01:00
popcornmix
f97b1af1b3 Revert "Add MMAL and MMAL_APPS to 64bit builds"
This reverts commit 7d3c6b9f4c.
2020-05-28 15:02:54 +01:00
RaspberryPiFan
f4bccc38f9 Fix compiler warning 2020-05-28 13:27:08 +01:00
popcornmix
ad8ef597bd raspicam: Fix up whitespace 2020-05-27 15:10:26 +01:00
popcornmix
c069fd469d WF: Fix copyright headers 2020-05-27 15:07:47 +01:00
popcornmix
98c382cd3d raspicam: Allow tainted check to be skipped 2020-05-27 15:01:44 +01:00
Serge Schneider
3689a918fb Link raspicam applications with -lm 2020-05-27 14:56:57 +01:00
popcornmix
598e42e1e5 vc_sm_cma_ioctl.h: Correct licence 2020-05-27 14:29:11 +01:00
Phil Elwell
b58bb558f8 arm_loader: Add SET_LAUNCH_VPU1 mailbox message
SET_LAUNCH_VPU (0x30013) works like SET_EXECUTE_CODE except it
runs the code on VPU1 using the QPU rpc thread. The mailbox
returns immediately, and will only fail if out of memory.
2020-05-27 14:24:19 +01:00
Dave Stevenson
ef41631200 video_encode: Add option to include header bytes with frame
V4L2 wants H264 header bytes to be included alongside an encoded
frame, therefore add a new option that selects this behaviour.
2020-05-27 14:23:10 +01:00
Dave Stevenson
04c2643311 mmal/vc: Add mapping for OMX_IndexConfigBufferStall / MMAL_PARAMETER_VIDEO_STALL_THRESHOLD
Requested on the forum, and potentially useful
https://www.raspberrypi.org/forums/viewtopic.php?f=70&t=273123&p=1655481
2020-05-27 14:23:10 +01:00
David Plowman
b420015189 isp: allow more formats of lens shading tables, including corner-sampled and 16-bit
The old lens_shading parameter structures exist for backwards
compatability, but there's a new v2 version which includes a
corner_sampled flag (when the grid is sampled on cell corners rather
than centrally) and a gain_format, which allows different fractional
precision in the uint8_t values, and even a u4.10 16-bit format.

Calls through the V4L2 interface to the ISP should use the v2
style of structure.
2020-05-27 14:23:10 +01:00
David Plowman
106b9ee84d isp: add application control of the gamma block
Preserves the "gamma_shift" functionality that was previously available.
2020-05-27 14:23:10 +01:00
David Plowman
998f7ee3e5 isp: add application control of (automatic) Defective Pixel Correction (DPC) block 2020-05-27 14:23:10 +01:00
David Plowman
336ef2b1d2 isp: add application control of sharpen block 2020-05-27 14:23:10 +01:00
David Plowman
f2f1eb651c isp: add application control of Green Equalisation (GEQ) parameters 2020-05-27 14:23:10 +01:00
David Plowman
010ffa92e4 isp: add application control of spatial denoise parameters 2020-05-27 14:23:10 +01:00
David Plowman
b8fa9560f9 isp: Allow setting Black Level for all 3 channels (whilst still preserving the old single channel method).
The new 3-channel method wants 16-bit black levels whereas the single-channel method uses native sensor bit depth. This does lead to some slightly awkward code; please refer to the inline comments for the conventions used.
2020-05-27 14:23:10 +01:00
Dave Stevenson
b1dc4cb6a7 isp: Add stats port to enable userspace 3A algorithms
Still needs some tarting up with regard enabling ports
in random orders, but all seems to be working.
2020-05-27 14:23:10 +01:00
popcornmix
e31da99739 Revert "mmal: Support 64 bit clients"
This reverts commit c2cd8020ed571c2db13d2ba99695c654136fb440.
2020-05-27 14:23:10 +01:00
Dave Stevenson
4a57ea4107 vc_image: Add vpitch parameter to VC_IMAGE_T for Bayer images
This allows us to use buffers that don't have any alignment on the
height.
2020-05-27 13:41:19 +01:00
popcornmix
03795057f9 Revert "tvservice: Fix freeze on old firmware. (#617)"
This reverts commit 2aaabf31e6.
2020-05-27 12:49:53 +01:00
James Hughes
a7f6686acd Fix up demo apps to abort when used on Pi4
Added a new library which contains code to read
/proc/cpuinfo and get the Type of device in use.

Demo apps use that to abort as necessary.
2020-05-27 12:43:39 +01:00
popcornmix
c0e5933973 hello_pi: Add top level makefile and enable parallel build 2020-05-27 12:43:17 +01:00
Dave Stevenson
2fe4ca33dc raspistill: Add option to start in burst mode if AE settings are manual
If exposure and analogue gain are set manually, and we run a stats
pass to setup all other control algorithms, then we can skip the
viewfinder phase and jump straight into captures, saving time over
dropped frames.

Add the relevant logic to allow this.
2020-05-20 15:37:07 +01:00
Dave Stevenson
291f9cb826 MMAL / video_render: Allow column stride to be set on column formats
MMAL and video_render used not to allow the client to set the column
stride or the chroma offset.
format->es->video.width wasn't actually being used for anything as
mmal_encoding_width_to_stride returns 0 meaning the component has to
compute it.

Add an extra flag for format->flags (MMAL_ES_FORMAT_FLAG_COL_FMTS_WIDTH_IS_COL_STRIDE)
that treats format->es->video.width as the column stride instead of
being ignored.

video_render also used to ignore nSliceHeight (format->es->video.width)
on the column formats.
Adding support in setting that (via vc_image vpitch) means that you can
crop down a larger image with the chroma in a different place.
eg width=(col stride), height=2160, crop.width=1920, crop.height=1080
flags = MMAL_ES_FORMAT_FLAG_COL_FMTS_WIDTH_IS_COL_STRIDE
will display the top left 1080p image out of a 4k source image.
2020-05-12 13:00:20 +01:00
Naushir Patuck
cb852cdd2d raspicam: Adjust framerate limits on long exposures for stills port.
Need to reduce the min fps limit to 0.005 for 200s exposures
available in HQ cam.

commit 27db31a8a8 fixed this for the video
port, but we need to do the same for the stills port as well.
2020-05-09 20:12:32 +01:00
naushir
27db31a8a8 raspistill: Adjust framerate limits on long exposures. (#622)
Need to reduce the min fps limit to 0.005 for 200s exposures
available in HQ cam.
2020-05-08 12:23:36 +01:00
naushir
b671bee987 raspicam: Add option to draw a focus window with FoM value. (#621)
Add a new option (-fw) in the raspicam applications to draw
a Figure of Merit (FoM) value to indicate sharpness in the displayed
region.  A larger value of FoM indicates a sharper image.

This is useful for the HQ camera to help with focussing on a subject.
2020-05-07 11:15:53 +01:00
Andrew Scheller
5b1ef8b158 Fix header enum typo 2020-05-04 12:46:31 +01:00
andry
2aaabf31e6 tvservice: Fix freeze on old firmware. (#617)
This fixes infinity loop at tvservice_wait_for_reply on initialize
with older firmare. [E] No multi display support in firmware!
Checked with `tvservice --list`
2020-05-04 09:18:45 +01:00
Joel Winarske
61255e90ad Remove libc++ dependency 2020-05-01 12:56:13 +01:00
Phil Elwell
a246147c21 dtoverlay: Add overlay_map functionality
The overlay_map DTB file provides a way to load different .dtbo
files on different platforms from the same overlay name, e.g.
translating "vc4-kms-v3d" to "vc4-kms-v3d-pi4" on bcm2711.

See: https://github.com/raspberrypi/linux/issues/3520
2020-04-07 18:19:07 +01:00
Phil Elwell
279c93f8ec dtoverlay: Fix whitespace problems 2020-04-07 18:19:07 +01:00
Dave Stevenson
6fb59736b1 debug_sym: Fixup whitespace issues from previous patch.
Fixes up "vcdbg/debugsym: Add option to specify the file size."
for whitespace issues that hadn't been raised during review on
the firmware tree.
2020-03-16 16:18:52 +00:00
Dave Stevenson
e75e59d9e3 vcdbg/debugsym: Add option to specify the file size.
This allows the use of /dev/mem instead of /dev/vc-mem (ie it
should work on mainline kernel builds.
vcdbg needs the offset and size of memory to work.
The firmware should have inserted these into the kernel
command line as vc_mem.mem_base and vc_mem.mem_size, so libdebugsym
tries to extract those values from /proc/cmdline, or you can
provide them on the command line via -l and -s

(/dev/mem couldn't be used previously as libdebugsym tries to do
lseek(SEEK_END) to get the length, and that isn't supported by
/dev/mem).
2020-03-16 16:18:52 +00:00
Dave Stevenson
6e6a2c859a vc_image/video_decode: Move +16 lines for di_adv from vc_image to decoder
The advanced deinterlaced algorithm wanted 16 extra lines of height on
SAND images as a scratchpad. vc_image had been hacked to add those lines
to each and every SAND image.

HEVC decode uses SAND but doesn't care about that context, and will never
support interlaced content.

Remove the +16 lines from vc_image, and add specify it as a vpitch when
creating the image from within the decoder.
2020-02-28 19:36:43 +00:00
Phil Elwell
261c39eac2 dtoverlay: Support intra-overlay fragments
The firmware's overlay application code has long supported fragments
that target other fragments, but the kernel's dynamic overlay
mechanism doesn't support them. Avoid the restriction by partially
merging overlays with themselves before handing them over to the
kernel.
2020-02-28 19:33:33 +00:00
Phil Elwell
6782cf08f8 libdtovl: Add support for intra-overlay fragments
The kernel's dynamic overlay mechanism does not support fragments that
target other fragments, so modify dtoverlay_merge_overlay to make it
capable of partially merging an overlay with itself. After this pass
(indicated by passing in a NULL base_dtb pointer), all intra-overlay
fragments will have been applied and made dormant.
2020-02-28 19:33:33 +00:00
Phil Elwell
30ccc9a54d dtoverlay: A dry run needs no config directory
It's useful to be able to perform the dry run on any host, not just
a Raspberry Pi with runtime overlay support, and this works once the
validity check has been removed.
2020-02-28 19:33:33 +00:00
Phil Elwell
3cd0547e38 dtoverlay: Preserve exported labels
Up to now, all labels have been local to overlays. It has been possible
to explicitly add labels to the base DTB, but only in a way that is
ugly and fragile - it requires knowledge of the absolute path to where
the overlay will be applied (which could vary between DTBs), and would
break if the target of a fragment was changed.

Overlay writers can now choose to explicitly export some labels by
listing them as empty properties in a first-level node called
"__exports__". For example, to export a label called "newnode", add
the following node to the overlay:

    __exports__ {
        newnode;
    };

Make use of the new ability by replacing the deletion of the __symbols__
node with a call to dtoverlay_filter_symbols.
2020-02-28 19:33:33 +00:00
Phil Elwell
ec490ba588 libdtovl: Rewrite and merge exported labels
Exported labels must be rewritten to make the paths match
the fragment targets in the base DTB, and then merged into
the base DTB.
2020-02-28 19:33:33 +00:00
Phil Elwell
2631c4ff1b libdtovl: Allow labels to be exported
Give overlay writers the ability to export symbols so that they become
visible to other overlays once the overlay is applied. Symbols (labels)
for exporting should be listed as empty properties in a first-level
node called "__exports__".

The new API function dtoverlay_filter_symbols deletes non-exported
symbols, and dtoverlay_merge_overlay rewrites any exported symbols
so as to be relative to the base tree.
2020-02-28 19:33:33 +00:00
popcornmix
06bc6daa02 CMakeLists: Remove unwanted quoting See: https://github.com/raspberrypi/userland/issues/603 2020-01-14 17:33:59 +00:00
Serge Schneider
61203b1cea dtoverlay: remove $EUID != 0 case 2020-01-14 17:28:49 +00:00
Serge Schneider
f594b9b161 dtoverlay: only run lxpanelctl hooks when lxpanel is running 2020-01-14 17:28:49 +00:00
Dave Stevenson
1117308aaa vc_image: Default YUVUV to non-tall mode, with flag if required.
The HEVC block and various others don't require tall mode, it's only
the H264 codec block that has to keep the column stride below
64kB.

Switch the default configuration to NOT require tall mode.
All the users of SAND with the H264 block are currently internal
to the VPU (video decode will vc_image_convert, or pass an opaque
VC_IMAGE_T. Camera to video_encode either goes via planar, or is
passing a VC_IMAGE_T).
Add a flag to these when creating the images to request tall mode.
2020-01-14 17:28:49 +00:00
Dave Stevenson
c1b07d07b0 dtoverlay: Trim trailing whitespace from a symbol name
The path_len returned after looking up a symbol can include the
trailing NULL.
After the libdft bump, fdt_path_offset_namelen now checks the length
fields to ensure we aren't matching on a short string, and was
therefore failing due to that NULL.

Trim the path_len value of any trailing NULL characters.
2020-01-14 17:28:49 +00:00