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: 249302 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp4723763ilg; Tue, 8 Sep 2020 09:53:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlTR9vbDfWlhLZpO7QcvpeaNqnM78S9j4gWj7Q1KbU3HpRQo/t51OgcGBP3mqlxty3PQmK X-Received: by 2002:aa7:db47:: with SMTP id n7mr23944333edt.315.1599583984313; Tue, 08 Sep 2020 09:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599583984; cv=none; d=google.com; s=arc-20160816; b=OKEg0mvgDGYZwSdOGZsBlO7Mg0kL5BCL9iABU5jNNDPDqjjCwmRs6KKR/CHL4x9tfG O8bhdcuT9gUgXhe+fD7aE2hnvlxGrkv6HEBhNrFB5yUQiDKb9qJzZRU1n5CG2q5jcUYk +NKrFz8C/7GHHiYB4W4hjHk0TQIO1GQ+S02fb7kvZQKPQFpvZQggP/3hxvKuKvIaIkz/ Zz4qxG8vSTHV8ukfdVSw+RTBoyCnsm2trf7U1tgFhvxk8zKjh4NBmFY7bs1AzUm8OlEQ 1dOjloL4oILJ7kD7GXjrc1OWC7KIfNWQkH9HsIrU+OZuSauLW40bs12xHWV243cSyKlc 0X/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=sN4+mZ5uhIAG0/WLkYctbIQcbAJtPn6Wi3GZq31qSIg=; b=MDza9LTIWdyn4mKOb8XzQsWjoZWjgRBYKQ0OWdCbtOYW8rEHkMf9fWh7swQKTt52Ln 2ftQtLb0wal986hz4ki1NPJfqv0J6/JKB3PMIHWInj4aBSaivSPQTxbdiwfYo1pHf7AN P+nHKvt62qgJ7BPFaOa0SF902itmp8mVa27fOln/p95mbhcrEL4Zruzm4gSK+7v9ZelQ CyJpegTA/EeYqVh96hw+bANHtxKjJaUl17vpzU5mkiJII+o4lP9EqtoCklklmkl9lMU+ QQ+8uqsrCWzu21mnjwJo3Jb04YzuiT6x8Pa8pPxepetrhOPQqFT4tH3r8lm17cmtu10P iYvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ugYmjN2x; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k14si11871695edr.96.2020.09.08.09.53.04; Tue, 08 Sep 2020 09:53:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ugYmjN2x; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731909AbgIHQwm (ORCPT + 4 others); Tue, 8 Sep 2020 12:52:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732090AbgIHQwM (ORCPT ); Tue, 8 Sep 2020 12:52:12 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8633C06134E for ; Tue, 8 Sep 2020 05:33:37 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id o8so9060383ejb.10 for ; Tue, 08 Sep 2020 05:33:37 -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=QPdF48VHTZY9F0qP4s3opYXKFzcKcl8RguwAMhPt+zep0PsXZwZwEwWiGR/L6OB2oC +OKKxTxTfy1QPTDxv0+pVmZ+Yl1I8wTZIFnF4GZHlsc/aUYEzFGcEHmNnY1C+Ez69LbT IyoHE4TAuxmk1xhmBNUc3xJA+FS7aTefDsWWUXYb9vwN5WBhAOC7FS4zC5NomKpIFuGi GHMTRZ622/xi5QupbDsWTnxtigyKFoBMnN0titqj9re2KDPjewB9J226WlLt5zY26F5L 53o4VNhuK3rH1FUDMXz8h9aQ2gED8t01t4NuExHKEtYsI+dpFLFi/DPHpZ7KOXqkmCz+ AnCQ== X-Gm-Message-State: AOAM531ruXIPP01dV9x0DDPJamGQybDPv8RieAw8Pg+rPk1MvNVfmnJK NIjqagkOLB36vnordh2DH/e0Aw== 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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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(-) -- 2.17.1 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: