From patchwork Tue Apr 24 12:44:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 10359485 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 694D6601BE for ; Tue, 24 Apr 2018 12:46:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59F6F28DB0 for ; Tue, 24 Apr 2018 12:46:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EF9E28DB4; Tue, 24 Apr 2018 12:46:04 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, 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 ED1BA28DB0 for ; Tue, 24 Apr 2018 12:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753182AbeDXMqB (ORCPT ); Tue, 24 Apr 2018 08:46:01 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:36596 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757875AbeDXMpe (ORCPT ); Tue, 24 Apr 2018 08:45:34 -0400 Received: by mail-wr0-f193.google.com with SMTP id u18-v6so22545274wrg.3 for ; Tue, 24 Apr 2018 05:45:33 -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=UolRG5OvAvAIOuK0bz7bLwswjFzqGxFCL6c8QvZu3g8=; b=aGPi7t2faDEcV5ALSzPvlpcgiRKW8KzTYqJuQHsv+9dIirW40HFE/dVpq+vzcDPmJC OdvfV6ChXYY6CGJXfLJkBsRlW9VH2ra6fjosz26Q4kWDXCAhCMgRUOwUAjwzmfq5ghfp lm8RJWGMf47Kzo4ZXgFYsGJgFVkine32zs+Kc= 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=UolRG5OvAvAIOuK0bz7bLwswjFzqGxFCL6c8QvZu3g8=; b=oDz8m6wWP0qdyG+MUv5axGJoR02VgrWFvTCYGmqvLPHER4hHwpgpF75Ql7thBMwuzd mcDPuLlwrhXf1yFNoiHBwIELfnxQ5ylO4TRBYajYlldkzGpUdf/L/qHiGgs2H5J0dduP zdK1Y0/MmXhmBmUWsw9GWQiJVGPOvvzOMz/wfyYNkXzod7PV1iEHjukR811usUS12x5/ nmKK6gkf+iy9STTTUrcObiTAWrAj+iBAvQlUMWnLfdMcT4gTOgNBtX5zy3ClW1rz5Lgh sTF4vAfib6JYCfog5PHXy8iBC/+IDAFAvpbEfu3bg8doaNPQD4mC7vKWyAmiXx4AhKUt xE5g== X-Gm-Message-State: ALQs6tAiuTmxwAZ6qNl65QVRhtGv6+smRNVIgTZ5ivbdEeUK/31nAZUQ K4M5SA5xv+tV/SyL3LrhNqREuw== X-Google-Smtp-Source: AIpwx4+zVLNB+pyXxAbQmS0Iuo6iJ1u3iRiTpgHROTlTnVluFdRbaRhSCVa5NbTwm2qxPHoyVESlKA== X-Received: by 2002:adf:bd89:: with SMTP id l9-v6mr18704739wrh.234.1524573933031; Tue, 24 Apr 2018 05:45:33 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id n49-v6sm22666013wrn.50.2018.04.24.05.45.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 05:45:32 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Stanimir Varbanov Subject: [PATCH 24/28] venus: vdec: new function for output configuration Date: Tue, 24 Apr 2018 15:44:32 +0300 Message-Id: <20180424124436.26955-25-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180424124436.26955-1-stanimir.varbanov@linaro.org> References: <20180424124436.26955-1-stanimir.varbanov@linaro.org> 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 Make a new function vdec_output_conf() for decoder output configuration. vdec_output_conf() will set properties via HFI interface related to the output configuration, and keep vdec_set_properties() which will set properties related to decoding parameters. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/vdec.c | 35 ++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 6ed9b7c4bd6e..ced3330c396a 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -545,6 +545,23 @@ static const struct v4l2_ioctl_ops vdec_ioctl_ops = { static int vdec_set_properties(struct venus_inst *inst) { struct vdec_controls *ctr = &inst->controls.dec; + struct hfi_enable en = { .enable = 1 }; + u32 ptype; + int ret; + + if (ctr->post_loop_deb_mode) { + ptype = HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER; + en.enable = 1; + ret = hfi_session_set_property(inst, ptype, &en); + if (ret) + return ret; + } + + return 0; +} + +static int vdec_output_conf(struct venus_inst *inst) +{ struct venus_core *core = inst->core; struct hfi_enable en = { .enable = 1 }; u32 ptype; @@ -569,14 +586,6 @@ static int vdec_set_properties(struct venus_inst *inst) if (ret) return ret; - if (ctr->post_loop_deb_mode) { - ptype = HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER; - en.enable = 1; - ret = hfi_session_set_property(inst, ptype, &en); - if (ret) - return ret; - } - return 0; } @@ -724,7 +733,6 @@ static int vdec_verify_conf(struct venus_inst *inst) static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) { struct venus_inst *inst = vb2_get_drv_priv(q); - struct venus_core *core = inst->core; int ret; mutex_lock(&inst->lock); @@ -753,12 +761,9 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) if (ret) goto deinit_sess; - if (core->res->hfi_version == HFI_VERSION_3XX) { - ret = venus_helper_set_bufsize(inst, inst->output_buf_size, - HFI_BUFFER_OUTPUT); - if (ret) - goto deinit_sess; - } + ret = vdec_output_conf(inst); + if (ret) + goto deinit_sess; ret = vdec_verify_conf(inst); if (ret)