From patchwork Wed Jun 27 15:27:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 10492009 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 F410460230 for ; Wed, 27 Jun 2018 15:30:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 391BD294CB for ; Wed, 27 Jun 2018 15:30:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D521294DF; Wed, 27 Jun 2018 15:30:02 +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=unavailable 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 D1516294AA for ; Wed, 27 Jun 2018 15:30:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934441AbeF0P3t (ORCPT ); Wed, 27 Jun 2018 11:29:49 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:39027 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965252AbeF0P20 (ORCPT ); Wed, 27 Jun 2018 11:28:26 -0400 Received: by mail-wm0-f66.google.com with SMTP id p11-v6so5922052wmc.4 for ; Wed, 27 Jun 2018 08:28:25 -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=0nhKxdCOw37kKVgSprpQsFMGs84elFtpX09ZZT6Wn24=; b=UpWC2btWqm7fyWLNH2uGCWcqGVwikWwwYbWpIBKU4T2UpHHCrEk0EqBvmZo8WhBzJX qnxB+4J8UeQ+LQHXMlxokOz+n8mZ31rDOd7L1A8HvBHhecafE6keHvqOFu6lz8mWNi/c 4wbBUZ5pIZ5AlZYfMy1KlJ3csdmsFlFpqPObM= 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=0nhKxdCOw37kKVgSprpQsFMGs84elFtpX09ZZT6Wn24=; b=lTB7p0JQ8Qv4NANAzf5AqXmqJoa6pn7HMFE7fE+3ZgOuSvLWdcqfzHl1pN5Mm4W9kM 46f4u8Q+g5Tq4UK0vZYpJRJw+WplsWGG1xdqyiblZf0j9/kudPfVzjh2oOg31VIJxCYF CAFEmoj0YE+xpSe8f4kiQ8sc6jbthEf26pGI71p3S1+GqzQvCNM7uoXSoyeGd32zl9hJ q6jRR7Q/JGjuaxRjeg3J503jUSZGdLUS5j8Yp9cV3mBhXPe3NFlh0GecVqtwpPh0ACqp uMwuQyvkVBD2hTawlVdaYrT1ABC2f7zWErO76B/Uhx0Y291EvaJzJE4GsKFU9evXBF+W Sp6Q== X-Gm-Message-State: APt69E1YoU2Xqe9nG2OykTiREitFuXh6E2lmppOH4aHFnYFyT+DyH9Ef YIxEcigh0sMSiuKsskAaJ0wlMQ== X-Google-Smtp-Source: AAOMgpeG+9S8IVAjeGxSi/efyW/3Iz6krMedxUDAKi6B3beyxKrE7n4e+hsoiFti9bvqJQGCH3s+4g== X-Received: by 2002:a1c:aa12:: with SMTP id t18-v6mr5219819wme.54.1530113305305; Wed, 27 Jun 2018 08:28:25 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id o203-v6sm2916075wmd.30.2018.06.27.08.28.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:24 -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 , Tomasz Figa , Stanimir Varbanov Subject: [PATCH v4 23/27] venus: vdec: a new function for output configuration Date: Wed, 27 Jun 2018 18:27:21 +0300 Message-Id: <20180627152725.9783-24-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180627152725.9783-1-stanimir.varbanov@linaro.org> References: <20180627152725.9783-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 | 34 ++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 55213a8d55a3..4d3f1cd7ed1d 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -545,6 +545,22 @@ 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; + 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 +585,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 +732,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 +760,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)