]> www.infradead.org Git - users/hch/block.git/commit
media: vimc: Implement get/set selection in sink
authorGuilherme Alcarde Gallo <gagallo7@gmail.com>
Sun, 10 Nov 2019 18:33:21 +0000 (19:33 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 16 Dec 2019 09:22:00 +0000 (10:22 +0100)
commit69e39d40587b8d7538f966607299c360dc935b1f
tree122d312052f30225a48ec9d6945ab3d630c95433
parent94010145a58f169e73e6c7e88b57017112814955
media: vimc: Implement get/set selection in sink

Add support for the sink pad of scaler subdevice to respond
VIDIOC_G_SELECTION and VIDIOC_S_SELECTION ioctls with the following
targets: V4L2_SEL_TGT_COMPOSE_BOUNDS and V4L2_SEL_TGT_CROP.

* Add new const struct crop_rect_default to initialize subdev scaler
  properly.
* Make changes in sink pad format reflect to the crop rectangle. E.g.
  changing the frame format to a smaller size one can make the former
  crop rectangle selects a non existing frame area. To solve this
  situation the crop rectangle is clamped to the frame boundaries.
* Clamp crop rectangle respecting the sink bounds during set_selection
  ioctl.

Co-developed-by: Danilo Figueiredo Rocha <drocha.figueiredo@gmail.com>
Signed-off-by: Guilherme Alcarde Gallo <gagallo7@gmail.com>
Signed-off-by: Danilo Figueiredo Rocha <drocha.figueiredo@gmail.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/vimc/vimc-scaler.c