Re: [Mesa-dev] [RFC PATCH] mesa: Export BOs in RW mode

2019-07-05 Thread Steven Price
On 03/07/2019 17:18, Daniel Vetter wrote: > On Wed, Jul 3, 2019 at 6:11 PM Steven Price wrote: [...] >> In theory the exporter should do whatever is required to ensure that the >> CPU is synchronised when a user space mapping exists. There are some >> issues here though: >> >> * In theory the kern

Re: [Mesa-dev] [RFC PATCH] mesa: Export BOs in RW mode

2019-07-04 Thread Daniel Vetter
On Thu, Jul 4, 2019 at 11:26 AM Steven Price wrote: > > On 03/07/2019 17:18, Daniel Vetter wrote: > > On Wed, Jul 3, 2019 at 6:11 PM Steven Price wrote: > [...] > >> In theory the exporter should do whatever is required to ensure that the > >> CPU is synchronised when a user space mapping exists.

Re: [RFC PATCH] mesa: Export BOs in RW mode

2019-07-04 Thread Steven Price
On 03/07/2019 15:33, Boris Brezillon wrote: > On Wed, 3 Jul 2019 15:13:25 +0100 > Steven Price wrote: > >> On 03/07/2019 14:56, Boris Brezillon wrote: >>> On Wed, 3 Jul 2019 07:45:32 -0600 >>> Rob Herring wrote: >>> On Wed, Jul 3, 2019 at 7:34 AM Boris Brezillon wrote: >

Re: [RFC PATCH] mesa: Export BOs in RW mode

2019-07-04 Thread Alyssa Rosenzweig
> Since the same discussion is happening with etnaviv: Why exactly does mesa > need to mmap imported buffers? The golden question! Seemingly, (one of the) reasons is that the state tracker does colourspace conversion in software if the winsys wants a format that the driver doesn't advertise. Unre

Re: [RFC PATCH] mesa: Export BOs in RW mode

2019-07-04 Thread Steven Price
On 03/07/2019 14:56, Boris Brezillon wrote: > On Wed, 3 Jul 2019 07:45:32 -0600 > Rob Herring wrote: > >> On Wed, Jul 3, 2019 at 7:34 AM Boris Brezillon >> wrote: >>> >>> Exported BOs might be imported back, then mmap()-ed to be written >>> too. Most drivers handle that by mmap()-ing the GEM han

Re: [RFC PATCH] mesa: Export BOs in RW mode

2019-07-04 Thread Steven Price
On 03/07/2019 16:59, Rob Herring wrote: > On Wed, Jul 3, 2019 at 8:13 AM Steven Price wrote: >> >> On 03/07/2019 14:56, Boris Brezillon wrote: >>> On Wed, 3 Jul 2019 07:45:32 -0600 >>> Rob Herring wrote: >>> On Wed, Jul 3, 2019 at 7:34 AM Boris Brezillon wrote: > > Exported BOs

Re: [Mesa-dev] [RFC PATCH] mesa: Export BOs in RW mode

2019-07-03 Thread Daniel Vetter
On Wed, Jul 3, 2019 at 6:11 PM Steven Price wrote: > > On 03/07/2019 15:33, Boris Brezillon wrote: > > On Wed, 3 Jul 2019 15:13:25 +0100 > > Steven Price wrote: > > > >> On 03/07/2019 14:56, Boris Brezillon wrote: > >>> On Wed, 3 Jul 2019 07:45:32 -0600 > >>> Rob Herring wrote: > >>> > On W

Re: [RFC PATCH] mesa: Export BOs in RW mode

2019-07-03 Thread Rob Herring
On Wed, Jul 3, 2019 at 8:13 AM Steven Price wrote: > > On 03/07/2019 14:56, Boris Brezillon wrote: > > On Wed, 3 Jul 2019 07:45:32 -0600 > > Rob Herring wrote: > > > >> On Wed, Jul 3, 2019 at 7:34 AM Boris Brezillon > >> wrote: > >>> > >>> Exported BOs might be imported back, then mmap()-ed to b

Re: [RFC PATCH] mesa: Export BOs in RW mode

2019-07-03 Thread Daniel Vetter
On Wed, Jul 03, 2019 at 05:47:24PM +0200, Daniel Vetter wrote: > On Wed, Jul 03, 2019 at 07:45:32AM -0600, Rob Herring wrote: > > On Wed, Jul 3, 2019 at 7:34 AM Boris Brezillon > > wrote: > > > > > > Exported BOs might be imported back, then mmap()-ed to be written > > > too. Most drivers handle t

Re: [RFC PATCH] mesa: Export BOs in RW mode

2019-07-03 Thread Daniel Vetter
On Wed, Jul 03, 2019 at 07:45:32AM -0600, Rob Herring wrote: > On Wed, Jul 3, 2019 at 7:34 AM Boris Brezillon > wrote: > > > > Exported BOs might be imported back, then mmap()-ed to be written > > too. Most drivers handle that by mmap()-ing the GEM handle after it's > > been imported, but, accordi

Re: [RFC PATCH] mesa: Export BOs in RW mode

2019-07-03 Thread Boris Brezillon
On Wed, 3 Jul 2019 15:50:08 +0100 Steven Price wrote: > On 03/07/2019 15:33, Boris Brezillon wrote: > > On Wed, 3 Jul 2019 15:13:25 +0100 > > Steven Price wrote: > > > >> On 03/07/2019 14:56, Boris Brezillon wrote: > >>> On Wed, 3 Jul 2019 07:45:32 -0600 > >>> Rob Herring wrote: > >>>

Re: [RFC PATCH] mesa: Export BOs in RW mode

2019-07-03 Thread Boris Brezillon
On Wed, 3 Jul 2019 15:13:25 +0100 Steven Price wrote: > On 03/07/2019 14:56, Boris Brezillon wrote: > > On Wed, 3 Jul 2019 07:45:32 -0600 > > Rob Herring wrote: > > > >> On Wed, Jul 3, 2019 at 7:34 AM Boris Brezillon > >> wrote: > >>> > >>> Exported BOs might be imported back, then mmap()-

Re: [RFC PATCH] mesa: Export BOs in RW mode

2019-07-03 Thread Boris Brezillon
On Wed, 3 Jul 2019 07:45:32 -0600 Rob Herring wrote: > On Wed, Jul 3, 2019 at 7:34 AM Boris Brezillon > wrote: > > > > Exported BOs might be imported back, then mmap()-ed to be written > > too. Most drivers handle that by mmap()-ing the GEM handle after it's > > been imported, but, according to

Re: [RFC PATCH] mesa: Export BOs in RW mode

2019-07-03 Thread Rob Herring
On Wed, Jul 3, 2019 at 7:34 AM Boris Brezillon wrote: > > Exported BOs might be imported back, then mmap()-ed to be written > too. Most drivers handle that by mmap()-ing the GEM handle after it's > been imported, but, according to [1], this is illegal. It's not illegal, but is supposed to go thru

[RFC PATCH] mesa: Export BOs in RW mode

2019-07-03 Thread Boris Brezillon
Exported BOs might be imported back, then mmap()-ed to be written too. Most drivers handle that by mmap()-ing the GEM handle after it's been imported, but, according to [1], this is illegal. The panfrost driver has recently switched to this generic helper (which was renamed into drm_gem_map_offset(