From patchwork Fri Jul 29 10:56:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 1020282 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6TAxcZU008860 for ; Fri, 29 Jul 2011 11:00:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756258Ab1G2K7l (ORCPT ); Fri, 29 Jul 2011 06:59:41 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:53812 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755688Ab1G2K5D (ORCPT ); Fri, 29 Jul 2011 06:57:03 -0400 Received: from axis700.grange (dslb-084-061-105-216.pools.arcor-ip.net [84.61.105.216]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0MfZIB-1R1wDG0FH1-00P1wF; Fri, 29 Jul 2011 12:57:01 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id 1E7CC189B84 for ; Fri, 29 Jul 2011 12:57:00 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1QmkkV-0007n5-Qb for linux-media@vger.kernel.org; Fri, 29 Jul 2011 12:56:59 +0200 From: Guennadi Liakhovetski To: linux-media@vger.kernel.org Subject: [PATCH 03/59] V4L: sh_mobile_ceu_camera: fix field addresses in interleaved mode Date: Fri, 29 Jul 2011 12:56:03 +0200 Message-Id: <1311937019-29914-4-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1311937019-29914-1-git-send-email-g.liakhovetski@gmx.de> References: <1311937019-29914-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:YF5GepXEfUzvkRKmyujZCsyrxFvMBU+LoiznNqdYMbr +4Rxy70aFWBgEIvMl/l4a74uFterlIBieUKM8aZmqcFOEa0DcE 0SxAQq5SfKvbCluCUNtuWzNP+QNtg7/26RGrHP+5/WKF5R2L2J RzVMpAGOHC9VvmiddQ8wqbGGe2NCVn9PKLQt3BTfClRgKBi+8p BZyKdhTtVMKA2LQ+xpE4v1d8a+4lyw3vwTsCBoXN4Y= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 29 Jul 2011 11:00:15 +0000 (UTC) In interlaced interleaved mode field offset for deinterlacing depends on the pixel format. Signed-off-by: Guennadi Liakhovetski --- drivers/media/video/sh_mobile_ceu_camera.c | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index 407b96a..a322f83 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c @@ -267,6 +267,7 @@ static int sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev) unsigned long top1, top2; unsigned long bottom1, bottom2; u32 status; + bool planar; int ret = 0; /* @@ -314,17 +315,29 @@ static int sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev) phys_addr_top = vb2_dma_contig_plane_paddr(pcdev->active, 0); - ceu_write(pcdev, top1, phys_addr_top); - if (V4L2_FIELD_NONE != pcdev->field) { - phys_addr_bottom = phys_addr_top + icd->user_width; - ceu_write(pcdev, bottom1, phys_addr_bottom); - } - switch (icd->current_fmt->host_fmt->fourcc) { case V4L2_PIX_FMT_NV12: case V4L2_PIX_FMT_NV21: case V4L2_PIX_FMT_NV16: case V4L2_PIX_FMT_NV61: + planar = true; + break; + default: + planar = false; + } + + ceu_write(pcdev, top1, phys_addr_top); + if (V4L2_FIELD_NONE != pcdev->field) { + if (planar) + phys_addr_bottom = phys_addr_top + icd->user_width; + else + phys_addr_bottom = phys_addr_top + + soc_mbus_bytes_per_line(icd->user_width, + icd->current_fmt->host_fmt); + ceu_write(pcdev, bottom1, phys_addr_bottom); + } + + if (planar) { phys_addr_top += icd->user_width * icd->user_height; ceu_write(pcdev, top2, phys_addr_top);