From patchwork Fri Mar 7 08:31:29 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: 3788461 Return-Path: X-Original-To: patchwork-linux-media@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 03707BF540 for ; Fri, 7 Mar 2014 08:31:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 27EEB20295 for ; Fri, 7 Mar 2014 08:31:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F5502027D for ; Fri, 7 Mar 2014 08:31:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750930AbaCGIbh (ORCPT ); Fri, 7 Mar 2014 03:31:37 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:51741 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750834AbaCGIbg (ORCPT ); Fri, 7 Mar 2014 03:31:36 -0500 Received: by mail-pb0-f44.google.com with SMTP id rp16so3879898pbb.3 for ; Fri, 07 Mar 2014 00:31:36 -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=II5YgITh4Q5KeNA2DYS/atzGMFhQs3cTiiEBDvPBCuw=; b=PURB8fC+9muwzeKBQWLK9fpIuQdNJJ0EmBtOIGkkGsazcxXU9BEhAD87CEGXIMrfxF x8YH8gpZLmJu60c6FXUSDuA1oGB62un2+s1kOe9imLNGzaxJ4npTjSV2GeMYriUItKco /1Z78/vuVaUw8JbmR0mCgr3VUNifbgF+NYVxpVp5F3Fib+WVWRX5YwCzahZVXrj++9L/ Mcc1zYmfPdmLpmpso5lrMhvrW65GE1ySF0wL7qVfblzQ09UN0lJRaMv1WYM51z4M1EJl I9mBqlrDdU3dPSHwX5beM7PUDUZ+RK4p0Qz6BZbD/K24/eMHePB+Qms8TemKDVG0bzYC EEdQ== X-Received: by 10.66.139.100 with SMTP id qx4mr20226902pab.141.1394181095987; Fri, 07 Mar 2014 00:31:35 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id np9sm20233659pbc.31.2014.03.07.00.31.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Mar 2014 00:31:35 -0800 (PST) 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] [media] s5p-mfc: add init buffer cmd to MFCV6 Date: Fri, 7 Mar 2014 14:01:29 +0530 Message-Id: <1394181090-16446-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-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable 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: avnd kiran Latest MFC v6 firmware requires tile mode and loop filter setting to be done as part of Init buffer command, in sync with v7. So, move these settings out of decode options reg. Also, make this register definition applicable from v6 onwards. Signed-off-by: avnd kiran Signed-off-by: Arun Kumar K --- drivers/media/platform/s5p-mfc/regs-mfc-v6.h | 1 + drivers/media/platform/s5p-mfc/regs-mfc-v7.h | 2 -- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 11 +++-------- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v6.h b/drivers/media/platform/s5p-mfc/regs-mfc-v6.h index 8d0b686..b47567c 100644 --- a/drivers/media/platform/s5p-mfc/regs-mfc-v6.h +++ b/drivers/media/platform/s5p-mfc/regs-mfc-v6.h @@ -132,6 +132,7 @@ #define S5P_FIMV_D_METADATA_BUFFER_ADDR_V6 0xf448 #define S5P_FIMV_D_METADATA_BUFFER_SIZE_V6 0xf44c #define S5P_FIMV_D_NUM_MV_V6 0xf478 +#define S5P_FIMV_D_INIT_BUFFER_OPTIONS_V6 0xf47c #define S5P_FIMV_D_CPB_BUFFER_ADDR_V6 0xf4b0 #define S5P_FIMV_D_CPB_BUFFER_SIZE_V6 0xf4b4 diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v7.h b/drivers/media/platform/s5p-mfc/regs-mfc-v7.h index ea5ec2a..82c96fa 100644 --- a/drivers/media/platform/s5p-mfc/regs-mfc-v7.h +++ b/drivers/media/platform/s5p-mfc/regs-mfc-v7.h @@ -18,8 +18,6 @@ #define S5P_FIMV_CODEC_VP8_ENC_V7 25 /* Additional registers for v7 */ -#define S5P_FIMV_D_INIT_BUFFER_OPTIONS_V7 0xf47c - #define S5P_FIMV_E_SOURCE_FIRST_ADDR_V7 0xf9e0 #define S5P_FIMV_E_SOURCE_SECOND_ADDR_V7 0xf9e4 #define S5P_FIMV_E_SOURCE_THIRD_ADDR_V7 0xf9e8 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 90edb19..b226d75 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c @@ -1296,10 +1296,8 @@ static int s5p_mfc_init_decode_v6(struct s5p_mfc_ctx *ctx) WRITEL(ctx->display_delay, S5P_FIMV_D_DISPLAY_DELAY_V6); } - if (IS_MFCV7(dev)) { - WRITEL(reg, S5P_FIMV_D_DEC_OPTIONS_V6); - reg = 0; - } + WRITEL(reg, S5P_FIMV_D_DEC_OPTIONS_V6); + reg = 0; /* Setup loop filter, for decoding this is only valid for MPEG4 */ if (ctx->codec_mode == S5P_MFC_CODEC_MPEG4_DEC) { @@ -1311,10 +1309,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(dev)) - WRITEL(reg, S5P_FIMV_D_INIT_BUFFER_OPTIONS_V7); - else - WRITEL(reg, S5P_FIMV_D_DEC_OPTIONS_V6); + WRITEL(reg, S5P_FIMV_D_INIT_BUFFER_OPTIONS_V6); /* 0: NV12(CbCr), 1: NV21(CrCb) */ if (ctx->dst_fmt->fourcc == V4L2_PIX_FMT_NV21M)