drivers: camera: Fix bytesperline derivation
Bhanu Murthy V [Tue, 26 Jul 2016 22:10:08 +0000 (15:10 -0700)]
Fix bytesperline calculation based on the
corresponding format derived with the code sent
from userspace.

Bug 200214096

Change-Id: Ic2ea7bf986e31b9177d1124142dfb115b935c24d
Signed-off-by: Bhanu Murthy V <bmurthyv@nvidia.com>
Reviewed-on: http://git-master/r/1191066
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Gigon Bae <gbae@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Gigon Bae <gbae@nvidia.com>
Reviewed-by: Jihoon Bang <jbang@nvidia.com>

drivers/media/platform/tegra/camera/channel.c

index e957363..468b2f2 100644 (file)
@@ -1311,7 +1311,8 @@ __tegra_channel_get_format(struct tegra_channel *chan,
        vfmt = tegra_core_get_format_by_code(fmt.format.code);
        if (vfmt != NULL) {
                pix->pixelformat = vfmt->fourcc;
-               pix->bytesperline = chan->format.bytesperline;
+               tegra_channel_fmt_align(chan,
+                       &pix->width, &pix->height, &pix->bytesperline);
                pix->sizeimage = pix->height * pix->bytesperline;
        }