| f78073e8 | 06-May-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
Revert "media: renesas: vsp1: brx: Fix format propagation"
This reverts commit 937f3e6b51f1cea079be9ba642665f2bf8bcc31f.
The change to format propagation in the BRx broke configuration of the DRM p
Revert "media: renesas: vsp1: brx: Fix format propagation"
This reverts commit 937f3e6b51f1cea079be9ba642665f2bf8bcc31f.
The change to format propagation in the BRx broke configuration of the DRM pipeline. Revert it to fix the regression.
The original commit was meant to fix a v4l2-compliance failure, with no known userspace applications being affected beside test tools. Reverting is the simplest option, a more comprehensive fix can be developed (and tested more thoroughly) later.
Reported-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Closes: https://lore.kernel.org/linux-media/CA+V-a8t481xuwava0nb7uY9CUPqFWZ_8EP0xrK3BgumP7HDcLg@mail.gmail.com Fixes: 937f3e6b51f1 ("media: renesas: vsp1: brx: Fix format propagation") Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # On RZ/T2H Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Link: https://patch.msgid.link/20260506215650.1897177-3-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 133ac42a | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: Initialize format on all pads
The state initialization function vsp1_entity_init_state() incorrectly leaves the last entity pad out when initializing formats due to an off by o
media: renesas: vsp1: Initialize format on all pads
The state initialization function vsp1_entity_init_state() incorrectly leaves the last entity pad out when initializing formats due to an off by one error. Fix it.
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-14-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 57485b54 | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: Implement control events
The V4L2 API requires drivers that expose controls to implement control notification events. This is enforced by v4l2-compliance. Add event handling to
media: renesas: vsp1: Implement control events
The V4L2 API requires drivers that expose controls to implement control notification events. This is enforced by v4l2-compliance. Add event handling to the VSP1 entities that create controls to fix the compliance failures.
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-13-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| d17d21bb | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: histo: Fix format setting
The histogram .set_fmt() handler suffers from two problems:
- When operating on the source pad, it returns correct information to userspace, but do
media: renesas: vsp1: histo: Fix format setting
The histogram .set_fmt() handler suffers from two problems:
- When operating on the source pad, it returns correct information to userspace, but does not store the format in the subdev state. Subsequent calls to .get_fmt(), handled by the vsp1_subdev_get_pad_format() helper, will not return the correct information.
- When operating on the sink pad, it uses the vsp1_subdev_set_pad_format(), which propagates the sink format to the source, incorrectly overwriting the fixed source format.
The first issue could be fixed by implementing the set format operation with vsp1_subdev_get_pad_format() on the source pad, if it wasn't that .set_fmt() is also used to initialize the subdev state in vsp1_entity_init_state(). The histogram would need a custom .init_state() handler.
As the second issue would anyway overwrite the format, and therefore requires a custom .set_fmt() implementation, fix both issues without using the helpers.
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-12-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 1b5db4e3 | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: histo: Fix size enumeration
The histogram supports size enumeration on the sink pad only, as the source pad outputs a metadata format. The correct error code when enumeration i
media: renesas: vsp1: histo: Fix size enumeration
The histogram supports size enumeration on the sink pad only, as the source pad outputs a metadata format. The correct error code when enumeration is not supported is -ENOTTY, not -EINVAL. Fix it.
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-11-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| a7985d28 | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: histo: Fix code enumeration
The histogram media bus code enumeration does not check the index when operating on the source pad, resulting in an infinite loop if userspace keeps
media: renesas: vsp1: histo: Fix code enumeration
The histogram media bus code enumeration does not check the index when operating on the source pad, resulting in an infinite loop if userspace keeps enumerating code without any loop boundary. Fix it by returning an error for indices larger than 0 as the pad supports a single format.
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-10-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| ae16c0d6 | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: hsit: Fix size enumeration
The HSIT entity performs format conversion, which leads to incorrect results with the vsp1_subdev_enum_frame_size() helper. Implement a custom .enum_
media: renesas: vsp1: hsit: Fix size enumeration
The HSIT entity performs format conversion, which leads to incorrect results with the vsp1_subdev_enum_frame_size() helper. Implement a custom .enum_frame_size() handler that correctly validates the media bus code. Size validation is identical to the helper.
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-9-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 937f3e6b | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: brx: Fix format propagation
The format width and height is never propagated to the BRX source pad, leaving its initial configuration invalid. Propagate the whole format from th
media: renesas: vsp1: brx: Fix format propagation
The format width and height is never propagated to the BRX source pad, leaving its initial configuration invalid. Propagate the whole format from the first sink pad to the source pad instead of only propagating the media bus code. This fixes compliance with the subdev format propagation rules.
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-8-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| d9a2bce9 | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: rwpf: Fix media bus code and frame size enumeration
The RWPF can't freely convert between all input and output formats. They support RGB <-> YUV conversion, but HSV formats can
media: renesas: vsp1: rwpf: Fix media bus code and frame size enumeration
The RWPF can't freely convert between all input and output formats. They support RGB <-> YUV conversion, but HSV formats can't be converted. Fix the media bus code and frame size enumeration to take this into account on the source pad.
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-7-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 78db71a2 | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: rpf: Fix crop width and height clamping
The vsp1 driver doesn't enforce a minimum value on the RPF crop rectangle width and height. Empty rectangles are accepted, leading to in
media: renesas: vsp1: rpf: Fix crop width and height clamping
The vsp1 driver doesn't enforce a minimum value on the RPF crop rectangle width and height. Empty rectangles are accepted, leading to incorrect hardware behaviour. Fix it by adding minimum width and height constraints to the value clamping.
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-6-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 55823379 | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: rpf: Fix crop left and top clamping
The RPF doesn't enforces the alignment constraint on the sink pad format, which could have an odd size, possibly down to 1x1. In that case,
media: renesas: vsp1: rpf: Fix crop left and top clamping
The RPF doesn't enforces the alignment constraint on the sink pad format, which could have an odd size, possibly down to 1x1. In that case, the upper bounds for the left and top coordinates clamping would become negative, cast to a very large positive value. Incorrect crop rectangle coordinates would then be incorrectly accepted.
A second issue can occur when the requested left and top coordinates are negative. They are cast to a large unsigned value, clamped to the maximum. While the calculation will produce valid values for the hardware, this is not compliant with the V4L2 specification that requires values to be adjusted to the closest valid value.
Fix both issues by switching to signed clamping, with an explicit minimum to adjust negative values, and adjusting the clamp bounds to avoid negative upper bounds.
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-5-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 46d3ad60 | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: Fix code checks in frame size enumeration
The media bus code passed to the .enum_frame_size() operation for the sink pad is required to be supported by the device, but not to m
media: renesas: vsp1: Fix code checks in frame size enumeration
The media bus code passed to the .enum_frame_size() operation for the sink pad is required to be supported by the device, but not to match the current format. All entities that use the vsp1_subdev_enum_frame_size() helper, as well as the SRU and UDS entities that implement the operation manually, perform the check incorrectly.
Fix the issue by implementing the correct code check in the vsp1_subdev_enum_frame_size(). For the SRU and UDS, to avoid duplicating code, use the vsp1_subdev_enum_frame_size() as a base and override the enumerated size on the source pad with entity-specific constraints.
While at it, include the missing <linux/mutex.h> as the code locks mutexes.
Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-4-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 2cbf20a3 | 19-Mar-2026 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: renesas: vsp1: Store size limits in vsp1_entity
Most entities use the vsp1_subdev_enum_frame_size() and vsp1_subdev_set_pad_format() helper functions to implement the corresponding subdev ope
media: renesas: vsp1: Store size limits in vsp1_entity
Most entities use the vsp1_subdev_enum_frame_size() and vsp1_subdev_set_pad_format() helper functions to implement the corresponding subdev operations. Both helpers are given the minimum and maximum sizes supported by the entity as arguments, requiring each entity to implement a wrapper.
Replace the function arguments with storing the size limits in the vsp1_entity structure. This allows dropping most of the .enum_frame_size() and .set_fmt() wrappers in entities.
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com> Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # HiHope RZ/G2M Link: https://patch.msgid.link/20260318235907.831556-3-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| b32655a5 | 21-Aug-2025 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: vsp1: Export missing vsp1_isp_free_buffer symbol
The vsp1_isp_free_buffer() function implemented by the vsp1 driver is part of the API exposed to the rcar-isp driver. All other symbols except
media: vsp1: Export missing vsp1_isp_free_buffer symbol
The vsp1_isp_free_buffer() function implemented by the vsp1 driver is part of the API exposed to the rcar-isp driver. All other symbols except that one are properly exported. Fix it.
Fixes: d06c1a9f348d ("media: vsp1: Add VSPX support") Cc: stable@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|
| 27796674 | 10-Aug-2025 |
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
media: Reset file->private_data to NULL in v4l2_fh_del()
Multiple drivers that use v4l2_fh and call v4l2_fh_del() manually reset the file->private_data pointer to NULL in their video device .release
media: Reset file->private_data to NULL in v4l2_fh_del()
Multiple drivers that use v4l2_fh and call v4l2_fh_del() manually reset the file->private_data pointer to NULL in their video device .release() file operation handler. Move the code to the v4l2_fh_del() function to avoid direct access to file->private_data in drivers. This requires adding a file pointer argument to the function.
Changes to drivers have been generated with the following coccinelle semantic patch:
@@ expression fh; identifier filp; identifier release; type ret; @@ ret release(..., struct file *filp, ...) { <... - filp->private_data = NULL; ... - v4l2_fh_del(fh); + v4l2_fh_del(fh, filp); ...> }
@@ expression fh; identifier filp; identifier release; type ret; @@ ret release(..., struct file *filp, ...) { <... - v4l2_fh_del(fh); + v4l2_fh_del(fh, filp); ... - filp->private_data = NULL; ...> }
@@ expression fh; identifier filp; identifier release; type ret; @@ ret release(..., struct file *filp, ...) { <... - v4l2_fh_del(fh); + v4l2_fh_del(fh, filp); ...> }
Manual changes have been applied to Documentation/ to update the usage patterns, to drivers/media/v4l2-core/v4l2-fh.c to update the v4l2_fh_del() prototype and reset file->private_data, and to include/media/v4l2-fh.h to update the v4l2_fh_del() function prototype and its documentation.
Additionally, white space issues have been fixed manually in drivers/usb/gadget/function/uvc_v4l2.c
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
show more ...
|