From patchwork Sun Dec 20 09:31:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 346265 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp3611121jai; Sun, 20 Dec 2020 01:34:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMSernwuX0rWTSFi8FXNg6eacTYcQYGEKgLCZznnTb8Uyh3d0jzw01vK6N4k0hRoIOGTng X-Received: by 2002:a05:6402:318f:: with SMTP id di15mr11757927edb.237.1608456894920; Sun, 20 Dec 2020 01:34:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608456894; cv=none; d=google.com; s=arc-20160816; b=PnmO4cY4GZAw750dISjtinShLZRL3Wdsaffs6widNBgd/OOXFb6p1c+RQXOurUB5pW 6+yXgGaZhfJkBUKu8pqLwyUbucVLwh9FE9O4tjeyP1VE8ON/lkVnNWKj3iBRDLjNRjLo aPWUcpPjUnL+vRvF7Qru1XOCvvGOH28XNoLzVUvWCyBRmwZDizA6FjNXVoKAGN4zc5Vk 7Kkm0vlnVJDhtIGaiEqJiQpKckdczZXiJNc0MMSEqf7pDy89ySKoWwQMnBF+4yzF+4Ql qgNi9+dMkQhlSnCdEy1wjP9kNsf/I//jVm8F0YEWk4q4KYCMpfI4QeenaWh2mnoRqFNB BjaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=DEs1jlqfRpmRp1QgU14zLhiXveVi1mzRfOntspJCdks=; b=dirQwfea1m70fo4rgbPEKl5tg8y1rqqXpmfMguSk6pj/MtXSsZ1PXUkJU6sDYfOXbW eINhOxpmKBsE+yPzgcOXDUoXE3nb5rEmqnXfCDI/9BE5fnSlTLmnlxjhhqeCWUOoE+yn 9ZGQygugN4xF8fbKRzqX4RI7dxK76F8wXFhhB+PMWyFkE0ElgpjedLnopCov46nTfm4E 1QVRNJFocUA54xaWxWRpFjP5gD5QSKruQ99EgjZfMSnHrEf5NrsYmYIrbxEMO7T5chu3 MKRzeYYGVE4B2yr0qB+LHQ7AyVOpXrU0Ib+oEl7e0SvwEYXEYqKOFEfV19IJz8G6KkYl bTnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=orl0kZnm; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id jg19si7151815ejc.365.2020.12.20.01.34.54; Sun, 20 Dec 2020 01:34:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-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=@linaro.org header.s=google header.b=orl0kZnm; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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 S1727429AbgLTJeQ (ORCPT + 4 others); Sun, 20 Dec 2020 04:34:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727377AbgLTJeO (ORCPT ); Sun, 20 Dec 2020 04:34:14 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC6CBC0611CB for ; Sun, 20 Dec 2020 01:32:53 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id cm17so6763204edb.4 for ; Sun, 20 Dec 2020 01:32:53 -0800 (PST) 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=DEs1jlqfRpmRp1QgU14zLhiXveVi1mzRfOntspJCdks=; b=orl0kZnme9l+fSwfq5e9A2EEgrbjubKmvQbOTNY8CScosT9Xk5vgZWmBaHn1kkj5my 9xFP52PSre+xRstUWHc7lghm5waUTIV+WnKSO7SoICuRuzYMHl5K316J3LNsCiY54wLU sZ7xd/0C0yVaZyEYVpBmNlsAuM4xF5SdwXY4GOdUHi1jzHB+W7V9TAhIZXeyzSb8SmG5 vhM2Kix9934u3reP40/XW70vqV8/226ex5Wg/ElA6WBrCiJqHPZ+4OMlkspgnN9HbOP4 JppWLFoek7j7nulrzeZhm9FkGLAZZpAIXmZZ54DP3FZ17YTJJ0Y9QGk3Or/8K93jVGFG F3OQ== 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=DEs1jlqfRpmRp1QgU14zLhiXveVi1mzRfOntspJCdks=; b=GemXLE8suX5xoJurczeIvuvs/NzN/RPYk7V2TbbjPm25xQ8pJuXhnZenffh8bwcemN 55GcvDLRimu/IbbC25Oxs5aDETj9x286UIplhMIss+78LKIrna0d/NfEFpkwCiLxXDOr Z0NxghU2nQgluZVHBhSkfJ8dUUBuvHiIoO61D+ctZgR7HUf4uMV2dkV33i0Vj09Fs062 xHHS8JIMG+NRGyXV0n9qzpImZQM+78KrPEakOL9a4qM3n5+In2cU3e22IHbHtKmRo4qt nZYhd+ErIyIloC/m6yy6mmHJ5puQ7pHRknjZgOPq57BnQytQ/stUdCbMKuSaJXUciClH GzXg== X-Gm-Message-State: AOAM530WFqaV33Vdu80m2Z2POVgwTgXZ7yVeQYcbu/xhVvGQ0UUhU/f2 VEVoeMjnpKxYuqQpUHi8Hlh1TfKY6xjOPnCu X-Received: by 2002:aa7:cac2:: with SMTP id l2mr11618071edt.141.1608456772331; Sun, 20 Dec 2020 01:32:52 -0800 (PST) Received: from localhost.localdomain (hst-221-118.medicom.bg. [84.238.221.118]) by smtp.gmail.com with ESMTPSA id z12sm7769814ejr.17.2020.12.20.01.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Dec 2020 01:32:51 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: vgarodia@codeaurora.org, acourbot@chromium.org, Fritz Koenig , Stanimir Varbanov Subject: [PATCH v2 2/5] venus: vdec: Make decoder return LAST flag for sufficient event Date: Sun, 20 Dec 2020 11:31:27 +0200 Message-Id: <20201220093130.10177-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201220093130.10177-1-stanimir.varbanov@linaro.org> References: <20201220093130.10177-1-stanimir.varbanov@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This makes the decoder to behaives equally for sufficient and 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(-) -- 2.17.1 diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index eb94e167e282..4ce23c2fc6eb 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -637,6 +637,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; @@ -712,6 +713,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, @@ -1346,19 +1363,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; + break; + default: + break; } /* @@ -1367,7 +1380,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) { int ret; inst->next_buf_last = true;