Questions about TTM buffer object maping

2013-07-12 Thread Jean-Sébastien Pédron
Le 11/07/2013 23:51, David Herrmann a ?crit : > ->vm_open() isn't called for the first mmap(), afaik (only called > during fork()s or similar). So the reference in ttm_bo_mmap() is a > replacement for the reference you take in the ->vm_open() callback. So the reference is acquired either in ttm_bo

Questions about TTM buffer object maping

2013-07-11 Thread David Herrmann
Hi On Thu, Jul 11, 2013 at 11:43 PM, Jean-S?bastien P?dron wrote: > Hi, > > Thank you J?r?me and Daniel for your input, that's really helpful! > > I have another question: in ttm_bo_mmap(), a reference to the buffer object > is acquired at the beginning of the function. Another reference is acqui

Questions about TTM buffer object maping

2013-07-11 Thread Jean-Sébastien Pédron
Hi, Thank you J?r?me and Daniel for your input, that's really helpful! I have another question: in ttm_bo_mmap(), a reference to the buffer object is acquired at the beginning of the function. Another reference is acquired in ttm_bo_vm_open() (released in ttm_bo_vm_close()). But where is the f

Questions about TTM buffer object maping

2013-07-11 Thread Jerome Glisse
On Thu, Jul 11, 2013 at 5:43 PM, Jean-S?bastien P?dron wrote: > Hi, > > Thank you J?r?me and Daniel for your input, that's really helpful! > > I have another question: in ttm_bo_mmap(), a reference to the buffer object > is acquired at the beginning of the function. Another reference is acquired >

Re: Questions about TTM buffer object maping

2013-07-11 Thread Jean-Sébastien Pédron
Le 11/07/2013 23:51, David Herrmann a écrit : ->vm_open() isn't called for the first mmap(), afaik (only called during fork()s or similar). So the reference in ttm_bo_mmap() is a replacement for the reference you take in the ->vm_open() callback. So the reference is acquired either in ttm_bo_mm

Re: Questions about TTM buffer object maping

2013-07-11 Thread David Herrmann
Hi On Thu, Jul 11, 2013 at 11:43 PM, Jean-Sébastien Pédron wrote: > Hi, > > Thank you Jérôme and Daniel for your input, that's really helpful! > > I have another question: in ttm_bo_mmap(), a reference to the buffer object > is acquired at the beginning of the function. Another reference is acqui

Re: Questions about TTM buffer object maping

2013-07-11 Thread Jerome Glisse
On Thu, Jul 11, 2013 at 5:43 PM, Jean-Sébastien Pédron wrote: > Hi, > > Thank you Jérôme and Daniel for your input, that's really helpful! > > I have another question: in ttm_bo_mmap(), a reference to the buffer object > is acquired at the beginning of the function. Another reference is acquired >

Re: Questions about TTM buffer object maping

2013-07-11 Thread Jean-Sébastien Pédron
Hi, Thank you Jérôme and Daniel for your input, that's really helpful! I have another question: in ttm_bo_mmap(), a reference to the buffer object is acquired at the beginning of the function. Another reference is acquired in ttm_bo_vm_open() (released in ttm_bo_vm_close()). But where is the

Questions about TTM buffer object maping

2013-07-11 Thread Jerome Glisse
On Thu, Jul 11, 2013 at 2:24 AM, Daniel Vetter wrote: > On Wed, Jul 10, 2013 at 09:00:33PM -0400, Jerome Glisse wrote: >> On Wed, Jul 10, 2013 at 8:27 PM, Jean-S?bastien P?dron >> wrote: >> > Hello, >> > >> > I'm trying to understand how TTM buffer object mapping works on Linux, to >> > make this

Questions about TTM buffer object maping

2013-07-11 Thread Daniel Vetter
On Wed, Jul 10, 2013 at 09:00:33PM -0400, Jerome Glisse wrote: > On Wed, Jul 10, 2013 at 8:27 PM, Jean-S?bastien P?dron > wrote: > > Hello, > > > > I'm trying to understand how TTM buffer object mapping works on Linux, to > > make this behave properly on FreeBSD. > > > > Here's what I think I unde

Re: Questions about TTM buffer object maping

2013-07-11 Thread Jerome Glisse
On Thu, Jul 11, 2013 at 2:24 AM, Daniel Vetter wrote: > On Wed, Jul 10, 2013 at 09:00:33PM -0400, Jerome Glisse wrote: >> On Wed, Jul 10, 2013 at 8:27 PM, Jean-Sébastien Pédron >> wrote: >> > Hello, >> > >> > I'm trying to understand how TTM buffer object mapping works on Linux, to >> > make this

Questions about TTM buffer object maping

2013-07-11 Thread Jean-Sébastien Pédron
Hello, I'm trying to understand how TTM buffer object mapping works on Linux, to make this behave properly on FreeBSD. Here's what I think I understand: When a buffer object is mmap()'d, ttm_bo_vm_open() is called. When there's a page fault, the page is looked up and inserted in the VMA using

Re: Questions about TTM buffer object maping

2013-07-10 Thread Daniel Vetter
On Wed, Jul 10, 2013 at 09:00:33PM -0400, Jerome Glisse wrote: > On Wed, Jul 10, 2013 at 8:27 PM, Jean-Sébastien Pédron > wrote: > > Hello, > > > > I'm trying to understand how TTM buffer object mapping works on Linux, to > > make this behave properly on FreeBSD. > > > > Here's what I think I unde

Questions about TTM buffer object maping

2013-07-10 Thread Jerome Glisse
On Wed, Jul 10, 2013 at 8:27 PM, Jean-S?bastien P?dron wrote: > Hello, > > I'm trying to understand how TTM buffer object mapping works on Linux, to > make this behave properly on FreeBSD. > > Here's what I think I understand: > > When a buffer object is mmap()'d, ttm_bo_vm_open() is called. When

Re: Questions about TTM buffer object maping

2013-07-10 Thread Jerome Glisse
On Wed, Jul 10, 2013 at 8:27 PM, Jean-Sébastien Pédron wrote: > Hello, > > I'm trying to understand how TTM buffer object mapping works on Linux, to > make this behave properly on FreeBSD. > > Here's what I think I understand: > > When a buffer object is mmap()'d, ttm_bo_vm_open() is called. When

Questions about TTM buffer object maping

2013-07-10 Thread Jean-Sébastien Pédron
Hello, I'm trying to understand how TTM buffer object mapping works on Linux, to make this behave properly on FreeBSD. Here's what I think I understand: When a buffer object is mmap()'d, ttm_bo_vm_open() is called. When there's a page fault, the page is looked up and inserted in the VMA usi