]> git.ipfire.org Git - thirdparty/linux.git/commit
media: renesas: vsp1: histo: Fix format setting
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 18 Mar 2026 23:59:05 +0000 (01:59 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 25 Mar 2026 09:25:49 +0000 (10:25 +0100)
commitd17d21bb0e161bdd52135bca5d461b7fe672e0ee
treedf4fabffd6e22dbf578fd34717d24f3d5f05e129
parent1b5db4e308443227ed5b97d8e5c287c6fc34eb4b
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>
drivers/media/platform/renesas/vsp1/vsp1_histo.c