]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.git/commit
media: tegra: camera: add control for alignment
authorKen Chang <kenc@nvidia.com>
Wed, 30 Nov 2016 06:07:14 +0000 (14:07 +0800)
committermobile promotions <svcmobile_promotions@nvidia.com>
Thu, 22 Dec 2016 02:35:08 +0000 (18:35 -0800)
commitf05475d4f424fdf42bfc1692ba0d7044a5bbcad8
tree9664bdf84665f521d89b0abe691e028f04745f16
parent432da04c2451daa4fe2af250dda5db29fa20a99f
media: tegra: camera: add control for alignment

The driver needs to know alignment constraints in order to
update bytesperline and sizeimage correctly based on the
hardware requirements. Thus the values can be used to configure
VI to make streaming data written into memory buffers as expected
based on the selected pixel format. Add v4l2 controls to
make the alignment variables configurable for applications:

height_alignment (int)    : min=1 max=2160 step=1 default=1 value=1
size_alignment (intmenu): min=0 max=2 default=0 value=0
               0: 1 (0x1)
               1: 65536 (0x10000)
               2: 131072 (0x20000)

In addition, the height in struct v4l2_pix_format shall never
include the padding lines thus fix the code to keep it as is.

Bug 200256176

Change-Id: I9ef4c823141334a0a4088f8e1bac190b41f31775
Signed-off-by: Ken Chang <kenc@nvidia.com>
Reviewed-on: http://git-master/r/1262132
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
drivers/media/platform/tegra/camera/vi/channel.c
drivers/media/platform/tegra/camera/vi/core.h
drivers/media/platform/tegra/camera/vi/mc_common.h
include/media/camera_common.h