media updates for v6.12-rc1

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+QmuaPwR3wnBdVwACF8+vY7k4RUFAmbxByQACgkQCF8+vY7k
 4RUWeg//QHB1sjjYsRs0IF6wBdzxWwpjqudxLjUTDEMKHVHUuCPRzMayZrokfTha
 /NOt+SSKpZqRtCjKuyLz7lup81b+oFXQ4CKChXJvLVJ+wuFFd/B9fbs3yw5fCWFk
 odHjVUpLOqdDSOHcqisKwim0ENzvJ4/rvFiiWUPqPJbjWYEyXX4eW3F8JlAXkdkI
 OGX9ixPsdAG2vdXpIsp3T3/KKTo7qwM6j/ckQ4SxkrTHMMdvJrkl3HutibaqOmOq
 FcR4Y9XSkBsNlrJ9CvG/uOSz5aQrY7A7s21OiH59FFyeOWsvKGFkLmAox/+M6vg8
 G/cjZjK3AiDll2fmAWo33MuyQG9HOTEFjWNN3cusr1gTcFowqH+cIjV3SKa1dH/1
 G+4KoOzJdkFrt1Y21zg+tWejoOjdPpklTiSAhgYRSblqsMbr3XF0cOqnSs5JOKo3
 ZgMko/JEI0CKltYc7kcTy8w6fg3g8B9RJ7nATgsKEQsln1hEy/Bii482tk6vbb9g
 7YLAzrExWnLjxOxco/LzHcBkQMov6/HA5ntEMieaybRcMPsXE8WNA2ElNOFOREgP
 MSWqoQD+7CuqYRnmfpQw2SPA0nRy2BT4ltITsA/ksfBWLvoK8UX99eiznkpWSm7p
 191mGPalKV07RUVXgXRTynTvfma6oTKIaebvPLoVaKg11cC5hq0=
 =TPMV
 -----END PGP SIGNATURE-----

Merge tag 'media/v6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab:

 - New CEC driver: Extron DA HD 4K Plus

 - Lots of driver fixes, cleanups and improvements

* tag 'media/v6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (179 commits)
  media: atomisp: Use clamp() in ia_css_eed1_8_vmem_encode()
  media: atomisp: Fix eed1_8 code assigning signed values to an unsigned variable
  media: atomisp: set lock before calling vb2_queue_init()
  media: atomisp: Improve binary finding debug logging
  media: atomisp: Drop dev_dbg() calls from hmm_[alloc|free]()
  media: atomisp: csi2-bridge: Add DMI quirk for t4ka3 on Xiaomi Mipad2
  media: atomisp: add missing wait_prepare/finish ops
  media: atomisp: Remove unused declaration
  media: atomisp: use clamp() in compute_coring()
  media: atomisp: use clamp() in ia_css_eed1_8_encode()
  media: atomisp: Simplify ia_css_pipe_create_cas_scaler_desc_single_output()
  media: atomisp: Replace rarely used macro from math_support.h
  media: atomisp: Remove duplicated leftover, i.e. sh_css_dvs_info.h
  media: atomisp: bnr: fix trailing statement
  media: atomisp: move trailing */ to separate lines
  media: atomisp: move trailing statement to next line.
  media: atomisp: Fix trailing statement in ia_css_de.host.c
  media: atomisp: Fix spelling mistakes in atomisp.h
  media: atomisp: Fix spelling mistakes in atomisp_platform.h
  media: atomisp: Fix spelling mistake in csi_rx_public.h
  ...
This commit is contained in:
Linus Torvalds 2024-09-23 15:27:58 -07:00
commit abf2050f51
297 changed files with 7390 additions and 1369 deletions

View File

@ -42,10 +42,14 @@ dongles):
``persistent_config``: by default this is off, but when set to 1 the driver
will store the current settings to the device's internal eeprom and restore
it the next time the device is connected to the USB port.
- RainShadow Tech. Note: this driver does not support the persistent_config
module option of the Pulse-Eight driver. The hardware supports it, but I
have no plans to add this feature. But I accept patches :-)
- Extron DA HD 4K PLUS HDMI Distribution Amplifier. See
:ref:`extron_da_hd_4k_plus` for more information.
Miscellaneous:
- vivid: emulates a CEC receiver and CEC transmitter.
@ -378,3 +382,86 @@ it later using ``--analyze-pin``.
You can also use this as a full-fledged CEC device by configuring it
using ``cec-ctl --tv -p0.0.0.0`` or ``cec-ctl --playback -p1.0.0.0``.
.. _extron_da_hd_4k_plus:
Extron DA HD 4K PLUS CEC Adapter driver
=======================================
This driver is for the Extron DA HD 4K PLUS series of HDMI Distribution
Amplifiers: https://www.extron.com/product/dahd4kplusseries
The 2, 4 and 6 port models are supported.
Firmware version 1.02.0001 or higher is required.
Note that older Extron hardware revisions have a problem with the CEC voltage,
which may mean that CEC will not work. This is fixed in hardware revisions
E34814 and up.
The CEC support has two modes: the first is a manual mode where userspace has
to manually control CEC for the HDMI Input and all HDMI Outputs. While this gives
full control, it is also complicated.
The second mode is an automatic mode, which is selected if the module option
``vendor_id`` is set. In that case the driver controls CEC and CEC messages
received in the input will be distributed to the outputs. It is still possible
to use the /dev/cecX devices to talk to the connected devices directly, but it is
the driver that configures everything and deals with things like Hotplug Detect
changes.
The driver also takes care of the EDIDs: /dev/videoX devices are created to
read the EDIDs and (for the HDMI Input port) to set the EDID.
By default userspace is responsible to set the EDID for the HDMI Input
according to the EDIDs of the connected displays. But if the ``manufacturer_name``
module option is set, then the driver will take care of setting the EDID
of the HDMI Input based on the supported resolutions of the connected displays.
Currently the driver only supports resolutions 1080p60 and 4kp60: if all connected
displays support 4kp60, then it will advertise 4kp60 on the HDMI input, otherwise
it will fall back to an EDID that just reports 1080p60.
The status of the Extron is reported in ``/sys/kernel/debug/cec/cecX/status``.
The extron-da-hd-4k-plus driver implements the following module options:
``debug``
---------
If set to 1, then all serial port traffic is shown.
``vendor_id``
-------------
The CEC Vendor ID to report to connected displays.
If set, then the driver will take care of distributing CEC messages received
on the input to the HDMI outputs. This is done for the following CEC messages:
- <Standby>
- <Image View On> and <Text View On>
- <Give Device Power Status>
- <Set System Audio Mode>
- <Request Current Latency>
If not set, then userspace is responsible for this, and it will have to
configure the CEC devices for HDMI Input and the HDMI Outputs manually.
``manufacturer_name``
---------------------
A three character manufacturer name that is used in the EDID for the HDMI
Input. If not set, then userspace is reponsible for configuring an EDID.
If set, then the driver will update the EDID automatically based on the
resolutions supported by the connected displays, and it will not be possible
anymore to manually set the EDID for the HDMI Input.
``hpd_never_low``
-----------------
If set, then the Hotplug Detect pin of the HDMI Input will always be high,
even if nothing is connected to the HDMI Outputs. If not set (the default)
then the Hotplug Detect pin of the HDMI input will go low if all the detected
Hotplug Detect pins of the HDMI Outputs are also low.
This option may be changed dynamically.

View File

@ -227,8 +227,13 @@ Common FPDL3/GMSL output parameters
open.*
**frame_rate** (RW):
Output video frame rate in frames per second. The default frame rate is
60Hz.
Output video signal frame rate limit in frames per second. Due to
the limited output pixel clock steps, the card can not always generate
a frame rate perfectly matching the value required by the connected display.
Using this parameter one can limit the frame rate by "crippling" the signal
so that the lines are not equal (the porches of the last line differ) but
the signal appears like having the exact frame rate to the connected display.
The default frame rate limit is 60Hz.
**hsync_polarity** (RW):
HSYNC signal polarity.
@ -253,33 +258,33 @@ Common FPDL3/GMSL output parameters
and there is a non-linear stepping between two consecutive allowed
frequencies. The driver finds the nearest allowed frequency to the given
value and sets it. When reading this property, you get the exact
frequency set by the driver. The default frequency is 70000kHz.
frequency set by the driver. The default frequency is 61150kHz.
*Note: This parameter can not be changed while the output v4l2 device is
open.*
**hsync_width** (RW):
Width of the HSYNC signal in pixels. The default value is 16.
Width of the HSYNC signal in pixels. The default value is 40.
**vsync_width** (RW):
Width of the VSYNC signal in video lines. The default value is 2.
Width of the VSYNC signal in video lines. The default value is 20.
**hback_porch** (RW):
Number of PCLK pulses between deassertion of the HSYNC signal and the first
valid pixel in the video line (marked by DE=1). The default value is 32.
valid pixel in the video line (marked by DE=1). The default value is 50.
**hfront_porch** (RW):
Number of PCLK pulses between the end of the last valid pixel in the video
line (marked by DE=1) and assertion of the HSYNC signal. The default value
is 32.
is 50.
**vback_porch** (RW):
Number of video lines between deassertion of the VSYNC signal and the video
line with the first valid pixel (marked by DE=1). The default value is 2.
line with the first valid pixel (marked by DE=1). The default value is 31.
**vfront_porch** (RW):
Number of video lines between the end of the last valid pixel line (marked
by DE=1) and assertion of the VSYNC signal. The default value is 2.
by DE=1) and assertion of the VSYNC signal. The default value is 30.
FPDL3 specific input parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -114,11 +114,18 @@ to be applied to the hardware during a video stream, allowing userspace
to dynamically modify values such as black level, cross talk corrections
and others.
The buffer format is defined by struct :c:type:`rkisp1_params_cfg`, and
userspace should set
The ISP driver supports two different parameters configuration methods, the
`fixed parameters format` or the `extensible parameters format`.
When using the `fixed parameters` method the buffer format is defined by struct
:c:type:`rkisp1_params_cfg`, and userspace should set
:ref:`V4L2_META_FMT_RK_ISP1_PARAMS <v4l2-meta-fmt-rk-isp1-params>` as the
dataformat.
When using the `extensible parameters` method the buffer format is defined by
struct :c:type:`rkisp1_ext_params_cfg`, and userspace should set
:ref:`V4L2_META_FMT_RK_ISP1_EXT_PARAMS <v4l2-meta-fmt-rk-isp1-ext-params>` as
the dataformat.
Capturing Video Frames Example
==============================

View File

@ -1343,7 +1343,7 @@ Some Future Improvements
Just as a reminder and in no particular order:
- Add a virtual alsa driver to test audio
- Add virtual sub-devices and media controller support
- Add virtual sub-devices
- Some support for testing compressed video
- Add support to loop raw VBI output to raw VBI input
- Add support to loop teletext sliced VBI output to VBI input
@ -1358,4 +1358,4 @@ Just as a reminder and in no particular order:
- Make a thread for the RDS generation, that would help in particular for the
"Controls" RDS Rx I/O Mode as the read-only RDS controls could be updated
in real-time.
- Changing the EDID should cause hotplug detect emulation to happen.
- Changing the EDID doesn't wait 100 ms before setting the HPD signal.

View File

@ -31,7 +31,8 @@ properties:
- items:
- enum:
- amlogic,gxbb-vdec # GXBB (S905)
- amlogic,gxl-vdec # GXL (S905X, S905D)
- amlogic,gxl-vdec # GXL (S905D, S905W, S905X, S905Y)
- amlogic,gxlx-vdec # GXLX (S905L)
- amlogic,gxm-vdec # GXM (S912)
- const: amlogic,gx-vdec
- enum:

View File

@ -0,0 +1,107 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright (c) 2023-2024 Linaro Ltd.
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/i2c/ovti,og01a1b.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: OmniVision OG01A1B Image Sensor
maintainers:
- Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
description:
The OmniVision OG01A1B is black and white CMOS 1.3 Megapixel (1280x1024)
image sensor controlled over an I2C-compatible SCCB bus.
The sensor transmits images on a MIPI CSI-2 output interface with one or
two data lanes.
allOf:
- $ref: /schemas/media/video-interface-devices.yaml#
properties:
compatible:
const: ovti,og01a1b
reg:
maxItems: 1
clocks:
maxItems: 1
reset-gpios:
description: Active low GPIO connected to XSHUTDOWN pad of the sensor.
maxItems: 1
strobe-gpios:
description: Input GPIO connected to strobe pad of the sensor.
maxItems: 1
avdd-supply:
description: Analogue circuit voltage supply.
dovdd-supply:
description: I/O circuit voltage supply.
dvdd-supply:
description: Digital circuit voltage supply.
port:
$ref: /schemas/graph.yaml#/$defs/port-base
additionalProperties: false
description:
Output port node, single endpoint describing the CSI-2 transmitter.
properties:
endpoint:
$ref: /schemas/media/video-interfaces.yaml#
unevaluatedProperties: false
properties:
data-lanes:
minItems: 1
maxItems: 2
items:
enum: [1, 2]
link-frequencies: true
required:
- data-lanes
- link-frequencies
required:
- compatible
- reg
- clocks
- port
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
sensor@60 {
compatible = "ovti,og01a1b";
reg = <0x60>;
clocks = <&clk 0>;
reset-gpios = <&gpio 117 GPIO_ACTIVE_LOW>;
avdd-supply = <&vreg_3v3>;
dovdd-supply = <&vreg_1p8>;
dvdd-supply = <&vreg_1p2>;
port {
og01a1b_ep: endpoint {
remote-endpoint = <&csiphy_ep>;
data-lanes = <1 2>;
link-frequencies = /bits/ 64 <500000000>;
};
};
};
};
...

View File

@ -75,6 +75,8 @@ additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
@ -92,6 +94,8 @@ examples:
ovdd-supply = <&camera_vddo_1v8>;
dvdd-supply = <&camera_vddd_1v2>;
reset-gpios = <&gpio 50 GPIO_ACTIVE_LOW>;
port {
imx335: endpoint {
remote-endpoint = <&cam>;

View File

@ -43,6 +43,7 @@ properties:
- const: vcodec_bus
iommus:
minItems: 1
maxItems: 2
interconnects:

View File

@ -27,6 +27,7 @@ properties:
- renesas,fcpf # FCP for FDP
- items:
- enum:
- renesas,r9a07g043u-fcpvd # RZ/G2UL
- renesas,r9a07g044-fcpvd # RZ/G2{L,LC}
- renesas,r9a07g054-fcpvd # RZ/V2L
- const: renesas,fcpv # Generic FCP for VSP fallback
@ -62,6 +63,7 @@ allOf:
compatible:
contains:
enum:
- renesas,r9a07g043u-fcpvd
- renesas,r9a07g044-fcpvd
- renesas,r9a07g054-fcpvd
then:

View File

@ -52,8 +52,12 @@ properties:
- renesas,vin-r8a77980 # R-Car V3H
- renesas,vin-r8a77990 # R-Car E3
- renesas,vin-r8a77995 # R-Car D3
- items:
- enum:
- renesas,vin-r8a779a0 # R-Car V3U
- renesas,vin-r8a779g0 # R-Car V4H
- renesas,vin-r8a779h0 # R-Car V4M
- const: renesas,rcar-gen4-vin # Generic R-Car Gen4
reg:
maxItems: 1

View File

@ -23,6 +23,7 @@ properties:
- renesas,vsp2 # R-Car Gen3 and RZ/G2
- items:
- enum:
- renesas,r9a07g043u-vsp2 # RZ/G2UL
- renesas,r9a07g054-vsp2 # RZ/V2L
- const: renesas,r9a07g044-vsp2 # RZ/G2L fallback

View File

@ -17,6 +17,7 @@ properties:
compatible:
enum:
- rockchip,rk3568-vepu
- rockchip,rk3588-vepu121
reg:
maxItems: 1

View File

@ -26,11 +26,16 @@ properties:
- rockchip,rk3568-vpu
- rockchip,rk3588-av1-vpu
- items:
- const: rockchip,rk3188-vpu
- enum:
- rockchip,rk3128-vpu
- rockchip,rk3188-vpu
- const: rockchip,rk3066-vpu
- items:
- const: rockchip,rk3228-vpu
- const: rockchip,rk3399-vpu
- items:
- const: rockchip,rk3588-vpu121
- const: rockchip,rk3568-vpu
reg:
maxItems: 1

View File

@ -144,7 +144,8 @@ valid values are described at :c:func:`media_create_pad_link()` and
Graph traversal
^^^^^^^^^^^^^^^
The media framework provides APIs to iterate over entities in a graph.
The media framework provides APIs to traverse media graphs, locating connected
entities and links.
To iterate over all entities belonging to a media device, drivers can use
the media_device_for_each_entity macro, defined in
@ -159,31 +160,6 @@ the media_device_for_each_entity macro, defined in
...
}
Drivers might also need to iterate over all entities in a graph that can be
reached only through enabled links starting at a given entity. The media
framework provides a depth-first graph traversal API for that purpose.
.. note::
Graphs with cycles (whether directed or undirected) are **NOT**
supported by the graph traversal API. To prevent infinite loops, the graph
traversal code limits the maximum depth to ``MEDIA_ENTITY_ENUM_MAX_DEPTH``,
currently defined as 16.
Drivers initiate a graph traversal by calling
:c:func:`media_graph_walk_start()`
The graph structure, provided by the caller, is initialized to start graph
traversal at the given entity.
Drivers can then retrieve the next entity by calling
:c:func:`media_graph_walk_next()`
When the graph traversal is complete the function will return ``NULL``.
Graph traversal can be interrupted at any moment. No cleanup function call
is required and the graph structure can be freed normally.
Helper functions can be used to find a link between two given pads, or a pad
connected to another pad through an enabled link
(:c:func:`media_entity_find_link()`, :c:func:`media_pad_remote_pad_first()`,
@ -276,6 +252,45 @@ Subsystems should facilitate link validation by providing subsystem specific
helper functions to provide easy access for commonly needed information, and
in the end provide a way to use driver-specific callbacks.
Pipeline traversal
^^^^^^^^^^^^^^^^^^
Once a pipeline has been constructed with :c:func:`media_pipeline_start()`,
drivers can iterate over entities or pads in the pipeline with the
:c:macro:´media_pipeline_for_each_entity` and
:c:macro:´media_pipeline_for_each_pad` macros. Iterating over pads is
straightforward:
.. code-block:: c
media_pipeline_pad_iter iter;
struct media_pad *pad;
media_pipeline_for_each_pad(pipe, &iter, pad) {
/* 'pad' will point to each pad in turn */
...
}
To iterate over entities, the iterator needs to be initialized and cleaned up
as an additional steps:
.. code-block:: c
media_pipeline_entity_iter iter;
struct media_entity *entity;
int ret;
ret = media_pipeline_entity_iter_init(pipe, &iter);
if (ret)
...;
media_pipeline_for_each_entity(pipe, &iter, entity) {
/* 'entity' will point to each entity in turn */
...
}
media_pipeline_entity_iter_cleanup(&iter);
Media Controller Device Allocator API
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -137,6 +137,12 @@ returns the information to the application. The ioctl never fails.
- 0x00000100
- If this capability is set, then :ref:`CEC_ADAP_G_CONNECTOR_INFO` can
be used.
* .. _`CEC-CAP-REPLY-VENDOR-ID`:
- ``CEC_CAP_REPLY_VENDOR_ID``
- 0x00000200
- If this capability is set, then
:ref:`CEC_MSG_FL_REPLY_VENDOR_ID <cec-msg-flags>` can be used.
Return Value
============

View File

@ -232,6 +232,21 @@ View On' messages from initiator 0xf ('Unregistered') to destination 0 ('TV').
capability. If that is not set, then the ``EPERM`` error code is
returned.
* .. _`CEC-MSG-FL-REPLY-VENDOR-ID`:
- ``CEC_MSG_FL_REPLY_VENDOR_ID``
- 4
- This flag is only available if the ``CEC_CAP_REPLY_VENDOR_ID`` capability
is set. If this flag is set, then the reply is expected to consist of
the ``CEC_MSG_VENDOR_COMMAND_WITH_ID`` opcode followed by the Vendor ID
(in bytes 1-4 of the message), followed by the ``struct cec_msg``
``reply`` field.
Note that this assumes that the byte after the Vendor ID is a
vendor-specific opcode.
This flag makes it easier to wait for replies to vendor commands.
.. tabularcolumns:: |p{5.6cm}|p{0.9cm}|p{10.8cm}|
.. _cec-tx-status:

View File

@ -334,6 +334,17 @@ VESA DMT
:author: Video Electronics Standards Association (http://www.vesa.org)
.. _vesaeddc:
E-DDC
=====
:title: VESA Enhanced Display Data Channel (E-DDC) Standard
:subtitle: Version 1.3
:author: Video Electronics Standards Association (http://www.vesa.org)
.. _vesaedid:
EDID

View File

@ -694,41 +694,6 @@ enum v4l2_memory
- 4
- The buffer is used for :ref:`DMA shared buffer <dmabuf>` I/O.
.. _memory-flags:
Memory Consistency Flags
------------------------
.. raw:: latex
\small
.. tabularcolumns:: |p{7.0cm}|p{2.1cm}|p{8.4cm}|
.. cssclass:: longtable
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 3 1 4
* .. _`V4L2-MEMORY-FLAG-NON-COHERENT`:
- ``V4L2_MEMORY_FLAG_NON_COHERENT``
- 0x00000001
- A buffer is allocated either in coherent (it will be automatically
coherent between the CPU and the bus) or non-coherent memory. The
latter can provide performance gains, for instance the CPU cache
sync/flush operations can be avoided if the buffer is accessed by the
corresponding device only and the CPU does not read/write to/from that
buffer. However, this requires extra care from the driver -- it must
guarantee memory consistency by issuing a cache flush/sync when
consistency is needed. If this flag is set V4L2 will attempt to
allocate the buffer in non-coherent memory. The flag takes effect
only if the buffer is used for :ref:`memory mapping <mmap>` I/O and the
queue reports the :ref:`V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS
<V4L2-BUF-CAP-SUPPORTS-MMAP-CACHE-HINTS>` capability.
.. raw:: latex
\normalsize

View File

@ -333,7 +333,7 @@ file: media/v4l/capture.c
if (-1 == xioctl(fd, VIDIOC_REQBUFS, &req)) {
if (EINVAL == errno) {
fprintf(stderr, "%s does not support "
"memory mappingn", dev_name);
"memory mapping\n", dev_name);
exit(EXIT_FAILURE);
} else {
errno_exit("VIDIOC_REQBUFS");
@ -391,7 +391,7 @@ file: media/v4l/capture.c
if (-1 == xioctl(fd, VIDIOC_REQBUFS, &req)) {
if (EINVAL == errno) {
fprintf(stderr, "%s does not support "
"user pointer i/on", dev_name);
"user pointer i/o\n", dev_name);
exit(EXIT_FAILURE);
} else {
errno_exit("VIDIOC_REQBUFS");
@ -547,7 +547,7 @@ file: media/v4l/capture.c
}
if (!S_ISCHR(st.st_mode)) {
fprintf(stderr, "%s is no devicen", dev_name);
fprintf(stderr, "%s is no device\n", dev_name);
exit(EXIT_FAILURE);
}

View File

@ -2993,7 +2993,11 @@ This structure contains all loop filter related parameters. See sections
- Applications and drivers must set this to zero.
* - __u16
- ``max_frame_width_minus_1``
- specifies the maximum frame width minus 1 for the frames represented by
- Specifies the maximum frame width minus 1 for the frames represented by
this sequence header.
* - __u16
- ``max_frame_height_minus_1``
- Specifies the maximum frame height minus 1 for the frames represented by
this sequence header.
.. _av1_sequence_flags:
@ -3374,7 +3378,7 @@ semantics" of :ref:`av1`.
- ``uv_pri_strength[V4L2_AV1_CDEF_MAX]``
- Specifies the strength of the primary filter.
* - __u8
- ``uv_secondary_strength[V4L2_AV1_CDEF_MAX]``
- ``uv_sec_strength[V4L2_AV1_CDEF_MAX]``
- Specifies the strength of the secondary filter.
.. c:type:: v4l2_av1_segment_feature
@ -3439,7 +3443,7 @@ semantics" of :ref:`av1`.
- Bitmask defining which features are enabled in each segment. Use
V4L2_AV1_SEGMENT_FEATURE_ENABLED to build a suitable mask.
* - __u16
- `feature_data[V4L2_AV1_MAX_SEGMENTS][V4L2_AV1_SEG_LVL_MAX]``
- ``feature_data[V4L2_AV1_MAX_SEGMENTS][V4L2_AV1_SEG_LVL_MAX]``
- Data attached to each feature. Data entry is only valid if the feature
is enabled.
@ -3490,7 +3494,7 @@ AV1 Loop filter params as defined in section 6.8.10 "Loop filter semantics" of
.. tabularcolumns:: |p{1.5cm}|p{5.8cm}|p{10.0cm}|
.. flat-table:: struct v4l2_av1_global_motion
.. flat-table:: struct v4l2_av1_loop_filter
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
@ -3806,12 +3810,12 @@ AV1 Tx mode as described in section 6.8.21 "TX mode semantics" of :ref:`av1`.
* - struct :c:type:`v4l2_av1_quantization`
- ``quantization``
- Quantization parameters.
* - struct :c:type:`v4l2_av1_segmentation`
- ``segmentation``
- Segmentation parameters.
* - __u8
- ``superres_denom``
- The denominator for the upscaling ratio.
* - struct :c:type:`v4l2_av1_segmentation`
- ``segmentation``
- Segmentation parameters.
* - struct :c:type:`v4l2_av1_loop_filter`
- ``loop_filter``
- Loop filter params
@ -3829,7 +3833,7 @@ AV1 Tx mode as described in section 6.8.21 "TX mode semantics" of :ref:`av1`.
* - struct :c:type:`v4l2_av1_loop_restoration`
- ``loop_restoration``
- Loop restoration parameters.
* - struct :c:type:`v4l2_av1_loop_global_motion`
* - struct :c:type:`v4l2_av1_global_motion`
- ``global_motion``
- Global motion parameters.
* - __u32

View File

@ -31,7 +31,7 @@ Image Process Control IDs
Pixel sampling rate in the device's pixel array. This control is
read-only and its unit is pixels / second.
Some devices use horizontal and vertical balanking to configure the frame
Some devices use horizontal and vertical blanking to configure the frame
rate. The frame rate can be calculated from the pixel rate, analogue crop
rectangle as well as horizontal and vertical blanking. The pixel rate
control may be present in a different sub-device than the blanking controls

View File

@ -1,28 +1,67 @@
.. SPDX-License-Identifier: GPL-2.0
.. _v4l2-meta-fmt-rk-isp1-params:
.. _v4l2-meta-fmt-rk-isp1-stat-3a:
*****************************************************************************
V4L2_META_FMT_RK_ISP1_PARAMS ('rk1p'), V4L2_META_FMT_RK_ISP1_STAT_3A ('rk1s')
*****************************************************************************
************************************************************************************************************************
V4L2_META_FMT_RK_ISP1_PARAMS ('rk1p'), V4L2_META_FMT_RK_ISP1_STAT_3A ('rk1s'), V4L2_META_FMT_RK_ISP1_EXT_PARAMS ('rk1e')
************************************************************************************************************************
========================
Configuration parameters
========================
The configuration parameters are passed to the
The configuration of the RkISP1 ISP is performed by userspace by providing
parameters for the ISP to the driver using the :c:type:`v4l2_meta_format`
interface.
There are two methods that allow to configure the ISP, the `fixed parameters`
configuration format and the `extensible parameters` configuration
format.
.. _v4l2-meta-fmt-rk-isp1-params:
Fixed parameters configuration format
=====================================
When using the fixed configuration format, parameters are passed to the
:ref:`rkisp1_params <rkisp1_params>` metadata output video node, using
the :c:type:`v4l2_meta_format` interface. The buffer contains
a single instance of the C structure :c:type:`rkisp1_params_cfg` defined in
``rkisp1-config.h``. So the structure can be obtained from the buffer by:
the `V4L2_META_FMT_RK_ISP1_PARAMS` meta format.
The buffer contains a single instance of the C structure
:c:type:`rkisp1_params_cfg` defined in ``rkisp1-config.h``. So the structure can
be obtained from the buffer by:
.. code-block:: c
struct rkisp1_params_cfg *params = (struct rkisp1_params_cfg*) buffer;
This method supports a subset of the ISP features only, new applications should
use the extensible parameters method.
.. _v4l2-meta-fmt-rk-isp1-ext-params:
Extensible parameters configuration format
==========================================
When using the extensible configuration format, parameters are passed to the
:ref:`rkisp1_params <rkisp1_params>` metadata output video node, using
the `V4L2_META_FMT_RK_ISP1_EXT_PARAMS` meta format.
The buffer contains a single instance of the C structure
:c:type:`rkisp1_ext_params_cfg` defined in ``rkisp1-config.h``. The
:c:type:`rkisp1_ext_params_cfg` structure is designed to allow userspace to
populate the data buffer with only the configuration data for the ISP blocks it
intends to configure. The extensible parameters format design allows developers
to define new block types to support new configuration parameters, and defines a
versioning scheme so that it can be extended and versioned without breaking
compatibility with existing applications.
For these reasons, this configuration method is preferred over the `fixed
parameters` format alternative.
.. rkisp1_stat_buffer
===========================
3A and histogram statistics
===========================

View File

@ -0,0 +1,315 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.2" width="140mm" height="220mm" viewBox="0 0 14000 22000" preserveAspectRatio="xMidYMid" fill-rule="evenodd" stroke-width="28.222" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:presentation="http://sun.com/xmlns/staroffice/presentation" xmlns:smil="http://www.w3.org/2001/SMIL20/" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xml:space="preserve">
<defs class="ClipPathGroup">
<clipPath id="presentation_clip_path" clipPathUnits="userSpaceOnUse">
<rect x="0" y="0" width="14000" height="22000"/>
</clipPath>
<clipPath id="presentation_clip_path_shrink" clipPathUnits="userSpaceOnUse">
<rect x="14" y="22" width="13972" height="21956"/>
</clipPath>
</defs>
<defs>
<font id="EmbeddedFont_1" horiz-adv-x="2048">
<font-face font-family="Liberation Sans embedded" units-per-em="2048" font-weight="normal" font-style="normal" ascent="1852" descent="423"/>
<missing-glyph horiz-adv-x="2048" d="M 0,0 L 2047,0 2047,2047 0,2047 0,0 Z"/>
<glyph unicode="y" horiz-adv-x="1033" d="M 191,-425 C 142,-425 100,-421 67,-414 L 67,-279 C 92,-283 120,-285 151,-285 263,-285 352,-203 417,-38 L 434,5 5,1082 197,1082 425,484 C 428,475 432,464 437,451 442,438 457,394 482,320 507,246 521,205 523,196 L 593,393 830,1082 1020,1082 604,0 C 559,-115 518,-201 479,-258 440,-314 398,-356 351,-384 304,-411 250,-425 191,-425 Z"/>
<glyph unicode="x" horiz-adv-x="1006" d="M 801,0 L 510,444 217,0 23,0 408,556 41,1082 240,1082 510,661 778,1082 979,1082 612,558 1002,0 801,0 Z"/>
<glyph unicode="w" horiz-adv-x="1509" d="M 1174,0 L 965,0 776,765 740,934 C 734,904 725,861 712,805 699,748 631,480 508,0 L 300,0 -3,1082 175,1082 358,347 C 363,331 377,265 401,149 L 418,223 644,1082 837,1082 1026,339 1072,149 1103,288 1308,1082 1484,1082 1174,0 Z"/>
<glyph unicode="u" horiz-adv-x="874" d="M 314,1082 L 314,396 C 314,325 321,269 335,230 349,191 371,162 402,145 433,128 478,119 537,119 624,119 692,149 742,208 792,267 817,350 817,455 L 817,1082 997,1082 997,231 C 997,105 999,28 1003,0 L 833,0 C 832,3 832,12 831,27 830,42 830,59 829,78 828,97 826,132 825,185 L 822,185 C 781,110 733,58 679,27 624,-4 557,-20 476,-20 357,-20 271,10 216,69 161,128 133,225 133,361 L 133,1082 314,1082 Z"/>
<glyph unicode="t" horiz-adv-x="531" d="M 554,8 C 495,-8 434,-16 372,-16 228,-16 156,66 156,229 L 156,951 31,951 31,1082 163,1082 216,1324 336,1324 336,1082 536,1082 536,951 336,951 336,268 C 336,216 345,180 362,159 379,138 408,127 450,127 474,127 509,132 554,141 L 554,8 Z"/>
<glyph unicode="s" horiz-adv-x="901" d="M 950,299 C 950,197 912,118 835,63 758,8 650,-20 511,-20 376,-20 273,2 200,47 127,91 79,160 57,254 L 216,285 C 231,227 263,185 311,158 359,131 426,117 511,117 602,117 669,131 712,159 754,187 775,229 775,285 775,328 760,362 731,389 702,416 654,438 589,455 L 460,489 C 357,516 283,542 240,568 196,593 162,624 137,661 112,698 100,743 100,796 100,895 135,970 206,1022 276,1073 378,1099 513,1099 632,1099 727,1078 798,1036 868,994 912,927 931,834 L 769,814 C 759,862 732,899 689,925 645,950 586,963 513,963 432,963 372,951 333,926 294,901 275,864 275,814 275,783 283,758 299,738 315,718 339,701 370,687 401,673 467,654 568,629 663,605 732,583 774,563 816,542 849,520 874,495 898,470 917,442 930,410 943,377 950,340 950,299 Z"/>
<glyph unicode="r" horiz-adv-x="530" d="M 142,0 L 142,830 C 142,906 140,990 136,1082 L 306,1082 C 311,959 314,886 314,861 L 318,861 C 347,954 380,1017 417,1051 454,1085 507,1102 575,1102 599,1102 623,1099 648,1092 L 648,927 C 624,934 592,937 552,937 477,937 420,905 381,841 342,776 322,684 322,564 L 322,0 142,0 Z"/>
<glyph unicode="p" horiz-adv-x="953" d="M 1053,546 C 1053,169 920,-20 655,-20 488,-20 376,43 319,168 L 314,168 C 317,163 318,106 318,-2 L 318,-425 138,-425 138,861 C 138,972 136,1046 132,1082 L 306,1082 C 307,1079 308,1070 309,1054 310,1037 312,1012 314,978 315,944 316,921 316,908 L 320,908 C 352,975 394,1024 447,1055 500,1086 569,1101 655,1101 788,1101 888,1056 954,967 1020,878 1053,737 1053,546 Z M 864,542 C 864,693 844,800 803,865 762,930 698,962 609,962 538,962 482,947 442,917 401,887 371,840 350,777 329,713 318,630 318,528 318,386 341,281 386,214 431,147 505,113 607,113 696,113 762,146 803,212 844,277 864,387 864,542 Z"/>
<glyph unicode="o" horiz-adv-x="980" d="M 1053,542 C 1053,353 1011,212 928,119 845,26 724,-20 565,-20 407,-20 288,28 207,125 126,221 86,360 86,542 86,915 248,1102 571,1102 736,1102 858,1057 936,966 1014,875 1053,733 1053,542 Z M 864,542 C 864,691 842,800 798,868 753,935 679,969 574,969 469,969 393,935 346,866 299,797 275,689 275,542 275,399 298,292 345,221 391,149 464,113 563,113 671,113 748,148 795,217 841,286 864,395 864,542 Z"/>
<glyph unicode="l" horiz-adv-x="187" d="M 138,0 L 138,1484 318,1484 318,0 138,0 Z"/>
<glyph unicode="i" horiz-adv-x="187" d="M 137,1312 L 137,1484 317,1484 317,1312 137,1312 Z M 137,0 L 137,1082 317,1082 317,0 137,0 Z"/>
<glyph unicode="f" horiz-adv-x="557" d="M 361,951 L 361,0 181,0 181,951 29,951 29,1082 181,1082 181,1204 C 181,1303 203,1374 246,1417 289,1460 356,1482 445,1482 495,1482 537,1478 572,1470 L 572,1333 C 542,1338 515,1341 492,1341 446,1341 413,1329 392,1306 371,1283 361,1240 361,1179 L 361,1082 572,1082 572,951 361,951 Z"/>
<glyph unicode="e" horiz-adv-x="980" d="M 276,503 C 276,379 302,283 353,216 404,149 479,115 578,115 656,115 719,131 766,162 813,193 844,233 861,281 L 1019,236 C 954,65 807,-20 578,-20 418,-20 296,28 213,123 129,218 87,360 87,548 87,727 129,864 213,959 296,1054 416,1102 571,1102 889,1102 1048,910 1048,527 L 1048,503 276,503 Z M 862,641 C 852,755 823,838 775,891 727,943 658,969 568,969 481,969 412,940 361,882 310,823 282,743 278,641 L 862,641 Z"/>
<glyph unicode="b" horiz-adv-x="953" d="M 1053,546 C 1053,169 920,-20 655,-20 573,-20 505,-5 451,25 396,54 352,102 318,168 L 316,168 C 316,147 315,116 312,74 309,31 307,7 306,0 L 132,0 C 136,36 138,110 138,223 L 138,1484 318,1484 318,1061 C 318,1018 317,967 314,908 L 318,908 C 351,977 396,1027 451,1057 506,1087 574,1102 655,1102 792,1102 892,1056 957,964 1021,872 1053,733 1053,546 Z M 864,540 C 864,691 844,800 804,865 764,930 699,963 609,963 508,963 434,928 388,859 341,790 318,680 318,529 318,387 341,282 386,215 431,147 505,113 607,113 698,113 763,147 804,214 844,281 864,389 864,540 Z"/>
<glyph unicode="8" horiz-adv-x="980" d="M 1050,393 C 1050,263 1009,162 926,89 843,16 725,-20 570,-20 419,-20 302,16 217,87 132,158 89,260 89,391 89,483 115,560 168,623 221,686 288,724 370,737 L 370,741 C 293,759 233,798 189,858 144,918 122,988 122,1069 122,1176 162,1263 243,1330 323,1397 431,1430 566,1430 705,1430 814,1397 895,1332 975,1267 1015,1178 1015,1067 1015,986 993,916 948,856 903,796 842,758 765,743 L 765,739 C 855,724 925,686 975,625 1025,563 1050,486 1050,393 Z M 828,1057 C 828,1216 741,1296 566,1296 481,1296 417,1276 373,1236 328,1196 306,1136 306,1057 306,976 329,915 375,873 420,830 485,809 568,809 653,809 717,829 762,868 806,907 828,970 828,1057 Z M 863,410 C 863,497 837,563 785,608 733,652 660,674 566,674 475,674 403,650 352,603 301,555 275,489 275,406 275,212 374,115 572,115 670,115 743,139 791,186 839,233 863,307 863,410 Z"/>
<glyph unicode="6" horiz-adv-x="980" d="M 1049,461 C 1049,312 1009,195 928,109 847,23 736,-20 594,-20 435,-20 314,39 230,157 146,275 104,447 104,672 104,916 148,1103 235,1234 322,1365 447,1430 608,1430 821,1430 955,1334 1010,1143 L 838,1112 C 803,1227 725,1284 606,1284 503,1284 424,1236 368,1141 311,1045 283,906 283,725 316,786 362,832 421,864 480,895 548,911 625,911 755,911 858,870 935,789 1011,708 1049,598 1049,461 Z M 866,453 C 866,555 841,634 791,689 741,744 671,772 582,772 498,772 430,748 379,699 327,650 301,582 301,496 301,387 328,298 382,229 435,160 504,125 588,125 675,125 743,154 792,213 841,271 866,351 866,453 Z"/>
<glyph unicode="4" horiz-adv-x="1060" d="M 881,319 L 881,0 711,0 711,319 47,319 47,459 692,1409 881,1409 881,461 1079,461 1079,319 881,319 Z M 711,1206 C 710,1202 700,1184 683,1153 666,1122 653,1100 644,1087 L 283,555 229,481 213,461 711,461 711,1206 Z"/>
<glyph unicode="3" horiz-adv-x="1006" d="M 1049,389 C 1049,259 1008,158 925,87 842,16 724,-20 571,-20 428,-20 315,12 230,77 145,141 94,236 78,362 L 264,379 C 288,212 390,129 571,129 662,129 733,151 785,196 836,241 862,307 862,395 862,472 833,532 774,575 715,618 629,639 518,639 L 416,639 416,795 514,795 C 613,795 689,817 744,860 798,903 825,962 825,1038 825,1113 803,1173 759,1217 714,1260 648,1282 561,1282 482,1282 418,1262 369,1221 320,1180 291,1123 283,1049 L 102,1063 C 115,1178 163,1268 246,1333 328,1398 434,1430 563,1430 704,1430 814,1397 893,1332 971,1266 1010,1174 1010,1057 1010,967 985,894 935,838 884,781 811,743 715,723 L 715,719 C 820,708 902,672 961,613 1020,554 1049,479 1049,389 Z"/>
<glyph unicode="2" horiz-adv-x="954" d="M 103,0 L 103,127 C 137,205 179,274 228,334 277,393 328,447 382,496 436,544 490,589 543,630 596,671 643,713 686,754 729,795 763,839 790,884 816,929 829,981 829,1038 829,1115 806,1175 761,1218 716,1261 653,1282 572,1282 495,1282 432,1261 383,1220 333,1178 304,1119 295,1044 L 111,1061 C 124,1174 172,1263 255,1330 337,1397 443,1430 572,1430 714,1430 823,1397 900,1330 976,1263 1014,1167 1014,1044 1014,989 1002,935 977,881 952,827 914,773 865,719 816,665 721,581 582,468 505,405 444,349 399,299 354,248 321,200 301,153 L 1036,153 1036,0 103,0 Z"/>
<glyph unicode="1" horiz-adv-x="927" d="M 156,0 L 156,153 515,153 515,1237 197,1010 197,1180 530,1409 696,1409 696,153 1039,153 1039,0 156,0 Z"/>
<glyph unicode=" " horiz-adv-x="556"/>
</font>
</defs>
<defs class="TextShapeIndex">
<g ooo:slide="id1" ooo:id-list="id3 id4 id5 id6 id7 id8 id9 id10 id11 id12 id13 id14 id15 id16 id17 id18 id19 id20 id21 id22 id23 id24 id25 id26 id27 id28 id29 id30"/>
</defs>
<defs class="EmbeddedBulletChars">
<g id="bullet-char-template-57356" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 580,1141 L 1163,571 580,0 -4,571 580,1141 Z"/>
</g>
<g id="bullet-char-template-57354" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 8,1128 L 1137,1128 1137,0 8,0 8,1128 Z"/>
</g>
<g id="bullet-char-template-10146" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 174,0 L 602,739 174,1481 1456,739 174,0 Z M 1358,739 L 309,1346 659,739 1358,739 Z"/>
</g>
<g id="bullet-char-template-10132" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 2015,739 L 1276,0 717,0 1260,543 174,543 174,936 1260,936 717,1481 1274,1481 2015,739 Z"/>
</g>
<g id="bullet-char-template-10007" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 0,-2 C -7,14 -16,27 -25,37 L 356,567 C 262,823 215,952 215,954 215,979 228,992 255,992 264,992 276,990 289,987 310,991 331,999 354,1012 L 381,999 492,748 772,1049 836,1024 860,1049 C 881,1039 901,1025 922,1006 886,937 835,863 770,784 769,783 710,716 594,584 L 774,223 C 774,196 753,168 711,139 L 727,119 C 717,90 699,76 672,76 641,76 570,178 457,381 L 164,-76 C 142,-110 111,-127 72,-127 30,-127 9,-110 8,-76 1,-67 -2,-52 -2,-32 -2,-23 -1,-13 0,-2 Z"/>
</g>
<g id="bullet-char-template-10004" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 285,-33 C 182,-33 111,30 74,156 52,228 41,333 41,471 41,549 55,616 82,672 116,743 169,778 240,778 293,778 328,747 346,684 L 369,508 C 377,444 397,411 428,410 L 1163,1116 C 1174,1127 1196,1133 1229,1133 1271,1133 1292,1118 1292,1087 L 1292,965 C 1292,929 1282,901 1262,881 L 442,47 C 390,-6 338,-33 285,-33 Z"/>
</g>
<g id="bullet-char-template-9679" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 813,0 C 632,0 489,54 383,161 276,268 223,411 223,592 223,773 276,916 383,1023 489,1130 632,1184 813,1184 992,1184 1136,1130 1245,1023 1353,916 1407,772 1407,592 1407,412 1353,268 1245,161 1136,54 992,0 813,0 Z"/>
</g>
<g id="bullet-char-template-8226" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 346,457 C 273,457 209,483 155,535 101,586 74,649 74,723 74,796 101,859 155,911 209,963 273,989 346,989 419,989 480,963 531,910 582,859 608,796 608,723 608,648 583,586 532,535 482,483 420,457 346,457 Z"/>
</g>
<g id="bullet-char-template-8211" transform="scale(0.00048828125,-0.00048828125)">
<path d="M -4,459 L 1135,459 1135,606 -4,606 -4,459 Z"/>
</g>
<g id="bullet-char-template-61548" transform="scale(0.00048828125,-0.00048828125)">
<path d="M 173,740 C 173,903 231,1043 346,1159 462,1274 601,1332 765,1332 928,1332 1067,1274 1183,1159 1299,1043 1357,903 1357,740 1357,577 1299,437 1183,322 1067,206 928,148 765,148 601,148 462,206 346,322 231,437 173,577 173,740 Z"/>
</g>
</defs>
<g>
<g id="id2" class="Master_Slide">
<g id="bg-id2" class="Background"/>
<g id="bo-id2" class="BackgroundObjects"/>
</g>
</g>
<g class="SlideGroup">
<g>
<g id="container-id1">
<g id="id1" class="Slide" clip-path="url(#presentation_clip_path)">
<g class="Page">
<g class="com.sun.star.drawing.MeasureShape">
<g id="id3">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="325" width="10003" height="15477"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 2037,950 L 11463,950"/>
<path fill="rgb(0,0,0)" stroke="none" d="M 1750,950 L 2050,1050 2050,850 1750,950 Z"/>
<path fill="rgb(0,0,0)" stroke="none" d="M 11750,950 L 11450,850 11450,1050 11750,950 Z"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 1750,15800 L 1750,750"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 11750,1650 L 11750,750"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="5953" y="768"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">16 px</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.MeasureShape">
<g id="id4">
<rect class="BoundingBox" stroke="none" fill="none" x="11795" y="1649" width="1853" height="19913"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 13446,1937 L 13446,21273"/>
<path fill="rgb(0,0,0)" stroke="none" d="M 13446,1650 L 13346,1950 13546,1950 13446,1650 Z"/>
<path fill="rgb(0,0,0)" stroke="none" d="M 13446,21560 L 13546,21260 13346,21260 13446,21560 Z"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 11796,1650 L 13646,1650"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 11796,21560 L 13646,21560"/>
<text class="SVGTextShape" transform="rotate(-90 13395 12369)"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="13395" y="12369"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">32 px</tspan></tspan></tspan></text>
</g>
</g>
<g class="Group">
<g class="com.sun.star.drawing.CustomShape">
<g id="id5">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="2449" width="10003" height="1753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,4200 L 1750,4200 1750,2450 11750,2450 11750,4200 6750,4200 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3718" y="3545"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of upper 8 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id6">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="1699" width="10003" height="753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,2450 L 1750,2450 1750,1700 11750,1700 11750,2450 6750,2450 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3860" y="2295"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of lower 2bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id7">
<rect class="BoundingBox" stroke="none" fill="none" x="1709" y="1609" width="10083" height="2583"/>
<path fill="none" stroke="rgb(52,101,164)" stroke-width="81" stroke-linejoin="round" d="M 6750,4150 L 1750,4150 1750,1650 11750,1650 11750,4150 6750,4150 Z"/>
</g>
</g>
</g>
<g class="com.sun.star.drawing.MeasureShape">
<g id="id8">
<rect class="BoundingBox" stroke="none" fill="none" x="385" y="1199" width="1294" height="3971"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 1027,5079 L 1027,2737"/>
<path fill="rgb(0,0,0)" stroke="none" d="M 1027,2450 L 927,2750 1127,2750 1027,2450 Z"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 1027,1413 L 1027,1200"/>
<path fill="rgb(0,0,0)" stroke="none" d="M 1027,1700 L 1127,1400 927,1400 1027,1700 Z"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 1027,2450 L 1027,1700"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 1677,2450 L 827,2450"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 1677,1700 L 827,1700"/>
<text class="SVGTextShape" transform="rotate(-90 845 5217)"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="845" y="5217"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">16 bytes</tspan></tspan></tspan></text>
</g>
</g>
<g class="Group">
<g class="com.sun.star.drawing.CustomShape">
<g id="id9">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="4929" width="10003" height="1753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,6680 L 1750,6680 1750,4930 11750,4930 11750,6680 6750,6680 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3718" y="6025"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of upper 8 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id10">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="4179" width="10003" height="753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,4930 L 1750,4930 1750,4180 11750,4180 11750,4930 6750,4930 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3771" y="4775"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of lower 2 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id11">
<rect class="BoundingBox" stroke="none" fill="none" x="1709" y="4089" width="10083" height="2583"/>
<path fill="none" stroke="rgb(52,101,164)" stroke-width="81" stroke-linejoin="round" d="M 6750,6630 L 1750,6630 1750,4130 11750,4130 11750,6630 6750,6630 Z"/>
</g>
</g>
</g>
<g class="Group">
<g class="com.sun.star.drawing.CustomShape">
<g id="id12">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="7409" width="10003" height="1753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,9160 L 1750,9160 1750,7410 11750,7410 11750,9160 6750,9160 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3718" y="8505"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of upper 8 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id13">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="6659" width="10003" height="753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,7410 L 1750,7410 1750,6660 11750,6660 11750,7410 6750,7410 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3771" y="7255"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of lower 2 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id14">
<rect class="BoundingBox" stroke="none" fill="none" x="1709" y="6569" width="10083" height="2583"/>
<path fill="none" stroke="rgb(52,101,164)" stroke-width="81" stroke-linejoin="round" d="M 6750,9110 L 1750,9110 1750,6610 11750,6610 11750,9110 6750,9110 Z"/>
</g>
</g>
</g>
<g class="Group">
<g class="com.sun.star.drawing.CustomShape">
<g id="id15">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="9889" width="10003" height="1753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,11640 L 1750,11640 1750,9890 11750,9890 11750,11640 6750,11640 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3718" y="10985"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of upper 8 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id16">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="9139" width="10003" height="753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,9890 L 1750,9890 1750,9140 11750,9140 11750,9890 6750,9890 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3771" y="9735"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of lower 2 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id17">
<rect class="BoundingBox" stroke="none" fill="none" x="1709" y="9049" width="10083" height="2583"/>
<path fill="none" stroke="rgb(52,101,164)" stroke-width="81" stroke-linejoin="round" d="M 6750,11590 L 1750,11590 1750,9090 11750,9090 11750,11590 6750,11590 Z"/>
</g>
</g>
</g>
<g class="Group">
<g class="com.sun.star.drawing.CustomShape">
<g id="id18">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="12369" width="10003" height="1753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,14120 L 1750,14120 1750,12370 11750,12370 11750,14120 6750,14120 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3718" y="13465"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of upper 8 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id19">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="11619" width="10003" height="753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,12370 L 1750,12370 1750,11620 11750,11620 11750,12370 6750,12370 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3771" y="12215"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of lower 2 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id20">
<rect class="BoundingBox" stroke="none" fill="none" x="1709" y="11529" width="10083" height="2583"/>
<path fill="none" stroke="rgb(52,101,164)" stroke-width="81" stroke-linejoin="round" d="M 6750,14070 L 1750,14070 1750,11570 11750,11570 11750,14070 6750,14070 Z"/>
</g>
</g>
</g>
<g class="Group">
<g class="com.sun.star.drawing.CustomShape">
<g id="id21">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="14849" width="10003" height="1753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,16600 L 1750,16600 1750,14850 11750,14850 11750,16600 6750,16600 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3718" y="15945"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of upper 8 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id22">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="14099" width="10003" height="753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,14850 L 1750,14850 1750,14100 11750,14100 11750,14850 6750,14850 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3771" y="14695"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of lower 2 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id23">
<rect class="BoundingBox" stroke="none" fill="none" x="1709" y="14009" width="10083" height="2583"/>
<path fill="none" stroke="rgb(52,101,164)" stroke-width="81" stroke-linejoin="round" d="M 6750,16550 L 1750,16550 1750,14050 11750,14050 11750,16550 6750,16550 Z"/>
</g>
</g>
</g>
<g class="Group">
<g class="com.sun.star.drawing.CustomShape">
<g id="id24">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="17329" width="10003" height="1753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,19080 L 1750,19080 1750,17330 11750,17330 11750,19080 6750,19080 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3718" y="18425"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of upper 8 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id25">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="16579" width="10003" height="753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,17330 L 1750,17330 1750,16580 11750,16580 11750,17330 6750,17330 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3771" y="17175"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of lower 2 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id26">
<rect class="BoundingBox" stroke="none" fill="none" x="1709" y="16489" width="10083" height="2583"/>
<path fill="none" stroke="rgb(52,101,164)" stroke-width="81" stroke-linejoin="round" d="M 6750,19030 L 1750,19030 1750,16530 11750,16530 11750,19030 6750,19030 Z"/>
</g>
</g>
</g>
<g class="Group">
<g class="com.sun.star.drawing.CustomShape">
<g id="id27">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="19809" width="10003" height="1753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,21560 L 1750,21560 1750,19810 11750,19810 11750,21560 6750,21560 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3718" y="20905"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of upper 8 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id28">
<rect class="BoundingBox" stroke="none" fill="none" x="1749" y="19059" width="10003" height="753"/>
<path fill="none" stroke="rgb(52,101,164)" d="M 6750,19810 L 1750,19810 1750,19060 11750,19060 11750,19810 6750,19810 Z"/>
<text class="SVGTextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="3771" y="19655"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">4 rows of lower 2 bits</tspan></tspan></tspan></text>
</g>
</g>
<g class="com.sun.star.drawing.CustomShape">
<g id="id29">
<rect class="BoundingBox" stroke="none" fill="none" x="1709" y="18969" width="10083" height="2583"/>
<path fill="none" stroke="rgb(52,101,164)" stroke-width="81" stroke-linejoin="round" d="M 6750,21510 L 1750,21510 1750,19010 11750,19010 11750,21510 6750,21510 Z"/>
</g>
</g>
</g>
<g class="com.sun.star.drawing.MeasureShape">
<g id="id30">
<rect class="BoundingBox" stroke="none" fill="none" x="11849" y="1949" width="1237" height="4987"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 12443,6845 L 12443,4487"/>
<path fill="rgb(0,0,0)" stroke="none" d="M 12443,4200 L 12343,4500 12543,4500 12443,4200 Z"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 12443,2163 L 12443,1950"/>
<path fill="rgb(0,0,0)" stroke="none" d="M 12443,2450 L 12543,2150 12343,2150 12443,2450 Z"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 12443,4200 L 12443,2450"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 11850,4200 L 12643,4200"/>
<path fill="none" stroke="rgb(0,0,0)" d="M 11850,2450 L 12643,2450"/>
<text class="SVGTextShape" transform="rotate(-90 12953 6967)"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="635px" font-weight="400"><tspan class="TextPosition" x="12953" y="6967"><tspan fill="rgb(0,0,0)" stroke="none" style="white-space: pre">64 bytes</tspan></tspan></tspan></text>
</g>
</g>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -275,19 +275,6 @@ please make a proposal on the linux-media mailing list.
Decoder's implementation can be found here,
`aspeed_codec <https://github.com/AspeedTech-BMC/aspeed_codec/>`__
* .. _V4L2-PIX-FMT-MT2110T:
- ``V4L2_PIX_FMT_MT2110T``
- 'MT2110T'
- This format is two-planar 10-Bit tile mode and having similitude with
``V4L2_PIX_FMT_MM21`` in term of alignment and tiling. Used for VP9, AV1
and HEVC.
* .. _V4L2-PIX-FMT-MT2110R:
- ``V4L2_PIX_FMT_MT2110R``
- 'MT2110R'
- This format is two-planar 10-Bit raster mode and having similitude with
``V4L2_PIX_FMT_MM21`` in term of alignment and tiling. Used for AVC.
* .. _V4L2-PIX-FMT-HEXTILE:
- ``V4L2_PIX_FMT_HEXTILE``

View File

@ -144,6 +144,20 @@ All components are stored with the same number of bits per component.
- Cb, Cr
- Yes
- 4x4 tiles
* - V4L2_PIX_FMT_MT2110T
- 'MT2T'
- 15
- 4:2:0
- Cb, Cr
- No
- 16x32 / 16x16 tiles tiled low bits
* - V4L2_PIX_FMT_MT2110R
- 'MT2R'
- 15
- 4:2:0
- Cb, Cr
- No
- 16x32 / 16x16 tiles raster low bits
* - V4L2_PIX_FMT_NV16
- 'NV16'
- 8
@ -295,8 +309,6 @@ of the luma plane.
.. _V4L2-PIX-FMT-NV12-32L32:
.. _V4L2-PIX-FMT-NV12M-8L128:
.. _V4L2-PIX-FMT-NV12-8L128:
.. _V4L2-PIX-FMT-NV12M-10BE-8L128:
.. _V4L2-PIX-FMT-NV12-10BE-8L128:
.. _V4L2-PIX-FMT-MM21:
Tiled NV12
@ -322,6 +334,22 @@ If the vertical resolution is an odd number of tiles, the last row of
tiles is stored in linear order. The layouts of the luma and chroma
planes are identical.
.. _nv12mt:
.. kernel-figure:: nv12mt.svg
:alt: nv12mt.svg
:align: center
V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
.. _nv12mt_ex:
.. kernel-figure:: nv12mt_example.svg
:alt: nv12mt_example.svg
:align: center
Example V4L2_PIX_FMT_NV12MT memory layout of tiles
``V4L2_PIX_FMT_NV12_4L4`` stores pixels in 4x4 tiles, and stores
tiles linearly in memory. The line stride and image height must be
aligned to a multiple of 4. The layouts of the luma and chroma planes are
@ -345,6 +373,27 @@ The layouts of the luma and chroma planes are identical.
``V4L2_PIX_FMT_NV12_8L128`` is similar to ``V4L2_PIX_FMT_NV12M_8L128`` but stores
two planes in one memory.
``V4L2_PIX_FMT_MM21`` store luma pixel in 16x32 tiles, and chroma pixels
in 16x16 tiles. The line stride must be aligned to a multiple of 16 and the
image height must be aligned to a multiple of 32. The number of luma and chroma
tiles are identical, even though the tile size differ. The image is formed of
two non-contiguous planes.
.. _V4L2-PIX-FMT-NV15-4L4:
.. _V4L2-PIX-FMT-NV12M-10BE-8L128:
.. _V4L2-PIX-FMT-NV12-10BE-8L128:
.. _V4L2-PIX-FMT-MT2110T:
.. _V4L2-PIX-FMT-MT2110R:
Tiled NV15
----------
``V4L2_PIX_FMT_NV15_4L4`` Semi-planar 10-bit YUV 4:2:0 formats, using 4x4 tiling.
All components are packed without any padding between each other.
As a side-effect, each group of 4 components are stored over 5 bytes
(YYYY or UVUV = 4 * 10 bits = 40 bits = 5 bytes).
``V4L2_PIX_FMT_NV12M_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M`` but stores
10 bits pixels in 2D 8x128 tiles, and stores tiles linearly in memory.
the data is arranged in big endian order.
@ -363,37 +412,119 @@ byte 4: Y3(bits 7-0)
``V4L2_PIX_FMT_NV12_10BE_8L128`` is similar to ``V4L2_PIX_FMT_NV12M_10BE_8L128`` but stores
two planes in one memory.
``V4L2_PIX_FMT_MM21`` store luma pixel in 16x32 tiles, and chroma pixels
in 16x16 tiles. The line stride must be aligned to a multiple of 16 and the
image height must be aligned to a multiple of 32. The number of luma and chroma
tiles are identical, even though the tile size differ. The image is formed of
two non-contiguous planes.
``V4L2_PIX_FMT_MT2110T`` is one of Mediatek packed 10bit YUV 4:2:0 formats.
It is fully packed 10bit 4:2:0 format like NV15 (15 bits per pixel), except
that the lower two bits data is stored in separate partitions. The format is
composed of 16x32 luma tiles, and 16x16 chroma tiles. Each tiles is 640 bytes
long, divided into 8 partitions of 80 bytes. The first 16 bytes of the
partition represent the 2 least significant bits of pixel data. The remaining
64 bytes represent the 8 most significant bits of pixel data.
.. _nv12mt:
.. kernel-figure:: nv12mt.svg
:alt: nv12mt.svg
.. kernel-figure:: mt2110t.svg
:alt: mt2110t.svg
:align: center
V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
Layout of MT2110T Chroma Tile
.. _nv12mt_ex:
Filtering out the upper part of each partitions results in a valid
``V4L2_PIX_FMT_MM21`` frame. A partition is a sub-tile of size 16 x 4. The
lower two bits is said to be tiled since each bytes contains the lower two
bits of the column of for pixel matching the same index. The chroma tiles
only have 4 partitions.
.. kernel-figure:: nv12mt_example.svg
:alt: nv12mt_example.svg
:align: center
.. flat-table:: MT2110T LSB bits layout
:header-rows: 1
:stub-columns: 1
Example V4L2_PIX_FMT_NV12MT memory layout of tiles
* -
- start + 0:
- start + 1:
- . . .
- start\ +\ 15:
* - Bits 1:0
- Y'\ :sub:`0:0`
- Y'\ :sub:`0:1`
- . . .
- Y'\ :sub:`0:15`
* - Bit 3:2
- Y'\ :sub:`1:0`
- Y'\ :sub:`1:1`
- . . .
- Y'\ :sub:`1:15`
* - Bits 5:4
- Y'\ :sub:`2:0`
- Y'\ :sub:`2:1`
- . . .
- Y'\ :sub:`2:15`
* - Bits 7:6
- Y'\ :sub:`3:0`
- Y'\ :sub:`3:1`
- . . .
- Y'\ :sub:`3:15`
.. _V4L2-PIX-FMT-NV15-4L4:
``V4L2_PIX_FMT_MT2110R`` is identical to ``V4L2_PIX_FMT_MT2110T`` except that
the least significant two bits layout is in raster order. This means the first byte
contains 4 pixels of the first row, with 4 bytes per line.
Tiled NV15
----------
.. flat-table:: MT2110R LSB bits layout
:header-rows: 2
:stub-columns: 1
* -
- :cspan:`3` Byte 0
- ...
- :cspan:`3` Byte 3
* -
- 7:6
- 5:4
- 3:2
- 1:0
- ...
- 7:6
- 5:4
- 3:2
- 1:0
* - start + 0:
- Y'\ :sub:`0:3`
- Y'\ :sub:`0:2`
- Y'\ :sub:`0:1`
- Y'\ :sub:`0:0`
- ...
- Y'\ :sub:`0:15`
- Y'\ :sub:`0:14`
- Y'\ :sub:`0:13`
- Y'\ :sub:`0:12`
* - start + 4:
- Y'\ :sub:`1:3`
- Y'\ :sub:`1:2`
- Y'\ :sub:`1:1`
- Y'\ :sub:`1:0`
- ...
- Y'\ :sub:`1:15`
- Y'\ :sub:`1:14`
- Y'\ :sub:`1:13`
- Y'\ :sub:`1:12`
* - start + 8:
- Y'\ :sub:`2:3`
- Y'\ :sub:`2:2`
- Y'\ :sub:`2:1`
- Y'\ :sub:`2:0`
- ...
- Y'\ :sub:`2:15`
- Y'\ :sub:`2:14`
- Y'\ :sub:`2:13`
- Y'\ :sub:`2:12`
* - start\ +\ 12:
- Y'\ :sub:`3:3`
- Y'\ :sub:`3:2`
- Y'\ :sub:`3:1`
- Y'\ :sub:`3:0`
- ...
- Y'\ :sub:`3:15`
- Y'\ :sub:`3:14`
- Y'\ :sub:`3:13`
- Y'\ :sub:`3:12`
Semi-planar 10-bit YUV 4:2:0 formats, using 4x4 tiling.
All components are packed without any padding between each other.
As a side-effect, each group of 4 components are stored over 5 bytes
(YYYY or UVUV = 4 * 10 bits = 40 bits = 5 bytes).
.. _V4L2-PIX-FMT-NV16:
.. _V4L2-PIX-FMT-NV61:

View File

@ -244,6 +244,17 @@ specification the ioctl returns an ``EINVAL`` error code.
- 0x01000000
- The device supports the :c:func:`read()` and/or
:c:func:`write()` I/O methods.
* - ``V4L2_CAP_EDID``
- 0x02000000
- The device stores the EDID for a video input, or retrieves the EDID for a video
output. It is a standalone EDID device, so no video streaming etc. will take place.
For a video input this is typically an eeprom that supports the
:ref:`VESA Enhanced Display Data Channel Standard <vesaeddc>`. It can be something
else as well, for example a micro controller.
For a video output this is typically read from an external device such as an
HDMI splitter accessed by a serial port.
* - ``V4L2_CAP_STREAMING``
- 0x04000000
- The device supports the :ref:`streaming <mmap>` I/O method.

View File

@ -73,6 +73,8 @@ aborting or finishing any DMA in progress, an implicit
.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
.. cssclass:: longtable
.. flat-table:: struct v4l2_requestbuffers
:header-rows: 0
:stub-columns: 0
@ -123,14 +125,6 @@ aborting or finishing any DMA in progress, an implicit
.. _V4L2-BUF-CAP-SUPPORTS-MAX-NUM-BUFFERS:
.. _V4L2-BUF-CAP-SUPPORTS-REMOVE-BUFS:
.. raw:: latex
\footnotesize
.. tabularcolumns:: |p{8.1cm}|p{2.2cm}|p{7.0cm}|
.. cssclass:: longtable
.. flat-table:: V4L2 Buffer Capabilities Flags
:header-rows: 0
:stub-columns: 0
@ -166,6 +160,36 @@ aborting or finishing any DMA in progress, an implicit
:ref:`V4L2_BUF_FLAG_NO_CACHE_INVALIDATE <V4L2-BUF-FLAG-NO-CACHE-INVALIDATE>`,
:ref:`V4L2_BUF_FLAG_NO_CACHE_CLEAN <V4L2-BUF-FLAG-NO-CACHE-CLEAN>` and
:ref:`V4L2_MEMORY_FLAG_NON_COHERENT <V4L2-MEMORY-FLAG-NON-COHERENT>`.
* - ``V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS``
- 0x00000080
- If set, then the ``max_num_buffers`` field in ``struct v4l2_create_buffers``
is valid. If not set, then the maximum is ``VIDEO_MAX_FRAME`` buffers.
* - ``V4L2_BUF_CAP_SUPPORTS_REMOVE_BUFS``
- 0x00000100
- If set, then ``VIDIOC_REMOVE_BUFS`` is supported.
.. _memory-flags:
.. _V4L2-MEMORY-FLAG-NON-COHERENT:
.. flat-table:: Memory Consistency Flags
:header-rows: 0
:stub-columns: 0
:widths: 3 1 4
* - ``V4L2_MEMORY_FLAG_NON_COHERENT``
- 0x00000001
- A buffer is allocated either in coherent (it will be automatically
coherent between the CPU and the bus) or non-coherent memory. The
latter can provide performance gains, for instance the CPU cache
sync/flush operations can be avoided if the buffer is accessed by the
corresponding device only and the CPU does not read/write to/from that
buffer. However, this requires extra care from the driver -- it must
guarantee memory consistency by issuing a cache flush/sync when
consistency is needed. If this flag is set V4L2 will attempt to
allocate the buffer in non-coherent memory. The flag takes effect
only if the buffer is used for :ref:`memory mapping <mmap>` I/O and the
queue reports the :ref:`V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS
<V4L2-BUF-CAP-SUPPORTS-MMAP-CACHE-HINTS>` capability.
.. raw:: latex

View File

@ -197,6 +197,7 @@ replace define V4L2_CAP_META_OUTPUT device-capabilities
replace define V4L2_CAP_DEVICE_CAPS device-capabilities
replace define V4L2_CAP_TOUCH device-capabilities
replace define V4L2_CAP_IO_MC device-capabilities
replace define V4L2_CAP_EDID device-capabilities
# V4L2 pix flags
replace define V4L2_PIX_FMT_PRIV_MAGIC :c:type:`v4l2_pix_format`

View File

@ -8548,6 +8548,13 @@ F: lib/bootconfig.c
F: tools/bootconfig/*
F: tools/bootconfig/scripts/*
EXTRON DA HD 4K PLUS CEC DRIVER
M: Hans Verkuil <hverkuil@xs4all.nl>
L: linux-media@vger.kernel.org
S: Maintained
T: git git://linuxtv.org/media_tree.git
F: drivers/media/cec/usb/extron-da-hd-4k-plus/
EXYNOS DP DRIVER
M: Jingoo Han <jingoohan1@gmail.com>
L: dri-devel@lists.freedesktop.org
@ -16964,6 +16971,7 @@ OMNIVISION OG01A1B SENSOR DRIVER
M: Sakari Ailus <sakari.ailus@linux.intel.com>
L: linux-media@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/media/i2c/ovti,og01a1b.yaml
F: drivers/media/i2c/og01a1b.c
OMNIVISION OV01A10 SENSOR DRIVER
@ -18932,7 +18940,7 @@ M: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
L: linux-media@vger.kernel.org
S: Maintained
F: Documentation/admin-guide/media/qcom_camss.rst
F: Documentation/devicetree/bindings/media/*camss*
F: Documentation/devicetree/bindings/media/qcom,*camss*
F: drivers/media/platform/qcom/camss/
QUALCOMM CLOCK DRIVERS

View File

@ -673,8 +673,9 @@ void cec_transmit_done_ts(struct cec_adapter *adap, u8 status,
/* Retry this message */
data->attempts -= attempts_made;
if (msg->timeout)
dprintk(2, "retransmit: %*ph (attempts: %d, wait for 0x%02x)\n",
msg->len, msg->msg, data->attempts, msg->reply);
dprintk(2, "retransmit: %*ph (attempts: %d, wait for %*ph)\n",
msg->len, msg->msg, data->attempts,
data->match_len, data->match_reply);
else
dprintk(2, "retransmit: %*ph (attempts: %d)\n",
msg->len, msg->msg, data->attempts);
@ -780,6 +781,8 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
{
struct cec_data *data;
bool is_raw = msg_is_raw(msg);
bool reply_vendor_id = (msg->flags & CEC_MSG_FL_REPLY_VENDOR_ID) &&
msg->len > 1 && msg->msg[1] == CEC_MSG_VENDOR_COMMAND_WITH_ID;
int err;
if (adap->devnode.unregistered)
@ -794,12 +797,13 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
msg->tx_low_drive_cnt = 0;
msg->tx_error_cnt = 0;
msg->sequence = 0;
msg->flags &= CEC_MSG_FL_REPLY_TO_FOLLOWERS | CEC_MSG_FL_RAW |
(reply_vendor_id ? CEC_MSG_FL_REPLY_VENDOR_ID : 0);
if (msg->reply && msg->timeout == 0) {
if ((reply_vendor_id || msg->reply) && msg->timeout == 0) {
/* Make sure the timeout isn't 0. */
msg->timeout = 1000;
}
msg->flags &= CEC_MSG_FL_REPLY_TO_FOLLOWERS | CEC_MSG_FL_RAW;
if (!msg->timeout)
msg->flags &= ~CEC_MSG_FL_REPLY_TO_FOLLOWERS;
@ -809,6 +813,11 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
dprintk(1, "%s: invalid length %d\n", __func__, msg->len);
return -EINVAL;
}
if (reply_vendor_id && msg->len < 6) {
dprintk(1, "%s: <Vendor Command With ID> message too short\n",
__func__);
return -EINVAL;
}
memset(msg->msg + msg->len, 0, sizeof(msg->msg) - msg->len);
@ -900,8 +909,9 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
__func__);
return -ENONET;
}
if (msg->reply) {
dprintk(1, "%s: invalid msg->reply\n", __func__);
if (reply_vendor_id || msg->reply) {
dprintk(1, "%s: adapter is unconfigured so reply is not supported\n",
__func__);
return -EINVAL;
}
}
@ -923,6 +933,14 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
data->fh = fh;
data->adap = adap;
data->blocking = block;
if (reply_vendor_id) {
memcpy(data->match_reply, msg->msg + 1, 4);
data->match_reply[4] = msg->reply;
data->match_len = 5;
} else if (msg->timeout) {
data->match_reply[0] = msg->reply;
data->match_len = 1;
}
init_completion(&data->c);
INIT_DELAYED_WORK(&data->work, cec_wait_timeout);
@ -1211,13 +1229,15 @@ void cec_received_msg_ts(struct cec_adapter *adap,
if (!abort && dst->msg[1] == CEC_MSG_INITIATE_ARC &&
(cmd == CEC_MSG_REPORT_ARC_INITIATED ||
cmd == CEC_MSG_REPORT_ARC_TERMINATED) &&
(dst->reply == CEC_MSG_REPORT_ARC_INITIATED ||
dst->reply == CEC_MSG_REPORT_ARC_TERMINATED))
(data->match_reply[0] == CEC_MSG_REPORT_ARC_INITIATED ||
data->match_reply[0] == CEC_MSG_REPORT_ARC_TERMINATED)) {
dst->reply = cmd;
data->match_reply[0] = cmd;
}
/* Does the command match? */
if ((abort && cmd != dst->msg[1]) ||
(!abort && cmd != dst->reply))
(!abort && memcmp(data->match_reply, msg->msg + 1, data->match_len)))
continue;
/* Does the addressing match? */
@ -2318,18 +2338,21 @@ int cec_adap_status(struct seq_file *file, void *priv)
}
data = adap->transmitting;
if (data)
seq_printf(file, "transmitting message: %*ph (reply: %02x, timeout: %ums)\n",
data->msg.len, data->msg.msg, data->msg.reply,
seq_printf(file, "transmitting message: %*ph (reply: %*ph, timeout: %ums)\n",
data->msg.len, data->msg.msg,
data->match_len, data->match_reply,
data->msg.timeout);
seq_printf(file, "pending transmits: %u\n", adap->transmit_queue_sz);
list_for_each_entry(data, &adap->transmit_queue, list) {
seq_printf(file, "queued tx message: %*ph (reply: %02x, timeout: %ums)\n",
data->msg.len, data->msg.msg, data->msg.reply,
seq_printf(file, "queued tx message: %*ph (reply: %*ph, timeout: %ums)\n",
data->msg.len, data->msg.msg,
data->match_len, data->match_reply,
data->msg.timeout);
}
list_for_each_entry(data, &adap->wait_queue, list) {
seq_printf(file, "message waiting for reply: %*ph (reply: %02x, timeout: %ums)\n",
data->msg.len, data->msg.msg, data->msg.reply,
seq_printf(file, "message waiting for reply: %*ph (reply: %*ph, timeout: %ums)\n",
data->msg.len, data->msg.msg,
data->match_len, data->match_reply,
data->msg.timeout);
}

View File

@ -580,7 +580,7 @@ static int cec_open(struct inode *inode, struct file *filp)
fh->mode_initiator = CEC_MODE_INITIATOR;
fh->adap = adap;
err = cec_get_device(devnode);
err = cec_get_device(adap);
if (err) {
kfree(fh);
return err;
@ -686,7 +686,7 @@ static int cec_release(struct inode *inode, struct file *filp)
mutex_unlock(&fh->lock);
kfree(fh);
cec_put_device(devnode);
cec_put_device(adap);
filp->private_data = NULL;
return 0;
}

View File

@ -51,35 +51,6 @@ static struct dentry *top_cec_dir;
/* dev to cec_devnode */
#define to_cec_devnode(cd) container_of(cd, struct cec_devnode, dev)
int cec_get_device(struct cec_devnode *devnode)
{
/*
* Check if the cec device is available. This needs to be done with
* the devnode->lock held to prevent an open/unregister race:
* without the lock, the device could be unregistered and freed between
* the devnode->registered check and get_device() calls, leading to
* a crash.
*/
mutex_lock(&devnode->lock);
/*
* return ENODEV if the cec device has been removed
* already or if it is not registered anymore.
*/
if (!devnode->registered) {
mutex_unlock(&devnode->lock);
return -ENODEV;
}
/* and increase the device refcount */
get_device(&devnode->dev);
mutex_unlock(&devnode->lock);
return 0;
}
void cec_put_device(struct cec_devnode *devnode)
{
put_device(&devnode->dev);
}
/* Called when the last user of the cec device exits. */
static void cec_devnode_release(struct device *cd)
{
@ -273,7 +244,7 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
adap->cec_pin_is_high = true;
adap->log_addrs.cec_version = CEC_OP_CEC_VERSION_2_0;
adap->log_addrs.vendor_id = CEC_VENDOR_ID_NONE;
adap->capabilities = caps;
adap->capabilities = caps | CEC_CAP_REPLY_VENDOR_ID;
if (debug_phys_addr)
adap->capabilities |= CEC_CAP_PHYS_ADDR;
adap->needs_hpd = caps & CEC_CAP_NEEDS_HPD;

View File

@ -37,8 +37,6 @@ static inline bool msg_is_raw(const struct cec_msg *msg)
/* cec-core.c */
extern int cec_debug;
int cec_get_device(struct cec_devnode *devnode);
void cec_put_device(struct cec_devnode *devnode);
/* cec-adap.c */
int cec_monitor_all_cnt_inc(struct cec_adapter *adap);

View File

@ -3,6 +3,7 @@
# USB drivers
if USB_SUPPORT && TTY
source "drivers/media/cec/usb/extron-da-hd-4k-plus/Kconfig"
source "drivers/media/cec/usb/pulse8/Kconfig"
source "drivers/media/cec/usb/rainshadow/Kconfig"
endif

View File

@ -2,5 +2,6 @@
#
# Makefile for the CEC USB device drivers.
#
obj-$(CONFIG_USB_EXTRON_DA_HD_4K_PLUS_CEC) += extron-da-hd-4k-plus/
obj-$(CONFIG_USB_PULSE8_CEC) += pulse8/
obj-$(CONFIG_USB_RAINSHADOW_CEC) += rainshadow/

View File

@ -0,0 +1,14 @@
# SPDX-License-Identifier: GPL-2.0-only
config USB_EXTRON_DA_HD_4K_PLUS_CEC
tristate "Extron DA HD 4K Plus CEC driver"
depends on VIDEO_DEV
depends on USB
depends on USB_ACM
select CEC_CORE
select SERIO
select SERIO_SERPORT
help
This is a CEC driver for the Extron DA HD 4K Plus HDMI Splitter.
To compile this driver as a module, choose M here: the
module will be called extron-da-hd-4k-plus-cec.

View File

@ -0,0 +1,8 @@
extron-da-hd-4k-plus-cec-objs := extron-da-hd-4k-plus.o cec-splitter.o
obj-$(CONFIG_USB_EXTRON_DA_HD_4K_PLUS_CEC) := extron-da-hd-4k-plus-cec.o
all:
$(MAKE) -C $(KDIR) M=$(shell pwd) modules
install:
$(MAKE) -C $(KDIR) M=$(shell pwd) modules_install

View File

@ -0,0 +1,657 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright 2021-2024 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
*/
#include <media/cec.h>
#include "cec-splitter.h"
/*
* Helper function to reply to a received message with a Feature Abort
* message.
*/
static int cec_feature_abort_reason(struct cec_adapter *adap,
struct cec_msg *msg, u8 reason)
{
struct cec_msg tx_msg = { };
/*
* Don't reply with CEC_MSG_FEATURE_ABORT to a CEC_MSG_FEATURE_ABORT
* message!
*/
if (msg->msg[1] == CEC_MSG_FEATURE_ABORT)
return 0;
/* Don't Feature Abort messages from 'Unregistered' */
if (cec_msg_initiator(msg) == CEC_LOG_ADDR_UNREGISTERED)
return 0;
cec_msg_set_reply_to(&tx_msg, msg);
cec_msg_feature_abort(&tx_msg, msg->msg[1], reason);
return cec_transmit_msg(adap, &tx_msg, false);
}
/* Transmit an Active Source message from this output port to a sink */
static void cec_port_out_active_source(struct cec_splitter_port *p)
{
struct cec_adapter *adap = p->adap;
struct cec_msg msg;
if (!adap->is_configured)
return;
p->is_active_source = true;
cec_msg_init(&msg, adap->log_addrs.log_addr[0], 0);
cec_msg_active_source(&msg, adap->phys_addr);
cec_transmit_msg(adap, &msg, false);
}
/* Transmit Active Source messages from all output ports to the sinks */
static void cec_out_active_source(struct cec_splitter *splitter)
{
unsigned int i;
for (i = 0; i < splitter->num_out_ports; i++)
cec_port_out_active_source(splitter->ports[i]);
}
/* Transmit a Standby message from this output port to a sink */
static void cec_port_out_standby(struct cec_splitter_port *p)
{
struct cec_adapter *adap = p->adap;
struct cec_msg msg;
if (!adap->is_configured)
return;
cec_msg_init(&msg, adap->log_addrs.log_addr[0], 0);
cec_msg_standby(&msg);
cec_transmit_msg(adap, &msg, false);
}
/* Transmit Standby messages from all output ports to the sinks */
static void cec_out_standby(struct cec_splitter *splitter)
{
unsigned int i;
for (i = 0; i < splitter->num_out_ports; i++)
cec_port_out_standby(splitter->ports[i]);
}
/* Transmit an Image/Text View On message from this output port to a sink */
static void cec_port_out_wakeup(struct cec_splitter_port *p, u8 opcode)
{
struct cec_adapter *adap = p->adap;
u8 la = adap->log_addrs.log_addr[0];
struct cec_msg msg;
if (la == CEC_LOG_ADDR_INVALID)
la = CEC_LOG_ADDR_UNREGISTERED;
cec_msg_init(&msg, la, 0);
msg.len = 2;
msg.msg[1] = opcode;
cec_transmit_msg(adap, &msg, false);
}
/* Transmit Image/Text View On messages from all output ports to the sinks */
static void cec_out_wakeup(struct cec_splitter *splitter, u8 opcode)
{
unsigned int i;
for (i = 0; i < splitter->num_out_ports; i++)
cec_port_out_wakeup(splitter->ports[i], opcode);
}
/*
* Update the power state of the unconfigured CEC device to either
* Off or On depending on the current state of the splitter.
* This keeps the outputs in a consistent state.
*/
void cec_splitter_unconfigured_output(struct cec_splitter_port *p)
{
p->video_latency = 1;
p->power_status = p->splitter->is_standby ?
CEC_OP_POWER_STATUS_TO_STANDBY : CEC_OP_POWER_STATUS_TO_ON;
/* The adapter was unconfigured, so clear the sequence and ts values */
p->out_give_device_power_status_seq = 0;
p->out_give_device_power_status_ts = ktime_set(0, 0);
p->out_request_current_latency_seq = 0;
p->out_request_current_latency_ts = ktime_set(0, 0);
}
/*
* Update the power state of the newly configured CEC device to either
* Off or On depending on the current state of the splitter.
* This keeps the outputs in a consistent state.
*/
void cec_splitter_configured_output(struct cec_splitter_port *p)
{
p->video_latency = 1;
p->power_status = p->splitter->is_standby ?
CEC_OP_POWER_STATUS_TO_STANDBY : CEC_OP_POWER_STATUS_TO_ON;
if (p->splitter->is_standby) {
/*
* Some sinks only obey Standby if it comes from the
* active source.
*/
cec_port_out_active_source(p);
cec_port_out_standby(p);
} else {
cec_port_out_wakeup(p, CEC_MSG_IMAGE_VIEW_ON);
}
}
/* Pass the in_msg on to all output ports */
static void cec_out_passthrough(struct cec_splitter *splitter,
const struct cec_msg *in_msg)
{
unsigned int i;
for (i = 0; i < splitter->num_out_ports; i++) {
struct cec_splitter_port *p = splitter->ports[i];
struct cec_adapter *adap = p->adap;
struct cec_msg msg;
if (!adap->is_configured)
continue;
cec_msg_init(&msg, adap->log_addrs.log_addr[0], 0);
msg.len = in_msg->len;
memcpy(msg.msg + 1, in_msg->msg + 1, msg.len - 1);
cec_transmit_msg(adap, &msg, false);
}
}
/*
* See if all output ports received the Report Current Latency message,
* and if so, transmit the result from the input port to the video source.
*/
static void cec_out_report_current_latency(struct cec_splitter *splitter,
struct cec_adapter *input_adap)
{
struct cec_msg reply = {};
unsigned int reply_lat = 0;
unsigned int cnt = 0;
unsigned int i;
for (i = 0; i < splitter->num_out_ports; i++) {
struct cec_splitter_port *p = splitter->ports[i];
struct cec_adapter *adap = p->adap;
/* Skip unconfigured ports */
if (!adap->is_configured)
continue;
/* Return if a port is still waiting for a reply */
if (p->out_request_current_latency_seq)
return;
reply_lat += p->video_latency - 1;
cnt++;
}
/*
* All ports that can reply, replied, so clear the sequence
* and timestamp values.
*/
for (i = 0; i < splitter->num_out_ports; i++) {
struct cec_splitter_port *p = splitter->ports[i];
p->out_request_current_latency_seq = 0;
p->out_request_current_latency_ts = ktime_set(0, 0);
}
/*
* Return if there were no replies or the input port is no longer
* configured.
*/
if (!cnt || !input_adap->is_configured)
return;
/* Reply with the average latency */
reply_lat = 1 + reply_lat / cnt;
cec_msg_init(&reply, input_adap->log_addrs.log_addr[0],
splitter->request_current_latency_dest);
cec_msg_report_current_latency(&reply, input_adap->phys_addr,
reply_lat, 1, 1, 1);
cec_transmit_msg(input_adap, &reply, false);
}
/* Transmit Request Current Latency to all output ports */
static int cec_out_request_current_latency(struct cec_splitter *splitter)
{
ktime_t now = ktime_get();
bool error = true;
unsigned int i;
for (i = 0; i < splitter->num_out_ports; i++) {
struct cec_splitter_port *p = splitter->ports[i];
struct cec_adapter *adap = p->adap;
if (!adap->is_configured) {
/* Clear if not configured */
p->out_request_current_latency_seq = 0;
p->out_request_current_latency_ts = ktime_set(0, 0);
} else if (!p->out_request_current_latency_seq) {
/*
* Keep the old ts if an earlier request is still
* pending. This ensures that the request will
* eventually time out based on the timestamp of
* the first request if the sink is unresponsive.
*/
p->out_request_current_latency_ts = now;
}
}
for (i = 0; i < splitter->num_out_ports; i++) {
struct cec_splitter_port *p = splitter->ports[i];
struct cec_adapter *adap = p->adap;
struct cec_msg msg;
if (!adap->is_configured)
continue;
cec_msg_init(&msg, adap->log_addrs.log_addr[0], 0);
cec_msg_request_current_latency(&msg, true, adap->phys_addr);
if (cec_transmit_msg(adap, &msg, false))
continue;
p->out_request_current_latency_seq = msg.sequence | (1U << 31);
error = false;
}
return error ? -ENODEV : 0;
}
/*
* See if all output ports received the Report Power Status message,
* and if so, transmit the result from the input port to the video source.
*/
static void cec_out_report_power_status(struct cec_splitter *splitter,
struct cec_adapter *input_adap)
{
struct cec_msg reply = {};
/* The target power status of the splitter itself */
u8 splitter_pwr = splitter->is_standby ?
CEC_OP_POWER_STATUS_STANDBY : CEC_OP_POWER_STATUS_ON;
/*
* The transient power status of the splitter, used if not all
* output report the target power status.
*/
u8 splitter_transient_pwr = splitter->is_standby ?
CEC_OP_POWER_STATUS_TO_STANDBY : CEC_OP_POWER_STATUS_TO_ON;
u8 reply_pwr = splitter_pwr;
unsigned int i;
for (i = 0; i < splitter->num_out_ports; i++) {
struct cec_splitter_port *p = splitter->ports[i];
/* Skip if no sink was found (HPD was low for more than 5s) */
if (!p->found_sink)
continue;
/* Return if a port is still waiting for a reply */
if (p->out_give_device_power_status_seq)
return;
if (p->power_status != splitter_pwr)
reply_pwr = splitter_transient_pwr;
}
/*
* All ports that can reply, replied, so clear the sequence
* and timestamp values.
*/
for (i = 0; i < splitter->num_out_ports; i++) {
struct cec_splitter_port *p = splitter->ports[i];
p->out_give_device_power_status_seq = 0;
p->out_give_device_power_status_ts = ktime_set(0, 0);
}
/* Return if the input port is no longer configured. */
if (!input_adap->is_configured)
return;
/* Reply with the new power status */
cec_msg_init(&reply, input_adap->log_addrs.log_addr[0],
splitter->give_device_power_status_dest);
cec_msg_report_power_status(&reply, reply_pwr);
cec_transmit_msg(input_adap, &reply, false);
}
/* Transmit Give Device Power Status to all output ports */
static int cec_out_give_device_power_status(struct cec_splitter *splitter)
{
ktime_t now = ktime_get();
bool error = true;
unsigned int i;
for (i = 0; i < splitter->num_out_ports; i++) {
struct cec_splitter_port *p = splitter->ports[i];
struct cec_adapter *adap = p->adap;
/*
* Keep the old ts if an earlier request is still
* pending. This ensures that the request will
* eventually time out based on the timestamp of
* the first request if the sink is unresponsive.
*/
if (adap->is_configured && !p->out_give_device_power_status_seq)
p->out_give_device_power_status_ts = now;
}
for (i = 0; i < splitter->num_out_ports; i++) {
struct cec_splitter_port *p = splitter->ports[i];
struct cec_adapter *adap = p->adap;
struct cec_msg msg;
if (!adap->is_configured)
continue;
cec_msg_init(&msg, adap->log_addrs.log_addr[0], 0);
cec_msg_give_device_power_status(&msg, true);
if (cec_transmit_msg(adap, &msg, false))
continue;
p->out_give_device_power_status_seq = msg.sequence | (1U << 31);
error = false;
}
return error ? -ENODEV : 0;
}
/*
* CEC messages received on the HDMI input of the splitter are
* forwarded (if relevant) to the HDMI outputs of the splitter.
*/
int cec_splitter_received_input(struct cec_splitter_port *p, struct cec_msg *msg)
{
if (!cec_msg_status_is_ok(msg))
return 0;
if (msg->len < 2)
return -ENOMSG;
switch (msg->msg[1]) {
case CEC_MSG_DEVICE_VENDOR_ID:
case CEC_MSG_REPORT_POWER_STATUS:
case CEC_MSG_SET_STREAM_PATH:
case CEC_MSG_ROUTING_CHANGE:
case CEC_MSG_REQUEST_ACTIVE_SOURCE:
case CEC_MSG_SYSTEM_AUDIO_MODE_STATUS:
return 0;
case CEC_MSG_STANDBY:
p->splitter->is_standby = true;
cec_out_standby(p->splitter);
return 0;
case CEC_MSG_IMAGE_VIEW_ON:
case CEC_MSG_TEXT_VIEW_ON:
p->splitter->is_standby = false;
cec_out_wakeup(p->splitter, msg->msg[1]);
return 0;
case CEC_MSG_ACTIVE_SOURCE:
cec_out_active_source(p->splitter);
return 0;
case CEC_MSG_SET_SYSTEM_AUDIO_MODE:
cec_out_passthrough(p->splitter, msg);
return 0;
case CEC_MSG_GIVE_DEVICE_POWER_STATUS:
p->splitter->give_device_power_status_dest =
cec_msg_initiator(msg);
if (cec_out_give_device_power_status(p->splitter))
cec_feature_abort_reason(p->adap, msg,
CEC_OP_ABORT_INCORRECT_MODE);
return 0;
case CEC_MSG_REQUEST_CURRENT_LATENCY: {
u16 pa;
p->splitter->request_current_latency_dest =
cec_msg_initiator(msg);
cec_ops_request_current_latency(msg, &pa);
if (pa == p->adap->phys_addr &&
cec_out_request_current_latency(p->splitter))
cec_feature_abort_reason(p->adap, msg,
CEC_OP_ABORT_INCORRECT_MODE);
return 0;
}
default:
return -ENOMSG;
}
return -ENOMSG;
}
void cec_splitter_nb_transmit_canceled_output(struct cec_splitter_port *p,
const struct cec_msg *msg,
struct cec_adapter *input_adap)
{
struct cec_splitter *splitter = p->splitter;
u32 seq = msg->sequence | (1U << 31);
/*
* If this is the result of a failed non-blocking transmit, or it is
* the result of the failed reply to a non-blocking transmit, then
* check if the original transmit was to get the current power status
* or latency and, if so, assume that the remove device is for one
* reason or another unavailable and assume that it is in the same
* power status as the splitter, or has no video latency.
*/
if ((cec_msg_recv_is_tx_result(msg) && !(msg->tx_status & CEC_TX_STATUS_OK)) ||
(cec_msg_recv_is_rx_result(msg) && !(msg->rx_status & CEC_RX_STATUS_OK))) {
u8 tx_op = msg->msg[1];
if (msg->len < 2)
return;
if (cec_msg_recv_is_rx_result(msg) &&
(msg->rx_status & CEC_RX_STATUS_FEATURE_ABORT))
tx_op = msg->msg[2];
switch (tx_op) {
case CEC_MSG_GIVE_DEVICE_POWER_STATUS:
if (p->out_give_device_power_status_seq != seq)
break;
p->out_give_device_power_status_seq = 0;
p->out_give_device_power_status_ts = ktime_set(0, 0);
p->power_status = splitter->is_standby ?
CEC_OP_POWER_STATUS_STANDBY :
CEC_OP_POWER_STATUS_ON;
cec_out_report_power_status(splitter, input_adap);
break;
case CEC_MSG_REQUEST_CURRENT_LATENCY:
if (p->out_request_current_latency_seq != seq)
break;
p->video_latency = 1;
p->out_request_current_latency_seq = 0;
p->out_request_current_latency_ts = ktime_set(0, 0);
cec_out_report_current_latency(splitter, input_adap);
break;
}
return;
}
if (cec_msg_recv_is_tx_result(msg)) {
if (p->out_request_current_latency_seq != seq)
return;
p->out_request_current_latency_ts = ns_to_ktime(msg->tx_ts);
return;
}
}
/*
* CEC messages received on an HDMI output of the splitter
* are processed here.
*/
int cec_splitter_received_output(struct cec_splitter_port *p, struct cec_msg *msg,
struct cec_adapter *input_adap)
{
struct cec_adapter *adap = p->adap;
struct cec_splitter *splitter = p->splitter;
u32 seq = msg->sequence | (1U << 31);
struct cec_msg reply = {};
u16 pa;
if (!adap->is_configured || msg->len < 2)
return -ENOMSG;
switch (msg->msg[1]) {
case CEC_MSG_REPORT_POWER_STATUS: {
u8 pwr;
cec_ops_report_power_status(msg, &pwr);
if (pwr > CEC_OP_POWER_STATUS_TO_STANDBY)
pwr = splitter->is_standby ?
CEC_OP_POWER_STATUS_TO_STANDBY :
CEC_OP_POWER_STATUS_TO_ON;
p->power_status = pwr;
if (p->out_give_device_power_status_seq == seq) {
p->out_give_device_power_status_seq = 0;
p->out_give_device_power_status_ts = ktime_set(0, 0);
}
cec_out_report_power_status(splitter, input_adap);
return 0;
}
case CEC_MSG_REPORT_CURRENT_LATENCY: {
u8 video_lat;
u8 low_lat_mode;
u8 audio_out_comp;
u8 audio_out_delay;
cec_ops_report_current_latency(msg, &pa,
&video_lat, &low_lat_mode,
&audio_out_comp, &audio_out_delay);
if (!video_lat || video_lat >= 252)
video_lat = 1;
p->video_latency = video_lat;
if (p->out_request_current_latency_seq == seq) {
p->out_request_current_latency_seq = 0;
p->out_request_current_latency_ts = ktime_set(0, 0);
}
cec_out_report_current_latency(splitter, input_adap);
return 0;
}
case CEC_MSG_STANDBY:
case CEC_MSG_ROUTING_CHANGE:
case CEC_MSG_GIVE_SYSTEM_AUDIO_MODE_STATUS:
return 0;
case CEC_MSG_ACTIVE_SOURCE:
cec_ops_active_source(msg, &pa);
if (pa == 0)
p->is_active_source = false;
return 0;
case CEC_MSG_REQUEST_ACTIVE_SOURCE:
if (!p->is_active_source)
return 0;
cec_msg_set_reply_to(&reply, msg);
cec_msg_active_source(&reply, adap->phys_addr);
cec_transmit_msg(adap, &reply, false);
return 0;
case CEC_MSG_GIVE_DEVICE_POWER_STATUS:
cec_msg_set_reply_to(&reply, msg);
cec_msg_report_power_status(&reply, splitter->is_standby ?
CEC_OP_POWER_STATUS_STANDBY :
CEC_OP_POWER_STATUS_ON);
cec_transmit_msg(adap, &reply, false);
return 0;
case CEC_MSG_SET_STREAM_PATH:
cec_ops_set_stream_path(msg, &pa);
if (pa == adap->phys_addr) {
cec_msg_set_reply_to(&reply, msg);
cec_msg_active_source(&reply, pa);
cec_transmit_msg(adap, &reply, false);
}
return 0;
default:
return -ENOMSG;
}
return -ENOMSG;
}
/*
* Called every second to check for timed out messages and whether there
* still is a video sink connected or not.
*
* Returns true if sinks were lost.
*/
bool cec_splitter_poll(struct cec_splitter *splitter,
struct cec_adapter *input_adap, bool debug)
{
ktime_t now = ktime_get();
u8 pwr = splitter->is_standby ?
CEC_OP_POWER_STATUS_STANDBY : CEC_OP_POWER_STATUS_ON;
unsigned int max_delay_ms = input_adap->xfer_timeout_ms + 2000;
unsigned int i;
bool res = false;
for (i = 0; i < splitter->num_out_ports; i++) {
struct cec_splitter_port *p = splitter->ports[i];
s64 pwr_delta, lat_delta;
bool pwr_timeout, lat_timeout;
if (!p)
continue;
pwr_delta = ktime_ms_delta(now, p->out_give_device_power_status_ts);
pwr_timeout = p->out_give_device_power_status_seq &&
pwr_delta >= max_delay_ms;
lat_delta = ktime_ms_delta(now, p->out_request_current_latency_ts);
lat_timeout = p->out_request_current_latency_seq &&
lat_delta >= max_delay_ms;
/*
* If the HPD is low for more than 5 seconds, then assume no display
* is connected.
*/
if (p->found_sink && ktime_to_ns(p->lost_sink_ts) &&
ktime_ms_delta(now, p->lost_sink_ts) > 5000) {
if (debug)
dev_info(splitter->dev,
"port %u: HPD low for more than 5s, assume no sink is connected.\n",
p->port);
p->found_sink = false;
p->lost_sink_ts = ktime_set(0, 0);
res = true;
}
/*
* If the power status request timed out, then set the port's
* power status to that of the splitter, ensuring a consistent
* power state.
*/
if (pwr_timeout) {
mutex_lock(&p->adap->lock);
if (debug)
dev_info(splitter->dev,
"port %u: give up on power status for seq %u\n",
p->port,
p->out_give_device_power_status_seq & ~(1 << 31));
p->power_status = pwr;
p->out_give_device_power_status_seq = 0;
p->out_give_device_power_status_ts = ktime_set(0, 0);
mutex_unlock(&p->adap->lock);
cec_out_report_power_status(splitter, input_adap);
}
/*
* If the current latency request timed out, then set the port's
* latency to 1.
*/
if (lat_timeout) {
mutex_lock(&p->adap->lock);
if (debug)
dev_info(splitter->dev,
"port %u: give up on latency for seq %u\n",
p->port,
p->out_request_current_latency_seq & ~(1 << 31));
p->video_latency = 1;
p->out_request_current_latency_seq = 0;
p->out_request_current_latency_ts = ktime_set(0, 0);
mutex_unlock(&p->adap->lock);
cec_out_report_current_latency(splitter, input_adap);
}
}
return res;
}

View File

@ -0,0 +1,51 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright 2021-2024 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
*/
#ifndef _CEC_SPLITTER_H_
#define _CEC_SPLITTER_H_
struct cec_splitter;
#define STATE_CHANGE_MAX_REPEATS 2
struct cec_splitter_port {
struct cec_splitter *splitter;
struct cec_adapter *adap;
unsigned int port;
bool is_active_source;
bool found_sink;
ktime_t lost_sink_ts;
u32 out_request_current_latency_seq;
ktime_t out_request_current_latency_ts;
u8 video_latency;
u32 out_give_device_power_status_seq;
ktime_t out_give_device_power_status_ts;
u8 power_status;
};
struct cec_splitter {
struct device *dev;
unsigned int num_out_ports;
struct cec_splitter_port **ports;
/* High-level splitter state */
u8 request_current_latency_dest;
u8 give_device_power_status_dest;
bool is_standby;
};
void cec_splitter_unconfigured_output(struct cec_splitter_port *port);
void cec_splitter_configured_output(struct cec_splitter_port *port);
int cec_splitter_received_input(struct cec_splitter_port *port, struct cec_msg *msg);
int cec_splitter_received_output(struct cec_splitter_port *port, struct cec_msg *msg,
struct cec_adapter *input_adap);
void cec_splitter_nb_transmit_canceled_output(struct cec_splitter_port *port,
const struct cec_msg *msg,
struct cec_adapter *input_adap);
bool cec_splitter_poll(struct cec_splitter *splitter,
struct cec_adapter *input_adap, bool debug);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,118 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright 2021-2024 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
*/
#ifndef _EXTRON_DA_HD_4K_PLUS_H_
#define _EXTRON_DA_HD_4K_PLUS_H_
#include <linux/kthread.h>
#include <linux/serio.h>
#include <linux/workqueue.h>
#include <media/cec.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-device.h>
#include <media/v4l2-dv-timings.h>
#include <media/v4l2-event.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-ioctl.h>
#include "cec-splitter.h"
#define DATA_SIZE 256
#define PING_PERIOD (15 * HZ)
#define NUM_MSGS CEC_MAX_MSG_RX_QUEUE_SZ
#define MAX_PORTS (1 + 6)
#define MAX_EDID_BLOCKS 2
struct extron;
struct extron_port {
struct cec_splitter_port port;
struct device *dev;
struct cec_adapter *adap;
struct video_device vdev;
struct v4l2_ctrl_handler hdl;
struct v4l2_ctrl *ctrl_rx_power_present;
struct v4l2_ctrl *ctrl_tx_hotplug;
struct v4l2_ctrl *ctrl_tx_edid_present;
bool is_input;
char direction;
char name[26];
unsigned char edid[MAX_EDID_BLOCKS * 128];
unsigned char edid_tmp[MAX_EDID_BLOCKS * 128];
unsigned int edid_blocks;
bool read_edid;
struct extron *extron;
struct work_struct irq_work;
struct completion cmd_done;
const char *response;
unsigned int cmd_error;
struct cec_msg rx_msg[NUM_MSGS];
unsigned int rx_msg_cur_idx, rx_msg_num;
/* protect rx_msg_cur_idx and rx_msg_num */
spinlock_t msg_lock;
u32 tx_done_status;
bool update_phys_addr;
u16 phys_addr;
bool cec_was_registered;
bool disconnected;
bool update_has_signal;
bool has_signal;
bool update_has_edid;
bool has_edid;
bool has_4kp30;
bool has_4kp60;
bool has_qy;
bool has_qs;
u8 est_i, est_ii;
/* locks access to the video_device */
struct mutex video_lock;
};
struct extron {
struct cec_splitter splitter;
struct device *dev;
struct serio *serio;
/* locks access to serio */
struct mutex serio_lock;
unsigned int num_ports;
unsigned int num_in_ports;
unsigned int num_out_ports;
char unit_name[32];
char unit_type[64];
char unit_fw_version[32];
char unit_cec_engine_version[32];
struct extron_port *ports[MAX_PORTS];
struct cec_splitter_port *splitter_ports[MAX_PORTS];
struct v4l2_device v4l2_dev;
bool hpd_never_low;
struct task_struct *kthread_setup;
struct delayed_work work_update_edid;
/* serializes EDID reading */
struct mutex edid_lock;
unsigned int edid_bytes_read;
struct extron_port *edid_port;
struct completion edid_completion;
bool edid_reading;
bool is_ready;
struct completion cmd_done;
const char *response;
unsigned int cmd_error;
char data[DATA_SIZE];
unsigned int len;
char reply[DATA_SIZE];
char buf[DATA_SIZE];
unsigned int idx;
};
#endif

View File

@ -1132,8 +1132,7 @@ static char *smscore_get_fw_filename(struct smscore_device_t *coredev,
* return: 0 on success, <0 on error.
*/
static int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
int mode,
loadfirmware_t loadfirmware_handler)
int mode)
{
int rc = -ENOENT;
u8 *fw_buf;
@ -1147,8 +1146,7 @@ static int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
}
pr_debug("Firmware name: %s\n", fw_filename);
if (!loadfirmware_handler &&
!(coredev->device_flags & SMS_DEVICE_FAMILY2))
if (!(coredev->device_flags & SMS_DEVICE_FAMILY2))
return -EINVAL;
rc = request_firmware(&fw, fw_filename, coredev->device);
@ -1166,10 +1164,8 @@ static int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
memcpy(fw_buf, fw->data, fw->size);
fw_buf_size = fw->size;
rc = (coredev->device_flags & SMS_DEVICE_FAMILY2) ?
smscore_load_firmware_family2(coredev, fw_buf, fw_buf_size)
: loadfirmware_handler(coredev->context, fw_buf,
fw_buf_size);
rc = smscore_load_firmware_family2(coredev, fw_buf,
fw_buf_size);
}
kfree(fw_buf);
@ -1353,8 +1349,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)
}
if (!(coredev->modes_supported & (1 << mode))) {
rc = smscore_load_firmware_from_file(coredev,
mode, NULL);
rc = smscore_load_firmware_from_file(coredev, mode);
if (rc >= 0)
pr_debug("firmware download success\n");
} else {

View File

@ -97,7 +97,6 @@ typedef int (*hotplug_t)(struct smscore_device_t *coredev,
typedef int (*setmode_t)(void *context, int mode);
typedef void (*detectmode_t)(void *context, int *mode);
typedef int (*sendrequest_t)(void *context, void *buffer, size_t size);
typedef int (*loadfirmware_t)(void *context, void *buffer, size_t size);
typedef int (*preload_t)(void *context);
typedef int (*postload_t)(void *context);
@ -1102,9 +1101,6 @@ extern int smscore_register_device(struct smsdevice_params_t *params,
extern void smscore_unregister_device(struct smscore_device_t *coredev);
extern int smscore_start_device(struct smscore_device_t *coredev);
extern int smscore_load_firmware(struct smscore_device_t *coredev,
char *filename,
loadfirmware_t loadfirmware_handler);
extern int smscore_set_device_mode(struct smscore_device_t *coredev, int mode);
extern int smscore_get_device_mode(struct smscore_device_t *coredev);
@ -1119,12 +1115,6 @@ extern int smsclient_sendrequest(struct smscore_client_t *client,
extern void smscore_onresponse(struct smscore_device_t *coredev,
struct smscore_buffer_t *cb);
extern int smscore_get_common_buffer_size(struct smscore_device_t *coredev);
extern int smscore_map_common_buffer(struct smscore_device_t *coredev,
struct vm_area_struct *vma);
extern int smscore_send_fw_file(struct smscore_device_t *coredev,
u8 *ufwbuf, int size);
extern
struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev);
extern void smscore_putbuffer(struct smscore_device_t *coredev,

View File

@ -303,14 +303,22 @@ static void __vb2_plane_dmabuf_put(struct vb2_buffer *vb, struct vb2_plane *p)
if (!p->mem_priv)
return;
if (p->dbuf_mapped)
call_void_memop(vb, unmap_dmabuf, p->mem_priv);
if (!p->dbuf_duplicated) {
if (p->dbuf_mapped)
call_void_memop(vb, unmap_dmabuf, p->mem_priv);
call_void_memop(vb, detach_dmabuf, p->mem_priv);
}
call_void_memop(vb, detach_dmabuf, p->mem_priv);
dma_buf_put(p->dbuf);
p->mem_priv = NULL;
p->dbuf = NULL;
p->dbuf_mapped = 0;
p->bytesused = 0;
p->length = 0;
p->m.fd = 0;
p->data_offset = 0;
p->dbuf_duplicated = false;
}
/*
@ -319,9 +327,15 @@ static void __vb2_plane_dmabuf_put(struct vb2_buffer *vb, struct vb2_plane *p)
*/
static void __vb2_buf_dmabuf_put(struct vb2_buffer *vb)
{
unsigned int plane;
int plane;
for (plane = 0; plane < vb->num_planes; ++plane)
/*
* When multiple planes share the same DMA buffer attachment, the plane
* with the lowest index owns the mem_priv.
* Put planes in the reversed order so that we don't leave invalid
* mem_priv behind.
*/
for (plane = vb->num_planes - 1; plane >= 0; --plane)
__vb2_plane_dmabuf_put(vb, &vb->planes[plane]);
}
@ -1369,7 +1383,7 @@ static int __prepare_dmabuf(struct vb2_buffer *vb)
struct vb2_plane planes[VB2_MAX_PLANES];
struct vb2_queue *q = vb->vb2_queue;
void *mem_priv;
unsigned int plane;
unsigned int plane, i;
int ret = 0;
bool reacquired = vb->planes[0].mem_priv == NULL;
@ -1383,11 +1397,13 @@ static int __prepare_dmabuf(struct vb2_buffer *vb)
for (plane = 0; plane < vb->num_planes; ++plane) {
struct dma_buf *dbuf = dma_buf_get(planes[plane].m.fd);
planes[plane].dbuf = dbuf;
if (IS_ERR_OR_NULL(dbuf)) {
dprintk(q, 1, "invalid dmabuf fd for plane %d\n",
plane);
ret = -EINVAL;
goto err;
goto err_put_planes;
}
/* use DMABUF size if length is not provided */
@ -1398,80 +1414,86 @@ static int __prepare_dmabuf(struct vb2_buffer *vb)
dprintk(q, 1, "invalid dmabuf length %u for plane %d, minimum length %u\n",
planes[plane].length, plane,
vb->planes[plane].min_length);
dma_buf_put(dbuf);
ret = -EINVAL;
goto err;
goto err_put_planes;
}
/* Skip the plane if already verified */
if (dbuf == vb->planes[plane].dbuf &&
vb->planes[plane].length == planes[plane].length) {
dma_buf_put(dbuf);
vb->planes[plane].length == planes[plane].length)
continue;
}
dprintk(q, 3, "buffer for plane %d changed\n", plane);
if (!reacquired) {
reacquired = true;
vb->copied_timestamp = 0;
call_void_vb_qop(vb, buf_cleanup, vb);
}
/* Release previously acquired memory if present */
__vb2_plane_dmabuf_put(vb, &vb->planes[plane]);
vb->planes[plane].bytesused = 0;
vb->planes[plane].length = 0;
vb->planes[plane].m.fd = 0;
vb->planes[plane].data_offset = 0;
/* Acquire each plane's memory */
mem_priv = call_ptr_memop(attach_dmabuf,
vb,
q->alloc_devs[plane] ? : q->dev,
dbuf,
planes[plane].length);
if (IS_ERR(mem_priv)) {
dprintk(q, 1, "failed to attach dmabuf\n");
ret = PTR_ERR(mem_priv);
dma_buf_put(dbuf);
goto err;
}
vb->planes[plane].dbuf = dbuf;
vb->planes[plane].mem_priv = mem_priv;
}
/*
* This pins the buffer(s) with dma_buf_map_attachment()). It's done
* here instead just before the DMA, while queueing the buffer(s) so
* userspace knows sooner rather than later if the dma-buf map fails.
*/
for (plane = 0; plane < vb->num_planes; ++plane) {
if (vb->planes[plane].dbuf_mapped)
continue;
ret = call_memop(vb, map_dmabuf, vb->planes[plane].mem_priv);
if (ret) {
dprintk(q, 1, "failed to map dmabuf for plane %d\n",
plane);
goto err;
}
vb->planes[plane].dbuf_mapped = 1;
}
/*
* Now that everything is in order, copy relevant information
* provided by userspace.
*/
for (plane = 0; plane < vb->num_planes; ++plane) {
vb->planes[plane].bytesused = planes[plane].bytesused;
vb->planes[plane].length = planes[plane].length;
vb->planes[plane].m.fd = planes[plane].m.fd;
vb->planes[plane].data_offset = planes[plane].data_offset;
reacquired = true;
}
if (reacquired) {
if (vb->planes[0].mem_priv) {
vb->copied_timestamp = 0;
call_void_vb_qop(vb, buf_cleanup, vb);
__vb2_buf_dmabuf_put(vb);
}
for (plane = 0; plane < vb->num_planes; ++plane) {
/*
* This is an optimization to reduce dma_buf attachment/mapping.
* When the same dma_buf is used for multiple planes, there is no need
* to create duplicated attachments.
*/
for (i = 0; i < plane; ++i) {
if (planes[plane].dbuf == vb->planes[i].dbuf &&
q->alloc_devs[plane] == q->alloc_devs[i]) {
vb->planes[plane].dbuf_duplicated = true;
vb->planes[plane].dbuf = vb->planes[i].dbuf;
vb->planes[plane].mem_priv = vb->planes[i].mem_priv;
break;
}
}
if (vb->planes[plane].dbuf_duplicated)
continue;
/* Acquire each plane's memory */
mem_priv = call_ptr_memop(attach_dmabuf,
vb,
q->alloc_devs[plane] ? : q->dev,
planes[plane].dbuf,
planes[plane].length);
if (IS_ERR(mem_priv)) {
dprintk(q, 1, "failed to attach dmabuf\n");
ret = PTR_ERR(mem_priv);
goto err_put_vb2_buf;
}
vb->planes[plane].dbuf = planes[plane].dbuf;
vb->planes[plane].mem_priv = mem_priv;
/*
* This pins the buffer(s) with dma_buf_map_attachment()). It's done
* here instead just before the DMA, while queueing the buffer(s) so
* userspace knows sooner rather than later if the dma-buf map fails.
*/
ret = call_memop(vb, map_dmabuf, vb->planes[plane].mem_priv);
if (ret) {
dprintk(q, 1, "failed to map dmabuf for plane %d\n",
plane);
goto err_put_vb2_buf;
}
vb->planes[plane].dbuf_mapped = 1;
}
/*
* Now that everything is in order, copy relevant information
* provided by userspace.
*/
for (plane = 0; plane < vb->num_planes; ++plane) {
vb->planes[plane].bytesused = planes[plane].bytesused;
vb->planes[plane].length = planes[plane].length;
vb->planes[plane].m.fd = planes[plane].m.fd;
vb->planes[plane].data_offset = planes[plane].data_offset;
}
/*
* Call driver-specific initialization on the newly acquired buffer,
* if provided.
@ -1479,19 +1501,28 @@ static int __prepare_dmabuf(struct vb2_buffer *vb)
ret = call_vb_qop(vb, buf_init, vb);
if (ret) {
dprintk(q, 1, "buffer initialization failed\n");
goto err;
goto err_put_vb2_buf;
}
} else {
for (plane = 0; plane < vb->num_planes; ++plane)
dma_buf_put(planes[plane].dbuf);
}
ret = call_vb_qop(vb, buf_prepare, vb);
if (ret) {
dprintk(q, 1, "buffer preparation failed\n");
call_void_vb_qop(vb, buf_cleanup, vb);
goto err;
goto err_put_vb2_buf;
}
return 0;
err:
err_put_planes:
for (plane = 0; plane < vb->num_planes; ++plane) {
if (!IS_ERR_OR_NULL(planes[plane].dbuf))
dma_buf_put(planes[plane].dbuf);
}
err_put_vb2_buf:
/* In case of errors, release planes that were already acquired */
__vb2_buf_dmabuf_put(vb);
@ -2601,13 +2632,6 @@ int vb2_core_queue_init(struct vb2_queue *q)
if (WARN_ON(q->supports_requests && q->min_queued_buffers))
return -EINVAL;
/*
* The minimum requirement is 2: one buffer is used
* by the hardware while the other is being processed by userspace.
*/
if (q->min_reqbufs_allocation < 2)
q->min_reqbufs_allocation = 2;
/*
* If the driver needs 'min_queued_buffers' in the queue before
* calling start_streaming() then the minimum requirement is

View File

@ -256,7 +256,7 @@ static void a8293_remove(struct i2c_client *client)
}
static const struct i2c_device_id a8293_id_table[] = {
{"a8293", 0},
{ "a8293" },
{}
};
MODULE_DEVICE_TABLE(i2c, a8293_id_table);

View File

@ -1553,7 +1553,7 @@ static void af9013_remove(struct i2c_client *client)
}
static const struct i2c_device_id af9013_id_table[] = {
{"af9013", 0},
{ "af9013" },
{}
};
MODULE_DEVICE_TABLE(i2c, af9013_id_table);

View File

@ -1173,7 +1173,7 @@ static void af9033_remove(struct i2c_client *client)
}
static const struct i2c_device_id af9033_id_table[] = {
{"af9033", 0},
{ "af9033" },
{}
};
MODULE_DEVICE_TABLE(i2c, af9033_id_table);

View File

@ -767,7 +767,7 @@ static void au8522_remove(struct i2c_client *client)
}
static const struct i2c_device_id au8522_id[] = {
{"au8522", 0},
{ "au8522" },
{}
};

View File

@ -672,7 +672,7 @@ static void cxd2099_remove(struct i2c_client *client)
}
static const struct i2c_device_id cxd2099_id[] = {
{"cxd2099", 0},
{ "cxd2099" },
{}
};
MODULE_DEVICE_TABLE(i2c, cxd2099_id);

View File

@ -723,7 +723,7 @@ static void cxd2820r_remove(struct i2c_client *client)
}
static const struct i2c_device_id cxd2820r_id_table[] = {
{"cxd2820r", 0},
{ "cxd2820r" },
{}
};
MODULE_DEVICE_TABLE(i2c, cxd2820r_id_table);

View File

@ -2244,7 +2244,7 @@ static void lgdt3306a_remove(struct i2c_client *client)
}
static const struct i2c_device_id lgdt3306a_id_table[] = {
{"lgdt3306a", 0},
{ "lgdt3306a" },
{}
};
MODULE_DEVICE_TABLE(i2c, lgdt3306a_id_table);

View File

@ -983,7 +983,7 @@ static void lgdt330x_remove(struct i2c_client *client)
}
static const struct i2c_device_id lgdt330x_id_table[] = {
{"lgdt330x", 0},
{ "lgdt330x" },
{}
};
MODULE_DEVICE_TABLE(i2c, lgdt330x_id_table);

View File

@ -708,7 +708,7 @@ static void mn88472_remove(struct i2c_client *client)
}
static const struct i2c_device_id mn88472_id_table[] = {
{"mn88472", 0},
{ "mn88472" },
{}
};
MODULE_DEVICE_TABLE(i2c, mn88472_id_table);

View File

@ -743,7 +743,7 @@ static void mn88473_remove(struct i2c_client *client)
}
static const struct i2c_device_id mn88473_id_table[] = {
{"mn88473", 0},
{ "mn88473" },
{}
};
MODULE_DEVICE_TABLE(i2c, mn88473_id_table);

View File

@ -1346,7 +1346,7 @@ static void mxl692_remove(struct i2c_client *client)
}
static const struct i2c_device_id mxl692_id_table[] = {
{"mxl692", 0},
{ "mxl692" },
{}
};
MODULE_DEVICE_TABLE(i2c, mxl692_id_table);

View File

@ -609,7 +609,7 @@ static int rtl2830_pid_filter(struct dvb_frontend *fe, u8 index, u16 pid, int on
index, pid, onoff);
/* skip invalid PIDs (0x2000) */
if (pid > 0x1fff || index > 32)
if (pid > 0x1fff || index >= 32)
return 0;
if (onoff)
@ -876,7 +876,7 @@ static void rtl2830_remove(struct i2c_client *client)
}
static const struct i2c_device_id rtl2830_id_table[] = {
{"rtl2830", 0},
{ "rtl2830" },
{}
};
MODULE_DEVICE_TABLE(i2c, rtl2830_id_table);

View File

@ -983,7 +983,7 @@ static int rtl2832_pid_filter(struct dvb_frontend *fe, u8 index, u16 pid,
index, pid, onoff, dev->slave_ts);
/* skip invalid PIDs (0x2000) */
if (pid > 0x1fff || index > 32)
if (pid > 0x1fff || index >= 32)
return 0;
if (onoff)
@ -1125,7 +1125,7 @@ static void rtl2832_remove(struct i2c_client *client)
}
static const struct i2c_device_id rtl2832_id_table[] = {
{"rtl2832", 0},
{ "rtl2832" },
{}
};
MODULE_DEVICE_TABLE(i2c, rtl2832_id_table);

View File

@ -1281,7 +1281,7 @@ static void si2165_remove(struct i2c_client *client)
}
static const struct i2c_device_id si2165_id_table[] = {
{"si2165", 0},
{ "si2165" },
{}
};
MODULE_DEVICE_TABLE(i2c, si2165_id_table);

View File

@ -788,7 +788,7 @@ static void si2168_remove(struct i2c_client *client)
}
static const struct i2c_device_id si2168_id_table[] = {
{"si2168", 0},
{ "si2168" },
{}
};
MODULE_DEVICE_TABLE(i2c, si2168_id_table);

View File

@ -407,7 +407,7 @@ static void sp2_remove(struct i2c_client *client)
}
static const struct i2c_device_id sp2_id[] = {
{"sp2", 0},
{ "sp2" },
{}
};
MODULE_DEVICE_TABLE(i2c, sp2_id);

View File

@ -5079,7 +5079,7 @@ struct dvb_frontend *stv090x_attach(struct stv090x_config *config,
EXPORT_SYMBOL_GPL(stv090x_attach);
static const struct i2c_device_id stv090x_id_table[] = {
{"stv090x", 0},
{ "stv090x" },
{}
};
MODULE_DEVICE_TABLE(i2c, stv090x_id_table);

View File

@ -470,7 +470,7 @@ const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
EXPORT_SYMBOL_GPL(stv6110x_attach);
static const struct i2c_device_id stv6110x_id_table[] = {
{"stv6110x", 0},
{ "stv6110x" },
{}
};
MODULE_DEVICE_TABLE(i2c, stv6110x_id_table);

View File

@ -1230,7 +1230,7 @@ static void tda10071_remove(struct i2c_client *client)
}
static const struct i2c_device_id tda10071_id_table[] = {
{"tda10071_cx24118", 0},
{ "tda10071_cx24118" },
{}
};
MODULE_DEVICE_TABLE(i2c, tda10071_id_table);

View File

@ -710,8 +710,8 @@ static void ts2020_remove(struct i2c_client *client)
}
static const struct i2c_device_id ts2020_id_table[] = {
{"ts2020", 0},
{"ts2022", 0},
{ "ts2020" },
{ "ts2022" },
{}
};
MODULE_DEVICE_TABLE(i2c, ts2020_id_table);

View File

@ -347,8 +347,8 @@ static void ad5820_remove(struct i2c_client *client)
}
static const struct i2c_device_id ad5820_id_table[] = {
{ "ad5820", 0 },
{ "ad5821", 0 },
{ "ad5820" },
{ "ad5821" },
{ }
};
MODULE_DEVICE_TABLE(i2c, ad5820_id_table);

View File

@ -522,7 +522,7 @@ static void adp1653_remove(struct i2c_client *client)
}
static const struct i2c_device_id adp1653_id_table[] = {
{ ADP1653_NAME, 0 },
{ ADP1653_NAME },
{ }
};
MODULE_DEVICE_TABLE(i2c, adp1653_id_table);

View File

@ -377,8 +377,8 @@ static void adv7170_remove(struct i2c_client *client)
/* ----------------------------------------------------------------------- */
static const struct i2c_device_id adv7170_id[] = {
{ "adv7170", 0 },
{ "adv7171", 0 },
{ "adv7170" },
{ "adv7171" },
{ }
};
MODULE_DEVICE_TABLE(i2c, adv7170_id);

View File

@ -432,8 +432,8 @@ static void adv7175_remove(struct i2c_client *client)
/* ----------------------------------------------------------------------- */
static const struct i2c_device_id adv7175_id[] = {
{ "adv7175", 0 },
{ "adv7176", 0 },
{ "adv7175" },
{ "adv7176" },
{ }
};
MODULE_DEVICE_TABLE(i2c, adv7175_id);

View File

@ -619,8 +619,8 @@ static void adv7183_remove(struct i2c_client *client)
}
static const struct i2c_device_id adv7183_id[] = {
{"adv7183", 0},
{},
{ "adv7183" },
{}
};
MODULE_DEVICE_TABLE(i2c, adv7183_id);

View File

@ -502,8 +502,8 @@ static void adv7343_remove(struct i2c_client *client)
}
static const struct i2c_device_id adv7343_id[] = {
{"adv7343", 0},
{},
{ "adv7343" },
{}
};
MODULE_DEVICE_TABLE(i2c, adv7343_id);

View File

@ -446,8 +446,8 @@ static void adv7393_remove(struct i2c_client *client)
}
static const struct i2c_device_id adv7393_id[] = {
{"adv7393", 0},
{},
{ "adv7393" },
{}
};
MODULE_DEVICE_TABLE(i2c, adv7393_id);

View File

@ -1949,7 +1949,7 @@ static void adv7511_remove(struct i2c_client *client)
/* ----------------------------------------------------------------------- */
static const struct i2c_device_id adv7511_id[] = {
{ "adv7511-v4l2", 0 },
{ "adv7511-v4l2" },
{ }
};
MODULE_DEVICE_TABLE(i2c, adv7511_id);

View File

@ -3617,7 +3617,7 @@ static void adv7842_remove(struct i2c_client *client)
/* ----------------------------------------------------------------------- */
static const struct i2c_device_id adv7842_id[] = {
{ "adv7842", 0 },
{ "adv7842" },
{ }
};
MODULE_DEVICE_TABLE(i2c, adv7842_id);

View File

@ -304,8 +304,8 @@ static void ak881x_remove(struct i2c_client *client)
}
static const struct i2c_device_id ak881x_id[] = {
{ "ak8813", 0 },
{ "ak8814", 0 },
{ "ak8813" },
{ "ak8814" },
{ }
};
MODULE_DEVICE_TABLE(i2c, ak881x_id);

View File

@ -835,21 +835,30 @@ static const struct initial_reg {
be(0x0707)), /* 3F44: couple k factor 2 */
};
static int ar0521_power_off(struct device *dev)
static void __ar0521_power_off(struct device *dev)
{
struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct ar0521_dev *sensor = to_ar0521_dev(sd);
int i;
clk_disable_unprepare(sensor->extclk);
if (sensor->reset_gpio)
gpiod_set_value(sensor->reset_gpio, 1); /* assert RESET signal */
/* assert RESET signal */
gpiod_set_value_cansleep(sensor->reset_gpio, 1);
for (i = ARRAY_SIZE(ar0521_supply_names) - 1; i >= 0; i--) {
if (sensor->supplies[i])
regulator_disable(sensor->supplies[i]);
}
}
static int ar0521_power_off(struct device *dev)
{
struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct ar0521_dev *sensor = to_ar0521_dev(sd);
clk_disable_unprepare(sensor->extclk);
__ar0521_power_off(dev);
return 0;
}
@ -878,7 +887,7 @@ static int ar0521_power_on(struct device *dev)
if (sensor->reset_gpio)
/* deassert RESET signal */
gpiod_set_value(sensor->reset_gpio, 0);
gpiod_set_value_cansleep(sensor->reset_gpio, 0);
usleep_range(4500, 5000); /* min 45000 clocks */
for (cnt = 0; cnt < ARRAY_SIZE(initial_regs); cnt++) {
@ -908,7 +917,8 @@ static int ar0521_power_on(struct device *dev)
return 0;
off:
ar0521_power_off(dev);
clk_disable_unprepare(sensor->extclk);
__ar0521_power_off(dev);
return ret;
}

View File

@ -457,9 +457,9 @@ static void bt819_remove(struct i2c_client *client)
/* ----------------------------------------------------------------------- */
static const struct i2c_device_id bt819_id[] = {
{ "bt819a", 0 },
{ "bt817a", 0 },
{ "bt815a", 0 },
{ "bt819a" },
{ "bt817a" },
{ "bt815a" },
{ }
};
MODULE_DEVICE_TABLE(i2c, bt819_id);

View File

@ -230,7 +230,7 @@ static void bt856_remove(struct i2c_client *client)
}
static const struct i2c_device_id bt856_id[] = {
{ "bt856", 0 },
{ "bt856" },
{ }
};
MODULE_DEVICE_TABLE(i2c, bt856_id);

View File

@ -197,7 +197,7 @@ static void bt866_remove(struct i2c_client *client)
}
static const struct i2c_device_id bt866_id[] = {
{ "bt866", 0 },
{ "bt866" },
{ }
};
MODULE_DEVICE_TABLE(i2c, bt866_id);

View File

@ -21,16 +21,13 @@
struct ccs_sensor;
int ccs_read_addr_no_quirk(struct ccs_sensor *sensor, u32 reg, u32 *val);
int ccs_read_addr(struct ccs_sensor *sensor, u32 reg, u32 *val);
int ccs_read_addr_8only(struct ccs_sensor *sensor, u32 reg, u32 *val);
int ccs_read_addr_noconv(struct ccs_sensor *sensor, u32 reg, u32 *val);
int ccs_write_addr_no_quirk(struct ccs_sensor *sensor, u32 reg, u32 val);
int ccs_write_addr(struct ccs_sensor *sensor, u32 reg, u32 val);
int ccs_write_data_regs(struct ccs_sensor *sensor, struct ccs_reg *regs,
size_t num_regs);
unsigned int ccs_reg_width(u32 reg);
u32 ccs_reg_conv(struct ccs_sensor *sensor, u32 reg, u32 val);
#define ccs_read(sensor, reg_name, val) \

View File

@ -109,7 +109,7 @@ static void cs3308_remove(struct i2c_client *client)
/* ----------------------------------------------------------------------- */
static const struct i2c_device_id cs3308_id[] = {
{ "cs3308", 0 },
{ "cs3308" },
{ }
};
MODULE_DEVICE_TABLE(i2c, cs3308_id);

View File

@ -189,7 +189,7 @@ static void cs5345_remove(struct i2c_client *client)
/* ----------------------------------------------------------------------- */
static const struct i2c_device_id cs5345_id[] = {
{ "cs5345", 0 },
{ "cs5345" },
{ }
};
MODULE_DEVICE_TABLE(i2c, cs5345_id);

View File

@ -200,7 +200,7 @@ static void cs53l32a_remove(struct i2c_client *client)
}
static const struct i2c_device_id cs53l32a_id[] = {
{ "cs53l32a", 0 },
{ "cs53l32a" },
{ }
};
MODULE_DEVICE_TABLE(i2c, cs53l32a_id);

View File

@ -3964,7 +3964,7 @@ static void cx25840_remove(struct i2c_client *client)
}
static const struct i2c_device_id cx25840_id[] = {
{ "cx25840", 0 },
{ "cx25840" },
{ }
};
MODULE_DEVICE_TABLE(i2c, cx25840_id);

View File

@ -877,7 +877,10 @@ static void ub913_remove(struct i2c_client *client)
ub913_gpiochip_remove(priv);
}
static const struct i2c_device_id ub913_id[] = { { "ds90ub913a-q1", 0 }, {} };
static const struct i2c_device_id ub913_id[] = {
{ "ds90ub913a-q1" },
{}
};
MODULE_DEVICE_TABLE(i2c, ub913_id);
static const struct of_device_id ub913_dt_ids[] = {

View File

@ -279,8 +279,8 @@ static int __maybe_unused dw9714_vcm_resume(struct device *dev)
}
static const struct i2c_device_id dw9714_id_table[] = {
{ DW9714_NAME, 0 },
{ { 0 } }
{ DW9714_NAME },
{ }
};
MODULE_DEVICE_TABLE(i2c, dw9714_id_table);

View File

@ -1501,7 +1501,7 @@ static const struct of_device_id et8ek8_of_table[] = {
MODULE_DEVICE_TABLE(of, et8ek8_of_table);
static const struct i2c_device_id et8ek8_id_table[] = {
{ ET8EK8_NAME, 0 },
{ ET8EK8_NAME },
{ }
};
MODULE_DEVICE_TABLE(i2c, et8ek8_id_table);

View File

@ -65,7 +65,7 @@
static const char *const gc05a2_test_pattern_menu[] = {
"No Pattern", "Fade_to_gray_Color Bar", "Color Bar",
"PN9", "Horizental_gradient", "Checkboard Pattern",
"PN9", "Horizontal_gradient", "Checkboard Pattern",
"Slant", "Resolution", "Solid Black",
"Solid White",
};

View File

@ -948,7 +948,7 @@ static int gc08a3_start_streaming(struct gc08a3 *gc08a3)
ret = cci_write(gc08a3->regmap, GC08A3_STREAMING_REG, 1, NULL);
if (ret < 0) {
dev_err(gc08a3->dev, "write STRAEMING_REG failed: %d\n", ret);
dev_err(gc08a3->dev, "write STREAMING_REG failed: %d\n", ret);
goto err_rpm_put;
}

View File

@ -1949,7 +1949,7 @@ static const struct of_device_id imx274_of_id_table[] = {
MODULE_DEVICE_TABLE(of, imx274_of_id_table);
static const struct i2c_device_id imx274_id[] = {
{ "IMX274", 0 },
{ "IMX274" },
{ }
};
MODULE_DEVICE_TABLE(i2c, imx274_id);

View File

@ -465,6 +465,39 @@ static const struct imx283_mode supported_modes_12bit[] = {
.horizontal_ob = 48,
.vertical_ob = 4,
.crop = {
.top = 40,
.left = 108,
.width = 5472,
.height = 3648,
},
},
{
/*
* Readout mode 3 : 3/3 binned mode (1824x1216)
*/
.mode = IMX283_MODE_3,
.bpp = 12,
.width = 1824,
.height = 1216,
.min_hmax = 1894, /* Pixels (284 * 480MHz/72MHz + padding) */
.min_vmax = 4200, /* Lines */
/* 60.00 fps */
.default_hmax = 1900, /* 285 @ 480MHz/72Mhz */
.default_vmax = 4200,
.veff = 1234,
.vst = 0,
.vct = 0,
.hbin_ratio = 3,
.vbin_ratio = 3,
.min_shr = 16,
.horizontal_ob = 32,
.vertical_ob = 4,
.crop = {
.top = 40,
.left = 108,

View File

@ -997,7 +997,7 @@ static int imx335_parse_hw_config(struct imx335 *imx335)
/* Request optional reset pin */
imx335->reset_gpio = devm_gpiod_get_optional(imx335->dev, "reset",
GPIOD_OUT_LOW);
GPIOD_OUT_HIGH);
if (IS_ERR(imx335->reset_gpio)) {
dev_err(imx335->dev, "failed to get reset gpio %ld\n",
PTR_ERR(imx335->reset_gpio));
@ -1110,8 +1110,7 @@ static int imx335_power_on(struct device *dev)
usleep_range(500, 550); /* Tlow */
/* Set XCLR */
gpiod_set_value_cansleep(imx335->reset_gpio, 1);
gpiod_set_value_cansleep(imx335->reset_gpio, 0);
ret = clk_prepare_enable(imx335->inclk);
if (ret) {
@ -1124,7 +1123,7 @@ static int imx335_power_on(struct device *dev)
return 0;
error_reset:
gpiod_set_value_cansleep(imx335->reset_gpio, 0);
gpiod_set_value_cansleep(imx335->reset_gpio, 1);
regulator_bulk_disable(ARRAY_SIZE(imx335_supply_name), imx335->supplies);
return ret;
@ -1141,7 +1140,7 @@ static int imx335_power_off(struct device *dev)
struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct imx335 *imx335 = to_imx335(sd);
gpiod_set_value_cansleep(imx335->reset_gpio, 0);
gpiod_set_value_cansleep(imx335->reset_gpio, 1);
clk_disable_unprepare(imx335->inclk);
regulator_bulk_disable(ARRAY_SIZE(imx335_supply_name), imx335->supplies);

View File

@ -1520,6 +1520,7 @@ static const struct v4l2_subdev_internal_ops imx355_internal_ops = {
static int imx355_init_controls(struct imx355 *imx355)
{
struct i2c_client *client = v4l2_get_subdevdata(&imx355->sd);
struct v4l2_fwnode_device_properties props;
struct v4l2_ctrl_handler *ctrl_hdlr;
s64 exposure_max;
s64 vblank_def;
@ -1531,7 +1532,7 @@ static int imx355_init_controls(struct imx355 *imx355)
int ret;
ctrl_hdlr = &imx355->ctrl_handler;
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 10);
ret = v4l2_ctrl_handler_init(ctrl_hdlr, 12);
if (ret)
return ret;
@ -1603,6 +1604,15 @@ static int imx355_init_controls(struct imx355 *imx355)
goto error;
}
ret = v4l2_fwnode_device_parse(&client->dev, &props);
if (ret)
goto error;
ret = v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &imx355_ctrl_ops,
&props);
if (ret)
goto error;
imx355->sd.ctrl_handler = ctrl_hdlr;
return 0;

View File

@ -1561,8 +1561,8 @@ static const struct of_device_id isl7998x_of_match[] = {
MODULE_DEVICE_TABLE(of, isl7998x_of_match);
static const struct i2c_device_id isl7998x_id[] = {
{ "isl79987", 0 },
{ /* sentinel */ },
{ "isl79987" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(i2c, isl7998x_id);

View File

@ -677,9 +677,9 @@ static void ks0127_remove(struct i2c_client *client)
}
static const struct i2c_device_id ks0127_id[] = {
{ "ks0127", 0 },
{ "ks0127b", 0 },
{ "ks0122s", 0 },
{ "ks0127" },
{ "ks0127b" },
{ "ks0122s" },
{ }
};
MODULE_DEVICE_TABLE(i2c, ks0127_id);

View File

@ -455,8 +455,8 @@ static void lm3560_remove(struct i2c_client *client)
}
static const struct i2c_device_id lm3560_id_table[] = {
{LM3559_NAME, 0},
{LM3560_NAME, 0},
{ LM3559_NAME },
{ LM3560_NAME },
{}
};

View File

@ -386,7 +386,7 @@ static void lm3646_remove(struct i2c_client *client)
}
static const struct i2c_device_id lm3646_id_table[] = {
{LM3646_NAME, 0},
{ LM3646_NAME },
{}
};

View File

@ -163,7 +163,7 @@ static void m52790_remove(struct i2c_client *client)
/* ----------------------------------------------------------------------- */
static const struct i2c_device_id m52790_id[] = {
{ "m52790", 0 },
{ "m52790" },
{ }
};
MODULE_DEVICE_TABLE(i2c, m52790_id);

View File

@ -1413,8 +1413,8 @@ static void max2175_remove(struct i2c_client *client)
}
static const struct i2c_device_id max2175_id[] = {
{ DRIVER_NAME, 0},
{},
{ DRIVER_NAME },
{}
};
MODULE_DEVICE_TABLE(i2c, max2175_id);

View File

@ -25,6 +25,7 @@
#define MAX96714_NPORTS 2
#define MAX96714_PAD_SINK 0
#define MAX96714_PAD_SOURCE 1
#define MAX96714_CSI_NLANES 4
/* DEV */
#define MAX96714_REG13 CCI_REG8(0x0d)
@ -52,9 +53,9 @@
#define MAX96714_PATGEN_V2D CCI_REG24(0x254)
#define MAX96714_PATGEN_DE_HIGH CCI_REG16(0x257)
#define MAX96714_PATGEN_DE_LOW CCI_REG16(0x259)
#define MAX96714_PATGEN_DE_CNT CCI_REG16(0x25B)
#define MAX96714_PATGEN_DE_CNT CCI_REG16(0x25b)
#define MAX96714_PATGEN_GRAD_INC CCI_REG8(0x25d)
#define MAX96714_PATGEN_CHKB_COLOR_A CCI_REG24(0x25E)
#define MAX96714_PATGEN_CHKB_COLOR_A CCI_REG24(0x25e)
#define MAX96714_PATGEN_CHKB_COLOR_B CCI_REG24(0x261)
#define MAX96714_PATGEN_CHKB_RPT_CNT_A CCI_REG8(0x264)
#define MAX96714_PATGEN_CHKB_RPT_CNT_B CCI_REG8(0x265)
@ -724,8 +725,9 @@ static int max96714_init_tx_port(struct max96714_priv *priv)
* Unused lanes need to be mapped as well to not have
* the same lanes mapped twice.
*/
for (; lane < 4; lane++) {
unsigned int idx = find_first_zero_bit(&lanes_used, 4);
for (; lane < MAX96714_CSI_NLANES; lane++) {
unsigned int idx = find_first_zero_bit(&lanes_used,
MAX96714_CSI_NLANES);
val |= idx << (lane * 2);
lanes_used |= BIT(idx);
@ -757,9 +759,7 @@ static int max96714_rxport_disable_poc(struct max96714_priv *priv)
static int max96714_parse_dt_txport(struct max96714_priv *priv)
{
struct device *dev = &priv->client->dev;
struct v4l2_fwnode_endpoint vep = {
.bus_type = V4L2_MBUS_CSI2_DPHY
};
struct v4l2_fwnode_endpoint vep = { .bus_type = V4L2_MBUS_CSI2_DPHY };
struct fwnode_handle *ep_fwnode;
u32 num_data_lanes;
int ret;
@ -791,14 +791,14 @@ static int max96714_parse_dt_txport(struct max96714_priv *priv)
}
num_data_lanes = vep.bus.mipi_csi2.num_data_lanes;
if (num_data_lanes < 1 || num_data_lanes > 4) {
if (num_data_lanes < 1 || num_data_lanes > MAX96714_CSI_NLANES) {
dev_err(dev,
"tx: invalid number of data lanes must be 1 to 4\n");
ret = -EINVAL;
goto err_free_vep;
}
memcpy(&priv->mipi_csi2, &vep.bus.mipi_csi2, sizeof(priv->mipi_csi2));
priv->mipi_csi2 = vep.bus.mipi_csi2;
err_free_vep:
v4l2_fwnode_endpoint_free(&vep);

View File

@ -16,6 +16,7 @@
#include <linux/regmap.h>
#include <media/v4l2-cci.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>
@ -24,6 +25,7 @@
#define MAX96717_PORTS 2
#define MAX96717_PAD_SINK 0
#define MAX96717_PAD_SOURCE 1
#define MAX96717_CSI_NLANES 4
#define MAX96717_DEFAULT_CLKOUT_RATE 24000000UL
@ -38,9 +40,35 @@
#define MAX96717_DEV_REV_MASK GENMASK(3, 0)
/* VID_TX Z */
#define MAX96717_VIDEO_TX0 CCI_REG8(0x110)
#define MAX96717_VIDEO_AUTO_BPP BIT(3)
#define MAX96717_VIDEO_TX2 CCI_REG8(0x112)
#define MAX96717_VIDEO_PCLKDET BIT(7)
/* VTX_Z */
#define MAX96717_VTX0 CCI_REG8(0x24e)
#define MAX96717_VTX1 CCI_REG8(0x24f)
#define MAX96717_PATTERN_CLK_FREQ GENMASK(3, 1)
#define MAX96717_VTX_VS_DLY CCI_REG24(0x250)
#define MAX96717_VTX_VS_HIGH CCI_REG24(0x253)
#define MAX96717_VTX_VS_LOW CCI_REG24(0x256)
#define MAX96717_VTX_V2H CCI_REG24(0x259)
#define MAX96717_VTX_HS_HIGH CCI_REG16(0x25c)
#define MAX96717_VTX_HS_LOW CCI_REG16(0x25e)
#define MAX96717_VTX_HS_CNT CCI_REG16(0x260)
#define MAX96717_VTX_V2D CCI_REG24(0x262)
#define MAX96717_VTX_DE_HIGH CCI_REG16(0x265)
#define MAX96717_VTX_DE_LOW CCI_REG16(0x267)
#define MAX96717_VTX_DE_CNT CCI_REG16(0x269)
#define MAX96717_VTX29 CCI_REG8(0x26b)
#define MAX96717_VTX_MODE GENMASK(1, 0)
#define MAX96717_VTX_GRAD_INC CCI_REG8(0x26c)
#define MAX96717_VTX_CHKB_COLOR_A CCI_REG24(0x26d)
#define MAX96717_VTX_CHKB_COLOR_B CCI_REG24(0x270)
#define MAX96717_VTX_CHKB_RPT_CNT_A CCI_REG8(0x273)
#define MAX96717_VTX_CHKB_RPT_CNT_B CCI_REG8(0x274)
#define MAX96717_VTX_CHKB_ALT CCI_REG8(0x275)
/* GPIO */
#define MAX96717_NUM_GPIO 11
#define MAX96717_GPIO_REG_A(gpio) CCI_REG8(0x2be + (gpio) * 3)
@ -82,6 +110,12 @@
/* MISC */
#define PIO_SLEW_1 CCI_REG8(0x570)
enum max96717_vpg_mode {
MAX96717_VPG_DISABLED = 0,
MAX96717_VPG_CHECKERBOARD = 1,
MAX96717_VPG_GRADIENT = 2,
};
struct max96717_priv {
struct i2c_client *client;
struct regmap *regmap;
@ -89,6 +123,7 @@ struct max96717_priv {
struct v4l2_mbus_config_mipi_csi2 mipi_csi2;
struct v4l2_subdev sd;
struct media_pad pads[MAX96717_PORTS];
struct v4l2_ctrl_handler ctrl_handler;
struct v4l2_async_notifier notifier;
struct v4l2_subdev *source_sd;
u16 source_sd_pad;
@ -96,6 +131,7 @@ struct max96717_priv {
u8 pll_predef_index;
struct clk_hw clk_hw;
struct gpio_chip gpio_chip;
enum max96717_vpg_mode pattern;
};
static inline struct max96717_priv *sd_to_max96717(struct v4l2_subdev *sd)
@ -131,6 +167,118 @@ static inline int max96717_start_csi(struct max96717_priv *priv, bool start)
start ? MAX96717_START_PORT_B : 0, NULL);
}
static int max96717_apply_patgen_timing(struct max96717_priv *priv,
struct v4l2_subdev_state *state)
{
struct v4l2_mbus_framefmt *fmt =
v4l2_subdev_state_get_format(state, MAX96717_PAD_SOURCE);
const u32 h_active = fmt->width;
const u32 h_fp = 88;
const u32 h_sw = 44;
const u32 h_bp = 148;
u32 h_tot;
const u32 v_active = fmt->height;
const u32 v_fp = 4;
const u32 v_sw = 5;
const u32 v_bp = 36;
u32 v_tot;
int ret = 0;
h_tot = h_active + h_fp + h_sw + h_bp;
v_tot = v_active + v_fp + v_sw + v_bp;
/* 75 Mhz pixel clock */
cci_update_bits(priv->regmap, MAX96717_VTX1,
MAX96717_PATTERN_CLK_FREQ, 0xa, &ret);
dev_info(&priv->client->dev, "height: %d width: %d\n", fmt->height,
fmt->width);
cci_write(priv->regmap, MAX96717_VTX_VS_DLY, 0, &ret);
cci_write(priv->regmap, MAX96717_VTX_VS_HIGH, v_sw * h_tot, &ret);
cci_write(priv->regmap, MAX96717_VTX_VS_LOW,
(v_active + v_fp + v_bp) * h_tot, &ret);
cci_write(priv->regmap, MAX96717_VTX_HS_HIGH, h_sw, &ret);
cci_write(priv->regmap, MAX96717_VTX_HS_LOW, h_active + h_fp + h_bp,
&ret);
cci_write(priv->regmap, MAX96717_VTX_V2D,
h_tot * (v_sw + v_bp) + (h_sw + h_bp), &ret);
cci_write(priv->regmap, MAX96717_VTX_HS_CNT, v_tot, &ret);
cci_write(priv->regmap, MAX96717_VTX_DE_HIGH, h_active, &ret);
cci_write(priv->regmap, MAX96717_VTX_DE_LOW, h_fp + h_sw + h_bp,
&ret);
cci_write(priv->regmap, MAX96717_VTX_DE_CNT, v_active, &ret);
/* B G R */
cci_write(priv->regmap, MAX96717_VTX_CHKB_COLOR_A, 0xfecc00, &ret);
/* B G R */
cci_write(priv->regmap, MAX96717_VTX_CHKB_COLOR_B, 0x006aa7, &ret);
cci_write(priv->regmap, MAX96717_VTX_CHKB_RPT_CNT_A, 0x3c, &ret);
cci_write(priv->regmap, MAX96717_VTX_CHKB_RPT_CNT_B, 0x3c, &ret);
cci_write(priv->regmap, MAX96717_VTX_CHKB_ALT, 0x3c, &ret);
cci_write(priv->regmap, MAX96717_VTX_GRAD_INC, 0x10, &ret);
return ret;
}
static int max96717_apply_patgen(struct max96717_priv *priv,
struct v4l2_subdev_state *state)
{
unsigned int val;
int ret = 0;
if (priv->pattern)
ret = max96717_apply_patgen_timing(priv, state);
cci_write(priv->regmap, MAX96717_VTX0, priv->pattern ? 0xfb : 0,
&ret);
val = FIELD_PREP(MAX96717_VTX_MODE, priv->pattern);
cci_update_bits(priv->regmap, MAX96717_VTX29, MAX96717_VTX_MODE,
val, &ret);
return ret;
}
static int max96717_s_ctrl(struct v4l2_ctrl *ctrl)
{
struct max96717_priv *priv =
container_of(ctrl->handler, struct max96717_priv, ctrl_handler);
int ret;
switch (ctrl->id) {
case V4L2_CID_TEST_PATTERN:
if (priv->enabled_source_streams)
return -EBUSY;
priv->pattern = ctrl->val;
break;
default:
return -EINVAL;
}
/* Use bpp from bpp register */
ret = cci_update_bits(priv->regmap, MAX96717_VIDEO_TX0,
MAX96717_VIDEO_AUTO_BPP,
priv->pattern ? 0 : MAX96717_VIDEO_AUTO_BPP,
NULL);
/*
* Pattern generator doesn't work with tunnel mode.
* Needs RGB color format and deserializer tunnel mode must be disabled.
*/
return cci_update_bits(priv->regmap, MAX96717_MIPI_RX_EXT11,
MAX96717_TUN_MODE,
priv->pattern ? 0 : MAX96717_TUN_MODE, &ret);
}
static const char * const max96717_test_pattern[] = {
"Disabled",
"Checkerboard",
"Gradient"
};
static const struct v4l2_ctrl_ops max96717_ctrl_ops = {
.s_ctrl = max96717_s_ctrl,
};
static int max96717_gpiochip_get(struct gpio_chip *gpiochip,
unsigned int offset)
{
@ -348,24 +496,28 @@ static int max96717_enable_streams(struct v4l2_subdev *sd,
u64 streams_mask)
{
struct max96717_priv *priv = sd_to_max96717(sd);
struct device *dev = &priv->client->dev;
u64 sink_streams;
int ret;
sink_streams = v4l2_subdev_state_xlate_streams(state,
MAX96717_PAD_SOURCE,
MAX96717_PAD_SINK,
&streams_mask);
if (!priv->enabled_source_streams)
max96717_start_csi(priv, true);
ret = v4l2_subdev_enable_streams(priv->source_sd, priv->source_sd_pad,
sink_streams);
if (ret) {
dev_err(dev, "Fail to start streams:%llu on remote subdev\n",
sink_streams);
ret = max96717_apply_patgen(priv, state);
if (ret)
goto stop_csi;
if (!priv->pattern) {
sink_streams =
v4l2_subdev_state_xlate_streams(state,
MAX96717_PAD_SOURCE,
MAX96717_PAD_SINK,
&streams_mask);
ret = v4l2_subdev_enable_streams(priv->source_sd,
priv->source_sd_pad,
sink_streams);
if (ret)
goto stop_csi;
}
priv->enabled_source_streams |= streams_mask;
@ -375,6 +527,7 @@ static int max96717_enable_streams(struct v4l2_subdev *sd,
stop_csi:
if (!priv->enabled_source_streams)
max96717_start_csi(priv, false);
return ret;
}
@ -394,13 +547,23 @@ static int max96717_disable_streams(struct v4l2_subdev *sd,
if (!priv->enabled_source_streams)
max96717_start_csi(priv, false);
sink_streams = v4l2_subdev_state_xlate_streams(state,
MAX96717_PAD_SOURCE,
MAX96717_PAD_SINK,
&streams_mask);
if (!priv->pattern) {
int ret;
return v4l2_subdev_disable_streams(priv->source_sd, priv->source_sd_pad,
sink_streams);
sink_streams =
v4l2_subdev_state_xlate_streams(state,
MAX96717_PAD_SOURCE,
MAX96717_PAD_SINK,
&streams_mask);
ret = v4l2_subdev_disable_streams(priv->source_sd,
priv->source_sd_pad,
sink_streams);
if (ret)
return ret;
}
return 0;
}
static const struct v4l2_subdev_pad_ops max96717_pad_ops = {
@ -513,6 +676,19 @@ static int max96717_subdev_init(struct max96717_priv *priv)
v4l2_i2c_subdev_init(&priv->sd, priv->client, &max96717_subdev_ops);
priv->sd.internal_ops = &max96717_internal_ops;
v4l2_ctrl_handler_init(&priv->ctrl_handler, 1);
priv->sd.ctrl_handler = &priv->ctrl_handler;
v4l2_ctrl_new_std_menu_items(&priv->ctrl_handler,
&max96717_ctrl_ops,
V4L2_CID_TEST_PATTERN,
ARRAY_SIZE(max96717_test_pattern) - 1,
0, 0, max96717_test_pattern);
if (priv->ctrl_handler.error) {
ret = priv->ctrl_handler.error;
goto err_free_ctrl;
}
priv->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_STREAMS;
priv->sd.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE;
priv->sd.entity.ops = &max96717_entity_ops;
@ -552,6 +728,8 @@ static int max96717_subdev_init(struct max96717_priv *priv)
v4l2_subdev_cleanup(&priv->sd);
err_entity_cleanup:
media_entity_cleanup(&priv->sd.entity);
err_free_ctrl:
v4l2_ctrl_handler_free(&priv->ctrl_handler);
return ret;
}
@ -563,6 +741,7 @@ static void max96717_subdev_uninit(struct max96717_priv *priv)
v4l2_async_nf_cleanup(&priv->notifier);
v4l2_subdev_cleanup(&priv->sd);
media_entity_cleanup(&priv->sd.entity);
v4l2_ctrl_handler_free(&priv->ctrl_handler);
}
struct max96717_pll_predef_freq {
@ -588,11 +767,8 @@ max96717_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
static unsigned int max96717_clk_find_best_index(struct max96717_priv *priv,
unsigned long rate)
{
unsigned int i, idx;
unsigned long diff_new, diff_old;
diff_old = U32_MAX;
idx = 0;
unsigned int i, idx = 0;
unsigned long diff_new, diff_old = U32_MAX;
for (i = 0; i < ARRAY_SIZE(max96717_predef_freqs); i++) {
diff_new = abs(rate - max96717_predef_freqs[i].freq);
@ -679,8 +855,7 @@ static int max96717_register_clkout(struct max96717_priv *priv)
struct clk_init_data init = { .ops = &max96717_clk_ops };
int ret;
init.name = kasprintf(GFP_KERNEL, "max96717.%s.clk_out",
dev_name(dev));
init.name = kasprintf(GFP_KERNEL, "max96717.%s.clk_out", dev_name(dev));
if (!init.name)
return -ENOMEM;
@ -763,8 +938,9 @@ static int max96717_init_csi_lanes(struct max96717_priv *priv)
* Unused lanes need to be mapped as well to not have
* the same lanes mapped twice.
*/
for (; lane < 4; lane++) {
unsigned int idx = find_first_zero_bit(&lanes_used, 4);
for (; lane < MAX96717_CSI_NLANES; lane++) {
unsigned int idx = find_first_zero_bit(&lanes_used,
MAX96717_CSI_NLANES);
val |= idx << (lane * 2);
lanes_used |= BIT(idx);
@ -818,9 +994,7 @@ static int max96717_hw_init(struct max96717_priv *priv)
static int max96717_parse_dt(struct max96717_priv *priv)
{
struct device *dev = &priv->client->dev;
struct v4l2_fwnode_endpoint vep = {
.bus_type = V4L2_MBUS_CSI2_DPHY
};
struct v4l2_fwnode_endpoint vep = { .bus_type = V4L2_MBUS_CSI2_DPHY };
struct fwnode_handle *ep_fwnode;
unsigned char num_data_lanes;
int ret;
@ -838,11 +1012,11 @@ static int max96717_parse_dt(struct max96717_priv *priv)
return dev_err_probe(dev, ret, "Failed to parse sink endpoint");
num_data_lanes = vep.bus.mipi_csi2.num_data_lanes;
if (num_data_lanes < 1 || num_data_lanes > 4)
if (num_data_lanes < 1 || num_data_lanes > MAX96717_CSI_NLANES)
return dev_err_probe(dev, -EINVAL,
"Invalid data lanes must be 1 to 4\n");
memcpy(&priv->mipi_csi2, &vep.bus.mipi_csi2, sizeof(priv->mipi_csi2));
priv->mipi_csi2 = vep.bus.mipi_csi2;
return 0;
}

Some files were not shown because too many files have changed in this diff Show More