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: 134084 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2191026lji; Tue, 24 Apr 2018 05:46:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx492kyWyMFEa7uslrkG5b234XSHqbSVTtGCpfWuJjZv96CiApCVQn0X9KvfA1ZUTBVjoTRuh X-Received: by 2002:a17:902:290a:: with SMTP id g10-v6mr24848479plb.155.1524573964461; Tue, 24 Apr 2018 05:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524573964; cv=none; d=google.com; s=arc-20160816; b=eUn/26g+IN+7t8M/lEedc2okCBAX4oo3BAJ9WQTh00fTnrXlYZHoz8/0JCa4HBFyyD mTJrqXxtJqR9S5O9qrhiQu0wzsgQzS1AGj5R8G5oU1yxNItrJx2+eJ05i7TZT5LvXzpJ mvoPGVseam1zm/8TmVe39rZ+gDMbYLU2U6qq5Bj7I91NXERPtbEMHLgCNSc1x7hZKfSh bXZu7268KRY8kHgDPl63I+QO//pQbt/a/ozDJVCRVTfPvRAdue3EipVq0Vk8XVCBIk1o NqTnEtz+WQBTCcedWth5j6UfxGDe3Oj1vDY/9Aldm7u9HV+9YhDm8st8rhuXhIY4DhnR E/Aw== 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:arc-authentication-results; bh=UolRG5OvAvAIOuK0bz7bLwswjFzqGxFCL6c8QvZu3g8=; b=TUnozsa+e5HRq8Hpc93rMbM2p5G9XbHs5hh5AcxrSWJE/prUc8gTZpws3yJpLADBW5 Oz8V+8h75DbhuLd2Lve6XNuRlErKznK7O8ynWlcaY2J9H99nQzLo1K6iqVH2BhgMdWef nWGBgdO10h2BR1/TQ84Y6T5VPbXA9rdeLeadL10F/P+nGV7GOWbmvI2T1XaedTFM0cV4 NHEkiLBN+yYIVswFAGB9xHHrg2TMInstr1V5dVBAbDTP1BZRAR0jgQbxtSaX8mElVrKk UJPBqAu30G91gx/8COPGQQdz7s+srMB0wL6x9oxWbMmY0f34BT8GA1ZjJ55L8SghxR3c tTig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aGPi7t2f; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id n86si13583346pfb.126.2018.04.24.05.46.04; Tue, 24 Apr 2018 05:46:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aGPi7t2f; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 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 S1753182AbeDXMqB (ORCPT + 5 others); 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-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 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(-) -- 2.14.1 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)