From patchwork Wed May 21 09:29:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Kumar K X-Patchwork-Id: 4215451 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 787189F32B for ; Wed, 21 May 2014 09:30:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81D0D201FE for ; Wed, 21 May 2014 09:30:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B02A7202DD for ; Wed, 21 May 2014 09:30:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752027AbaEUJ37 (ORCPT ); Wed, 21 May 2014 05:29:59 -0400 Received: from mail-pb0-f43.google.com ([209.85.160.43]:36600 "EHLO mail-pb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751786AbaEUJ35 (ORCPT ); Wed, 21 May 2014 05:29:57 -0400 Received: by mail-pb0-f43.google.com with SMTP id up15so1250244pbc.2 for ; Wed, 21 May 2014 02:29:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=J2DFhuGmi3Y76RdImWli7ov6aqMt4RUNwgRykth4K3Q=; b=KqJiE1mNZbG1yKL7KnNougcyZ32l9+9b1ZwOE2S28fLati7oXK2vb+KligymD+hQ8T 0eU/UdkoaDf8c1R0Z5nnVZQC2tbtB3Sj3rF+Uzq721mP/ZMZQTFjxewN9WJQZ+rANp3D bukWYofHUveaeIlBRbeFaKmOvLmjOZ4xTJo3ytwv0yW4HszB2l3jWIcWuSgodOH4feCR +nG3S59YZhaV+QxCz3QPD0kw12M2fhGhfI7bxofXfdUVsxGzjQD6vw/vuJUThbj6YDwX 3Yw2qxuKKhrwJCHBffTFQEW9dHZFPedTYR35ofwTLTvx0GfI/hxbIhyHRAlh6MJG5EOM ghng== X-Received: by 10.68.129.99 with SMTP id nv3mr8773017pbb.128.1400664597150; Wed, 21 May 2014 02:29:57 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id fu12sm102504908pad.42.2014.05.21.02.29.50 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 May 2014 02:29:52 -0700 (PDT) From: Arun Kumar K To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: k.debski@samsung.com, s.nawrocki@samsung.com, posciak@chromium.org, avnd.kiran@samsung.com, sachin.kamat@linaro.org, t.figa@samsung.com, arunkk.samsung@gmail.com Subject: [PATCH v2 3/3] [media] s5p-mfc: Add init buffer cmd to MFCV6 Date: Wed, 21 May 2014 14:59:31 +0530 Message-Id: <1400664571-13746-4-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400664571-13746-1-git-send-email-arun.kk@samsung.com> References: <1400664571-13746-1-git-send-email-arun.kk@samsung.com> 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.4 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 Latest MFC v6 firmware requires tile mode and loop filter setting to be done as part of Init buffer command, in sync with v7. This patch adds this support for new v6 firmware. Signed-off-by: Arun Kumar K Signed-off-by: Kiran AVND Reviewed-by: Tomasz Figa --- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c index 4f5e0ea..c1c12f8 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c @@ -48,6 +48,8 @@ #define WRITEL(data, reg) \ (WARN_ON_ONCE(!(reg)) ? 0 : writel((data), (reg))) +#define IS_MFCV6_V2(dev) (!IS_MFCV7_PLUS(dev) && dev->fw_ver == MFC_FW_V2) + /* Allocate temporary buffers for decoding */ static int s5p_mfc_alloc_dec_temp_buffers_v6(struct s5p_mfc_ctx *ctx) { @@ -1352,7 +1354,7 @@ static int s5p_mfc_init_decode_v6(struct s5p_mfc_ctx *ctx) WRITEL(ctx->display_delay, mfc_regs->d_display_delay); } - if (IS_MFCV7_PLUS(dev)) { + if (IS_MFCV7_PLUS(dev) || IS_MFCV6_V2(dev)) { WRITEL(reg, mfc_regs->d_dec_options); reg = 0; } @@ -1367,7 +1369,7 @@ static int s5p_mfc_init_decode_v6(struct s5p_mfc_ctx *ctx) if (ctx->dst_fmt->fourcc == V4L2_PIX_FMT_NV12MT_16X16) reg |= (0x1 << S5P_FIMV_D_OPT_TILE_MODE_SHIFT_V6); - if (IS_MFCV7_PLUS(dev)) + if (IS_MFCV7_PLUS(dev) || IS_MFCV6_V2(dev)) WRITEL(reg, mfc_regs->d_init_buffer_options); else WRITEL(reg, mfc_regs->d_dec_options);