Skip to content

Commit 8fa5960

Browse files
committed
Merge tag 'media/v5.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: - fix a regression at the CEC adapter core - two uAPI patches (one revert) for changes in this development cycle * tag 'media/v5.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: dt-bindings: media: imx274: Convert to json-schema media: media/v4l2: remove V4L2_FLAG_MEMORY_NON_CONSISTENT flag media: cec-adap.c: don't use flush_scheduled_work()
2 parents 9ef7dce + d0254f8 commit 8fa5960

16 files changed

Lines changed: 101 additions & 175 deletions

File tree

‎Documentation/devicetree/bindings/media/i2c/imx274.txt‎

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/media/i2c/sony,imx274.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Sony 1/2.5-Inch 8.51MP CMOS Digital Image Sensor
8+
9+
maintainers:
10+
- Leon Luo <leonl@leopardimaging.com>
11+
12+
description: |
13+
The Sony IMX274 is a 1/2.5-inch CMOS active pixel digital image sensor with an
14+
active array size of 3864H x 2202V. It is programmable through I2C interface.
15+
Image data is sent through MIPI CSI-2, which is configured as 4 lanes at 1440
16+
Mbps.
17+
18+
properties:
19+
compatible:
20+
const: sony,imx274
21+
22+
reg:
23+
const: 0x1a
24+
25+
reset-gpios:
26+
maxItems: 1
27+
28+
clocks:
29+
maxItems: 1
30+
31+
clock-names:
32+
const: inck
33+
34+
vana-supply:
35+
description: Sensor 2.8 V analog supply.
36+
maxItems: 1
37+
38+
vdig-supply:
39+
description: Sensor 1.8 V digital core supply.
40+
maxItems: 1
41+
42+
vddl-supply:
43+
description: Sensor digital IO 1.2 V supply.
44+
maxItems: 1
45+
46+
port:
47+
type: object
48+
description: Output video port. See ../video-interfaces.txt.
49+
50+
required:
51+
- compatible
52+
- reg
53+
- port
54+
55+
additionalProperties: false
56+
57+
examples:
58+
- |
59+
i2c0 {
60+
#address-cells = <1>;
61+
#size-cells = <0>;
62+
63+
imx274: camera-sensor@1a {
64+
compatible = "sony,imx274";
65+
reg = <0x1a>;
66+
reset-gpios = <&gpio_sensor 0 0>;
67+
68+
port {
69+
sensor_out: endpoint {
70+
remote-endpoint = <&csiss_in>;
71+
};
72+
};
73+
};
74+
};
75+
76+
...

‎Documentation/userspace-api/media/v4l/buffer.rst‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -701,23 +701,6 @@ Memory Consistency Flags
701701
:stub-columns: 0
702702
:widths: 3 1 4
703703

704-
* .. _`V4L2-FLAG-MEMORY-NON-CONSISTENT`:
705-
706-
- ``V4L2_FLAG_MEMORY_NON_CONSISTENT``
707-
- 0x00000001
708-
- A buffer is allocated either in consistent (it will be automatically
709-
coherent between the CPU and the bus) or non-consistent memory. The
710-
latter can provide performance gains, for instance the CPU cache
711-
sync/flush operations can be avoided if the buffer is accessed by the
712-
corresponding device only and the CPU does not read/write to/from that
713-
buffer. However, this requires extra care from the driver -- it must
714-
guarantee memory consistency by issuing a cache flush/sync when
715-
consistency is needed. If this flag is set V4L2 will attempt to
716-
allocate the buffer in non-consistent memory. The flag takes effect
717-
only if the buffer is used for :ref:`memory mapping <mmap>` I/O and the
718-
queue reports the :ref:`V4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTS
719-
<V4L2-BUF-CAP-SUPPORTS-MMAP-CACHE-HINTS>` capability.
720-
721704
.. c:type:: v4l2_memory
722705
723706
enum v4l2_memory

‎Documentation/userspace-api/media/v4l/vidioc-create-bufs.rst‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,9 @@ than the number requested.
120120
If you want to just query the capabilities without making any
121121
other changes, then set ``count`` to 0, ``memory`` to
122122
``V4L2_MEMORY_MMAP`` and ``format.type`` to the buffer type.
123-
* - __u32
124-
- ``flags``
125-
- Specifies additional buffer management attributes.
126-
See :ref:`memory-flags`.
127123

128124
* - __u32
129-
- ``reserved``\ [6]
125+
- ``reserved``\ [7]
130126
- A place holder for future extensions. Drivers and applications
131127
must set the array to zero.
132128

‎Documentation/userspace-api/media/v4l/vidioc-reqbufs.rst‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,10 @@ aborting or finishing any DMA in progress, an implicit
112112
``V4L2_MEMORY_MMAP`` and ``type`` set to the buffer type. This will
113113
free any previously allocated buffers, so this is typically something
114114
that will be done at the start of the application.
115-
* - union {
116-
- (anonymous)
117-
* - __u32
118-
- ``flags``
119-
- Specifies additional buffer management attributes.
120-
See :ref:`memory-flags`.
121115
* - __u32
122116
- ``reserved``\ [1]
123-
- Kept for backwards compatibility. Use ``flags`` instead.
124-
* - }
125-
-
117+
- A place holder for future extensions. Drivers and applications
118+
must set the array to zero.
126119
127120
.. tabularcolumns:: |p{6.1cm}|p{2.2cm}|p{8.7cm}|
128121
@@ -169,7 +162,6 @@ aborting or finishing any DMA in progress, an implicit
169162
- This capability is set by the driver to indicate that the queue supports
170163
cache and memory management hints. However, it's only valid when the
171164
queue is used for :ref:`memory mapping <mmap>` streaming I/O. See
172-
:ref:`V4L2_FLAG_MEMORY_NON_CONSISTENT <V4L2-FLAG-MEMORY-NON-CONSISTENT>`,
173165
:ref:`V4L2_BUF_FLAG_NO_CACHE_INVALIDATE <V4L2-BUF-FLAG-NO-CACHE-INVALIDATE>` and
174166
:ref:`V4L2_BUF_FLAG_NO_CACHE_CLEAN <V4L2-BUF-FLAG-NO-CACHE-CLEAN>`.
175167

‎MAINTAINERS‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16154,7 +16154,7 @@ M: Leon Luo <leonl@leopardimaging.com>
1615416154
L: linux-media@vger.kernel.org
1615516155
S: Maintained
1615616156
T: git git://linuxtv.org/media_tree.git
16157-
F: Documentation/devicetree/bindings/media/i2c/imx274.txt
16157+
F: Documentation/devicetree/bindings/media/i2c/sony,imx274.yaml
1615816158
F: drivers/media/i2c/imx274.c
1615916159

1616016160
SONY IMX290 SENSOR DRIVER

‎drivers/media/cec/core/cec-adap.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ void cec_received_msg_ts(struct cec_adapter *adap,
11991199
/* Cancel the pending timeout work */
12001200
if (!cancel_delayed_work(&data->work)) {
12011201
mutex_unlock(&adap->lock);
1202-
flush_scheduled_work();
1202+
cancel_delayed_work_sync(&data->work);
12031203
mutex_lock(&adap->lock);
12041204
}
12051205
/*

‎drivers/media/common/videobuf2/videobuf2-core.c‎

Lines changed: 6 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -721,39 +721,14 @@ int vb2_verify_memory_type(struct vb2_queue *q,
721721
}
722722
EXPORT_SYMBOL(vb2_verify_memory_type);
723723

724-
static void set_queue_consistency(struct vb2_queue *q, bool consistent_mem)
725-
{
726-
q->dma_attrs &= ~DMA_ATTR_NON_CONSISTENT;
727-
728-
if (!vb2_queue_allows_cache_hints(q))
729-
return;
730-
if (!consistent_mem)
731-
q->dma_attrs |= DMA_ATTR_NON_CONSISTENT;
732-
}
733-
734-
static bool verify_consistency_attr(struct vb2_queue *q, bool consistent_mem)
735-
{
736-
bool queue_is_consistent = !(q->dma_attrs & DMA_ATTR_NON_CONSISTENT);
737-
738-
if (consistent_mem != queue_is_consistent) {
739-
dprintk(q, 1, "memory consistency model mismatch\n");
740-
return false;
741-
}
742-
return true;
743-
}
744-
745724
int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
746-
unsigned int flags, unsigned int *count)
725+
unsigned int *count)
747726
{
748727
unsigned int num_buffers, allocated_buffers, num_planes = 0;
749728
unsigned plane_sizes[VB2_MAX_PLANES] = { };
750-
bool consistent_mem = true;
751729
unsigned int i;
752730
int ret;
753731

754-
if (flags & V4L2_FLAG_MEMORY_NON_CONSISTENT)
755-
consistent_mem = false;
756-
757732
if (q->streaming) {
758733
dprintk(q, 1, "streaming active\n");
759734
return -EBUSY;
@@ -765,8 +740,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
765740
}
766741

767742
if (*count == 0 || q->num_buffers != 0 ||
768-
(q->memory != VB2_MEMORY_UNKNOWN && q->memory != memory) ||
769-
!verify_consistency_attr(q, consistent_mem)) {
743+
(q->memory != VB2_MEMORY_UNKNOWN && q->memory != memory)) {
770744
/*
771745
* We already have buffers allocated, so first check if they
772746
* are not in use and can be freed.
@@ -803,7 +777,6 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
803777
num_buffers = min_t(unsigned int, num_buffers, VB2_MAX_FRAME);
804778
memset(q->alloc_devs, 0, sizeof(q->alloc_devs));
805779
q->memory = memory;
806-
set_queue_consistency(q, consistent_mem);
807780

808781
/*
809782
* Ask the driver how many buffers and planes per buffer it requires.
@@ -888,18 +861,14 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
888861
EXPORT_SYMBOL_GPL(vb2_core_reqbufs);
889862

890863
int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
891-
unsigned int flags, unsigned int *count,
864+
unsigned int *count,
892865
unsigned int requested_planes,
893866
const unsigned int requested_sizes[])
894867
{
895868
unsigned int num_planes = 0, num_buffers, allocated_buffers;
896869
unsigned plane_sizes[VB2_MAX_PLANES] = { };
897-
bool consistent_mem = true;
898870
int ret;
899871

900-
if (flags & V4L2_FLAG_MEMORY_NON_CONSISTENT)
901-
consistent_mem = false;
902-
903872
if (q->num_buffers == VB2_MAX_FRAME) {
904873
dprintk(q, 1, "maximum number of buffers already allocated\n");
905874
return -ENOBUFS;
@@ -912,15 +881,12 @@ int vb2_core_create_bufs(struct vb2_queue *q, enum vb2_memory memory,
912881
}
913882
memset(q->alloc_devs, 0, sizeof(q->alloc_devs));
914883
q->memory = memory;
915-
set_queue_consistency(q, consistent_mem);
916884
q->waiting_for_buffers = !q->is_output;
917885
} else {
918886
if (q->memory != memory) {
919887
dprintk(q, 1, "memory model mismatch\n");
920888
return -EINVAL;
921889
}
922-
if (!verify_consistency_attr(q, consistent_mem))
923-
return -EINVAL;
924890
}
925891

926892
num_buffers = min(*count, VB2_MAX_FRAME - q->num_buffers);
@@ -2581,7 +2547,7 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read)
25812547
fileio->memory = VB2_MEMORY_MMAP;
25822548
fileio->type = q->type;
25832549
q->fileio = fileio;
2584-
ret = vb2_core_reqbufs(q, fileio->memory, 0, &fileio->count);
2550+
ret = vb2_core_reqbufs(q, fileio->memory, &fileio->count);
25852551
if (ret)
25862552
goto err_kfree;
25872553

@@ -2638,7 +2604,7 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read)
26382604

26392605
err_reqbufs:
26402606
fileio->count = 0;
2641-
vb2_core_reqbufs(q, fileio->memory, 0, &fileio->count);
2607+
vb2_core_reqbufs(q, fileio->memory, &fileio->count);
26422608

26432609
err_kfree:
26442610
q->fileio = NULL;
@@ -2658,7 +2624,7 @@ static int __vb2_cleanup_fileio(struct vb2_queue *q)
26582624
vb2_core_streamoff(q, q->type);
26592625
q->fileio = NULL;
26602626
fileio->count = 0;
2661-
vb2_core_reqbufs(q, fileio->memory, 0, &fileio->count);
2627+
vb2_core_reqbufs(q, fileio->memory, &fileio->count);
26622628
kfree(fileio);
26632629
dprintk(q, 3, "file io emulator closed\n");
26642630
}

‎drivers/media/common/videobuf2/videobuf2-dma-contig.c‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ struct vb2_dc_buf {
4242
struct dma_buf_attachment *db_attach;
4343
};
4444

45-
static inline bool vb2_dc_buffer_consistent(unsigned long attr)
46-
{
47-
return !(attr & DMA_ATTR_NON_CONSISTENT);
48-
}
49-
5045
/*********************************************/
5146
/* scatterlist table functions */
5247
/*********************************************/
@@ -341,27 +336,13 @@ static int
341336
vb2_dc_dmabuf_ops_begin_cpu_access(struct dma_buf *dbuf,
342337
enum dma_data_direction direction)
343338
{
344-
struct vb2_dc_buf *buf = dbuf->priv;
345-
struct sg_table *sgt = buf->dma_sgt;
346-
347-
if (vb2_dc_buffer_consistent(buf->attrs))
348-
return 0;
349-
350-
dma_sync_sg_for_cpu(buf->dev, sgt->sgl, sgt->nents, buf->dma_dir);
351339
return 0;
352340
}
353341

354342
static int
355343
vb2_dc_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf,
356344
enum dma_data_direction direction)
357345
{
358-
struct vb2_dc_buf *buf = dbuf->priv;
359-
struct sg_table *sgt = buf->dma_sgt;
360-
361-
if (vb2_dc_buffer_consistent(buf->attrs))
362-
return 0;
363-
364-
dma_sync_sg_for_device(buf->dev, sgt->sgl, sgt->nents, buf->dma_dir);
365346
return 0;
366347
}
367348

‎drivers/media/common/videobuf2/videobuf2-dma-sg.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ static void *vb2_dma_sg_alloc(struct device *dev, unsigned long dma_attrs,
123123
/*
124124
* NOTE: dma-sg allocates memory using the page allocator directly, so
125125
* there is no memory consistency guarantee, hence dma-sg ignores DMA
126-
* attributes passed from the upper layer. That means that
127-
* V4L2_FLAG_MEMORY_NON_CONSISTENT has no effect on dma-sg buffers.
126+
* attributes passed from the upper layer.
128127
*/
129128
buf->pages = kvmalloc_array(buf->num_pages, sizeof(struct page *),
130129
GFP_KERNEL | __GFP_ZERO);

0 commit comments

Comments
 (0)