From patchwork Fri Nov 24 09:34:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10073877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 16A0E60383 for ; Fri, 24 Nov 2017 09:34:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 080EB2A31A for ; Fri, 24 Nov 2017 09:34:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0E1A2A354; Fri, 24 Nov 2017 09:34:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA53C2A31A for ; Fri, 24 Nov 2017 09:34:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752399AbdKXJeI (ORCPT ); Fri, 24 Nov 2017 04:34:08 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:38249 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752257AbdKXJeF (ORCPT ); Fri, 24 Nov 2017 04:34:05 -0500 Received: by mail-wm0-f67.google.com with SMTP id 128so21175531wmo.3 for ; Fri, 24 Nov 2017 01:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=JSpEwV8BznX8oRqZVc2iRN+wISsZI8BuupcZKfRKVJs=; b=MqtKaqskn1Z2wnV6U3ohl7DRrl8kVHqbPXOoiMnnMxxms4qQXyZrpDCON3NbALn/RO g7dn+nqhGS9kHt4FpZnp/MJWYL0whQ57hYefoPmto4No60EyTLsGPB/8GH/ZwzUMXQji StcZj8FeCOPhRQNfAOfBC15+FcYzGnci3PWRY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JSpEwV8BznX8oRqZVc2iRN+wISsZI8BuupcZKfRKVJs=; b=WPvjOvc9vQqIF2ni6pZZqqGxW6mVpa3SC+1jyxV53+IhEnyWQD/sSWCPfKKTV+MZE7 jIA0HK9mz4DDqQ+galiRH7tWeAR0pY10w2/0TpEC8YOpEf7R6x6MjKpWTe0QqVUg6Y3J FsPzo00A2PmM4gypxmxg5fSzF3R+4FQIq4YL2eXYSIRbfCs8DvGD6NH3E5f5hZfVpoNa 0mkYUtAcWhiUEtI4+v2LPllAdcRqNZ5gz9+ogONhsmbfgqP64jlNHTMopw3y+mE1y7qR 4svUUq5kZgSO0uygO9Qgjt5QsjRhKRD1PKJEsDNZMKeV3NbA60lI+CRhQrQJ9+PPs6Ip iC/g== X-Gm-Message-State: AJaThX4Cr43GwNC98UkB/nZ0BatnseToqjtHS/NtyhEJ3Hhzzf7uP95t abUWvj8FKtfJRWQrS5MVNOWtvA== X-Google-Smtp-Source: AGs4zMYNO0XIu3/wausrPBw4K9XM8VZ9W7CTp2+KjnAToizHdJJSZfi6N0Fe5U/M3CU8aNBU29JbTg== X-Received: by 10.28.174.78 with SMTP id x75mr10458453wme.27.1511516044561; Fri, 24 Nov 2017 01:34:04 -0800 (PST) Received: from localhost.localdomain (LFbn-TOU-1-178-83.w86-201.abo.wanadoo.fr. [86.201.28.83]) by smtp.gmail.com with ESMTPSA id r3sm8922051wmg.31.2017.11.24.01.34.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Nov 2017 01:34:04 -0800 (PST) From: Loic Poulain To: stanimir.varbanov@linaro.org, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, Loic Poulain Subject: [PATCH 1/2] media: venus: venc: configure entropy mode Date: Fri, 24 Nov 2017 10:34:01 +0100 Message-Id: <1511516042-11415-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP H264 entropy mode can be selected via V4L2 API but is eventually not applied. Configure encoder with selected mode, CALVC (def) or CABAC. Note that hw/firmware also expects a CABAC model configuration which currently doesn't have existing V4L2 API control. For now, use model_0 which seems always supported and so the default one. Signed-off-by: Loic Poulain Reviewed-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/venc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 6f123a3..d5d824e 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -641,6 +641,7 @@ static int venc_set_properties(struct venus_inst *inst) if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264) { struct hfi_h264_vui_timing_info info; + struct hfi_h264_entropy_control entropy; ptype = HFI_PROPERTY_PARAM_VENC_H264_VUI_TIMING_INFO; info.enable = 1; @@ -650,6 +651,16 @@ static int venc_set_properties(struct venus_inst *inst) ret = hfi_session_set_property(inst, ptype, &info); if (ret) return ret; + + ptype = HFI_PROPERTY_PARAM_VENC_H264_ENTROPY_CONTROL; + entropy.entropy_mode = venc_v4l2_to_hfi( + V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE, + ctr->h264_entropy_mode); + entropy.cabac_model = HFI_H264_CABAC_MODEL_0; + + ret = hfi_session_set_property(inst, ptype, &entropy); + if (ret) + return ret; } ptype = HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD;