All of lore.kernel.org
 help / color / mirror / Atom feed
* How to use host1x syncpt?
@ 2014-02-04 23:51 Bryan Wu
       [not found] ` <CAK5ve-+ARW3cx+671vNYQCWYPe=CVa5n81q2-BrKyGzF8Nv4fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Bryan Wu @ 2014-02-04 23:51 UTC (permalink / raw)
  To: linux-tegra, Stephen Warren, Thierry Reding; +Cc: Eric Brower

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?

host1x_syncpt_incr_max() is not exported and without calling it I
always got error message like this:
"tegra-host1x 50000000.host1x: syncpt_load failed: id=1, min=46, max=0, live=46"
So I have to increase the max_val manually like step 3. And
host1x_syncpt_incr() won't increase the max_val which will still
generate this error message.

Actually with the steps I listed, I can capture data from real sensor now.

Thanks,
-Bryan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to use host1x syncpt?
       [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-13 11:36   ` Terje Bergström
  1 sibling, 1 reply; 5+ messages in thread
From: Bryan Wu @ 2014-02-07  2:11 UTC (permalink / raw)
  To: linux-tegra, Stephen Warren, Thierry Reding, Terje Bergström
  Cc: Eric Brower

Hi Terje,

Forget to add you to this email, could you please help to take a look
at my questions?

Thanks,
-Bryan

On Tue, Feb 4, 2014 at 3:51 PM, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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?
>
> host1x_syncpt_incr_max() is not exported and without calling it I
> always got error message like this:
> "tegra-host1x 50000000.host1x: syncpt_load failed: id=1, min=46, max=0, live=46"
> So I have to increase the max_val manually like step 3. And
> host1x_syncpt_incr() won't increase the max_val which will still
> generate this error message.
>
> Actually with the steps I listed, I can capture data from real sensor now.
>
> Thanks,
> -Bryan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to use host1x syncpt?
       [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>
  0 siblings, 1 reply; 5+ messages in thread
From: Bryan Wu @ 2014-02-11  0:08 UTC (permalink / raw)
  To: linux-tegra, Stephen Warren, Thierry Reding, Terje Bergström
  Cc: Eric Brower

Ping,

-Bryan

On Thu, Feb 6, 2014 at 6:11 PM, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi Terje,
>
> Forget to add you to this email, could you please help to take a look
> at my questions?
>
> Thanks,
> -Bryan
>
> On Tue, Feb 4, 2014 at 3:51 PM, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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?
>>
>> host1x_syncpt_incr_max() is not exported and without calling it I
>> always got error message like this:
>> "tegra-host1x 50000000.host1x: syncpt_load failed: id=1, min=46, max=0, live=46"
>> So I have to increase the max_val manually like step 3. And
>> host1x_syncpt_incr() won't increase the max_val which will still
>> generate this error message.
>>
>> Actually with the steps I listed, I can capture data from real sensor now.
>>
>> Thanks,
>> -Bryan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to use host1x syncpt?
       [not found]         ` <CAK5ve-+A1-V8rrDo4HAHoBgdD+U-Dp6XY_GAzEmxfv49w9qVOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-02-12 19:39           ` Bryan Wu
  0 siblings, 0 replies; 5+ messages in thread
From: Bryan Wu @ 2014-02-12 19:39 UTC (permalink / raw)
  To: linux-tegra, Stephen Warren, Thierry Reding, Terje Bergström
  Cc: Eric Brower

Sorry for bothering, Thierry and Terje, do you guys have time to take
a look at my questions?

Thanks,
-Bryan

On Mon, Feb 10, 2014 at 4:08 PM, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Ping,
>
> -Bryan
>
> On Thu, Feb 6, 2014 at 6:11 PM, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Hi Terje,
>>
>> Forget to add you to this email, could you please help to take a look
>> at my questions?
>>
>> Thanks,
>> -Bryan
>>
>> On Tue, Feb 4, 2014 at 3:51 PM, Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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?
>>>
>>> host1x_syncpt_incr_max() is not exported and without calling it I
>>> always got error message like this:
>>> "tegra-host1x 50000000.host1x: syncpt_load failed: id=1, min=46, max=0, live=46"
>>> So I have to increase the max_val manually like step 3. And
>>> host1x_syncpt_incr() won't increase the max_val which will still
>>> generate this error message.
>>>
>>> Actually with the steps I listed, I can capture data from real sensor now.
>>>
>>> Thanks,
>>> -Bryan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to use host1x syncpt?
       [not found] ` <CAK5ve-+ARW3cx+671vNYQCWYPe=CVa5n81q2-BrKyGzF8Nv4fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2014-02-07  2:11   ` Bryan Wu
@ 2014-02-13 11:36   ` Terje Bergström
  1 sibling, 0 replies; 5+ messages in thread
From: Terje Bergström @ 2014-02-13 11:36 UTC (permalink / raw)
  To: Bryan Wu, linux-tegra, Stephen Warren, Thierry Reding; +Cc: Eric Brower

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-13 11:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.