Helen Koike [Fri, 24 Jul 2020 16:25:55 +0000 (18:25 +0200)]
media: staging: rkisp1: uapi: remove __packed
The driver access struct's fields one by one, they are not blindly
copied to/from the hardware, so we can remove __packed from the
structs.
Tested on Scarlet Chromebook with ChromeOS stack and verified images
with the Camera app.
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Sat, 15 Aug 2020 10:37:24 +0000 (12:37 +0200)]
media: staging: rkisp1: params: don't release lock in isr before buffer is done
In the irq handler 'rkisp1_params_isr', the lock 'config_lock'
should be held as long as the current buffer is used. Otherwise the
stop_streaming calback might remove it from the list and
pass it to userspace while it is referenced in the irq handler.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Sat, 15 Aug 2020 10:37:22 +0000 (12:37 +0200)]
media: staging: rkisp1: params: use rkisp1_param_set_bits to set reg in isr
replace a read and write of RKISP1_CIF_ISP_CTRL register
in the isr with the 'rkisp1_param_set_bits' function
that does that.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Sat, 15 Aug 2020 10:37:21 +0000 (12:37 +0200)]
media: staging: rkisp1: call params isr only upon frame out
Currently the params isr is called and then returned when
isp-frame interrupt is not set. This condition is already
tested in the isp's isr so move the call under the condition
in the isp's isr.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 25 Jun 2020 18:50:17 +0000 (20:50 +0200)]
media: staging: rkisp1: change type of fields in 'rkisp1_cif_isp_lsc_config' from u32 to u16
The fields in struct 'rkisp1_cif_isp_lsc_config' need to hold
values of 12 bits, therefore it is enough to declare them as u16.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 25 Jun 2020 18:50:16 +0000 (20:50 +0200)]
media: staging: rkisp1: replace two identical macros with one
The two macros RKISP1_CIF_ISP_LSC_{GRAD/SIZE}_TBL_SIZE have
the same value which is the number of sectors in the grads
and size parameters. Therefore there is no need for two
different macros. Replace them with one macro
RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE. Also use the macro
when iterating the arrays instead of hardcoded '4'.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 25 Jun 2020 18:50:15 +0000 (20:50 +0200)]
media: staging: rkisp1: set "*_data_tbl" fields in rkisp1_cif_isp_lsc_config as 2D arrays
Currently the fields '*_data_tbl' in the struct
'rkisp1_cif_isp_lsc_config' are one dimensional arrays
of size 290. The entries are accessed in a nested
loop by summing two indexes for the rows and columns.
Therefore it fits better to define the arrays as two
dimensional arrays of size 17x17.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Tue, 18 Aug 2020 08:18:01 +0000 (10:18 +0200)]
media: Documentation: v4l: move table of v4l2_pix_format(_mplane) flags to pixfmt-v4l2.rst
The table of the flags of the structs
v4l2_pix_format(_mplane) is currently in pixfmt-reserved.rst
which is wrong, it should be in pixfmt-v4l2.rst
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 6 Aug 2020 10:34:17 +0000 (12:34 +0200)]
media: staging: rkisp1: improve documentation of rkisp1-common.h
Add more detailed documentation of the structs and functions
in rkisp1-common.h
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 6 Aug 2020 10:34:16 +0000 (12:34 +0200)]
media: staging: rkisp1: group declaration of similar functions together
In file rkisp1-common.h, group declaration of register/unregister
functions together and group other functions together to make
the code easier to read.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 6 Aug 2020 10:34:15 +0000 (12:34 +0200)]
media: staging: rkisp1: remove declaration of unimplemented function 'rkisp1_params_isr_handler'
The file rkisp1-common.h has a function declarion
'rkisp1_params_isr_handler' that is not implemented.
Remove it.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 6 Aug 2020 10:34:14 +0000 (12:34 +0200)]
media: staging: rkisp1: unify (un)register functions to have the same parameters
The different register/unregister functions receive
different parameters. This patch unify them so they all receive just
'struct *rkisp1_device' as parameter.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 6 Aug 2020 10:34:13 +0000 (12:34 +0200)]
media: staging: rkisp1: don't define vaddr field in rkisp1_buffer as an array
The field vaddr in rkisp1_buffer struct is used only by the
rkisp1-stats and rkisp1-params entities and they both use only
vaddr[0] so there is no need to define this field as an array.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 6 Aug 2020 11:50:33 +0000 (13:50 +0200)]
media: staging: rkisp1: improve documentation in file rkisp1-config.h
There is some missing documentation of structs and
fields in rkisp1-config.h. This patch improves the
documentation.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 6 Aug 2020 11:50:32 +0000 (13:50 +0200)]
media: staging: rkisp1: rename RKISP1_CIF_ISP_STAT_AFM_FIN to RKISP1_CIF_ISP_STAT_AFM
The flag RKISP1_CIF_ISP_STAT_AFM_FIN indicates userspace
that auto-focus measurements were collected. Therefore
the suffix _FIN in the flag's name does not fit.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 6 Aug 2020 11:50:31 +0000 (13:50 +0200)]
media: staging: rkisp1: replace 3 fields 'ct_offset_*' with one array
The struct rkisp1_cif_isp_ctk_config contains 3 fields
ct_offset_{rgb}. Replace them with one array field 'ct_offset[3].
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Dafna Hirschfeld [Thu, 6 Aug 2020 11:50:30 +0000 (13:50 +0200)]
media: staging: rkisp1: replace 9 coeff* fields with a 3x3 array
The struct rkisp1_cif_isp_ctk_config has 9 fields 'coeff*' for the
3x3 color correction matrix. Replace these fields with one 3x3
array coeff[3][3] and document the field.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sylwester Nawrocki [Mon, 10 Aug 2020 15:32:40 +0000 (17:32 +0200)]
media: exynos4-is: Simplify the pinctrl code
There is no need to request the "idle" pinctrl state in the driver as that
is implemented in the driver core and the pinctrl_pm_* API can be used for
switching between the default and the idle state.
Simplify the pinctrl code to only request and check for the mandatory
"default" pinctrl state.
Switching between the default/idle pinctrl state is not yet implemented
in the driver and this patch doesn't change that.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sylwester Nawrocki [Mon, 10 Aug 2020 15:32:39 +0000 (17:32 +0200)]
media: Revert "media: exynos4-is: Add missed check for pinctrl_lookup_state()"
The "idle" pinctrl state is optional as documented in the DT binding.
The change introduced by the commit being reverted makes that pinctrl state
mandatory and breaks initialization of the whole media driver, since the
"idle" state is not specified in any mainline dts.
This reverts commit
18ffec750578 ("media: exynos4-is: Add missed check for pinctrl_lookup_state()")
to fix the regression.
Fixes:
18ffec750578 ("media: exynos4-is: Add missed check for pinctrl_lookup_state()")
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Andrey Konovalov [Fri, 14 Aug 2020 20:54:03 +0000 (22:54 +0200)]
media: camss: __video_try_fmt(): don't use hardcoded constants
Use the definitions introduced by commit "media: camss: add support
for vidioc_enum_framesizes ioctl" instead of the hardcoded values.
Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Andrey Konovalov [Fri, 14 Aug 2020 20:54:02 +0000 (22:54 +0200)]
media: camss: add support for vidioc_enum_framesizes ioctl
VIDIOC_ENUM_FRAMESIZES support in the video capture driver is required by
libcamera. Without this change libcamera errors out with:
"ERROR V4L2 v4l2_videodevice.cpp:1059 /dev/video0[cap]: Unable to enumerate
frame sizes: Inappropriate ioctl for device"
Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Andrey Konovalov [Fri, 14 Aug 2020 20:54:01 +0000 (22:54 +0200)]
media: camss: Make use of V4L2_CAP_IO_MC
Implement mbus_code filtering for format enumeration.
Without this patch libcamera errors out with:
"ERROR V4L2 v4l2_videodevice.cpp:982 /dev/video0[cap]: Media bus code
filtering not supported by the device"
Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Niklas Söderlund [Thu, 13 Aug 2020 21:06:02 +0000 (23:06 +0200)]
media: rcar-vin: Register media device when all sub-devices bound
The media device is not usable by userspace before all devices involved
in capture are present in the system. Move registering of the media
device to the async complete callback.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Niklas Söderlund [Thu, 13 Aug 2020 21:06:01 +0000 (23:06 +0200)]
media: rcar-vin: Unconditionally unregister notifier on remove
If the VIN device is part of a group of VIN devices (all Gen3 boards)
there is no reason to only unregister the group notifier if the VIN that
registers the notifier is removed. The VIN that registers the notifier
is always the last VIN device to be bound, so keeping the notifier
around after any VIN is unbound creates an unbalanced state where no VIN
in the group is operational.
Fix this by unconditionally unregistering the notifier when any VIN
device is unbound. Unregistering the notifier will lead to unbound()
being called and all video devices exposed by any VIN instance to be
removed.
The lock was only needed to protect the check which VIN registers the
notifier and is no longer needed.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tom Rix [Mon, 10 Aug 2020 19:25:18 +0000 (21:25 +0200)]
media: tw5864: check status of tw5864_frameinterval_get
clang static analysis reports this problem
tw5864-video.c:773:32: warning: The left expression of the compound
assignment is an uninitialized value.
The computed value will also be garbage
fintv->stepwise.max.numerator *= std_max_fps;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
stepwise.max is set with frameinterval, which comes from
ret = tw5864_frameinterval_get(input, &frameinterval);
fintv->stepwise.step = frameinterval;
fintv->stepwise.min = frameinterval;
fintv->stepwise.max = frameinterval;
fintv->stepwise.max.numerator *= std_max_fps;
When tw5864_frameinterval_get() fails, frameinterval is not
set. So check the status and fix another similar problem.
Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Ismael Luceno [Mon, 10 Aug 2020 19:17:55 +0000 (21:17 +0200)]
media: MAINTAINERS: Remove broken bluecherry.net email
Remove broken bluecherry.net email
Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Frederic Chen [Thu, 6 Aug 2020 15:58:22 +0000 (17:58 +0200)]
media: mc-device.c: change media_device_request_alloc to match media_ioctl_info
We modified the type of media_device_request_alloc()'s second
parameter from int* to void* so that it can match the interface
defined in struct media_ioctl_info.
[hverkuil: move #ifdef before variable to avoid compile warning]
Signed-off-by: Frederic Chen <frederic.chen@mediatek.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>
YueHaibing [Tue, 4 Aug 2020 01:41:37 +0000 (03:41 +0200)]
media: staging: tegra-vde: Mark tegra_vde_runtime_suspend/resume as __maybe_unused
If CONFIG_PM is not set, gcc warns:
drivers/staging/media/tegra-vde/vde.c:916:12:
warning: 'tegra_vde_runtime_suspend' defined but not used [-Wunused-function]
Make it __maybe_unused to fix this.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Allen Pais [Mon, 17 Aug 2020 08:31:53 +0000 (10:31 +0200)]
media: ttusb-dec: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Allen Pais [Mon, 17 Aug 2020 08:31:52 +0000 (10:31 +0200)]
media: media/radio: wl128x: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Allen Pais [Mon, 17 Aug 2020 08:31:51 +0000 (10:31 +0200)]
media: sti: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Allen Pais [Mon, 17 Aug 2020 08:31:50 +0000 (10:31 +0200)]
media: pxa_camera: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Allen Pais [Mon, 17 Aug 2020 08:31:49 +0000 (10:31 +0200)]
media: marvell-ccic: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Allen Pais [Mon, 17 Aug 2020 08:31:48 +0000 (10:31 +0200)]
media: tw5864: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Allen Pais [Mon, 17 Aug 2020 08:31:47 +0000 (10:31 +0200)]
media: ttpci: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Allen Pais [Mon, 17 Aug 2020 08:31:46 +0000 (10:31 +0200)]
media: smipcie: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Allen Pais [Mon, 17 Aug 2020 08:31:45 +0000 (10:31 +0200)]
media: ngene: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Allen Pais [Mon, 17 Aug 2020 08:31:44 +0000 (10:31 +0200)]
media: mantis: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Allen Pais [Mon, 17 Aug 2020 08:31:43 +0000 (10:31 +0200)]
media: bt8xx: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Lubomir Rintel [Mon, 17 Aug 2020 22:08:50 +0000 (00:08 +0200)]
media: marvell-ccic: add support for runtime PM
On MMP3, the camera block lives on a separate power island. We want to
turn it off if the CCIC is not in use to conserve power.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Lubomir Rintel [Mon, 17 Aug 2020 22:08:49 +0000 (00:08 +0200)]
media: marvell-ccic: mmp: use generic dev_pm_ops
This simplifies things a bit and makes adding runtime PM a bit more
straightforward.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Lubomir Rintel [Mon, 17 Aug 2020 22:08:48 +0000 (00:08 +0200)]
media: marvell-ccic: mmp: get rid of mmpcam_devices list
The sole reason for this was so that it would be possible to get a
mmp_camera from a platform_device in suspend/resume/remove hooks, because
drvdata used to be used by the v4l core.
Since commit
95db3a60e065 ("[media] v4l: Add a media_device pointer to the
v4l2_device structure") it is no longer case and thus we can make things
a great deal simpler.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Lubomir Rintel [Mon, 17 Aug 2020 22:08:47 +0000 (00:08 +0200)]
media: cafe-driver: use drvdata instead of back-casting from v4l2_device
Since commit
95db3a60e065 ("[media] v4l: Add a media_device pointer
to the v4l2_device structure") the v4l core doesn't insist on using drvdata
itself. Therefore we can use it ourselves, making things somewhat simpler.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fabio Estevam [Mon, 17 Aug 2020 20:23:56 +0000 (22:23 +0200)]
media: fsl-viu: Do not redefine out_be32()/in_be32() for CONFIG_M68K
The following W=1 build warning is seen on a m68k:
drivers/media/platform/fsl-viu.c: At top level:
drivers/media/platform/fsl-viu.c:36: warning: "out_be32" redefined
36 | #define out_be32(v, a) iowrite32be(a, (void __iomem *)v)
|
In file included from ./arch/m68k/include/asm/io_mm.h:25,
from ./arch/m68k/include/asm/io.h:8,
from ./include/linux/io.h:13,
from ./include/linux/irq.h:20,
from ./include/asm-generic/hardirq.h:13,
from ./arch/m68k/include/generated/asm/hardirq.h:1,
from ./include/linux/hardirq.h:9,
from ./include/linux/interrupt.h:11,
from drivers/media/platform/fsl-viu.c:17:
./arch/m68k/include/asm/raw_io.h:32: note: this is the location of the previous definition
32 | #define out_be32(addr,l) (void)((*(__force volatile u32 *) (addr)) = (l))
Avoid the out_be32() and in_be32() redefinitions when building for CONFIG_M68K
in the same way we currently do for CONFIG_PPC and CONFIG_MICROBLAZE.
Reported-by: kernel test robot <lkp@intel.com>
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>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:47 +0000 (10:35 +0200)]
media: mtk-vcodec: vdec_vp9_if.c: fix comparison to bool
Fix the following coccinelle report:
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c:963:6-31:
WARNING: Comparison to bool
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:45 +0000 (10:35 +0200)]
media: pci: cobalt-i2c.c: fix comparison of 0/1 to bool variable
Fix the following coccinelle reports:
drivers/media/pci/cobalt/cobalt-i2c.c:176:16-21: WARNING:
Comparison of 0/1 to bool variable
drivers/media/pci/cobalt/cobalt-i2c.c:180:29-33: WARNING:
Comparison of 0/1 to bool variable
drivers/media/pci/cobalt/cobalt-i2c.c:121:16-21: WARNING:
Comparison of 0/1 to bool variable
drivers/media/pci/cobalt/cobalt-i2c.c:125:29-33: WARNING:
Comparison of 0/1 to bool variable
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:44 +0000 (10:35 +0200)]
media: i2c: tda1997x.c: Fix assignment of 0/1 to bool variable
Fix the following coccinelle reports:
drivers/media/i2c/tda1997x.c:911:6-21:
WARNING: Assignment of 0/1 to bool variable
drivers/media/i2c/tda1997x.c:939:2-17:
WARNING: Assignment of 0/1 to bool variable
drivers/media/i2c/tda1997x.c:947:4-19:
WARNING: Assignment of 0/1 to bool variable
Replace assignment to 1 with true and assignment to 0 with false.
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:43 +0000 (10:35 +0200)]
media: i2c: imx219.c: fix assignment of 0/1 to bool variable
Fix the following coccinelle report:
drivers/media/i2c/imx219.c:1191:1-18:
WARNING: Assignment of 0/1 to bool variable
Replace the assignment to 0 with false instead.
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:42 +0000 (10:35 +0200)]
media: pci: cx23855-video.c: remove duplicate argument in 'or'
Fix the following coccinelle report:
drivers/media/pci/cx23885/cx23885-video.c:639:24-44:
duplicated argument to & or |
V4L2_CAP_VBI_CAPTURE appears twice, remove it.
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:40 +0000 (10:35 +0200)]
media: dvb-frontends: mb86a16.c: remove useless if/else
Fix the following coccinelle report:
drivers/media/dvb-frontends/mb86a16.c:1455:6-8:
WARNING: possible condition with no effect (if == else)
Both branches are the same, so remove the if/else altogether.
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:39 +0000 (10:35 +0200)]
media: usb: dib0700_devices.c: remove useless if/else
Fix the following coccinelle report:
drivers/media/usb/dvb-usb/dib0700_devices.c:1741:1-3:
WARNING: possible condition with no effect (if == else)
Both branches are the same, so remove the if/else altogether.
Found using - Coccinelle (http://coccinelle.lip6.fr)
[hverkuil: fix checkpatch warnings]
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:38 +0000 (10:35 +0200)]
media: pci: saa7164-core.c: replace if (cond) BUG() with BUG_ON()
Fix the following coccinelle reports:
drivers/media/pci/saa7164/saa7164-core.c:579:2-5:
WARNING: Use BUG_ON instead of if condition followed by BUG.
drivers/media/pci/saa7164/saa7164-core.c:592:3-6:
WARNING: Use BUG_ON instead of if condition followed by BUG.
drivers/media/pci/saa7164/saa7164-core.c:898:2-5:
WARNING: Use BUG_ON instead of if condition followed by BUG.
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:37 +0000 (10:35 +0200)]
media: pci: saa7164-vbi.c: replace if (cond) BUG() with BUG_ON()
Fix the following coccinelle reports:
drivers/media/pci/saa7164/saa7164-vbi.c:707:2-5:
WARNING: Use BUG_ON instead of if condition followed by BUG.
drivers/media/pci/saa7164/saa7164-vbi.c:760:2-5:
WARNING: Use BUG_ON instead of if condition followed by BUG.
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:36 +0000 (10:35 +0200)]
media: pci: saa7164-dvb.c: replace if(cond) BUG() with BUG_ON()
Fix the following coccinelle reports:
drivers/media/pci/saa7164/saa7164-dvb.c:341:2-5:
WARNING: Use BUG_ON instead of if condition followed by BUG
drivers/media/pci/saa7164/saa7164-dvb.c:483:2-5:
WARNING: Use BUG_ON instead of if condition followed by BUG.
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:35 +0000 (10:35 +0200)]
media: pci: saa7164.c: Replace if(cond) BUG with BUG_ON
Fix the following coccinelle reports:
drivers/media/pci/saa7164/saa7164-buffer.c:254:3-6: WARNING: Use BUG_ON
instead of if condition followed by BUG.
drivers/media/pci/saa7164/saa7164-buffer.c:261:3-6: WARNING: Use BUG_ON
instead of if condition followed by BUG.
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:34 +0000 (10:35 +0200)]
media: vicodec: vicodec-core.c: fix assignment of 0/1 to bool variable
Fix the following coccinelle reports:
drivers/media/test-drivers/vicodec/vicodec-core.c:1674:2-21:
WARNING: Assignment of 0/1 to bool variable
drivers/media/test-drivers/vicodec/vicodec-core.c:1675:2-26:
WARNING: Assignment of 0/1 to bool variable
By replacing the assignment to 0 with 'false' instead.
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:33 +0000 (10:35 +0200)]
media: mtk-vcodec: mtk_vcodec_dec.c: fix comparison to bool
Fix the following coccinelle reports:
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c:197:14-35:
WARNING: Comparison to bool
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c:198:7-29:
WARNING: Comparison to bool
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c:451:12-19:
WARNING: Comparison to bool
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c:1159:6-15:
WARNING: Comparison to bool
By replacing (cond == true) with (cond) and (cond == false) with
(!cond)
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:32 +0000 (10:35 +0200)]
media: cobalt: cobalt-omnitek.c: fix comparison to bool
Fix the following coccinelle report:
drivers/media/pci/cobalt/cobalt-omnitek.c:119:5-19:
WARNING: Comparison to bool
By using "!cond" instead of "cond == false"
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Daniel W. S. Almeida [Fri, 7 Aug 2020 08:35:28 +0000 (10:35 +0200)]
media: sunxi: sun8i-rotate.c: remove useless error message
This fixes the following coccinelle report:
drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c:751:2-9:
line 751 is redundant because platform_get_irq() already prints an error
By removing the useless call to dev_err()
Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:12:02 +0000 (09:12 +0200)]
media: platform: Add jpeg enc feature
Add mtk jpeg encode v4l2 driver based on jpeg decode, because that jpeg
decode and encode have great similarities with function operation.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:12:01 +0000 (09:12 +0200)]
media: platform: Using the variant structure to contain the varability between dec and enc
Add varability which would be used between jpeg dec and enc to a match
data structure, it will make the code linear.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:12:00 +0000 (09:12 +0200)]
media: platform: Rename existing functions/defines/variables
Rename existing functions/defines/variables with a _dec prefix and
without dec_ prefix to prepare for the addition of the jpeg encoder
feature.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:59 +0000 (09:11 +0200)]
media: platform: Rename jpeg dec file name
Rename the files which are for decode feature. This is preparing
path since the jpeg enc patch will be added later.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:57 +0000 (09:11 +0200)]
media: dt-bindings: Add jpeg enc device tree node document
Add jpeg enc device tree node document.
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:56 +0000 (09:11 +0200)]
media: platform: Change the call functions of getting/enable/disable the jpeg's clock
Use the generic clk_bulk_* helpers to enable and disable clocks.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:55 +0000 (09:11 +0200)]
media: platform: Refactor mtk_jpeg_set_default_params()
Call mtk_jpeg_try_fmt_mplane() to replace the original computation of
sizeimage and bytesperline, because that mtk_jpeg_try_fmt_mplane()
already did it.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:54 +0000 (09:11 +0200)]
media: platform: Change the colorspace of jpeg to the fixed value
Jpeg doesn't support colorspace conversion, so it shouldn't accept any
other colorspace in S_FMT.
Change the colorspace of jpeg to the fixed value.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:53 +0000 (09:11 +0200)]
media: platform: Redefinition of mtk_jpeg_q_data structure
The standard v4l2_pix_format_mplane structure contains width/height/
sizeimage/bytesperline, so use v4l2_pix_format_mplane to replace them.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:52 +0000 (09:11 +0200)]
media: platform: Refactor mtk_jpeg_find_format()
Delete the unused ctx parameter.
Using mtk_jpeg_formats and num_formats parameters is more generic,
because that jpeg enc will also use it.
Delete the macro definition of MTK_JPEG_FMT_TYPE_OUTPUT and
MTK_JPEG_FMT_TYPE_CAPTURE, because that MTK_JPEG_FMT_FLAG_DEC_OUTPUT
and MTK_JPEG_FMT_FLAG_DEC_CAPTURE are enough.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:51 +0000 (09:11 +0200)]
media: platform: Refactor mtk_jpeg_try_fmt_mplane()
The function of mtk_jpeg_adjust_fmt_mplane() equals
mtk_jpeg_g_fmt_vid_mplane(), so use mtk_jpeg_g_fmt_vid_mplane() to
replace it .
Delete the unused ctx parameter.
Using fourcc to distinguish between different formats is more generic,
because that jpeg enc will also use it.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:50 +0000 (09:11 +0200)]
media: platform: Change the maximum width and height supported by JPEG dec
The maximum width and height supported by JPEG dec is 65535, so change
them from 8192 to 65535.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:49 +0000 (09:11 +0200)]
media: platform: Delete vidioc_s_selection ioctl of jpeg dec
JPEG dec does't support setting a compose rectangle, so remove
mtk_jpeg_dec_s_selection().
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:48 +0000 (09:11 +0200)]
media: platform: Delete redundant code and add annotation for an enum
Delete unused member variables annotation.
Delete unused variable definition.
Delete redundant log print, because V4L2 debug logs already print it.
Add annotation for enum mtk_jpeg_ctx_state.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:47 +0000 (09:11 +0200)]
media: platform: Change MTK_JPEG_COMP_MAX macro definition location
Move MTK_JPEG_COMP_MAX definition to mtk_jpeg_core.h file, because it
is used by mtk_jpeg_core.c file.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:46 +0000 (09:11 +0200)]
media: platform: Use generic rounding helpers
Use clamp() to replace mtk_jpeg_bound_align_image() and round() to
replace mtk_jpeg_align().
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:45 +0000 (09:11 +0200)]
media: platform: Stylistic changes for improving code quality
Change register offset hex numerals from uppercase to lowercase.
Change data type of max/min width/height from integer to unsigned
integer.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:44 +0000 (09:11 +0200)]
media: platform: Delete zeroing the reserved fields
Delete zeroing the reserved fields because that the core already
does it.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:43 +0000 (09:11 +0200)]
media: platform: Cancel the last frame handling flow
There is no need to queue an empty buffer for signaling a last frame,
because all frames are separate from each other in JPEG.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:42 +0000 (09:11 +0200)]
media: platform: Add mechanism to handle jpeg hardware's locking up
There is a delayed work scheduled before starting the hardware and
canceled in the interrupt handler. If the delayed work is executed, it
resets the hardware and reports the failure to V4L2, so that the
execution can continue from next frames.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:41 +0000 (09:11 +0200)]
media: platform: Improve the implementation of the system PM ops
Add v4l2_m2m_suspend() function call in mtk_jpeg_suspend() to make sure
that the current frame is processed completely before suspend.
Add v4l2_m2m_resume() function call in mtk_jpeg_resume() to unblock the
driver from scheduling next frame.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Pi-Hsun Shih [Fri, 14 Aug 2020 07:11:40 +0000 (09:11 +0200)]
media: v4l2-mem2mem: add v4l2_m2m_suspend, v4l2_m2m_resume
Add two functions that can be used to stop new jobs from being queued /
continue running queued job. This can be used while a driver using m2m
helper is going to suspend / wake up from resume, and can ensure that
there's no job running in suspend process.
Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Signed-off-by: Jerry-ch Chen <jerry-ch.chen@mediatek.corp-partner.google.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:39 +0000 (09:11 +0200)]
media: platform: Delete the resetting hardware flow in the system PM ops
Delete the resetting hardware flow in suspend and resume function
because that resetting operation will be done in device_run().
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:38 +0000 (09:11 +0200)]
media: platform: Improve power on and power off flow
Call pm_runtime_get_sync() before starting a frame and then
pm_runtime_put() after completing it. This can save power for the time
between processing two frames.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:37 +0000 (09:11 +0200)]
media: platform: Change the fixed device node number to unfixed value
The driver can be instantiated multiple times, e.g. for a decoder and
an encoder. Moreover, other drivers could coexist on the same system.
This makes the static video node number assignment pointless, so switch
to automatic assignment instead.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:36 +0000 (09:11 +0200)]
media: platform: Improve getting and requesting irq flow for bug fixing
Delete platform_get_resource operation for irq.
Return actual value rather than EINVAL when fail to get and request
irq.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:35 +0000 (09:11 +0200)]
media: platform: Improve queue set up flow for bug fixing
Add checking created buffer size follow in mtk_jpeg_queue_setup().
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Xia Jiang [Fri, 14 Aug 2020 07:11:34 +0000 (09:11 +0200)]
media: platform: Improve subscribe event flow for bug fixing
Let v4l2_ctrl_subscribe_event() do the job for other types except
V4L2_EVENT_SOURCE_CHANGE.
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sowjanya Komatineni [Wed, 12 Aug 2020 00:27:21 +0000 (02:27 +0200)]
media: tegra-video: Compute settle times based on the clock rate
Settle time determines the number of cil clock cyles to wait after
LP00 when moving from LP to HS.
This patch computes T-CLK-SETTLE and T-HS-SETTLE times based on cil
clock rate and pixel rate from the sensor and programs them during
streaming.
T-CLK-SETTLE time is the interval during which receiver will ignore
any HS transitions on clock lane starting from the beginning of
T-CLK-PREPARE.
T-HS-SETTLE time is the interval during which recevier will ignore
any HS transitions on data lane starting from the beginning of
T-HS-PREPARE.
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sowjanya Komatineni [Wed, 12 Aug 2020 00:27:20 +0000 (02:27 +0200)]
media: tegra-video: Add CSI MIPI pads calibration
CSI MIPI pads need to be enabled and calibrated for capturing from
the external sensor or transmitter.
MIPI CAL unit calibrates MIPI pads pull-up, pull-down and termination
impedances. Calibration is done by co-work of MIPI BIAS pad and MIPI
CAL control unit.
Triggering calibration start can happen any time after MIPI pads are
enabled but calibration results will be latched and applied to MIPI
pads by MIPI CAL unit only when the link is in LP11 state and then
calibration status register gets updated.
This patch enables CSI MIPI pads and calibrates them during streaming.
Tegra CSI receiver is able to catch the very first clock transition.
So, CSI receiver is always enabled prior to sensor streaming and
trigger of calibration start is done during CSI subdev streaming and
status of calibration is verified after sensor stream on.
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sowjanya Komatineni [Wed, 12 Aug 2020 00:27:19 +0000 (02:27 +0200)]
media: gpu: host1x: mipi: Keep MIPI clock enabled and mutex locked till calibration done
With the split of MIPI calibration into tegra_mipi_calibrate() and
tegra_mipi_wait(), MIPI clock is not kept enabled and mutex is not locked
till the calibration is done.
So, this patch keeps MIPI clock enabled and mutex locked after triggering
start of calibration till its done.
To let calibration process go through its finite sequence codes before
calibration logic waiting for pads idle state added wait time of 75usec
to make sure it sees idle state to apply the results.
This patch renames tegra_mipi_calibrate() as tegra_mipi_start_calibration()
and tegra_mipi_wait() as tegra_mipi_finish_calibration() to be inline
with their usage.
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sowjanya Komatineni [Wed, 12 Aug 2020 00:27:18 +0000 (02:27 +0200)]
media: tegra-video: Add support for selection ioctl ops
This patch adds selection v4l2 ioctl operations to allow configuring
a selection rectangle in the sensor through the Tegra video device
node.
Some sensor drivers supporting crop uses try_crop rectangle from
v4l2_subdev_pad_config during try format for computing binning.
So with selection ops support, this patch also updates try format
to use try crop rectangle either from subdev frame size enumeration
or from subdev crop boundary.
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sowjanya Komatineni [Wed, 12 Aug 2020 00:27:17 +0000 (02:27 +0200)]
media: tegra-video: Add support for external sensor capture
This patch adds support to capture from the external sensor
based on device graph in the device tree.
Driver walks through the device graph to create media links
between the entities and registers and unregisters video devices
when the corresponding sub-devices are bound and unbound.
Channel formats are enumerated based on available formats from
the sensor and the corresponding matched formats from the Tegra
supported video formats list.
Each Tegra CSI instance can be configured as 4-lane or 2-lane
based on supported lane configuration from the sensor through
the device tree.
Currently this driver supports V4L2 video node centric only.
[hverkuil: changed video_unregister_device to vb2_video_unregister_device]
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sowjanya Komatineni [Wed, 12 Aug 2020 00:27:16 +0000 (02:27 +0200)]
media: tegra-video: Separate CSI stream enable and disable implementations
This patch separates implementation of CSI stream enable and disable
into separate functions for readability.
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sowjanya Komatineni [Wed, 12 Aug 2020 00:27:15 +0000 (02:27 +0200)]
media: dt-bindings: tegra: Update VI and CSI bindings with port info
Update VI and CSI bindings to add port and endpoint nodes as per
media video-interfaces DT binding document.
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sowjanya Komatineni [Wed, 12 Aug 2020 00:27:14 +0000 (02:27 +0200)]
media: tegra-video: Update format lookup to offset based
Tegra VI supported video formats are more for non TPG and there
can be multiple pixel formats for the same media bus format.
This patch updates the helper function for format lookup based on
mbus code from pre-defined Tegra supported format list to look from
the specified list index offset.
Offset based look up is used with sensor device graph (non TPG)
where format enumeration can list all supported formats for the
specific sensor mbus codes.
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sowjanya Komatineni [Wed, 12 Aug 2020 00:27:13 +0000 (02:27 +0200)]
media: tegra-video: Enable TPG based on kernel config
Tegra internal TPG mode is only for Tegra vi and csi testing
without a real sensor and driver should default support real
sensor.
So, This patch adds CONFIG_VIDEO_TEGRA_TPG and enables Tegra
internal TPG mode only when this config is selected.
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sowjanya Komatineni [Wed, 12 Aug 2020 00:27:12 +0000 (02:27 +0200)]
media: tegra-video: Fix channel format alignment
Pixel format width is mistakenly aligned to surface align bytes
and altering width to aligned value may force sensor mode change
other than the requested one and also cause mismatch in width
programmed between sensor and vi which can lead to capture errors.
This patch removes width alignment and clamps width as per Tegra
minimum and maximum limits.
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Mon, 13 Jul 2020 11:30:48 +0000 (13:30 +0200)]
media: staging/media: drop vb2_queue_release()
This is only needed for drivers that do not use vb2_fop_release().
Note that vb2_queue_release() is *not* the counterpart of vb2_queue_init()
as some drivers here seem to think.
Also use vb2_video_unregister_device() to automatically stop streaming
at unregister time for those drivers that set vdev->queue.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Mon, 13 Jul 2020 11:30:47 +0000 (13:30 +0200)]
media: media/test-drivers: use vb2_video_unregister_device()
Use vb2_video_unregister_device() to automatically stop streaming
at unregister time.
This avoids the use of vb2_queue_release() which should not be
called by drivers that set vdev->queue.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Hans Verkuil [Mon, 13 Jul 2020 11:30:46 +0000 (13:30 +0200)]
media: media/usb: use vb2_video_unregister_device()
Use vb2_video_unregister_device() to automatically stop streaming
at unregister time.
This avoids the use of vb2_queue_release() which should not be
called by drivers that set vdev->queue.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>