Commit graph

1249312 commits

Author SHA1 Message Date
Sakari Ailus
ec86a04bed media: ipu-bridge: Add ov01a10 in Dell XPS 9315
Add Omnivision ov01a10 sensor used in Dell XPS 9315, and use the driver
default frequency.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:32 +01:00
Matthias Fend
37e83782f9 media: imx335: Add support for test pattern generator
Add support for the sensor's test pattern generator.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:32 +01:00
Umang Jain
2d5aea517c media: imx335: Refactor power sequence to set controls
Additional controls might require the sensor to be powered up
to set the control value. Currently, only the exposure control
powers up the sensor.

Move the power up sequence out of the switch-case block.
In a subsequent patch, test pattern control will be added that
needs the sensor to be powered up. Hence, refactor the power
sequence to be present outside the switch-case block.

The VBLANK control is also moved out of the switch-case in order
to be handled early on, to propagate the changes to other controls.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:32 +01:00
Umang Jain
a95253d832 media: imx335: Support multiple link frequency
Support link frequency of 445MHz in addition to 594MHz.
Break out the register set specific to each data lane rate and also add
the general timing register set corresponding to the each data
lane rate.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:32 +01:00
Umang Jain
0862582b52 media: imx335: Use v4l2_link_freq_to_bitmap helper
Use the v4l2_link_freq_to_bitmap() helper to figure out which
driver-supported link frequencies can be used on a given system.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:32 +01:00
Umang Jain
14a60786d7 media: imx335: Set reserved register to default value
0x3a00 is a reserved register as per the datasheet. The driver
currently sets to it 0x01 while the datasheet claims 0x00 to be
the default value.

On one of the setup based on i.MX8MP platform with IMX335, this register
write broke the CSI-2 configuration. Setting 0x3a00 to its default
value (i.e. 0x00) fixed the issue. It is not clear from the datasheet
what this register write is responsible for but setting it to its default
value seems the right thing to do, provided it has been found
responsible to break CSI-2 configuration on one of the platform.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reported-by: Matthias Fend <matthias.fend@emfend.at>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:32 +01:00
Ondrej Jirman
9d00ccabfb media: i2c: dw9714: Fix occasional probe errors
The powerup delay was not observed during probe, leading to occasional
I2C communication failures in RPM suspend callback. Power delay is
properly observed in resume callback already.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:32 +01:00
Biju Das
25a3c0c7d0 media: i2c: ov5645: Remove software reset entry from ov5645_global_init_setting
The SYSTEM_CTRL0 register in ov5645 is almost similar to ov5640. But the
hard reset control is mandatory for the ov5645 device, so there is no
need for soft reset in the driver.

Add a 1msec delay for the software power up (OV5645_SYSTEM_CTRL0_START)
register in ov5645_global_init_setting. Without this delay sometimes the
image is not captured at all when the i2c frequency is 400kHz.

The changes are fixing both the greenish issue and image capture at 400kHz
i2c frequency on Renesas RZ/G2L SMARC EVK platforms.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:32 +01:00
Tommaso Merciai
188d2ff334 media: i2c: alvium: fix req_fr check in alvium_s_frame_interval()
req_fr check in alvium_s_frame_interval() is incorrect. In particular
req_fr can't be >=max and <= min at the same time. Ensure the requested
frame rate remains within the supported range between min_fr and max_fr by
clamping it.

Also remove the unused dft_fr argument of alvium_get_frame_interval().

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:32 +01:00
Tommaso Merciai
d95d9c2c93 media: i2c: alvium: store frame interval in subdev state
Use the newly added storage for frame interval in the subdev state to
simplify the driver.

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:32 +01:00
Tommaso Merciai
d0d487582f media: i2c: alvium: inline set_frame_interval into s_frame_interval
Inline alvium_set_frame_interval() into alvium_s_frame_interval().
The alvium_set_frame_interval() is called once only, by
alvium_s_frame_interval(). The latter is a thin wrapper around the
former. Inline the function in its caller to make the code more
readable.

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:31 +01:00
Tommaso Merciai
d7f686d8c5 media: i2c: alvium: remove the fr field of the alvium_dev structure
The fr (frame rate) field of the alvium_dev structure is
only used to pass result from alvium_set_frame_interval() to
alvium_set_frame_rate() that writes this info into the hw reg.
Replace it with a function parameter.

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:31 +01:00
Tommaso Merciai
b5c5a02b3d media: i2c: alvium: removal of dft_fr, min_fr and max_fr
The dft_fr, min_fr and max_fr fields of the alvium_dev structure are
only used to pass results from alvium_get_frame_interval() to its
caller. Replace them with function parameters.

Signed-off-by: Tommaso Merciai <tomm.merciai@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-23 14:33:31 +01:00
Detlev Casanova
e0b8eb0f6d media: visl: Add codec specific variability on output frames
When running tests with different input data, the stable output frames
could be too similar and hide possible issues.

This commit adds variation by using some codec specific parameters.

Only HEVC and H.264 support this.

Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: add media: prefix to Subject]
2024-02-16 11:46:33 +01:00
Detlev Casanova
ce7e79acb6 doc: media: visl: Document tpg_verbose parameter
Also document stable frames and what it means for testing tools.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: add media: prefix to Subject]
2024-02-16 11:46:33 +01:00
Detlev Casanova
8901f20bf7 media: visl: Add a tpg_verbose parameter
The text written on the output frames stable for a given input.
Remove the unstable elements like pointers, buffer indexes or queues
status so that frames are always identical and can be compared against
a reference in automatic tests.

As the unstable information can be relevant when debugging the API, add
a tpg_verbose parameter to show them.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: correct a few small checkpatch issues]
2024-02-16 11:46:33 +01:00
Detlev Casanova
68f715a820 media: visl,vidtv: Set parameters permissions to 0444
This avoids confusion with default values and lets userspace
programs get the modules parameters values at run time.

This can be useful when setting up a test suite.

Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:33 +01:00
Arnd Bergmann
9fb86bee96 media: v4l: marvell: select CONFIG_V4L2_ASYNC where needed
Drivers that call v4l2_async_nf_init() need to select the corresponding
Kconfig symbol:

ERROR: modpost: "v4l2_async_nf_init" [drivers/media/platform/marvell/cafe_ccic.ko] undefined!
ERROR: modpost: "__v4l2_async_nf_add_i2c" [drivers/media/platform/marvell/cafe_ccic.ko] undefined!
ERROR: modpost: "v4l2_async_nf_unregister" [drivers/media/platform/marvell/mcam-core.ko] undefined!
ERROR: modpost: "v4l2_async_nf_init" [drivers/media/platform/marvell/mmp_camera.ko] undefined!
ERROR: modpost: "__v4l2_async_nf_add_fwnode_remote" [drivers/media/platform/marvell/mmp_camera.ko] undefined!

I checked all v4l2 drivers to see if anything else has the same
bug, but these two appear to be the only ones.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:33 +01:00
Arnd Bergmann
30baa4a96b media: pvrusb2: fix pvr2_stream_callback casts
clang-16 complains about a control flow integrity (KCFI) issue in pvrusb2,
which casts three different prototypes into pvr2_stream_callback:

drivers/media/usb/pvrusb2/pvrusb2-v4l2.c:1070:30: error: cast from 'void (*)(struct pvr2_v4l2_fh *)' to 'pvr2_stream_callback' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
 1070 |         pvr2_stream_set_callback(sp,(pvr2_stream_callback)pvr2_v4l2_notify,fh);
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/usb/pvrusb2/pvrusb2-context.c:110:6: error: cast from 'void (*)(struct pvr2_context *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict]
  110 |                                         (void (*)(void *))pvr2_context_notify,
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/usb/pvrusb2/pvrusb2-dvb.c:152:6: error: cast from 'void (*)(struct pvr2_dvb_adapter *)' to 'pvr2_stream_callback' (aka 'void (*)(void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
  152 |                                  (pvr2_stream_callback) pvr2_dvb_notify, adap);
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change the functions to actually take a void* argument so the cast is no longer
needed.

Fixes: bb8ce9d914 ("V4L/DVB (7682): pvrusb2-dvb: finish up stream & buffer handling")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:33 +01:00
Arnd Bergmann
3de49ae81c media: sta2x11: fix irq handler cast
clang-16 warns about casting incompatible function pointers:

drivers/media/pci/sta2x11/sta2x11_vip.c:1057:6: error: cast from 'irqreturn_t (*)(int, struct sta2x11_vip *)' (aka 'enum irqreturn (*)(int, struct sta2x11_vip *)') to 'irq_handler_t' (aka 'enum irqreturn (*)(int, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]

Change the prototype of the irq handler to the regular version with a
local variable to adjust the argument type.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil: update argument documentation]
2024-02-16 11:46:33 +01:00
Andrzej Pietrasiewicz
26a3a10342 media: videobuf2: Add missing doc comment for waiting_in_dqbuf
While at it rearrange other comments to match the order of struct members.

Fixes: d65842f712 ("media: vb2: add waiting_in_dqbuf flag")

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:33 +01:00
Daniil Dulov
95ac1210fb media: pvrusb2: remove redundant NULL check
Pointer dip->stream cannot be NULL due to a shift, thus remove redundant
NULL check.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: c74e006268 ("V4L/DVB (5059): Pvrusb2: Be smarter about mode restoration")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:33 +01:00
Daniil Dulov
0b70530ee7 media: go7007: add check of return value of go7007_read_addr()
If go7007_read_addr() returns error channel is not assigned a value.
In this case go to allocfail.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 866b8695d6 ("Staging: add the go7007 video driver")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:33 +01:00
Ricardo B. Marliere
044c566d05 media: bt8xx: make bttv_sub_bus_type const
Now that the driver core can properly handle constant struct bus_type,
move the bttv_sub_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:33 +01:00
Vincenzo Mezzela
45d6ed9170 docs: media: fix typo in docs
This patch resolves a spelling error in the documentation.

It is submitted as part of my application to the "Linux Kernel Bug
Fixing Spring Unpaid 2024" mentorship program of the Linux Kernel
Foundation.

Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
Hans Verkuil
c464c2e3bb media: core: v4l2-ioctl.c: use is_valid_ioctl()
In most cases the is_valid_ioctl() macro is used to check if an ioctl is
valid, except in one place. Use it there as well as it makes the code
easier to read.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
Markus Elfring
619200d5fe media: ti: Use devm_platform_ioremap_resource() in ti_csi2rx_probe()
A wrapper function is available since the commit 7945f929f1
("drivers: provide devm_platform_ioremap_resource()").

* Thus reuse existing functionality instead of keeping duplicate source
  code.

* Delete a local variable which became unnecessary with this refactoring.

This issue was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Jai Luthra <j-luthra@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
Kells Ping
76f623d2d4 media: platform: cros-ec: Add Dita to the match table
The Google Dita device uses the same approach as the Google Brask
which enables the HDMI CEC via the cros-ec-cec driver.

Signed-off-by: Kells Ping <kells.ping@quanta.corp-partner.google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
Colin Ian King
ab9279b92d media: i2c: st-vgxy61: remove redundant initialization of pointer mode
The pointer mode is being initialized with a value that is never
read, it is being re-assigned later on. The initialization is
redundant and can be removed.

Cleans up clang scan build warning:
drivers/media/i2c/st-vgxy61.c:632:33: warning: Value stored to 'mode'
during its initialization is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
Colin Ian King
83b1a46d6e media: tda18271: remove redundant assignment to variable bcal
The variable bcal is being initialized with a value that is never
read, it is being re-assigned in both paths of an if statement near
the end of the function. The initialization is redundant and can
be removed.

Cleans up clang scan build warning:
drivers/media/tuners/tda18271-fe.c:473:2: warning: Value stored
to 'bcal' is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
Hans Verkuil
ee0f867465 media: v4l2-ctrls-core.c: check min/max for menu, controls
Menu controls that use the menu_skip_mask require that the min-max range is
inside 0-63.

Negative values obviously make no sense for menu controls, and the maximum
value is currently limited by the number of bits of the menu_skip_mask
value. However, if menu_skip_mask == 0, then larger menus are fine.

If we ever need to add support for larger menus that support the skip
mask, then more work is needed.

In the places where the menu_skip_mask is checked, use BIT_ULL to get the
bit to check and check if the bit number is < BITS_PER_LONG_LONG to avoid
shifting out of range. With the new check in check_range this should
never happen, but it is better to be safe and avoid static analyzer
warnings.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
Ming Qian
8cda891db3 media: amphion: Abort vpu parsing directly in seek
Driver abort vpu decoding when both output and capture queues are off,
but if seek in parsing the sequence header, driver may miss aborting the
parsing. so just abort the vpu parsing directly in seek.

Meanwhile if capture is off unexpectedly, we still need to abort the
decoding and return capture buffers.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
Ming Qian
c8027d79e0 media: imx-jpeg: Support for negotiating bytesperline with client
This mxc-jpeg driver doesn't allow the client to set the bytesperline,
but for some android cts case, it need to negotiate the bytesperline
between decoder and display, and fail the case if driver doesn't support
negotiating bytesperline

The jpegdec and jpegenc does support to set bytesperline which is
multiple of 2, and greater than the value calulated by driver.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
Lucas Stach
4797a3dd46 media: imx: csc/scaler: fix v4l2_ctrl_handler memory leak
Free the memory allocated in v4l2_ctrl_handler_init on release.

Fixes: a8ef0488cc ("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>
2024-02-16 11:46:32 +01:00
Changhuang Liang
a38cd27c9e staging: media: starfive: Set 16 bpp for capture_raw device
For StarFive JH7110 Camera Subsystem, capture_raw video device output
raw10 pixelformat requires 16bit of alignment.

Fixes: e080f339c8 ("media: staging: media: starfive: camss: Add capture driver")
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
Niklas Söderlund
b4a2952bb9 media: rcar-csi2: Move driver to renesas directory
The rcar-csi2 driver was added before the platform/renesas directory
existed and since it was used together in a pipeline with the rcar-vin
driver it was located together with it.

The rcar-isp driver can also be used together with the rcar-csi2 driver
in a pipeline that is terminated by the rcar-vin driver. However by the
time rcar-isp was added the platform/renesas directory existed so it was
added there.

To remove the confusion that the rcar-csi2 driver have code dependencies
on the rcar-vin driver move it to the same directory level as the
rcar-isp driver. This makes it clear they are three distinct drivers
that can be used together in a pipeline, but do not depend on each
other.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
Hans Verkuil
24d9cb1430 media: staging: imx: controls are from another device, mark this
The last argument of v4l2_ctrl_add_handler() indicates whether the controls
you add are from a control handler owned by another driver (true) or from
the same driver (false). In this case the last argument was incorrectly set
to false. The control handlers are from different devices.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
XueBing Chen
7d62ebc654 media: dvb-frontends: Clean up errors in tda8083.h
Fix the following errors reported by checkpatch:

ERROR: "foo* bar" should be "foo *bar"

Signed-off-by: XueBing Chen <chenxb_99091@126.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
XueBing Chen
9e996dc3f1 media: Clean up errors in bcm3510_priv.h
Fix the following errors reported by checkpatch:

ERROR: space prohibited before that ',' (ctx:WxW)

Signed-off-by: XueBing Chen <chenxb_99091@126.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
XueBing Chen
6dfb8796e3 media: stv6110x: Clean up errors in stv6110x.h
Fix the following errors reported by checkpatch:

ERROR: space prohibited before that ',' (ctx:WxW)

Signed-off-by: XueBing Chen <chenxb_99091@126.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:32 +01:00
XueBing Chen
732cbefc5a media: dvb-frontends: Clean up errors in cx24110.h
Fix the following errors reported by checkpatch:

ERROR: "foo* bar" should be "foo *bar"

Signed-off-by: XueBing Chen <chenxb_99091@126.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:31 +01:00
Matthias Schwarzott
75ee3c49f8 media: zl10036: Fix my email address
It has been wrong from the beginning.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Reported-by: Ulrich Mueller <ulm@gentoo.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:31 +01:00
Kevin Hao
730ffa9c5c media: pvrusb2: Use wait_event_freezable() for freezable kthread
A freezable kernel thread can enter frozen state during freezing by
either calling try_to_freeze() or using wait_event_freezable() and its
variants. So for the following snippet of code in a kernel thread loop:
  try_to_freeze();
  wait_event_interruptible();

We can change it to a simple wait_event_freezable() and then eliminate
a function call.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:31 +01:00
Kevin Hao
7c17c55248 media: msp3400: Use wait_event_freezable_timeout() in msp_sleep()
The msp_sleep() is nearly open-coded wait_event_interruptible_timeout(),
and a freezable kernel thread can enter frozen state during freezing by
either calling try_to_freeze() or using wait_event_freezable() and its
variants. So we can reimplement msp_sleep() to simply invoke
a wait_event_freezable_timeout() and then eliminate a call to
try_to_freeze().

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:31 +01:00
Kevin Hao
ed917040eb media: dvb_frontend: Use wait_event_freezable_timeout() for freezable kthread
A freezable kernel thread can enter frozen state during freezing by
either calling try_to_freeze() or using wait_event_freezable() and its
variants. So for the following snippet of code in a kernel thread loop:
  wait_event_interruptible_timeout();
  try_to_freeze();

We can change it to a simple wait_event_freezable_timeout() and
then eliminate a function call.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:31 +01:00
Jernej Skrabec
856525e8db media: sun8i-di: Fix chroma difference threshold
While there is no good explanation what this value does, vendor driver
uses value 31 for it. Align driver with it.

Fixes: a4260ea495 ("media: sun4i: Add H3 deinterlace driver")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:31 +01:00
Jernej Skrabec
cff104e33b media: sun8i-di: Fix power on/off sequences
According to user manual, reset line should be deasserted before clocks
are enabled. Also fix power down sequence to be reverse of that.

Fixes: a4260ea495 ("media: sun4i: Add H3 deinterlace driver")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:31 +01:00
Jernej Skrabec
794b581f8c media: sun8i-di: Fix coefficient writes
Currently coefficients are applied only once, since they don't change.
However, this is done before enable bit is set and thus it doesn't get
applied properly.

Fix that by applying coefficients after enable bit is set. While this
means that it will be done evey time, it doesn't bring much time
penalty.

Fixes: a4260ea495 ("media: sun4i: Add H3 deinterlace driver")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:31 +01:00
Jernej Skrabec
3a11887f7f media: cedrus: h265: Fix configuring bitstream size
bit_size field holds size of slice, not slice + header. Because of HW
quirks, driver can't program in just slice, but also preceding header.
But that means that currently used bit_size is wrong (too small).
Instead, just use size of whole buffer. There is no harm in doing this.

Fixes: 86caab29da ("media: cedrus: Add HEVC/H.265 decoding support")
Suggested-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:31 +01:00
Yang Li
1b69c93831 media: mediatek: vcodec: Remove unneeded semicolon
./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:569:2-3: Unneeded semicolon
./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:583:2-3: Unneeded semicolon
./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:599:2-3: Unneeded semicolon
./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:613:2-3: Unneeded semicolon
./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:633:2-3: Unneeded semicolon
./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:647:2-3: Unneeded semicolon
./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c:683:2-3: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7632
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2024-02-16 11:46:31 +01:00