From patchwork Tue Feb 4 09:59:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Grover X-Patchwork-Id: 3574681 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 9E1C4C02DD for ; Tue, 4 Feb 2014 09:59:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C289420170 for ; Tue, 4 Feb 2014 09:59:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C5C1A20179 for ; Tue, 4 Feb 2014 09:59:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753915AbaBDJ6k (ORCPT ); Tue, 4 Feb 2014 04:58:40 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:43602 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753996AbaBDJ6I (ORCPT ); Tue, 4 Feb 2014 04:58:08 -0500 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N0G00DP2UCV2580@mailout1.samsung.com>; Tue, 04 Feb 2014 18:58:07 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 99.07.10364.FA9B0F25; Tue, 04 Feb 2014 18:58:07 +0900 (KST) X-AuditID: cbfee690-b7f266d00000287c-1b-52f0b9afd560 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 06.B1.29263.FA9B0F25; Tue, 04 Feb 2014 18:58:07 +0900 (KST) Received: from user-laptop.sisodomain.com ([107.109.108.128]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N0G00AM7UC4PY00@mmp2.samsung.com>; Tue, 04 Feb 2014 18:58:07 +0900 (KST) From: Amit Grover To: linux-media@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kyungmin.park@samsung.com, k.debski@samsung.com, prabhakar.csengg@gmail.com, s.nawrocki@samsung.com, hans.verkuil@cisco.com, hverkuil@xs4all.nl, swaminath.p@samsung.com Cc: jtp.park@samsung.com, Rrob@landley.net, andrew.smirnov@gmail.com, anatol.pomozov@gmail.com, jmccrohan@gmail.com, joe@perches.com, awalls@md.metrocast.net, arun.kk@samsung.com, amit.grover@samsung.com, austin.lobo@samsung.com Subject: [PATCH 2/2] [media] s5p-mfc: Add Horizontal and Vertical MV Search Range Date: Tue, 04 Feb 2014 15:29:59 +0530 Message-id: <1391507999-31437-3-git-send-email-amit.grover@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1391507999-31437-1-git-send-email-amit.grover@samsung.com> References: <52E0ED10.2020901@samsung.com> <1391507999-31437-1-git-send-email-amit.grover@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDIsWRmVeSWpSXmKPExsWyRsSkSnf9zg9BBk8apC2e9X1itXjZW2jR 3GFr8fHUbVaL+Z9usli8aU+yWPJzF5PFqcnPmCz6H61ntJh9/zGLxZG1V5ksfry+wGZxtukN u8Wmx9dYLRa2LWGxuLxrDptFz4atQMPur2C2ePrqOZvF4TftrBZtXVMZHUQ9pvzeyOqxc9Zd do9Xq2eyemxeUu8x68Jmdo8vq64xe/RtWcXo8XmTnMepr5/ZAzijuGxSUnMyy1KL9O0SuDLe rX7PVHBJpmLZ99oGxiUSXYycHBICJhJfPr1hhbDFJC7cW8/Wx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GkhAR2MAk8bD7IjuIwyzwilHi 2OQVzCBVwgLBEsffLgUbxSKgKnHnz0Iwm1fAXeLBhD6gBg6gdQoScybZgIQ5BTwkTuy9wASx OUPi3fFLbBMYeRcwMqxiFE0tSC4oTkrPNdQrTswtLs1L10vOz93ECI74Z1I7GFc2WBxiFOBg VOLhVVD5ECTEmlhWXJl7iFGCg1lJhNd8G1CINyWxsiq1KD++qDQntfgQYzLQUROZpUST84HJ KK8k3tDYxNzU2NTSxMLEzJI0YSVx3gOt1oFCAumJJanZqakFqUUwW5g4OKUaGJsdFxl9dfWq UXrEUxIWL7LyU9vdg1OufjoX8bb65beN61SXf0vznhE38RWv8fzueyK3plpOPVaUM+thFJPs HaU8l7IT3R35t1l3dF39Z53O+rvolM21nGuZX4zLVurJzpY9/DluDX/uk4xcK1vx38ySOwue sUfYGJxeNIdhtXvxqtJWm9P7HZRYijMSDbWYi4oTAZmKWw88AwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 This patch adds Controls to set Horizontal and Vertical search range for Motion Estimation block for Samsung MFC video Encoders. Signed-off-by: Swami Nathan Signed-off-by: Amit Grover --- drivers/media/platform/s5p-mfc/regs-mfc-v6.h | 1 + drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 2 ++ drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 24 +++++++++++++++++++++++ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 8 ++------ 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v6.h b/drivers/media/platform/s5p-mfc/regs-mfc-v6.h index 2398cdf..8d0b686 100644 --- a/drivers/media/platform/s5p-mfc/regs-mfc-v6.h +++ b/drivers/media/platform/s5p-mfc/regs-mfc-v6.h @@ -229,6 +229,7 @@ #define S5P_FIMV_E_PADDING_CTRL_V6 0xf7a4 #define S5P_FIMV_E_MV_HOR_RANGE_V6 0xf7ac #define S5P_FIMV_E_MV_VER_RANGE_V6 0xf7b0 +#define S5P_FIMV_E_MV_RANGE_V6_MASK 0x3fff #define S5P_FIMV_E_VBV_BUFFER_SIZE_V6 0xf84c #define S5P_FIMV_E_VBV_INIT_DELAY_V6 0xf850 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index f723f1f..5c28cc3 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -426,6 +426,8 @@ struct s5p_mfc_vp8_enc_params { struct s5p_mfc_enc_params { u16 width; u16 height; + u32 mv_h_range; + u32 mv_v_range; u16 gop_size; enum v4l2_mpeg_video_multi_slice_mode slice_mode; diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index 91b6e02..df83cd1 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -208,6 +208,24 @@ static struct mfc_control controls[] = { .default_value = 0, }, { + .id = V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE, + .type = V4L2_CTRL_TYPE_INTEGER, + .name = "Horizontal MV Search Range", + .minimum = 16, + .maximum = 128, + .step = 16, + .default_value = 32, + }, + { + .id = V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE, + .type = V4L2_CTRL_TYPE_INTEGER, + .name = "Vertical MV Search Range", + .minimum = 16, + .maximum = 128, + .step = 16, + .default_value = 32, + }, + { .id = V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE, .type = V4L2_CTRL_TYPE_INTEGER, .minimum = 0, @@ -1417,6 +1435,12 @@ static int s5p_mfc_enc_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_VBV_SIZE: p->vbv_size = ctrl->val; break; + case V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE: + p->mv_h_range = ctrl->val; + break; + case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE: + p->mv_v_range = ctrl->val; + break; case V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE: p->codec.h264.cpb_size = ctrl->val; break; 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 f6ff2db..f64621a 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c @@ -727,14 +727,10 @@ static int s5p_mfc_set_enc_params(struct s5p_mfc_ctx *ctx) WRITEL(reg, S5P_FIMV_E_RC_CONFIG_V6); /* setting for MV range [16, 256] */ - reg = 0; - reg &= ~(0x3FFF); - reg = 256; + reg = (p->mv_h_range & S5P_FIMV_E_MV_RANGE_V6_MASK); WRITEL(reg, S5P_FIMV_E_MV_HOR_RANGE_V6); - reg = 0; - reg &= ~(0x3FFF); - reg = 256; + reg = (p->mv_v_range & S5P_FIMV_E_MV_RANGE_V6_MASK); WRITEL(reg, S5P_FIMV_E_MV_VER_RANGE_V6); WRITEL(0x0, S5P_FIMV_E_FRAME_INSERTION_V6);