852 Commits

Author SHA1 Message Date
Phil Elwell
2820a38ef0 dtoverlay: Extend DT parameter syntax
Add support for new DT parameter types:

* Inverted booleans:
    enable = <&node>,"disable!";

* Immediate string values:
    mcp3421 = <&mcp342x>,"compatible=microchip,mcp3421";
    mcp3422 = <&mcp342x>,"compatible=microchip,mcp3422";
  ...

* Immedate integer values:
    slow = <&device>,"clock-frequency:0=100000";
    i2c1 = <&fragment_1>,"target:0=", <&i2c1>;

* Byte strings:
    macaddr = <&eth0>,"local-mac-address[";
    mymac = <&eth0>,"local-mac-address[=01:23:45:67:89:ab";

* Lookup tables:
    translate = <&ov0>,"english",
                <&ov0>,"french{hello=bonjour,goodbye='au revoir',weekend,=?}",

    bus = <&fragment_1>,"target:0{0=",<&i2c0>,
                                ",1=",<&i2c1>,
                                ",2=",<&i2c2>,
                                "}";

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2020-01-14 17:28:49 +00:00
Phil Elwell
5c72a00a4c dtoverlay: Add functions to walk pinctrl node
dtoverlay_find_pins_for_device looks up a device node by its label,
verifies that it is enabled, and opens the list of pinctrl nodes.

dtoverlay_next_pin retrieves the details of the next pin (beginning
with the first) from the relevant pinctrl nodes, return 1 if found
or 0 if there are no more pins.
2020-01-14 17:28:49 +00:00
Phil Elwell
9277ca3ffc dtoverlay: Plug small memory leak
The dtoverlay library will leak an allocation of 4 bytes for every
application of an overlay that attempt to set a "reg" property that
doesn't already exist, e.g. the old i2c-gpio overlay. This is an
error case since it won't do what the user expects, but that's no
excuse to leak.
2020-01-14 17:28:49 +00:00
Phil ElWell
3d5c43768c Update libfdt to v1.5.1+
See: https://github.com/raspberrypi/userland/issues/582
2020-01-14 17:28:49 +00:00
Dagg Stompler
42ec119e03 vmcs_host/vcilcs: build only on 32 bit
vcilcs requries libbrcmEGL, libbrcmGLESv2 and libkhrn_client which have
only 32 bit versions currently, so disable it when building aarch64

Signed-off-by: Dagg Stompler <daggs@gmx.com>
2019-12-17 09:25:33 +00:00
Dave Stevenson
7d3c6b9f4c Add MMAL and MMAL_APPS to 64bit builds
Drops
host_applications/android/apps/vidtex
interface/mmal/openmaxil
interface/mmal/client(/brcmjpeg)
as they aren't directly supported and need further fixup for 64bit.
2019-12-11 14:04:13 +00:00
Dave Stevenson
76c0680083 MMAL and vcsm fixups for 64bit builds
Fixes various casts to/from integer of a different size, and printf
for size_t not using %zu.
2019-12-11 14:04:13 +00:00
Dave Stevenson
4946eb203f raspicam: Fix up so that it doesn't include brclegl libraries on 64 bit 2019-12-11 14:04:13 +00:00
Dave Stevenson
b20feb419e mmal: Support 64 bit clients
Where 32bit values are passed down to the VPU, these need to
be mapped into a lookup table within the client. Any pointers
that happen to be within structures such as MMAL_ES_FORMAT_T
are already recreated at each end, but the IPC structures must
always be of the same structure.

Where there are pointers to host side client contexts or component
handles, these are stored in lookup tables and a 32bit handle passed
to the VPU. On return these are looked back up again to convert
back to the handle.
2019-12-11 14:04:13 +00:00
imbens
13b33c8ee5 Fix confusing typo swapping _MAP and _ALLOC 2019-11-28 16:59:46 +00:00
Dave Stevenson
9238b8c5eb uservcsm: Fix incorrect struct type
vcsm_clean_invalid2 created and filled a struct for the older
kernel driver, and this caused problems when used against the
new driver.
Use the correct struct.
2019-11-18 17:03:12 +00:00
James Hughes
3e0bbcfea3 Update the GPS version to 23
Buster now has gpsd version 23, (up from 22)

This PR updates the camera code to reflect the change.
2019-11-14 15:20:55 +00:00
Christer Solskogen
666d281a7a Replace 'arch' with uname 2019-11-07 11:21:57 +00:00
Conn O'Griofa
5070cb7fc1 Remove legacy pkgconfig to avoid Mesa conflicts
When building software targeting Pi, it's common practice to use
the pkgconfig to assist building by specifying PKG_CONFIG_PATH.

Unfortunately, the presence of the legacy pkgconfig that conflict with
Mesa's libraries will cause issues for users that build against the
firmware pkgconfig, but wish to target Mesa. (Pi 4B or earlier revisions
using the f/kms overlay).

Although a possible workaround may be to omit the custom PKG_CONFIG_PATH
of the firmware pkgconfig during build, there are plausible use cases in
which to target a software build against Mesa whilst also leveraging
the non GL-specific firmware libraries (e.g. MMAL for hardware codec support
that works on the FKMS overlay, or BCM_HOST for basic board detection).

Note: this conflict is already resolved via the Raspbian packages by deliberately
omitting the conflicting .pc files during the packaging stage; see https://github.com/raspberrypi/firmware/issues/857
2019-10-24 08:16:46 +01:00
maazl
8062d68f49 Fixed hello_fft test cases with larger batch size (#581)
For batch size >= N/2 the test patterns were wrong and created out of
bound memory access.
2019-10-04 16:48:30 +01:00
Dave Stevenson
72bc33a6d8 Raspicam: Add 3D controls to RaspistillYUV and RaspiVidYUV
These two apps had missed the relevant calls to configure 3D
capture.

https://github.com/raspberrypi/userland/issues/579
2019-10-03 18:26:13 +02:00
Dave Stevenson
5fbf5de17b vcsm: If /dev/vcsm fails, then try /dev/vcsm-cma not already tried.
If export is not requested, then /dev/vcsm was the only device tried.

On aarch64 we are not including /dev/vcsm as it has too many
32 bit assumptions, therefore the sensible thing is to try
/dev/vcsm-cma, even if export hasn't been explicitly requested.
2019-10-03 16:19:32 +01:00
popcornmix
a14ee020d3 bcm_host: Add support for querying processor type and fkms status 2019-09-27 15:10:44 +02:00
Dave Stevenson
02c45b3266 vcsm: Add vcsm_clean_invalid2 to vcsm_cma
Not portable with 64 bit, and rather nasty to be exposing caching
operations to userspace, but effectively reimplement the same
as the older vcsm driver did.
2019-09-27 15:10:44 +02:00
Dave Stevenson
c2c06cc90c vcsm: Add support for vcsm_vc_addr_from_hdl to vcsm-cma path
It does have potential nasty failure mechanisms should you be
using 64 bit kernels etc, but should work for all current cases.
2019-09-03 23:25:25 +02:00
Dave Stevenson
2549c149d8 raspicam: Add -dn option to set the DispmanX display number
Allows options like -dn 7 to push the preview onto HDMI1.
Values are Dispmanx display enums, therefore predominantly
0 = DSI/DPI LCD
2 = HDMI0
3 = SDTV
7 = HDMI1
Behaviour should the chosen display not be present should be to
revert to the primary display that is present.
2019-09-03 16:06:51 +02:00
Gordon Hollingworth
2f85f2db00 Update issue templates 2019-07-29 09:27:20 +01:00
Phil Elwell
17d2fdc1ab bcm_host: Adjust for 64-bit physical addresses 2019-07-24 17:44:57 +01:00
popcornmix
2eee5e89ef fixup! Add full support for Argon10 as a new image format 2019-07-24 16:35:31 +01:00
popcornmix
23555674f9 dtoverlay: Update to stop lxpanel alsa correctly
From Simon Long
2019-07-24 16:31:47 +01:00
Dave Stevenson
945d7d0560 vcsm: Fixup vcsm_clean_invalid2
It was doing the wrong thing in both branches.
2019-07-24 16:29:43 +01:00
Dave Stevenson
4d9243ebc0 user-vcsm: Remove an erroneous debug line from vcsm_free. 2019-07-24 16:29:32 +01:00
Dave Stevenson
3eb81193e7 user-vcsm: Add option to pass in an external fd to vcsm 2019-07-24 16:29:23 +01:00
Dave Stevenson
fece203905 uservcsm: Error if export requested and existing connection doesn't use it.
Next step into making vcsm-cma the default.

Only one instance can be opened per process, and that is then used for
all clients. If the first client didn't ask for export so opened
vc-sm, but a subsequent request wants export (and therefore vcsm-cma)
then fail the vcsm_init.
2019-07-24 16:29:12 +01:00
Dave Stevenson
5c57ed546f user-vcsm: Add a local copy of the kernel dma-buf.h uapi header
Avoids entertainment in trying to cross-compile.
2019-07-24 16:29:00 +01:00
Dave Stevenson
18a4906311 user-vcsm: Reinstate vcsm_init as a funtion (not an inline)
Some apps may already be compiled looking for the symbol
vcsm_init, so having changed it to an inline will fail.

Reinstate vcsm_init as a function.
2019-07-24 16:28:46 +01:00
Dave Stevenson
0d6dda8d96 user_vcsm: Use const char* for names of objects
Avoids warnings from more recent compilers of const being stripped
2019-07-24 16:28:38 +01:00
Dave Stevenson
336c8c3d1e vc-sm-cma support 2019-07-24 16:27:58 +01:00
James Hughes
e3e28c7877 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.
2019-07-24 16:20:00 +01:00
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