linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Zhang <nvmarkzhang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Terje Bergström" <tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: "dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Lucas Stach <dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org>,
	Thierry Reding
	<thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
Subject: Re: First version of host1x intro
Date: Fri, 07 Dec 2012 13:38:34 +0800	[thread overview]
Message-ID: <50C180DA.508@gmail.com> (raw)
In-Reply-To: <50C08338.3070408-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

On 12/06/2012 07:36 PM, Terje Bergström wrote:
> On 06.12.2012 09:06, Mark Zhang wrote:
>> Thank you for the doc. So here I have questions:
>>
>> Push buffer contains a lot of opcodes for this channel. So when multiple
>> userspace processes submit jobs to this channel, all these jobs will be
>> saved in the push buffer and return, right? I mean, nvhost driver will
>> create a workqueue or something to pull stuffs out from the push buffer
>> and process them one by one?
> 
> Yes, "sync queue" contains the list of jobs that are pending (or that
> kernel thinks are pending).
>

I see.

> Push buffer in general case contains GATHER opcodes, which point to the
> streams from user space. This way we don't have to copy command streams.
> In case IOMMU is not available, we either have to copy the contents
> directly to push buffer so user space can't modify it later (I'm trying
> to implement this), or then we have to ensure the command streams cannot
> be tampered with in some other way.
> 

Yes, we have been talking about this for several days.

>> Besides, "If command DMA sees opcode GATHER, it will allocate(you missed
>> a verb here and I suppose it may be "allocate") a memory area to command
>> FIFO" -- So why we need command FIFO, this extra component? Can't we
>> just pass the correct address in push buffer to host1x clients?
> 
> This is about the hardware, and the correct verb is "copy". HOST1X
> hardware pre-fetches opcodes from push buffer and contents of GATHERs to
> a FIFO to overcome memory latencies. The execution happens from FIFO.
> 
> host1x clients don't know about push buffers. They're a feature of
> HOST1X. HOST1X just interprets the opcodes and performs the operations
> indicated, for example writes a value to a register of 2D.
> 
> In general, the FIFO is invisible to users of HOST1X, but important to
> understand when debugging stuck hardware.
> 

Okay, so the command FIFO is not a part of memory we need to allocate.
It's inside in every host1x clients.

>> And when the host1x client starts working is controlled by userspace
>> program, right? Because command DMA allocates the command FIFO when it
>> sees opcode "GATHER". Or nvhost driver will generate "GATHER" as well,
>> to buffer some opcodes then send them to host1x clients in one shot?
> 
> FIFO is hardware inside HOST1X, so it's not allocated by user space or
> kernel.
> 

Got it. We just need to copy stuffs into FIFO.

>> Could you explain more about this "relocation information"? I assume the
>> "target buffers" here mentioned are some memory saving, e.g, textures,
>> compressed video data which need to be decoded...
>> But the userspace should already allocate the memory to save them, why
>> we need to relocate?
> 
> Lucas already did a better job of explaining than I could've, so I'll
> pass. :-)
> 

Yeah, I have known the idea. What I'm confused before is that why we
need this reloc table because all mem are allocated from us(I mean,
tegradrm/nvhost) so ideally we can find out all buffer related infos in
the driver while userspace doesn't need to provide such informations.

> I'll add some notes about these to the doc.
> 

Thanks for the doc and it's really helpful.

> Terje
> 

  parent reply	other threads:[~2012-12-07  5:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05  9:47 First version of host1x intro Terje Bergström
     [not found] ` <50BF1831.3060606-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-12-06  7:06   ` Mark Zhang
     [not found]     ` <50C0440D.3000702-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-06  7:20       ` Lucas Stach
2012-12-06  7:49         ` Mark Zhang
     [not found]           ` <50C04E1D.1050702-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-06  8:00             ` Lucas Stach
2012-12-06  8:13               ` Mark Zhang
     [not found]                 ` <50C053AD.2000802-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-06 11:17                   ` Lucas Stach
2012-12-07  5:26                     ` Mark Zhang
2012-12-06 18:46                   ` Stephen Warren
     [not found]                     ` <50C0E7F4.2090802-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-12-07  5:49                       ` Mark Zhang
2012-12-06 11:36       ` Terje Bergström
     [not found]         ` <50C08338.3070408-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-12-07  5:38           ` Mark Zhang [this message]
     [not found]             ` <50C180DA.508-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-07  6:44               ` Terje Bergström
     [not found]                 ` <50C1903C.8040608-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-12-07  7:05                   ` Mark Zhang

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=50C180DA.508@gmail.com \
    --to=nvmarkzhang-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=dev-8ppwABl0HbeELgA04lAiVw@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tbergstrom-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@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 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).