Skip to content

Commit 32138be

Browse files
author
Hans Verkuil
committed
Merge tag 'media-renesas-fixes-20231113' of git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git
Laurent Pinchart says: ---------------------------------------------------------------- Renesas R-Car VSP1 driver regression fix ---------------------------------------------------------------- Laurent Pinchart (1): media: vsp1: Remove unbalanced .s_stream(0) calls Link: https://lore.kernel.org/linux-media/20231113020054.GA18039@pendragon.ideasonboard.com/ Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2 parents 173d167 + 42d62b7 commit 32138be

5 files changed

Lines changed: 14 additions & 39 deletions

File tree

drivers/media/platform/renesas/vsp1/vsp1_pipe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ int vsp1_pipeline_stop(struct vsp1_pipeline *pipe)
373373
(7 << VI6_DPR_SMPPT_TGW_SHIFT) |
374374
(VI6_DPR_NODE_UNUSED << VI6_DPR_SMPPT_PT_SHIFT));
375375

376-
v4l2_subdev_call(&pipe->output->entity.subdev, video, s_stream, 0);
376+
vsp1_wpf_stop(pipe->output);
377377

378378
return ret;
379379
}

drivers/media/platform/renesas/vsp1/vsp1_rpf.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ static inline void vsp1_rpf_write(struct vsp1_rwpf *rpf,
4343
data);
4444
}
4545

46-
/* -----------------------------------------------------------------------------
47-
* V4L2 Subdevice Operations
48-
*/
49-
50-
static const struct v4l2_subdev_ops rpf_ops = {
51-
.pad = &vsp1_rwpf_pad_ops,
52-
};
53-
5446
/* -----------------------------------------------------------------------------
5547
* VSP1 Entity Operations
5648
*/
@@ -411,7 +403,7 @@ struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index)
411403
rpf->entity.index = index;
412404

413405
sprintf(name, "rpf.%u", index);
414-
ret = vsp1_entity_init(vsp1, &rpf->entity, name, 2, &rpf_ops,
406+
ret = vsp1_entity_init(vsp1, &rpf->entity, name, 2, &vsp1_rwpf_subdev_ops,
415407
MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER);
416408
if (ret < 0)
417409
return ERR_PTR(ret);

drivers/media/platform/renesas/vsp1/vsp1_rwpf.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf,
2424
}
2525

2626
/* -----------------------------------------------------------------------------
27-
* V4L2 Subdevice Pad Operations
27+
* V4L2 Subdevice Operations
2828
*/
2929

3030
static int vsp1_rwpf_enum_mbus_code(struct v4l2_subdev *subdev,
@@ -243,7 +243,7 @@ static int vsp1_rwpf_set_selection(struct v4l2_subdev *subdev,
243243
return ret;
244244
}
245245

246-
const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops = {
246+
static const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops = {
247247
.init_cfg = vsp1_entity_init_cfg,
248248
.enum_mbus_code = vsp1_rwpf_enum_mbus_code,
249249
.enum_frame_size = vsp1_rwpf_enum_frame_size,
@@ -253,6 +253,10 @@ const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops = {
253253
.set_selection = vsp1_rwpf_set_selection,
254254
};
255255

256+
const struct v4l2_subdev_ops vsp1_rwpf_subdev_ops = {
257+
.pad = &vsp1_rwpf_pad_ops,
258+
};
259+
256260
/* -----------------------------------------------------------------------------
257261
* Controls
258262
*/

drivers/media/platform/renesas/vsp1/vsp1_rwpf.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ static inline struct vsp1_rwpf *entity_to_rwpf(struct vsp1_entity *entity)
7979
struct vsp1_rwpf *vsp1_rpf_create(struct vsp1_device *vsp1, unsigned int index);
8080
struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index);
8181

82+
void vsp1_wpf_stop(struct vsp1_rwpf *wpf);
83+
8284
int vsp1_rwpf_init_ctrls(struct vsp1_rwpf *rwpf, unsigned int ncontrols);
8385

84-
extern const struct v4l2_subdev_pad_ops vsp1_rwpf_pad_ops;
86+
extern const struct v4l2_subdev_ops vsp1_rwpf_subdev_ops;
8587

8688
struct v4l2_rect *vsp1_rwpf_get_crop(struct vsp1_rwpf *rwpf,
8789
struct v4l2_subdev_state *sd_state);

drivers/media/platform/renesas/vsp1/vsp1_wpf.c

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -186,45 +186,22 @@ static int wpf_init_controls(struct vsp1_rwpf *wpf)
186186
}
187187

188188
/* -----------------------------------------------------------------------------
189-
* V4L2 Subdevice Core Operations
189+
* VSP1 Entity Operations
190190
*/
191191

192-
static int wpf_s_stream(struct v4l2_subdev *subdev, int enable)
192+
void vsp1_wpf_stop(struct vsp1_rwpf *wpf)
193193
{
194-
struct vsp1_rwpf *wpf = to_rwpf(subdev);
195194
struct vsp1_device *vsp1 = wpf->entity.vsp1;
196195

197-
if (enable)
198-
return 0;
199-
200196
/*
201197
* Write to registers directly when stopping the stream as there will be
202198
* no pipeline run to apply the display list.
203199
*/
204200
vsp1_write(vsp1, VI6_WPF_IRQ_ENB(wpf->entity.index), 0);
205201
vsp1_write(vsp1, wpf->entity.index * VI6_WPF_OFFSET +
206202
VI6_WPF_SRCRPF, 0);
207-
208-
return 0;
209203
}
210204

211-
/* -----------------------------------------------------------------------------
212-
* V4L2 Subdevice Operations
213-
*/
214-
215-
static const struct v4l2_subdev_video_ops wpf_video_ops = {
216-
.s_stream = wpf_s_stream,
217-
};
218-
219-
static const struct v4l2_subdev_ops wpf_ops = {
220-
.video = &wpf_video_ops,
221-
.pad = &vsp1_rwpf_pad_ops,
222-
};
223-
224-
/* -----------------------------------------------------------------------------
225-
* VSP1 Entity Operations
226-
*/
227-
228205
static void vsp1_wpf_destroy(struct vsp1_entity *entity)
229206
{
230207
struct vsp1_rwpf *wpf = entity_to_rwpf(entity);
@@ -583,7 +560,7 @@ struct vsp1_rwpf *vsp1_wpf_create(struct vsp1_device *vsp1, unsigned int index)
583560
wpf->entity.index = index;
584561

585562
sprintf(name, "wpf.%u", index);
586-
ret = vsp1_entity_init(vsp1, &wpf->entity, name, 2, &wpf_ops,
563+
ret = vsp1_entity_init(vsp1, &wpf->entity, name, 2, &vsp1_rwpf_subdev_ops,
587564
MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER);
588565
if (ret < 0)
589566
return ERR_PTR(ret);

0 commit comments

Comments
 (0)