History log of /linux-master/drivers/staging/media/imx/imx-media-csc-scaler.c
Revision Date Author Comments
# 4797a3dd 31-Jan-2024 Lucas Stach <l.stach@pengutronix.de>

media: imx: csc/scaler: fix v4l2_ctrl_handler memory leak

Free the memory allocated in v4l2_ctrl_handler_init on release.

Fixes: a8ef0488cc59 ("media: imx: add csc/scaler mem2mem device")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>


# 61b20dde 12-Oct-2021 Rikard Falkeborn <rikard.falkeborn@gmail.com>

media: imx: Constify static struct v4l2_m2m_ops

The only usage of m2m_ops is to pass its address to v4l2_m2m_init(),
which takes a pointer to const v4l2_m2m_ops as argument. Make it const
to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 82bedfbf 14-Feb-2021 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

media: imx: utils: Add ability to filter pixel formats by mbus code

Add a media bus code argument to the imx_media_enum_pixel_formats(). If
set to a non-zero value, the function will only consider pixel formats
that match the given media bus code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 89b14485 04-Jan-2021 Ezequiel Garcia <ezequiel@collabora.com>

media: imx: Fix csc/scaler unregister

The csc/scaler device private struct is released by
ipu_csc_scaler_video_device_release(), which can be called
by video_unregister_device() if there are no users
of the underlying struct video device.

Therefore, the mutex can't be held when calling
video_unregister_device() as its memory may be freed
by it, leading to a kernel oops.

Fortunately, the fix is quite simple as no locking
is needed when calling video_unregister_device(): v4l2-core
already has its own internal locking, and the structures
are also properly refcounted.

Fixes: a8ef0488cc59 ("media: imx: add csc/scaler mem2mem device")
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 33d23637 08-Apr-2020 Fabio Estevam <festevam@gmail.com>

media: imx-media-csc-scaler: Use a shorter name for driver

Currently v4l2-compliance tool returns the following output:

Compliance test for imx-media-csc-s device /dev/video8:

Driver Info:
Driver name : imx-media-csc-s
Card type : imx-media-csc-scaler
Bus info : platform:imx-media-csc-scaler

The driver name string is limited to 16 characters, so provide
a shorter name in order to get a better output.

While at it, use the same shorter name for driver, card and platform.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# eef98882 06-Apr-2020 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

media: imx: utils: Rename format lookup and enumeration functions

Rename the format lookup and enumeration functions according to their
usage:

- Rename imx_media_(find|enum)_format() to *_pixel_format() to
explicitly state on what formats the functions operate. This aligns
the naming scheme with the media bus and IPU format functions that
already end with *_mbus_format() and *_ipu_formats().

- Rename all enumeration functions to pluralize 'formats' at the end, as
they enumerate multiple formats.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# a7d5003c 06-Apr-2020 Steve Longerbeam <slongerbeam@gmail.com>

media: imx: utils: Rename pixel format selection enumeration

After the introduction of the CS_SEL_BAYER flag, the "codespace"
pixel format selection enumeration wording no longer makes sense
(and even before, when selecting between YUV or RGB formats,
"codespace" was a misuse of the term).

Rename

- 'enum codespace_sel' to 'enum imx_pixfmt_sel'
- CS_SEL_* to PIXFMT_SEL_*
- local vars named cs_sel to fmt_sel or just sel

No functional changes.

Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 0cd5d896 06-Apr-2020 Laurent Pinchart <laurent.pinchart@ideasonboard.com>

media: imx: utils: Handle Bayer format lookup through a selection flag

The format lookup (and enumeration) functions take a boolean flag to
tell if Bayer formats should be considered. This leads to hard to read
lines such as

return enum_format(fourcc, NULL, index, cs_sel, true, false);

where the boolean parameters can easily be mixed. To make the code
clearer, add a CS_SEL_BAYER flag that can be passed through the
codespace_sel parameter of the lookup functions to replace the bool
parameter.

[slongerbeam@gmail.com: Instead of declaring CS_SEL_ANY as a bitfield
containing only CS_SEL_YUV | CS_SEL_RGB, declare CS_SEL_ANY as all of
the above (YUV, RGB, BAYER). A new enum is declared for the YUV | RGB
selection as CS_SEL_YUV_RGB, and that is used by sub-devices that
don't support BAYER and only allow selecting and enumerating YUV or RGB
encodings. CS_SEL_ANY is now only used by the CSI sub-devices and the
attached capture interfaces, since only those devices support BAYER
formats.]

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 0e17c50f 02-Feb-2020 Hans Verkuil <hverkuil-cisco@xs4all.nl>

media: staging/media: rename VFL_TYPE_GRABBER to _VIDEO

'GRABBER' is a weird name, all other types map to the /dev
device names. Rename to 'VIDEO' to be consistent with the
other types.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 968bce2f 28-Aug-2019 YueHaibing <yuehaibing@huawei.com>

media: imx: remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>


# a8ef0488 14-Aug-2019 Philipp Zabel <p.zabel@pengutronix.de>

media: imx: add csc/scaler mem2mem device

Add a single imx-media mem2mem video device that uses the IPU IC PP
(image converter post processing) task for scaling and colorspace
conversion.
On i.MX6Q/DL SoCs with two IPUs currently only the first IPU is used.

The hardware only supports writing to destination buffers up to
1024x1024 pixels in a single pass, arbitrary sizes can be achieved
by rendering multiple tiles per frame.

[slongerbeam@gmail.com: use ipu_image_convert_adjust(), fix
device_run() error handling, add missing media-device header,
unregister and remove the mem2mem device in error paths in
imx_media_probe_complete() and in imx_media_remove(), updated
for sync subdev registration]

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: correct two minor checkpatch issues]
[hverkuil-cisco@xs4all.nl: sparse warning: make imx6_media_probe_complete static]
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>