All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Terje Bergström" <tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-tegra <linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Eric Brower <ebrower-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: Re: How to use host1x syncpt?
Date: Thu, 13 Feb 2014 13:36:08 +0200	[thread overview]
Message-ID: <52FCAE28.5080508@nvidia.com> (raw)
In-Reply-To: <CAK5ve-+ARW3cx+671vNYQCWYPe=CVa5n81q2-BrKyGzF8Nv4fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 05.02.2014 01:51, Bryan Wu wrote:
> Hi Stephen and Thierry,
> 
> Recently I'm working on upstreaming my V4L2 driver for Tegra video
> input module, which is using host1x syncpt to wait for frame
> capturing.
> 
> So here is my basic steps for handling host1x syncpt,
> 
> 1. Call host1x_syncpt_request(cam->client.dev, flags); to allocate
> syncpts for my driver.
> 
> 2. Program host1x_syncpt_id(sp) into Tegra VI syncpt event register.
> So when VI captures one frame, syncpt will be increased one.
> 
> 3. Call thresh = host1x_syncpt_incr_max(sp, 1) to incr max_val of the
> syncpt, which is the threshold for waiting.
> 
> 4. Start capture and wait for host1x syncpt event like this
> host1x_syncpt_wait(sp, thresh, WAIT_TIMEOUT, &value);
> 
> Is that the right sequence?

You should get the correct syncpt fence value by calling
host1x_syncpt_incr_max(). It seems we've just forgotten to export it,
but you can add a trivial patch to export that function.

If you don't do this, host1x will treat your sync point value as "out of
valid range", consider it an outdated one, and treat any waits as NOP.

Terje

      parent reply	other threads:[~2014-02-13 11:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04 23:51 How to use host1x syncpt? Bryan Wu
     [not found] ` <CAK5ve-+ARW3cx+671vNYQCWYPe=CVa5n81q2-BrKyGzF8Nv4fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-07  2:11   ` Bryan Wu
     [not found]     ` <CAK5ve-+sWLtaCQwPOm99pzPmtJioAKUjba-_6eV5bqf3KxXwFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-11  0:08       ` Bryan Wu
     [not found]         ` <CAK5ve-+A1-V8rrDo4HAHoBgdD+U-Dp6XY_GAzEmxfv49w9qVOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-12 19:39           ` Bryan Wu
2014-02-13 11:36   ` Terje Bergström [this message]

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=52FCAE28.5080508@nvidia.com \
    --to=tbergstrom-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
    --cc=cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ebrower-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.