From patchwork Fri Dec 20 08:59:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar K X-Patchwork-Id: 21212 X-Patchwork-Delegate: kamil@wypas.org Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Vtvvv-00088g-EJ; Fri, 20 Dec 2013 09:59:47 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-6) with esmtp id 1Vtvvt-0001zK-4q; Fri, 20 Dec 2013 09:59:47 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755095Ab3LTI7n (ORCPT + 1 other); Fri, 20 Dec 2013 03:59:43 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:46881 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754589Ab3LTI7m (ORCPT ); Fri, 20 Dec 2013 03:59:42 -0500 Received: by mail-pa0-f44.google.com with SMTP id fa1so2357795pad.31 for ; Fri, 20 Dec 2013 00:59:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=hkMBxC/wuXmTbLDtC58iGzxDlSfY5XCVJ+0+SVmazco=; b=0PWYjx1UIrEVFxINMU+oPX35kG9Fq1hFmQbkR3SicMDod/f+YKLVpf/R1ddIvSVATq OO04jzRdd+Os5rVwlRWaitSoF2b10QG8LBmB4UX3W3WpyqOAegrHi4LKNGGoiubTADQQ ANTTHvMgxEeiDQXCq2O2d9V6u3oJVnSuvqvqYsHUS+VU6fUpYBCgLoVMzjTboxEA4RDO BzkKUa4rdv75DNTydt32qa6jf5hnJes+D5Y7wLVrekiYNKwVVET83kKRIVNtLxDGG+gK OFWRKyvPbgB+I4yaswg+mDc2l3k9V9iGGBsGYxesZOtxYfAZdwBB1aJNzZnu1bU0htoy USeQ== X-Received: by 10.66.255.39 with SMTP id an7mr7020977pad.7.1387529981452; Fri, 20 Dec 2013 00:59:41 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id by1sm12764873pbd.25.2013.12.20.00.59.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Dec 2013 00:59:40 -0800 (PST) From: Arun Kumar K To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: s.nawrocki@samsung.com, k.debski@samsung.com, prathyush.k@samsung.com, s.shirish@samsung.com, arun.m@samsung.com, arunkk.samsung@gmail.com Subject: [PATCH] [media] exynos-gsc: swap cb/cr only for 3 plane formats Date: Fri, 20 Dec 2013 14:29:33 +0530 Message-Id: <1387529973-6123-1-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.12.20.85115 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1700_1799 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, FROM_NAME_PHRASE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' From: Prathyush K The address for cb/cr needs to be swapped for 3 plane formats like YVU420 and YVU420M. If these address gets swapped for other formats like NV21, it results in passing a NULL dma address to gscalar (which will result in a PAGE FAULT if sysmmu is enabled). E.g. For NV21, the dma_address are (Y, CbCr, 0) and we swap them (Y, 0, CbCr) which is incorrect. Signed-off-by: Prathyush K Signed-off-by: Shirish S Signed-off-by: Arun Mankuzhi Signed-off-by: Arun Kumar K --- drivers/media/platform/exynos-gsc/gsc-core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 9d0cc04..ff851fc 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -844,11 +844,7 @@ int gsc_prepare_addr(struct gsc_ctx *ctx, struct vb2_buffer *vb, addr->cr = vb2_dma_contig_plane_dma_addr(vb, 2); } - if ((frame->fmt->pixelformat == V4L2_PIX_FMT_VYUY) || - (frame->fmt->pixelformat == V4L2_PIX_FMT_YVYU) || - (frame->fmt->pixelformat == V4L2_PIX_FMT_NV61) || - (frame->fmt->pixelformat == V4L2_PIX_FMT_YVU420) || - (frame->fmt->pixelformat == V4L2_PIX_FMT_NV21) || + if ((frame->fmt->pixelformat == V4L2_PIX_FMT_YVU420) || (frame->fmt->pixelformat == V4L2_PIX_FMT_YVU420M)) swap(addr->cb, addr->cr);