Skip to content

Commit

Permalink
media: staging: rkisp1: set pads array of the resizer to size 2
Browse files Browse the repository at this point in the history
Currently the 'pads' and 'pad_cfg' arrays of the rkisp1_resizer
are of size 'RKISP1_ISP_PAD_MAX' which is 4. But the resizer
has only two pads. Change the size of the arrays to 2 by adding
and using 'RKISP1_RSZ_PAD_MAX' similar to the way it is done in
the isp entity.

[hverkuil: fix typos in commit log]

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Dafna Hirschfeld authored and Mauro Carvalho Chehab committed Jul 19, 2020
1 parent 1b265b4 commit 8d4a696
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions drivers/staging/media/rkisp1/rkisp1-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
enum rkisp1_rsz_pad {
RKISP1_RSZ_PAD_SINK,
RKISP1_RSZ_PAD_SRC,
RKISP1_RSZ_PAD_MAX
};

enum rkisp1_stream_id {
Expand Down Expand Up @@ -219,8 +220,8 @@ struct rkisp1_resizer {
struct v4l2_subdev sd;
enum rkisp1_stream_id id;
struct rkisp1_device *rkisp1;
struct media_pad pads[RKISP1_ISP_PAD_MAX];
struct v4l2_subdev_pad_config pad_cfg[RKISP1_ISP_PAD_MAX];
struct media_pad pads[RKISP1_RSZ_PAD_MAX];
struct v4l2_subdev_pad_config pad_cfg[RKISP1_RSZ_PAD_MAX];
const struct rkisp1_rsz_config *config;
enum v4l2_pixel_encoding pixel_enc;
struct mutex ops_lock;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/media/rkisp1/rkisp1-resizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ static int rkisp1_rsz_register(struct rkisp1_resizer *rsz)
rsz->pixel_enc = RKISP1_DEF_PIXEL_ENC;

mutex_init(&rsz->ops_lock);
ret = media_entity_pads_init(&sd->entity, 2, pads);
ret = media_entity_pads_init(&sd->entity, RKISP1_RSZ_PAD_MAX, pads);
if (ret)
return ret;

Expand Down

0 comments on commit 8d4a696

Please sign in to comment.