From patchwork Thu Jul 5 13:03:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 141130 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1920245ljj; Thu, 5 Jul 2018 06:06:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdyBxAW/He1ECWg3JDAVlj/KBTxs3sry48TrxM/9nzT5hOVoRcolWx/I7Uxma8sgKESP5jX X-Received: by 2002:a17:902:6b86:: with SMTP id p6-v6mr6170804plk.75.1530796005161; Thu, 05 Jul 2018 06:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796005; cv=none; d=google.com; s=arc-20160816; b=INKK0wwLl29df6xLbxTNQsvJwbdWOY3P6D/5RS60LTcvunoaA+EZtZtVry9qA7oOHn JLuAmVVWZpV1/9ctGJI/KtktVG7EqjJ5vPKnOng2bjxzg/NdjNc8wxWb1+l9CxmfsN6F 6N7h4jZ6PxC70W9xWqA++GAtRVuZZsm/WFqhAxACRB/v7pCw/3ySPLWLvADiN5FbS3XE hZxacxM8B0xG+yczAl2NYH8sidShlUetUZwoFnhYRs2are/oE2HI89w13lodK6qebQZs y634GMcM2ANIHFNPqiz9MgdVlfwApEjFaD3j6tQU81ubqRAF41i6dBe0BtpJcmDsXH6Y lRfQ== 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=rLJrcqwr+U5qiHZwf9V1nV8FSGGmPF39OlgIgvisi0Y=; b=A2zznUbjXUItk1hH08pOOLFspgTBStPhBY4tq8fLzi6Jr1wGeiteovrckHg1VV6siJ wVAy0IBIjNGsApRtUq9Nu/JgIhG9QWNwLbz+R45FKDJRdbkkAwgsDWL1q65rkkp1e7Hq U2GRLYl4/v/5jZgc4qW6+56hwThq8PN6z8QyIZ4M/F0vDKS7oNGNIqLA3sRWZtM0DQyV LOqSeG4QKHBMHxA7yqXNsKVOpM2wpPsGlbAPjoQZjjL9+HS7bwne08rmBoGARuFpv7NH 6kyS/t9wSsXH7L06Zc9FDeECCjNGGkmG/WTeACr+AIZXewEQAHcJwaP1BzZ/13ELlSGm zXcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W8h3Sbse; 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 144-v6si5614291pge.406.2018.07.05.06.06.44; Thu, 05 Jul 2018 06:06:45 -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=W8h3Sbse; 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 S1754511AbeGENGm (ORCPT + 4 others); Thu, 5 Jul 2018 09:06:42 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42515 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754514AbeGENFd (ORCPT ); Thu, 5 Jul 2018 09:05:33 -0400 Received: by mail-wr1-f68.google.com with SMTP id p1-v6so1140637wrs.9 for ; Thu, 05 Jul 2018 06:05: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=rLJrcqwr+U5qiHZwf9V1nV8FSGGmPF39OlgIgvisi0Y=; b=W8h3Sbseb4M64faQQYVpYCbdPFDK2sCzxH6W9HJ/1gIxHkW8YGwfAHAf8xPw3KoPwA SPdtQITGN7GqvSXfP5Z1YpcALRpd6Toea1eNjgAUWbELsfj1yIc3B1EtVOF9b5y3U7FT zFU7coTLaWYJTwNZqPbZ88O85maTjP3EZbsMI= 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=rLJrcqwr+U5qiHZwf9V1nV8FSGGmPF39OlgIgvisi0Y=; b=c3FWclUJnYSCvYSUq+N6XnQk96s/wBBFeLvCMkDGX6FKn5kGuV8evjD6kv3Z/Ylvui HZW5s1mvv6qOzmnkbTfzae27eM5kjs0YNfbrvv3UNqkO/Pe5qaJrY9eeCnqbU0rlv4nD KbxrizeUug+ebou/Ik9EN/4YB9FNSTa6CZvw9gRrDSoz8SxPSCOnK8sHZTaG8xh+SNBb iuNnapOkjEYLyGh0sUumXs6/fdeV8LQbtbex8aXprzEXBBbj6XszXy3PWlksUu5YCiGX d1PIbUYJ3ZsZq9FgXhC5MuqFhD3fyuSL3jTYGzIIjj4SYrCDI9R/Ny9Fbx6By4stSp6H G4QQ== X-Gm-Message-State: APt69E3HXUMfB7zj8yqIZbuHYI2BzUsdw2P1uAZZPPhjkU2Egn/GQsuU MCmGMMCE85eQ41fKL7m9R1TyiA== X-Received: by 2002:adf:9f0f:: with SMTP id l15-v6mr4654445wrf.206.1530795932574; Thu, 05 Jul 2018 06:05:32 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 11-v6sm2109102wrw.67.2018.07.05.06.05.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05: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 , Tomasz Figa , Alexandre Courbot , Stanimir Varbanov Subject: [PATCH v5 23/27] venus: vdec: a new function for output configuration Date: Thu, 5 Jul 2018 16:03:57 +0300 Message-Id: <20180705130401.24315-24-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180705130401.24315-1-stanimir.varbanov@linaro.org> References: <20180705130401.24315-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 | 34 ++++++++++++++++++-------------- 1 file changed, 19 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 c98084f51e5e..11db3074d1a5 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)