Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp782858pxu; Wed, 7 Oct 2020 16:14:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzygC7NH93MtexXSyUn0uJhL6bED6HvjjlV4vDdRvLuHvDtMIpRs1VWhvO4fBfGIf/GIjBj X-Received: by 2002:a50:a143:: with SMTP id 61mr6181539edj.57.1602112485105; Wed, 07 Oct 2020 16:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602112485; cv=none; d=google.com; s=arc-20160816; b=OCBWUm1EGfx12jhkVU5++W7X6/wWnti6MWrtLXxez6VIWUb6wuwbjVp19sLYr2a0dn L3jRvkDFbyYJpy9oTrv+XxoHkJimgxr7A6o97FyqqB0iEaSdzXpJSX+XuJlIRmhc1FA1 /DjvdDbIKdpDQGX2+xp7nrWQCzfw67NZLIMeWns/JG/PGLKOEZ3SMMCmamZMdAy+rSdI H9VEFK+4C2C5fvoriUuUOytvzqemLbnu+jSKs62ygFxePoGFaPmzIRwcVQoVsZkgkyW3 MwPavbZWf40AvhtGzc1OxyIElhd9FduEOW52whRvDhSl6pZtmbW2mvhgODkJaZjKWwx4 J01g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=y/Hs4nN28QIPh7k57IFR93DTFtO3KcbPd/P4OgQym4s=; b=Sn3cGzbnlkc7sPpTbeqxhx6fNC7iGG5wn8OHjolpdVKK32kcCyU7KLyHtI1Jp8emJh nWLSWjtq3dKk7byigkOuEUk75x9qpF4fKA/ruA+NAssvPbVFJGXJAaKw5x1Ndz/sepOP Me2CFHNNDB6jr7xgSzabeCHC7NUHZJvVfa0s0Wp/w7us3qk5ml5nQ7g5s/Kia9ivpSID rdkB0nfMkNS6cFwl5UjnkN6+3JTasOExZ1zH506Afhrm61CGu8IPgcxaxAgMsRGi9OcV 4yZBPSMznvn5V4/+gK8Mo03bKRtR6BG/b57uYr3S+ZKZGRc3i1doM+BJcfGrr/WwUS51 P8eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=MiV4aB37; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f3si2478349ejz.386.2020.10.07.16.14.17; Wed, 07 Oct 2020 16:14:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@mg.codeaurora.org header.s=smtp header.b=MiV4aB37; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728479AbgJGTxS (ORCPT + 99 others); Wed, 7 Oct 2020 15:53:18 -0400 Received: from z5.mailgun.us ([104.130.96.5]:10682 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727773AbgJGTxS (ORCPT ); Wed, 7 Oct 2020 15:53:18 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1602100397; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=y/Hs4nN28QIPh7k57IFR93DTFtO3KcbPd/P4OgQym4s=; b=MiV4aB37vAEFnuWmA+BtxenghxTOj/ERzjU6qnvuVj+8SJf01DW+iR+qNQXOnJSHP1FIVJLs AOcPLMOxbtZA4D/9QOfwAwEAmyC3oSV4GRO0msGuveFJLkAukIIupeEbwNe+lGYTmXEnQjCr 0Juf3QKLIq2A+2jXb65wzIiXl1E= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-east-1.postgun.com with SMTP id 5f7e1cadd63768e57be386d0 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 07 Oct 2020 19:53:17 GMT Sender: vgarodia=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 322DFC433F1; Wed, 7 Oct 2020 19:53:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: vgarodia) by smtp.codeaurora.org (Postfix) with ESMTPSA id 73E20C433C8; Wed, 7 Oct 2020 19:53:15 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 08 Oct 2020 01:23:15 +0530 From: vgarodia@codeaurora.org To: Stanimir Varbanov Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandre Courbot , Mansur Alisha Shaik Subject: Re: [PATCH 2/3] venus: vdec: Make decoder return LAST flag for sufficient event In-Reply-To: <20200928164431.21884-3-stanimir.varbanov@linaro.org> References: <20200928164431.21884-1-stanimir.varbanov@linaro.org> <20200928164431.21884-3-stanimir.varbanov@linaro.org> Message-ID: <5a823acc60d4c5cace1d2562adc548ff@codeaurora.org> X-Sender: vgarodia@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stan, On 2020-09-28 22:14, Stanimir Varbanov wrote: > This makes the decoder to behaives equally for sufficient and behaves > insufficient events. After this change the LAST buffer flag will be set > when the new resolution (in dynamic-resolution-change state) is smaller > then the old bitstream resolution. > > Signed-off-by: Stanimir Varbanov > --- > drivers/media/platform/qcom/venus/vdec.c | 41 ++++++++++++++++-------- > 1 file changed, 27 insertions(+), 14 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/vdec.c > b/drivers/media/platform/qcom/venus/vdec.c > index c11bdf3ca21b..c006401255dc 100644 > --- a/drivers/media/platform/qcom/venus/vdec.c > +++ b/drivers/media/platform/qcom/venus/vdec.c > @@ -634,6 +634,7 @@ static int vdec_output_conf(struct venus_inst > *inst) > { > struct venus_core *core = inst->core; > struct hfi_enable en = { .enable = 1 }; > + struct hfi_buffer_requirements bufreq; > u32 width = inst->out_width; > u32 height = inst->out_height; > u32 out_fmt, out2_fmt; > @@ -709,6 +710,22 @@ static int vdec_output_conf(struct venus_inst > *inst) > } > > if (IS_V3(core) || IS_V4(core)) { > + ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq); > + if (ret) > + return ret; > + > + if (bufreq.size > inst->output_buf_size) > + return -EINVAL; > + > + if (inst->dpb_fmt) { > + ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT2, &bufreq); > + if (ret) > + return ret; > + > + if (bufreq.size > inst->output2_buf_size) > + return -EINVAL; > + } > + > if (inst->output2_buf_size) { > ret = venus_helper_set_bufsize(inst, > inst->output2_buf_size, > @@ -1327,19 +1344,15 @@ static void vdec_event_change(struct venus_inst > *inst, > dev_dbg(dev, VDBGM "event %s sufficient resources (%ux%u)\n", > sufficient ? "" : "not", ev_data->width, ev_data->height); > > - if (sufficient) { > - hfi_session_continue(inst); > - } else { > - switch (inst->codec_state) { > - case VENUS_DEC_STATE_INIT: > - inst->codec_state = VENUS_DEC_STATE_CAPTURE_SETUP; > - break; > - case VENUS_DEC_STATE_DECODING: > - inst->codec_state = VENUS_DEC_STATE_DRC; > - break; > - default: > - break; > - } > + switch (inst->codec_state) { > + case VENUS_DEC_STATE_INIT: > + inst->codec_state = VENUS_DEC_STATE_CAPTURE_SETUP; > + break; > + case VENUS_DEC_STATE_DECODING: > + inst->codec_state = VENUS_DEC_STATE_DRC; Video firmware would raise reconfig event to driver even for cases like interlace detection, color space change in the bitstream. If not with this patch, we can optimize by sending reconfig event only for resolution and bitdepth update, in a followup patch. > + break; > + default: > + break; > } > > /* > @@ -1348,7 +1361,7 @@ static void vdec_event_change(struct venus_inst > *inst, > * itself doesn't mark the last decoder output buffer with HFI EOS > flag. > */ > > - if (!sufficient && inst->codec_state == VENUS_DEC_STATE_DRC) { > + if (inst->codec_state == VENUS_DEC_STATE_DRC) { > struct vb2_v4l2_buffer *last; > int ret;