Lines Matching full:sel
197 struct v4l2_subdev_selection *sel) in histo_get_selection() argument
205 if (sel->pad != HISTO_PAD_SINK) in histo_get_selection()
210 state = vsp1_entity_get_state(&histo->entity, sd_state, sel->which); in histo_get_selection()
216 switch (sel->target) { in histo_get_selection()
220 sel->r.left = 0; in histo_get_selection()
221 sel->r.top = 0; in histo_get_selection()
222 sel->r.width = crop->width; in histo_get_selection()
223 sel->r.height = crop->height; in histo_get_selection()
229 sel->r.left = 0; in histo_get_selection()
230 sel->r.top = 0; in histo_get_selection()
231 sel->r.width = format->width; in histo_get_selection()
232 sel->r.height = format->height; in histo_get_selection()
236 sel->r = *v4l2_subdev_state_get_compose(state, sel->pad); in histo_get_selection()
240 sel->r = *v4l2_subdev_state_get_crop(state, sel->pad); in histo_get_selection()
255 struct v4l2_subdev_selection *sel) in histo_set_crop() argument
261 sel->r.left = clamp_t(unsigned int, sel->r.left, 0, format->width - 1); in histo_set_crop()
262 sel->r.top = clamp_t(unsigned int, sel->r.top, 0, format->height - 1); in histo_set_crop()
263 sel->r.width = clamp_t(unsigned int, sel->r.width, HISTO_MIN_SIZE, in histo_set_crop()
264 format->width - sel->r.left); in histo_set_crop()
265 sel->r.height = clamp_t(unsigned int, sel->r.height, HISTO_MIN_SIZE, in histo_set_crop()
266 format->height - sel->r.top); in histo_set_crop()
269 *v4l2_subdev_state_get_crop(sd_state, sel->pad) = sel->r; in histo_set_crop()
270 *v4l2_subdev_state_get_compose(sd_state, sel->pad) = sel->r; in histo_set_crop()
277 struct v4l2_subdev_selection *sel) in histo_set_compose() argument
288 sel->r.left = 0; in histo_set_compose()
289 sel->r.top = 0; in histo_set_compose()
291 crop = v4l2_subdev_state_get_crop(sd_state, sel->pad); in histo_set_compose()
307 sel->r.width = clamp(sel->r.width, crop->width / 4, crop->width); in histo_set_compose()
308 ratio = 1 << (crop->width * 2 / sel->r.width / 3); in histo_set_compose()
309 sel->r.width = crop->width / ratio; in histo_set_compose()
312 sel->r.height = clamp(sel->r.height, crop->height / 4, crop->height); in histo_set_compose()
313 ratio = 1 << (crop->height * 2 / sel->r.height / 3); in histo_set_compose()
314 sel->r.height = crop->height / ratio; in histo_set_compose()
316 compose = v4l2_subdev_state_get_compose(sd_state, sel->pad); in histo_set_compose()
317 *compose = sel->r; in histo_set_compose()
324 struct v4l2_subdev_selection *sel) in histo_set_selection() argument
330 if (sel->pad != HISTO_PAD_SINK) in histo_set_selection()
335 state = vsp1_entity_get_state(&histo->entity, sd_state, sel->which); in histo_set_selection()
341 if (sel->target == V4L2_SEL_TGT_CROP) in histo_set_selection()
342 ret = histo_set_crop(subdev, state, sel); in histo_set_selection()
343 else if (sel->target == V4L2_SEL_TGT_COMPOSE) in histo_set_selection()
344 ret = histo_set_compose(subdev, state, sel); in histo_set_selection()