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: 3386501 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 40E84C0D4A for ; Fri, 20 Dec 2013 08:59:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B268206E6 for ; Fri, 20 Dec 2013 08:59:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8BC52206A9 for ; Fri, 20 Dec 2013 08:59:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754613Ab3LTI7m (ORCPT ); Fri, 20 Dec 2013 03:59:42 -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-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);