Commit Graph

718 Commits

Author SHA1 Message Date
Tim Gover
55a683e9b9 EDID: Add HDMI_I2C driver for 2711
The HDMI block on 2711 has a dedicate I2C module in order to support
SCDC and HDCP. Create a new I2C driver which implements DDC read and
SCDC that can be used by both the hdmi_2711 driver and the edid
middlware.

Remove the CHIPIT specific configuration which forced dummy edid and
hotplug on 2711. The preferred HDMI mode selection from EDID should now
work in the same manner as on Pi3.
2019-07-24 16:16:40 +01:00
Dave Stevenson
ceb18b1b04 mmal_vc_shm: Expand error message 2019-07-24 16:14:17 +01:00
Dave Stevenson
1eeb882dd6 mmal_vc_shm: Refcount init/exit, and call on component create/destroy
Calling mmal_vc_shm from the constructor means that vcsm_init
is initialised very early. Should another user come along and
want to use export then it can't.

Move mmal_vc_shm init and exit calls to mmal_vc_component_create /
destroy so that other things can be created first, and reference
count calls so that it can be called for every component.
2019-07-24 16:08:53 +01:00
James Hughes
917d4cecd2 Fix tvservice -d option
Wasn't handling the new bitmap based flag for ID correctly
in the send command function. Not picked up before as this
function is not used by many commands, and it was simply missed

Moved the command check to before the point where the ID bit is set.
2019-07-24 16:05:00 +01:00
James Hughes
ebb96ac7e7 Change to tvservice commands
Commands now use a bit set to specify that they include
a display_id parameter, rather than having two sets of
commands, one with and one without the display_id.

Makes things a lot easier.

Tested on Pi4 and Pi3 with older firmware to check backwards
compatibility. Seemed OK.
2019-07-24 16:04:46 +01:00
James Hughes
6df8668220 tvservice backwards compatibility
Previously, not able to run new tvservice app on firmware that
did not support the new commands. You could use old apps on new
firmware though!

This fixes this and forces use of old non-ID display commands
on older firmware.
2019-07-24 16:04:37 +01:00
Tim Gover
02d186a871 vcimage: Add basic support for VC_IMAGE_RGBA1010102
Add basic support for deep color RGBA. Images can be uploaded/copied and
displayed via dispmanx but there is no support for converting to other
formats.
2019-07-24 16:03:33 +01:00
Dave Stevenson
93af8ff10e Add support for Rec2020 colour space in vc_image, IL, and MMAL 2019-07-24 16:03:33 +01:00
Dave Stevenson
6d22c1ee19 Add full support for Argon10 as a new image format
Argon 10bit YUV had been temporarily hacked in as a modified
YUV_UV format. Actually add it as a new image format at Scalerlib,
vc_image, IL, and MMAL levels.
2019-07-24 16:03:33 +01:00
popcornmix
fd10e48d30 argon: Initial argon image format support 2019-07-24 16:03:33 +01:00
Tim Gover
91dae74ffd warnings: Missing strlen declaration in fdt 2019-07-24 16:03:33 +01:00
James Hughes
22e3124dcd Renamed the DISPMANX_ID_HDMI* defines to be more consistent
DISPMANX_ID_HDMI ->DISPMANX_ID_HDMI0
DISPMANX_ID_HDMI2->DISPMANX_ID_HDMI1
2019-07-24 16:03:33 +01:00
James Hughes
d0b791235b Large change to TVService to support multiple devices 2019-07-24 16:03:33 +01:00
Tim Gover
a59e8f6b91 2711: HDMI: EXPERIMENTAL - Dual HDMI support
NOTE: Dual HDMI mode is only enabled if hdmi_test | 0x2 != 0

The reason for conditionally enabling dual HDMI mode because this might
cause problems if force_hotplug is enabled. Instead of enabling one
display this would enable two displays. A proper configuration for
dual HDMI has yet to be designed.

Change the static state to arrays of state structures indexed by HDMI
core.

It compiles and both HDMI cores seem to work individually.

Concurrent display usage works with one display just displaying the HVS
background colour.

HDCP functions have NOT been updated. The code won't compile if
WANT_HDCP is enabled. HDCP isn't supported on Raspberry Pi and the 2711
HDCP functionality has changed so this would need re-writing anyway.

TODO:
* Create hdmi_primary instead of using C(hdmi_core) everywhere
* Fix issue where hotplug of HDMI0 causes missaligned exception in EOF
  frame handler for core 0 - seems to only happen with logging enabled
  and might be a long standing issue.
2019-07-24 16:03:33 +01:00
James Hughes
d06c90e4d5 Fix tv_server so it responds with invalid call when unrecognised commmand sent
Previously no response was sent so source of call locks up.
Also handles wrong number of parameters in the same way.
2019-07-24 16:03:32 +01:00
Dave Stevenson
db59a006f3 vcos: Add reporting of which variant was built
Minor string replacement so that
 - raspberrypi_full gotes to start_x
 - raspberrypi_debug goes to start_db
 - raspberrypi goes to start
to match the ELF names. All others are left untouched.

Includes reporting it via gencmd version and mailbox service.
2019-07-24 15:22:37 +01:00
Dave Stevenson
c566fafdea arm_loader/hdmi: Add mailbox call to set custom display timings
Used by FKMS to change display mode.

This also adds hooks to arm_dispmanx into HDMI so that elements
are restored after mode changes.
2019-07-24 15:22:37 +01:00
Tim Gover
77d7159cf5 vc-hdmi: Add HDMI_PICTURE_ASPECT_256_135 for DCI 4K
Add the new apsect ratio enum for DCI 4K modes.
2019-07-24 15:22:37 +01:00
Dave Stevenson
ed1958642c debug_sym: Remove annoying message should fb copy fail
Any kernel not using bcm2708_fb as the FB driver is likely to
fail the FBIODMACOPY ioctl that vcdbg tries to use to access
the hidden 16MB of RAM behind the peripheral space.
Remove the error message as it drops back to using /dev/mem
instead anyway.
2019-07-24 15:22:37 +01:00
James Hughes
aa4e83406a Update vcdbg help
The help text is now clearer.
When using vcdbg help <command>, prevent the command name itself
being displayed twice.

Fixes https://github.com/raspberrypi/firmware/issues/594
2019-07-24 15:22:37 +01:00
Dave Stevenson
f00a1189b9 interface: Drop vcfiled
vcfiled isn't used, nor the firmware side built into the image,
therefore drop building it from the cmake targets.
2019-07-24 15:22:37 +01:00
popcornmix
5b1a3fbef7 mmalomx_util_params_camera: Sync with vc4 tree 2019-07-24 15:22:37 +01:00
Dave Stevenson
8e63faa4ec IL: Add XRGB8888 and XBGR8888, and support on video_render, isp, and hvs
Adds new video formats XRGB8888 and XBGR8888 as no-alpha
versions of ARGB8888 and ABGR8888.

The MMAL types of MMAL_ENCODING_RGB32 and MMAL_ENCODING_BGR32
were already defined but didn't map onto anything. The functionality
could be replicated by setting the per-plane alpha on the HVS,
but it makes some more sense to support it explicitly.
2019-07-24 15:22:37 +01:00
Dave Stevenson
c868a50ca5 Expose display timings via the mailbox
FKMS wants to add the relevant modes for DPI and DSI displays,
and the VEC.
Plumbing required to expose the PV timings info for these displays,
and then added the mailbox call.
2019-07-24 15:22:37 +01:00
Tim Gover
896c747f97 HVS: Update HVS channel options to specify pixelvavle
Rename use_pixelvalve1 to a more generic use_pixelvalve allowing hdmi to
specify which hdmi core / pixelvalve is being selected.
2019-07-24 15:22:37 +01:00
Tim Gover
91da39af21 vcgencmd: Increase buffer size and ensure strings are null terminated
The current maximum response size for a non-bulk VCHI transfer is
4092 bytes. Increase the GENCMD buffer size to match this.

Additionally, ensure that the buffer is null terminated and use
the size defined in in the vcgencmd_defs header instead of
hard-coding this.
2019-07-19 16:33:53 +01:00
Naushir Patuck
c5a5234152 Add AWB Grey World mode option.
This mode should be used for NoIR cameras.
Only valid for the new RPi AWB algorithm.
2019-07-16 13:09:26 +01:00
Paolo
30c89b53f2 Fix for missing cleanup step for hello_videocube and hello_teapot
Fixed missing cleanup step in hello_videocube and hello_teapot, and fixed lockup when cleaning up egl_render component
2019-06-11 11:33:05 +01:00
James Hughes
95b29b556a Add media flushing call on when writing bitstream (#554)
Under certain circumstances, the Linux file system write behind caching
gets so much data to write in one go that is causes frames to be dropped.
The current fflush is not sufficient as that only flushes the C library
caches, not the Linux filesystem caches.

This fix forces data to be written to media as soon as it arrives, using
fdatasync().

Note, currently it's conditional on the --flush command line parameter.
2019-06-03 11:43:34 +01:00
James Hughes
3ddc4e673a Fix for missing timestamps when data exceed one buffers worth (#553)
The addition of a NAL flag appears to have broken timestamps with
large buffers. This simplifies the 'if' around timestamps and takes
the NAL change in to account.

Also fixed up some bad code formatting after the if statement. Yes, I know.
2019-06-03 11:06:02 +01:00
andrum99
517cdc30da Improve vcgencmd (#552)
Add basic usage, detect and report errors to STDERR, and add link to forthcoming documentation on the website.
2019-05-01 13:50:52 +01:00
James Hughes
ff2bd45521 Update README.md 2019-04-15 11:43:13 +01:00
Dave Stevenson
379398ed7f mmal_vc_api: Report FLAG_TRANSMISSION_FAILED on VCHI bulk_rx failure
Fix a couple of FIXME's where no error was reported should a
bulk receive fail to start. The buffer header got forwarded
to the app with length 0, so the client was left with little
idea what had gone wrong.
2019-03-19 20:35:13 +00:00
Dave Stevenson
0512645268 raspicam: Set preview fps in raspivid and raspividyuv.
If no output file is defined, then only the preview port is active
and it doesn't get the frame rate programmed based on the command
line (0 is used for variable FPS).
Set the fps based on the command line for the preview port.
2019-03-19 20:35:13 +00:00
Dave Stevenson
2e2899cc6f Fix ups for James 2019-03-05 10:53:04 +00:00
Dave Stevenson
391c04647b Review fixups 2019-03-05 10:53:04 +00:00
Dave Stevenson
8b8f6571b6 buildme: Add option for ARM64 builds via either native or cross compile
Supports native builds on aarch64 machines.

Supports making a 64-bit build via either cross compiling, or on
aarch64 machines.
Both options require the addition of --aarch64 to the command line,
otherwise 32-bit libraries will be built.

Cross compiling requires the aarch64-linux-gnu- compile tools to
be installed (packages gcc-5-aarch64-linux-gnu and g++-aarch64-linux-gnu
on Ubuntu).
2019-03-05 10:53:04 +00:00
tvjon
0b1293c70d mmalcam: Create Makefile 2019-03-04 15:16:04 +00:00
tvjon
860415858a mmalplay: Create Makefile 2019-03-04 15:16:04 +00:00
Dave Stevenson
0c8aa8101c raspivid: Stop --raw option resetting --raw-format to YUV
Observed on
https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=189830&start=25#p1432589

The raspivid command line
raspivid --raw-format rgb --raw foo.rgb -o foo.h264
actually saved YUV data to foo.rgb as the --raw option reset
raw-format to YUV mode.

Renumber the enums so that YUV is 0, and use the fact the state
structure is memset to 0 (and therefore YUV) to avoid the
-raw parser needing to change the format at all.
2019-03-04 14:54:03 +00:00
James Hughes
aa79238341 Fixed up overflow in microsecond timer
Was using a 32 bit calculation when should have been 64bit.
2019-03-04 11:54:57 +00:00
Joel Winarske
e5803f2c98 fix cross-compile install failing 2019-01-15 15:59:39 +00:00
James Hughes
6da49bce07 Update README.md 2019-01-09 17:32:31 +00:00
David Girault
20f03b4f39 Allow aborting on write error to stdout when -t 0 specified (#521)
* Allow aborting on write error to stdout when `-t 0` specified

* Allow aborting on write error to stdout when `-t 0` specified in raspividyuv
2019-01-09 16:12:02 +00:00
popcornmix
3617b3f5c0 Merge pull request #520 from JamesH65/new_microsecond_timer
Move to standard Linux  microsecond count
2019-01-08 13:19:03 +00:00
James Hughes
b98b3af8d5 Move to standard Linux microsecond count
The camera apps were using vcos_getmicrosecs64 which
was in turn using gettimeofday. This means timelapse code
goes very wrong when the date/time is changed while the
timelapse is being done.

Moved to a scheme based on clock_gettime(CLOCK_MONOTONIC_RAW)
which is not affected by underlying clock changes.
2019-01-08 09:43:22 +00:00
James Hughes
7cbfbd38d9 Added H264 slicing. (#486)
This is a modified version of that provided by shizukachan

We are having to limit this to widths < 1280 due to an as yet
unfixed firmware issue. I've taken a quick look - its not
obvious what is going on.
2018-12-12 15:34:56 +00:00
James Hughes
0858c4bd17 Add GPS annotation to the camera apps output (#517)
This involved:
Moving GPS code to own file so can be used in all apps
Adding option in apps to apply GPS data to annotation

Enabled with the -gps flag on command line plus -a 2 to turn on
application annotation.
2018-12-12 13:23:16 +00:00
popcornmix
27d03c337e Merge pull request #508 from kaomoneus/issue-1077-attr_vertex2
Fixed #1077: hello_triangle2, 'vertex' attribute for Mandelbrot
2018-12-11 17:17:57 +00:00
James Hughes
febf337f83 Added annotate options to raspiyuv and raspividyuv
This brings them in to line with the non-YUV variants.
2018-12-11 10:59:47 +00:00