From patchwork Tue May 20 10:17:09 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: 4208761 Return-Path: X-Original-To: patchwork-linux-media@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 616289F23C for ; Tue, 20 May 2014 10:17:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 848F620138 for ; Tue, 20 May 2014 10:17:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB3F020131 for ; Tue, 20 May 2014 10:17:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752237AbaETKR1 (ORCPT ); Tue, 20 May 2014 06:17:27 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:52387 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbaETKR0 (ORCPT ); Tue, 20 May 2014 06:17:26 -0400 Received: by mail-pa0-f41.google.com with SMTP id lj1so195497pab.28 for ; Tue, 20 May 2014 03:17:25 -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=A81+GdyUDWMxIx/usUbM7QT7+Sd/UrlnsepGM7mdNiU=; b=pnUoglhj1YE2Gc0Dli2vZ+fRmpRe1/YRyym2NaGoe75wv0fcobgIVjApyxjSV8+w/A 0jMnJa+p+ohEl9PkxUWK3LOw+5Crg2f9G8DGDsoH7i+/MZG31sifi/wiwyt7P0FD6cwy iNzd+Tp7R/PhtKJluxaAoqthto0YGKOm5TYQFbq30QTgbvPLkROn7fCkyMkCfc0fiARW PXVzukohwyd64ynDQ5TnzX9TzeqcJbTsQ1xth8yCDHskxEBaa6vQq2zi1kb/xtbJqXnR +MV7LW/GmBX3wa1ztGKMQUdQDEfaoyKN7WGjffked0ksJkD2riUmyJeRWSkHYZzmv4M/ J/rQ== X-Received: by 10.68.225.74 with SMTP id ri10mr49804494pbc.116.1400581045786; Tue, 20 May 2014 03:17:25 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id ry10sm88016931pab.38.2014.05.20.03.17.22 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 20 May 2014 03:17:25 -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, arunkk.samsung@gmail.com Subject: [PATCH 3/3] [media] s5p-mfc: Add init buffer cmd to MFCV6 Date: Tue, 20 May 2014 15:47:09 +0530 Message-Id: <1400581029-3475-4-git-send-email-arun.kk@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1400581029-3475-1-git-send-email-arun.kk@samsung.com> References: <1400581029-3475-1-git-send-email-arun.kk@samsung.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 --- 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);