linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanimir Varbanov <stanimir.varbanov@linaro.org>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Stanimir Varbanov <stanimir.varbanov@linaro.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Andy Gross <andy.gross@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v7 5/9] media: venus: vdec: add video decoder files
Date: Mon, 27 Mar 2017 14:49:21 +0300	[thread overview]
Message-ID: <7ae41d9d-d5fb-367c-ea08-c9a1bc818ffe@linaro.org> (raw)
In-Reply-To: <6ea4524d-9794-a9b5-8327-367152c92493@xs4all.nl>

Hi Hans,

On 03/27/2017 11:45 AM, Hans Verkuil wrote:
> On 25/03/17 23:30, Stanimir Varbanov wrote:
>> Thanks for the comments!

<snip>

>>>> +static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type,
>>>> +              u32 tag, u32 bytesused, u32 data_offset, u32 flags,
>>>> +              u64 timestamp_us)
>>>> +{
>>>> +    struct vb2_v4l2_buffer *vbuf;
>>>> +    struct vb2_buffer *vb;
>>>> +    unsigned int type;
>>>> +
>>>> +    if (buf_type == HFI_BUFFER_INPUT)
>>>> +        type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
>>>> +    else
>>>> +        type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
>>>> +
>>>> +    vbuf = helper_find_buf(inst, type, tag);
>>>> +    if (!vbuf)
>>>> +        return;
>>>> +
>>>> +    vbuf->flags = flags;
>>>> +
>>>> +    if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
>>>> +        vb = &vbuf->vb2_buf;
>>>> +        vb->planes[0].bytesused =
>>>> +            max_t(unsigned int, inst->output_buf_size, bytesused);
>>>> +        vb->planes[0].data_offset = data_offset;
>>>> +        vb->timestamp = timestamp_us * NSEC_PER_USEC;
>>>> +        vbuf->sequence = inst->sequence++;
>>>
>>> timestamp and sequence are only set for CAPTURE, not OUTPUT. Is that correct?
>>
>> Correct. I can add sequence for the OUTPUT queue too, but I have no idea how that sequence is used by userspace.
> 
> You set V4L2_BUF_FLAG_TIMESTAMP_COPY, so you have to copy the timestamp from the output buffer
> to the capture buffer, if that makes sense for this codec. If not, then you shouldn't use that

The timestamp_us is filled by firmware and it is the timestamp of the
output buffer which is used to produce the uncompressed capture buffer.
So I think V4L2_BUF_FLAG_TIMESTAMP_COPY is correctly used here.

> V4L2_BUF_FLAG and just generate new timestamps whenever a capture buffer is ready.
> 
> For sequence numbering just give the output queue its own sequence counter.

OK will do.

-- 
regards,
Stan

  reply	other threads:[~2017-03-27 11:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 16:37 [PATCH v7 0/9] Qualcomm video decoder/encoder driver Stanimir Varbanov
2017-03-13 16:37 ` [PATCH v7 1/9] media: v4l2-mem2mem: extend m2m APIs for more accurate buffer management Stanimir Varbanov
2017-03-13 16:37 ` [PATCH v7 2/9] doc: DT: venus: binding document for Qualcomm video driver Stanimir Varbanov
2017-03-13 16:37 ` [PATCH v7 3/9] MAINTAINERS: Add Qualcomm Venus video accelerator driver Stanimir Varbanov
2017-03-13 16:37 ` [PATCH v7 4/9] media: venus: adding core part and helper functions Stanimir Varbanov
2017-03-24 14:23   ` Hans Verkuil
2017-03-25 22:36     ` Stanimir Varbanov
2017-03-13 16:37 ` [PATCH v7 5/9] media: venus: vdec: add video decoder files Stanimir Varbanov
2017-03-24 14:41   ` Hans Verkuil
2017-03-24 18:21     ` Nicolas Dufresne
2017-03-25 23:14       ` Stanimir Varbanov
2017-03-25 22:30     ` Stanimir Varbanov
2017-03-27  2:18       ` Nicolas Dufresne
2017-03-27  8:50         ` Hans Verkuil
2017-03-27  8:45       ` Hans Verkuil
2017-03-27 11:49         ` Stanimir Varbanov [this message]
2017-03-27 14:58         ` Nicolas Dufresne
2017-03-27  8:47       ` Hans Verkuil
2017-03-13 16:37 ` [PATCH v7 6/9] media: venus: venc: add video encoder files Stanimir Varbanov
2017-03-13 16:37 ` [PATCH v7 7/9] media: venus: hfi: add Host Firmware Interface (HFI) Stanimir Varbanov
2017-03-13 16:37 ` [PATCH v7 8/9] media: venus: hfi: add Venus HFI files Stanimir Varbanov
2017-03-13 16:37 ` [PATCH v7 9/9] media: venus: enable building of Venus video driver Stanimir Varbanov
2017-03-24 14:49   ` Hans Verkuil
2017-03-24 15:30     ` Stanimir Varbanov
2017-03-24 14:06 ` [PATCH v7 0/9] Qualcomm video decoder/encoder driver Hans Verkuil
2017-03-24 14:07   ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ae41d9d-d5fb-367c-ea08-c9a1bc818ffe@linaro.org \
    --to=stanimir.varbanov@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=srinivas.kandagatla@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).