summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-09-23 22:49:06 +0300
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-10-12 09:46:37 +0200
commit1126d89f8f54a13e7c5cbee24c414603ee794f10 (patch)
tree96810b3ea56cb29a44d565ac7a60a7003819a1dd /drivers/media
parent603fbdc1122565dd5bb3fc0b3f574afe5ac49cd9 (diff)
media: rkisp1: resizer: Drop unneeded local variable
The sink_y local variable in rkisp1_rsz_config() stores a copy of the sink_crop crop rectangle. Drop it, and rename sink_crop to sink_y. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
index 8700be7d19aa..1741ada7032b 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c
@@ -271,14 +271,12 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
{
const struct rkisp1_rsz_yuv_mbus_info *sink_yuv_info, *src_yuv_info;
const struct v4l2_mbus_framefmt *src_fmt, *sink_fmt;
- const struct v4l2_rect *sink_crop;
- struct v4l2_rect sink_y, sink_c;
+ const struct v4l2_rect *sink_y;
struct v4l2_area src_y, src_c;
+ struct v4l2_rect sink_c;
sink_fmt = v4l2_subdev_get_pad_format(&rsz->sd, sd_state,
RKISP1_RSZ_PAD_SINK);
- sink_crop = v4l2_subdev_get_pad_crop(&rsz->sd, sd_state,
- RKISP1_RSZ_PAD_SINK);
src_fmt = v4l2_subdev_get_pad_format(&rsz->sd, sd_state,
RKISP1_RSZ_PAD_SRC);
@@ -294,14 +292,14 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
return;
}
- sink_y.width = sink_crop->width;
- sink_y.height = sink_crop->height;
+ sink_y = v4l2_subdev_get_pad_crop(&rsz->sd, sd_state,
+ RKISP1_RSZ_PAD_SINK);
+ sink_c.width = sink_y->width / sink_yuv_info->hdiv;
+ sink_c.height = sink_y->height / sink_yuv_info->vdiv;
+
src_y.width = src_fmt->width;
src_y.height = src_fmt->height;
- sink_c.width = sink_y.width / sink_yuv_info->hdiv;
- sink_c.height = sink_y.height / sink_yuv_info->vdiv;
-
/*
* The resizer is used not only to change the dimensions of the frame
* but also to change the scale for YUV formats,
@@ -317,13 +315,13 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
}
dev_dbg(rsz->rkisp1->dev, "stream %d rsz/scale: %dx%d -> %dx%d\n",
- rsz->id, sink_crop->width, sink_crop->height,
+ rsz->id, sink_y->width, sink_y->height,
src_fmt->width, src_fmt->height);
dev_dbg(rsz->rkisp1->dev, "chroma scaling %dx%d -> %dx%d\n",
sink_c.width, sink_c.height, src_c.width, src_c.height);
/* set values in the hw */
- rkisp1_rsz_config_regs(rsz, &sink_y, &sink_c, &src_y, &src_c, when);
+ rkisp1_rsz_config_regs(rsz, sink_y, &sink_c, &src_y, &src_c, when);
}
/* ----------------------------------------------------------------------------