From patchwork Thu Mar 6 06:03:39 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: 3781591 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 D01B4BF540 for ; Thu, 6 Mar 2014 06:03:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC624201DC for ; Thu, 6 Mar 2014 06:03:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5AA65201D5 for ; Thu, 6 Mar 2014 06:03:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751365AbaCFGDu (ORCPT ); Thu, 6 Mar 2014 01:03:50 -0500 Received: from mail-pd0-f176.google.com ([209.85.192.176]:42550 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbaCFGDt (ORCPT ); Thu, 6 Mar 2014 01:03:49 -0500 Received: by mail-pd0-f176.google.com with SMTP id r10so2090402pdi.35 for ; Wed, 05 Mar 2014 22:03:49 -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=kUwXuCIobSC8sY0tW8Qj5cmfDhxt7Z29h2RZsuXQ5CQ=; b=Y75xXNll/orR53gGAzsTmt+ucXoKjzAganX5CvsAFVuDKhMK8rcHS/C609G1nkylSg vGmc8OhgVhYBdvf7BoXIBImNjpPVRUlXKiqlSoR/VGgnzq+X9r85e5Zp7Lhea6kVAxeS qBolYcH1mpHyy7ftrEHj6yNv7wS3yWCoQGJDAFEJ3Df+oVT0Q1M6iKNgYVmtyG2sxh+t hUmfaplytqPXU78nFE8wMH7Q3dUiBKcFES/lWT1R8CQB6RZTz0GXimIh2UvFpxgjucAG GYGvyjdYhKuof5Q8r5SYnKOFA/tH8jgBNkFGr6RRC38DojBdOJlEyNM+bp/bPUlbGMhz 74Xw== X-Received: by 10.68.35.129 with SMTP id h1mr12000560pbj.163.1394085829238; Wed, 05 Mar 2014 22:03:49 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id cz3sm15505612pbc.9.2014.03.05.22.03.46 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Mar 2014 22:03:48 -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, arunkk.samsung@gmail.com Subject: [PATCH] [media] s5p-mfc: Add a control for IVF format for VP8 encoder Date: Thu, 6 Mar 2014 11:33:39 +0530 Message-Id: <1394085820-3784-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=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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: Pawel Osciak Add a control to enable/disable IVF output stream format for VP8 encode. Set the IVF format output to disabled as default. Signed-off-by: Pawel Osciak Signed-off-by: Arun Kumar K --- Documentation/DocBook/media/v4l/controls.xml | 8 ++++++++ drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 1 + drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 11 +++++++++++ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 2 ++ drivers/media/v4l2-core/v4l2-ctrls.c | 1 + include/uapi/linux/v4l2-controls.h | 1 + 6 files changed, 24 insertions(+) diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index 0e1770c..07fb64a 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml @@ -3222,6 +3222,14 @@ V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD as a golden frame. Acceptable values are 0, 1, 2 and 3 corresponding to encoder profiles 0, 1, 2 and 3. + + + V4L2_CID_MPEG_VIDEO_VPX_IVF_FORMAT  + boolean + + Outputs the VP8 encoded stream in IVF file format. + + diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index 5c28cc3..4d17df9 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -418,6 +418,7 @@ struct s5p_mfc_vp8_enc_params { u8 rc_frame_qp; u8 rc_p_frame_qp; u8 profile; + bool ivf; }; /** diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index df83cd1..a67913e 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -676,6 +676,14 @@ static struct mfc_control controls[] = { .step = 1, .default_value = 0, }, + { + .id = V4L2_CID_MPEG_VIDEO_VPX_IVF_FORMAT, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .minimum = 0, + .maximum = 1, + .step = 1, + .default_value = 0, + }, }; #define NUM_CTRLS ARRAY_SIZE(controls) @@ -1636,6 +1644,9 @@ static int s5p_mfc_enc_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_VPX_PROFILE: p->codec.vp8.profile = ctrl->val; break; + case V4L2_CID_MPEG_VIDEO_VPX_IVF_FORMAT: + p->codec.vp8.ivf = ctrl->val; + break; default: v4l2_err(&dev->v4l2_dev, "Invalid control, id=%d, val=%d\n", ctrl->id, ctrl->val); 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 f64621a..90edb19 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c @@ -1243,6 +1243,8 @@ static int s5p_mfc_set_enc_params_vp8(struct s5p_mfc_ctx *ctx) /* VP8 specific params */ reg = 0; + /* Bit set to 1 disables IVF stream format. */ + reg |= p_vp8->ivf ? 0 : (0x1 << 12); reg |= (p_vp8->imd_4x4 & 0x1) << 10; switch (p_vp8->num_partitions) { case V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION: diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index e9e12c4..19e78df 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -752,6 +752,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP: return "VPX I-Frame QP Value"; case V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP: return "VPX P-Frame QP Value"; case V4L2_CID_MPEG_VIDEO_VPX_PROFILE: return "VPX Profile"; + case V4L2_CID_MPEG_VIDEO_VPX_IVF_FORMAT: return "VPX Output stream in IVF format"; /* CAMERA controls */ /* Keep the order of the 'case's the same as in videodev2.h! */ diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index cda6fa0..b2763d6 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -565,6 +565,7 @@ enum v4l2_vp8_golden_frame_sel { #define V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (V4L2_CID_MPEG_BASE+509) #define V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (V4L2_CID_MPEG_BASE+510) #define V4L2_CID_MPEG_VIDEO_VPX_PROFILE (V4L2_CID_MPEG_BASE+511) +#define V4L2_CID_MPEG_VIDEO_VPX_IVF_FORMAT (V4L2_CID_MPEG_BASE+512) /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)