From patchwork Tue Sep 8 12:32:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 292977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31992C43461 for ; Tue, 8 Sep 2020 16:57:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED073208FE for ; Tue, 8 Sep 2020 16:57:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ugYmjN2x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730701AbgIHQ5c (ORCPT ); Tue, 8 Sep 2020 12:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731789AbgIHQ5M (ORCPT ); Tue, 8 Sep 2020 12:57:12 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B451C061350 for ; Tue, 8 Sep 2020 05:33:38 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id z23so22196440ejr.13 for ; Tue, 08 Sep 2020 05:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sN4+mZ5uhIAG0/WLkYctbIQcbAJtPn6Wi3GZq31qSIg=; b=ugYmjN2xSHhF+21F3d6hVWxMmiUDsryJHIXuwRUHRfhQ4TYfF/9IpxodOQvAjPwnrN KYGdkGCLqQgm9tAA6RaKgQALDbF1Y+Cn+PsB/1XAaBeUMoTNKilxf92q7/WiZxmXyO3n yR9eS3xfO/9Pg8zEzTGnoj59wcp+w/zE4FztcOxZhmW6/74rwJ4GapCfZ2wzJnSLmPFP StSHAYcGuP0QuR96/3HVpfU1mGfHnbHCXPHLCXN/Mrdf/g+22eWx5vM0gfLgQme42lB+ BgXWfzPbr0Ip5OzxRgOsw6ywurxu4bv2EyqV3k6B5UiNvbYCYsW7TNOwS+WH7skgLnrZ 4t4A== 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:in-reply-to :references; bh=sN4+mZ5uhIAG0/WLkYctbIQcbAJtPn6Wi3GZq31qSIg=; b=kjkf+GMYBiCNakFNwQEb3eyuBfL8S41roOqNB22Nj3JtTPUjl68MvZBEQSaSh/QNm0 c3HZIMYNqMRztkCbZPnyi5xC87A4TYKDjnb7IaiZH2cAxYILAvgBo5aFXqdT4ieU554d JFCX1XMjUO1QsU+TcazWAeB7WXXQrk6KtIfzgeqherBgPvw+QybpSFItsNbE5TcC3Wil Xyo6Pep0PWdEsajcfGR79JFo33ReKMk1qwF9jqc+2TfHPcIb+QtK8UwdQ4QjtFOy9DyV KGlt6JjfJWvdFgTFInHedtncpbDAa2WX8W+rRpugfwipVin3UAyUQKTktksrnhu7LZz9 oX3w== X-Gm-Message-State: AOAM531huvSmlIbFE7WBaxxl8p2BNU8GwncNeXeH1+yTNRwiqtYv/NnT w0EIkzkPyar9qUWCJnNpUXCEe9IFr4/Lvz2X X-Google-Smtp-Source: ABdhPJxHtd4i992YKOwmkNVnGZRsMiLfUfV15eGwYacP2ySW3da2CW4AtHELAQrxAQUN07P6vV4aUA== X-Received: by 2002:a17:906:e103:: with SMTP id gj3mr25132826ejb.153.1599568416595; Tue, 08 Sep 2020 05:33:36 -0700 (PDT) Received: from localhost.localdomain ([195.24.90.54]) by smtp.gmail.com with ESMTPSA id y9sm17499744edo.37.2020.09.08.05.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 05:33:35 -0700 (PDT) From: Stanimir Varbanov To: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Paul Kocialkowski , Philipp Zabel , Hans Verkuil , Mauro Carvalho Chehab , Neil Armstrong , nicolas.dufresne@collabora.com, Stanimir Varbanov Subject: [PATCH v3 5/6] venus: vdec: Use helper to get profile and level Date: Tue, 8 Sep 2020 15:32:20 +0300 Message-Id: <20200908123221.2793-6-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200908123221.2793-1-stanimir.varbanov@linaro.org> References: <20200908123221.2793-1-stanimir.varbanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Currently the returned profile and level is not aligned with v4l2 ctrl id. Correct that by use the helpers which translate the v4l2 <-> hfi mapping internally. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/vdec_ctrls.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec_ctrls.c b/drivers/media/platform/qcom/venus/vdec_ctrls.c index f3f41c1baa6e..974110b75b93 100644 --- a/drivers/media/platform/qcom/venus/vdec_ctrls.c +++ b/drivers/media/platform/qcom/venus/vdec_ctrls.c @@ -42,9 +42,8 @@ static int vdec_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl) struct venus_inst *inst = ctrl_to_inst(ctrl); struct vdec_controls *ctr = &inst->controls.dec; struct hfi_buffer_requirements bufreq; - union hfi_get_property hprop; enum hfi_version ver = inst->core->res->hfi_version; - u32 ptype = HFI_PROPERTY_PARAM_PROFILE_LEVEL_CURRENT; + u32 profile, level; int ret; switch (ctrl->id) { @@ -52,17 +51,17 @@ static int vdec_op_g_volatile_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE: case V4L2_CID_MPEG_VIDEO_VP8_PROFILE: case V4L2_CID_MPEG_VIDEO_VP9_PROFILE: - ret = hfi_session_get_property(inst, ptype, &hprop); + ret = venus_helper_get_profile_level(inst, &profile, &level); if (!ret) - ctr->profile = hprop.profile_level.profile; + ctr->profile = profile; ctrl->val = ctr->profile; break; case V4L2_CID_MPEG_VIDEO_H264_LEVEL: case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL: case V4L2_CID_MPEG_VIDEO_VP9_LEVEL: - ret = hfi_session_get_property(inst, ptype, &hprop); + ret = venus_helper_get_profile_level(inst, &profile, &level); if (!ret) - ctr->level = hprop.profile_level.level; + ctr->level = level; ctrl->val = ctr->level; break; case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER: