Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / media / platform / rockchip / rkisp1 / rkisp1-common.c
blobcf889666e166a87934daa45a5a682afc44defe3c
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3 * Rockchip ISP1 Driver - Common definitions
5 * Copyright (C) 2019 Collabora, Ltd.
6 */
8 #include <media/v4l2-rect.h>
10 #include "rkisp1-common.h"
12 static const struct v4l2_rect rkisp1_sd_min_crop = {
13 .width = RKISP1_ISP_MIN_WIDTH,
14 .height = RKISP1_ISP_MIN_HEIGHT,
15 .top = 0,
16 .left = 0,
19 void rkisp1_sd_adjust_crop_rect(struct v4l2_rect *crop,
20 const struct v4l2_rect *bounds)
22 v4l2_rect_set_min_size(crop, &rkisp1_sd_min_crop);
23 v4l2_rect_map_inside(crop, bounds);
26 void rkisp1_sd_adjust_crop(struct v4l2_rect *crop,
27 const struct v4l2_mbus_framefmt *bounds)
29 struct v4l2_rect crop_bounds = {
30 .left = 0,
31 .top = 0,
32 .width = bounds->width,
33 .height = bounds->height,
36 rkisp1_sd_adjust_crop_rect(crop, &crop_bounds);