- Nov 05, 2021
-
-
Maxime Ripard authored
Our HVS global state, when duplicated, will also copy the pointer to the drm_crtc_commit (and increase the reference count) for each FIFO if the pointer is not NULL. However, our atomic_setup function will overwrite that pointer without putting the reference back leading to a memory leak. Since the commit is only relevant during the atomic commit process, it doesn't make sense to duplicate the reference to the commit anyway. Let's remove it. Fixes: 9ec03d7f ("drm/vc4: kms: Wait on previous FIFO users before a commit") Signed-off-by: Maxime Ripard <maxime@cerno.tech>
-
Maxime Ripard authored
Commit 9ec03d7f ("drm/vc4: kms: Wait on previous FIFO users before a commit") introduced a wait on the previous commit done on a given HVS FIFO. However, we never cleared that pointer once done. Since drm_crtc_commit_put can free the drm_crtc_commit structure directly if we were the last user, this means that it can lead to a use-after free if we were to duplicate the state, and that stale pointer would even be copied to the new state. Set the pointer to NULL once we're done with the wait so that we don't carry over a pointer to a free'd structure. Fixes: 9ec03d7f ("drm/vc4: kms: Wait on previous FIFO users before a commit") Signed-off-by: Maxime Ripard <maxime@cerno.tech>
-
Maxime Ripard authored
The HVS global state functions return an error pointer, but in most cases we check if it's NULL, possibly resulting in an invalid pointer dereference. Fixes: 9ec03d7f ("drm/vc4: kms: Wait on previous FIFO users before a commit") Signed-off-by: Maxime Ripard <maxime@cerno.tech>
-
Maxime Ripard authored
Several DRM/KMS atomic commits can run in parallel if they affect different CRTC. These commits share the global HVS state, so we have some code to make sure we run commits in sequence. This synchronization code is one of the first thing that runs in vc4_atomic_commit_tail(). Another constraints we have is that we need to make sure the HVS clock gets a boost during the commit. That code relies on clk_requests and will remove the old requests and start a new one. We also need another, temporary, request for the duration of the commit. The algorithm is thus to start a temporary request, drop the previous one, do the commit, start a new request for the current mode, and finally drop the temporary request. However, the part that takes a temporary request and drops the older one runs before the commit synchronization code. Thus, under the proper conditions, we can end up dropping twice the old request, resulting in an use-after-free. To avoid it, let's move the clock setup in the protected section. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
-
Maxime Ripard authored
Commit 9ec03d7f ("drm/vc4: kms: Wait on previous FIFO users before a commit") introduced a global state for the HVS, with each FIFO storing the current CRTC commit so that we can properly synchronize commits. However, the refcounting was off and we thus ended up leaking the drm_crtc_commit structure every commit. Add a drm_crtc_commit_put to prevent the leakage. Fixes: 9ec03d7f ("drm/vc4: kms: Wait on previous FIFO users before a commit") Signed-off-by: Maxime Ripard <maxime@cerno.tech>
-
Maxime Ripard authored
If vc4_crtc_disable_at_boot runs, we call into the HDMI controller hooks to disable it but we never made sure it was running and the core clock was running either. This doesn't fix any known bugs, but it's still something we should make sure of. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
-
Maxime Ripard authored
On bind we will register the HDMI codec device but we don't unregister it on unbind, leading to a device leakage. Unregister our device at unbind. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
-
- Oct 01, 2021
-
-
Phil Elwell authored
Add the driver for the PEAK Systems USB CAN interface. See: https://github.com/raspberrypi/linux/issues/4583 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Serge Schneider authored
Signed-off-by: Serge Schneider <serge@raspberrypi.com>
-
Phil Elwell authored
Removing downstream PoE HAT support now there is an upstream equivalent. This reverts commit 79835ea5.
-
Phil Elwell authored
Removing downstream PoE HAT support now there is an upstream equivalent. This reverts commit 336d8599.
-
Phil Elwell authored
Removing downstream PoE HAT support now there is an upstream equivalent. This reverts commit ac11b5ee.
-
Phil Elwell authored
Removing downstream PoE HAT support now there is an upstream equivalent. This reverts commit 4cf7cde6.
-
Dom Cobley authored
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
-
Dom Cobley authored
Matches correct behaviour from DECODE and DEINTERLACE Signed-off-by: Dom Cobley <popcornmix@gmail.com>
-
Dom Cobley authored
Adds another /dev/video node wrapping image_fx doing deinterlace. Co-developed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Dom Cobley <popcornmix@gmail.com>
-
Dave Stevenson authored
As we're wanting to wrap the image_fx component for deinterlacing, add the deinterlace algorithm values to enum mmal_parameter_imagefx Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
If the client provides a bytesperline value in try_fmt/s_fmt then validate it and correct if necessary. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
The flags is a bitmask, so it's far easier to interpret as hex data instead of decimal. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
Should start_streaming fail, or buffers be queued during stop_streaming, they should be returned to the core as QUEUED and not (as currently) as ERROR. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
Being YUV420 formats, the step size is always 2 to avoid part chroma subsampling. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
The video decoder can support decoding interlaced streams, so add the required plumbing to signal this correctly. The encoder and ISP do NOT support interlaced data, so trying to configure an interlaced format on those nodes will be rejected. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
Adds enum mmal_interlace_type and struct mmal_parameter_video_interlace_type to allow for querying the interlacing mode on decoders. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
Add the buffer flags that the firmware uses to identify fields on interlaced video Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
In order to effectively guarantee that a V4L2_EVENT_SOURCE_CHANGE event occurs, adopt a default resolution of 32x32 so that it is incredibly unlikely to be decoding a stream of that resolution and therefore failing to note a "change" requiring the event. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
The older panel-raspberrypi-touchscreen driver had issues in that it also controlled the power for the touchscreen without having an appropriate hook for the touchscreen driver to control that. Mainline has now added a Toshiba TC358762 bridge driver, and a regulator/backlight driver for the ATTiny microcontroller on the board. That allows clean integration with the touchscreen driver. Switch the overlays over to using newer drivers. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
Add the two newer drivers for the Pi 7" touchscreen to the defconfigs Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
We need independent control of the resets for the panel&bridge, vs the touch controller. Expose the reset lines that are on the Atmel's port C via the GPIO API so that they can be controlled appropriately. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
The Atmel was doing a load of automatic sequencing of control lines, however it was combining the touch controller's reset with the bridge/panel control. Change to control the control signals directly rather than through the automatic POWERON control. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
The initial state of the Atmel is not defined, so ensure the backlight PWM is set to 0 by default. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
The driver was using the regmap lock to serialise the individual accesses, but we really need to protect the timings of enabling the regulators, including any communication with the Atmel. Use a mutex within the driver to control overall accesses to the Atmel, instead of the regmap lock. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
The Atmel is doing some things in the I2C ISR, during which period it will not respond to further commands. This is particularly true of the POWERON command. Increase delays appropriately, and retry should I2C errors be reported. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
There's no reason why 2 Raspberry Pi DSI displays can't be attached to a Pi Compute Module, so the backlight names need to be unique. Use the parent dev_name. It's not as readable, but is unique. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
If no interrupt is defined then a timer and workqueue are used to poll the controller. On remove these were not being cleaned up correctly. Fixes: ca61fdab "Input: edt-ft5x06: Poll the device if no interrupt is configured." Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
The Raspberry Pi 7" 800x480 panel uses a Toshiba TC358762 DSI to DPI bridge chip, so there is a requirement for the timings to be specified for the end panel. Add such a definition. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
rpi_touchscreen_i2c_read returns any errors from i2c_transfer, or the 8 bit received value. Check for error values before trying to process the data as valid. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
The panel has a prepare call which is before video starts, and an enable call which is after. The Toshiba bridge should be configured before video, so move the relevant power and initialisation calls to prepare. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dave Stevenson authored
If a call to rpi_touchscreen_i2c_write from rpi_touchscreen_probe fails before mipi_dsi_device_register_full is called, then in trying to log the error message if uses ts->dsi->dev when it is still NULL. Use ts->i2c->dev instead, which is initialised earlier in probe. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-