Lines Matching full:sel
199 struct v4l2_subdev_selection *sel) in histo_get_selection() argument
207 if (sel->pad != HISTO_PAD_SINK) in histo_get_selection()
212 state = vsp1_entity_get_state(&histo->entity, sd_state, sel->which); in histo_get_selection()
218 switch (sel->target) { in histo_get_selection()
222 sel->r.left = 0; in histo_get_selection()
223 sel->r.top = 0; in histo_get_selection()
224 sel->r.width = crop->width; in histo_get_selection()
225 sel->r.height = crop->height; in histo_get_selection()
231 sel->r.left = 0; in histo_get_selection()
232 sel->r.top = 0; in histo_get_selection()
233 sel->r.width = format->width; in histo_get_selection()
234 sel->r.height = format->height; in histo_get_selection()
238 sel->r = *v4l2_subdev_state_get_compose(state, sel->pad); in histo_get_selection()
242 sel->r = *v4l2_subdev_state_get_crop(state, sel->pad); in histo_get_selection()
257 struct v4l2_subdev_selection *sel) in histo_set_crop() argument
263 sel->r.left = clamp_t(unsigned int, sel->r.left, 0, format->width - 1); in histo_set_crop()
264 sel->r.top = clamp_t(unsigned int, sel->r.top, 0, format->height - 1); in histo_set_crop()
265 sel->r.width = clamp_t(unsigned int, sel->r.width, HISTO_MIN_SIZE, in histo_set_crop()
266 format->width - sel->r.left); in histo_set_crop()
267 sel->r.height = clamp_t(unsigned int, sel->r.height, HISTO_MIN_SIZE, in histo_set_crop()
268 format->height - sel->r.top); in histo_set_crop()
271 *v4l2_subdev_state_get_crop(sd_state, sel->pad) = sel->r; in histo_set_crop()
272 *v4l2_subdev_state_get_compose(sd_state, sel->pad) = sel->r; in histo_set_crop()
279 struct v4l2_subdev_selection *sel) in histo_set_compose() argument
290 sel->r.left = 0; in histo_set_compose()
291 sel->r.top = 0; in histo_set_compose()
293 crop = v4l2_subdev_state_get_crop(sd_state, sel->pad); in histo_set_compose()
309 sel->r.width = clamp(sel->r.width, crop->width / 4, crop->width); in histo_set_compose()
310 ratio = 1 << (crop->width * 2 / sel->r.width / 3); in histo_set_compose()
311 sel->r.width = crop->width / ratio; in histo_set_compose()
314 sel->r.height = clamp(sel->r.height, crop->height / 4, crop->height); in histo_set_compose()
315 ratio = 1 << (crop->height * 2 / sel->r.height / 3); in histo_set_compose()
316 sel->r.height = crop->height / ratio; in histo_set_compose()
318 compose = v4l2_subdev_state_get_compose(sd_state, sel->pad); in histo_set_compose()
319 *compose = sel->r; in histo_set_compose()
326 struct v4l2_subdev_selection *sel) in histo_set_selection() argument
332 if (sel->pad != HISTO_PAD_SINK) in histo_set_selection()
337 state = vsp1_entity_get_state(&histo->entity, sd_state, sel->which); in histo_set_selection()
343 if (sel->target == V4L2_SEL_TGT_CROP) in histo_set_selection()
344 ret = histo_set_crop(subdev, state, sel); in histo_set_selection()
345 else if (sel->target == V4L2_SEL_TGT_COMPOSE) in histo_set_selection()
346 ret = histo_set_compose(subdev, state, sel); in histo_set_selection()