Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp3365294ybd; Fri, 28 Jun 2019 07:24:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4ow5loe5+OqRXl9ac/nGJDOryhDf8zgug1rsCpfIVLMJrYZM4JrtZOTNu3gzano7mXm00 X-Received: by 2002:a63:f648:: with SMTP id u8mr9556171pgj.132.1561731865353; Fri, 28 Jun 2019 07:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561731865; cv=none; d=google.com; s=arc-20160816; b=ip66cFdPORpl1bP/hWO9HalYVviqDvi78pIcJu2ClzNSwQqAiZ0kKMfdO59E+RuPzJ zNiezJ5g/oUL4miaB3stL1J/wWXk24+KR12u8MhCvsyii5+bm3D1qWbFCEJRbWRz43sZ micKz1iqghqL1x7DAYWXGXiRoyr9EERjn95B4LjZsLDJ70CB9C7w3TH08GEKUwPXmEfI 473471PRYcmDzIVCLdxu+Qb5AWcrVcgOddKpnpatvOyq0heXYSnE/CYKIWNibZNVUDPU ZVN1cyYJq+XKdHywgD9kCFNLlOtm+SwVqQTFuOJxC+pzrWye+cF4oQ0VrjwG+QHc63Ck Oadw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=jazJikWs53JblJlge+x05wz6lsgoAUTPWWDU+NDItRg=; b=rFAK/MiZ1yrB3LFLOuEw57uLjtU4pZdeneK497pX9CoIdCRwMXvovdVvd3yFroKoys qB67aMcmDJUrY31ajQZOUXTn46/lnKBS1yM769jmzVdzEVfJaHaI6zssrRwE147yJ2+4 SpG8KtwtCXEfsLFn/NcZ+mieNTXmR9A/3pMtn+PumcL19JOAO/TbIJD6NQfzjcnRQjQ5 ArDIqrfmj34QiKWLkTrA3wwAB3ZaOIMSuCAC9rN32pSnPkcDIRVXVJceuGniviwPlRrK clBpZaozRLJZ+SJNO/6LRc0V0gTl6VwRK4+wkjMoufp/ic7G0wt3ZSiLc5fkJMaw9GrB hF1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kbu36oBZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 3si2414132plp.31.2019.06.28.07.24.08; Fri, 28 Jun 2019 07:24:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=Kbu36oBZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1726770AbfF1OXv (ORCPT + 99 others); Fri, 28 Jun 2019 10:23:51 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:43574 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726669AbfF1OXv (ORCPT ); Fri, 28 Jun 2019 10:23:51 -0400 Received: by mail-lf1-f67.google.com with SMTP id j29so4068966lfk.10 for ; Fri, 28 Jun 2019 07:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=jazJikWs53JblJlge+x05wz6lsgoAUTPWWDU+NDItRg=; b=Kbu36oBZoqBFezbtClxt+7rC0ANG3Cj06iz8OVSOF4191OklQuxrnD+19u2OgMYbQx xiRDzVRFdcvIIoi4ps9rZIN8X0A6u9C7D+DG3kStsajBj+h55epUXs5gwZiUEqoZeCU4 Gb/HC1RbRN30dDLjlISaiwLNG3faT6bx2ME+KDZexW6tVZcxsANT+BfkF7f5LAbIohvH wUMipnw7PYTqQyzmXu3ZhtLus61whF5i6Dpg9m0Q61hCrrLypUnpZJBUc3Fyg+awBa3t i8Q+NfFQRELjO5MCd6w0dyL5mEK7JZYeGnryA3iy7OnCvSmSbVTIr5tt1A91ls3scgtz sGWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jazJikWs53JblJlge+x05wz6lsgoAUTPWWDU+NDItRg=; b=o6LAmFq9G0mE4ZssueeaJSKqtFDPR0FNkKg4DuL+jHCyEH+/cjSlSO2O1o8SwI99ZS CxjEBOWOcUiGyIC4KRmRsVWxSD+a2A3MRnjAAXFKjJR5VQ2vl48s4FAH0L4MVCdnN7rN mfldIHEQ1kWhSfkcp9bd/vPh+zhNRHFBUsWC1QfPsaklt6dtlVLUkjGXPt4ZfUHoq039 5upKmm6ojUCvSHXHqti3ldtgRTia3wOT6zSfyQgVJR+SvUWTqT1mdESxDknzNMSByJO8 MLFgUK9VCbf1DNzCjkuThezm0bp9HTwdmjsd307LlMhE1sPwgQ0zttmcipfNlscEcALC kksA== X-Gm-Message-State: APjAAAUV3b+LL7SVM7vyMGpjUJkbulL87tiGd13ikEbVHPF07q6M1wJ6 9wNilhCG+IIJBcB1AYHHRpE1lA== X-Received: by 2002:a19:7716:: with SMTP id s22mr5136656lfc.64.1561731829204; Fri, 28 Jun 2019 07:23:49 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id t63sm762337lje.65.2019.06.28.07.23.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Jun 2019 07:23:48 -0700 (PDT) Subject: Re: [PATCH v2 00/11] Venus stateful Codec API To: Hans Verkuil , linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Tomasz Figa , Alexandre Courbot References: <20190628130002.24293-1-stanimir.varbanov@linaro.org> <9c3399a8-4fc6-3117-10ee-3395cee034da@xs4all.nl> From: Stanimir Varbanov Message-ID: <997204c7-c702-868c-9a49-52fefc9ab3d2@linaro.org> Date: Fri, 28 Jun 2019 17:23:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 In-Reply-To: <9c3399a8-4fc6-3117-10ee-3395cee034da@xs4all.nl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hans, On 6/28/19 4:37 PM, Hans Verkuil wrote: > On 6/28/19 2:59 PM, Stanimir Varbanov wrote: >> Hello, >> >> Here is v2 of the Venus transition to stateful codec API >> compliance. The v2 can be found at [1]. >> >> Changes since v1: >> * codec_state is now enum >> * dropped IS_OUT and IS_CAP macros and use vb2_start_streaming_called() >> * corrected g_fmt and reconfig logic >> * s/vdec_dst_buffers_done/vdec_cancel_dst_buffers >> * use v4l2_m2m_ioctl_try_decoder_cmd M2M helper >> * various fixes to make v4l2-compliance pass the streaming test >> >> To test the streaming with --stream-from-hdr v4l2-compliance option I have >> to make the following hack (it is needed because the size of decoder input >> buffers (OUTPUT queue) is not enough for the h264 bitstream, i.e the driver >> default resolution is 64x64 but the h264 stream is 320x240): >> >> diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp b/utils/v4l2-compliance/v4l2-test-buffers.cpp >> index c71dcf65b721..dc0fcf20d3e4 100644 >> --- a/utils/v4l2-compliance/v4l2-test-buffers.cpp >> +++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp >> @@ -1294,6 +1294,11 @@ int testMmap(struct node *node, unsigned frame_count, enum poll_mode pollmode) >> fmt.s_sizeimage(fmt.g_sizeimage(p) * 2, p); >> } >> fail_on_test(q.create_bufs(node, 1, &fmt)); >> + >> + for (unsigned p = 0; p < fmt.g_num_planes(); p++) >> + fmt.s_sizeimage(fmt.g_sizeimage(p) * 2, p); >> + node->s_fmt(fmt); >> + >> fail_on_test(q.reqbufs(node, 2)); >> } >> if (v4l_type_is_output(type)) > > Does the venus driver set sizeimage based on the given output resolution? Yes. > > E.g. if v4l2-compliance would first set the output resolution to 320x240, > is the returned sizeimage value OK in that case? Yes. Here are few options to me: - set the correct resolution - set 0x0 and sizeimage at some arbitrary value (1 or 2MB). Despite if the bitstream is 4K it will not be enough if the bitrate is huge. - invent some mechanism to trigger reconfiguration on the OUTPUT queue as well (similar to the CAPTURE queue) > > And this also means that the venus driver requires each buffer to have > a single compressed frame, right? I.e. it can't be spread over multiple > OUTPUT buffers. I cannot say for sure but that is how all downstream cases uses it i.e. one compressed frame per input buffer. I wonder if you fill input decoder buffer with many compressed frames in one input decoder buffer how you pass the timestamp for every packet? > > We really need to let userspace know about such restrictions. > > Stanimir, can you list the restrictions of the decoder for the various > codecs? What you mean? Restrictions like "one compressed frame per input buffer"? -- regards, Stan