Skip to content

Commit 1126d89

Browse files
pinchartlHans Verkuil
authored andcommitted
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 <[email protected]> Reviewed-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 603fbdc commit 1126d89

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,12 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
271271
{
272272
const struct rkisp1_rsz_yuv_mbus_info *sink_yuv_info, *src_yuv_info;
273273
const struct v4l2_mbus_framefmt *src_fmt, *sink_fmt;
274-
const struct v4l2_rect *sink_crop;
275-
struct v4l2_rect sink_y, sink_c;
274+
const struct v4l2_rect *sink_y;
276275
struct v4l2_area src_y, src_c;
276+
struct v4l2_rect sink_c;
277277

278278
sink_fmt = v4l2_subdev_get_pad_format(&rsz->sd, sd_state,
279279
RKISP1_RSZ_PAD_SINK);
280-
sink_crop = v4l2_subdev_get_pad_crop(&rsz->sd, sd_state,
281-
RKISP1_RSZ_PAD_SINK);
282280
src_fmt = v4l2_subdev_get_pad_format(&rsz->sd, sd_state,
283281
RKISP1_RSZ_PAD_SRC);
284282

@@ -294,14 +292,14 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
294292
return;
295293
}
296294

297-
sink_y.width = sink_crop->width;
298-
sink_y.height = sink_crop->height;
295+
sink_y = v4l2_subdev_get_pad_crop(&rsz->sd, sd_state,
296+
RKISP1_RSZ_PAD_SINK);
297+
sink_c.width = sink_y->width / sink_yuv_info->hdiv;
298+
sink_c.height = sink_y->height / sink_yuv_info->vdiv;
299+
299300
src_y.width = src_fmt->width;
300301
src_y.height = src_fmt->height;
301302

302-
sink_c.width = sink_y.width / sink_yuv_info->hdiv;
303-
sink_c.height = sink_y.height / sink_yuv_info->vdiv;
304-
305303
/*
306304
* The resizer is used not only to change the dimensions of the frame
307305
* but also to change the scale for YUV formats,
@@ -317,13 +315,13 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz,
317315
}
318316

319317
dev_dbg(rsz->rkisp1->dev, "stream %d rsz/scale: %dx%d -> %dx%d\n",
320-
rsz->id, sink_crop->width, sink_crop->height,
318+
rsz->id, sink_y->width, sink_y->height,
321319
src_fmt->width, src_fmt->height);
322320
dev_dbg(rsz->rkisp1->dev, "chroma scaling %dx%d -> %dx%d\n",
323321
sink_c.width, sink_c.height, src_c.width, src_c.height);
324322

325323
/* set values in the hw */
326-
rkisp1_rsz_config_regs(rsz, &sink_y, &sink_c, &src_y, &src_c, when);
324+
rkisp1_rsz_config_regs(rsz, sink_y, &sink_c, &src_y, &src_c, when);
327325
}
328326

329327
/* ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)