[PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Daniel Vetter
On Fri, Dec 7, 2012 at 9:33 PM, Aaron Plattner wrote: > Ah, I see what you mean. This would also need either a pointer to the drv > directly so the helpers can lock drv->struct_mutex, or a helper function to > convert from a drm_prime_helper_obj* to a gem_buffer_object* in a > driver-specific way

[PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Daniel Vetter
On Fri, Dec 07, 2012 at 09:58:38AM -0800, Aaron Plattner wrote: > On 12/06/2012 01:46 PM, Daniel Vetter wrote: [snip] > >- Just an idea for all the essential noop cpu helpers: Maybe just call > > them dma_buf*noop and shovel them as convenience helpers into the > > dma-buf.c code in the core,

[PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Maarten Lankhorst
Op 06-12-12 22:50, Daniel Vetter schreef: > On Thu, Dec 06, 2012 at 10:46:30PM +0100, Daniel Vetter wrote: >> On Thu, Dec 06, 2012 at 10:07:48AM -0800, Aaron Plattner wrote: >>> Instead of reimplementing all of the dma_buf functionality in every driver, >>> create helpers drm_prime_import and drm_p

Re: [PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Aaron Plattner
On 12/07/2012 01:38 PM, Daniel Vetter wrote: On Fri, Dec 7, 2012 at 9:33 PM, Aaron Plattner wrote: Ah, I see what you mean. This would also need either a pointer to the drv directly so the helpers can lock drv->struct_mutex, or a helper function to convert from a drm_prime_helper_obj* to a gem

[PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Aaron Plattner
On 12/07/2012 01:38 PM, Daniel Vetter wrote: > On Fri, Dec 7, 2012 at 9:33 PM, Aaron Plattner > wrote: >> Ah, I see what you mean. This would also need either a pointer to the drv >> directly so the helpers can lock drv->struct_mutex, or a helper function to >> convert from a drm_prime_helper_ob

Re: [PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Daniel Vetter
On Fri, Dec 7, 2012 at 9:33 PM, Aaron Plattner wrote: > Ah, I see what you mean. This would also need either a pointer to the drv > directly so the helpers can lock drv->struct_mutex, or a helper function to > convert from a drm_prime_helper_obj* to a gem_buffer_object* in a > driver-specific way

Re: [PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Aaron Plattner
On 12/07/2012 10:48 AM, Daniel Vetter wrote: On Fri, Dec 07, 2012 at 09:58:38AM -0800, Aaron Plattner wrote: On 12/06/2012 01:46 PM, Daniel Vetter wrote: - To make it a first-class helper and remove any and all midlayer stints from this (I truly loath midlayers ...) maybe shovel this into a

[PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Aaron Plattner
On 12/07/2012 10:48 AM, Daniel Vetter wrote: > On Fri, Dec 07, 2012 at 09:58:38AM -0800, Aaron Plattner wrote: >> On 12/06/2012 01:46 PM, Daniel Vetter wrote: >>> - To make it a first-class helper and remove any and all midlayer stints >>>from this (I truly loath midlayers ...) maybe shovel thi

Re: [PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Daniel Vetter
On Fri, Dec 07, 2012 at 09:58:38AM -0800, Aaron Plattner wrote: > On 12/06/2012 01:46 PM, Daniel Vetter wrote: [snip] > >- Just an idea for all the essential noop cpu helpers: Maybe just call > > them dma_buf*noop and shovel them as convenience helpers into the > > dma-buf.c code in the core,

Re: [PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Aaron Plattner
On 12/06/2012 01:46 PM, Daniel Vetter wrote: On Thu, Dec 06, 2012 at 10:07:48AM -0800, Aaron Plattner wrote: Instead of reimplementing all of the dma_buf functionality in every driver, create helpers drm_prime_import and drm_prime_export that implement them in terms of new, lower-level hook func

[PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Aaron Plattner
On 12/06/2012 01:46 PM, Daniel Vetter wrote: > On Thu, Dec 06, 2012 at 10:07:48AM -0800, Aaron Plattner wrote: >> Instead of reimplementing all of the dma_buf functionality in every driver, >> create helpers drm_prime_import and drm_prime_export that implement them in >> terms of new, lower-level h

Re: [PATCH 1/4] drm: add prime helpers

2012-12-07 Thread Maarten Lankhorst
Op 06-12-12 22:50, Daniel Vetter schreef: > On Thu, Dec 06, 2012 at 10:46:30PM +0100, Daniel Vetter wrote: >> On Thu, Dec 06, 2012 at 10:07:48AM -0800, Aaron Plattner wrote: >>> Instead of reimplementing all of the dma_buf functionality in every driver, >>> create helpers drm_prime_import and drm_p

[PATCH 1/4] drm: add prime helpers

2012-12-06 Thread Daniel Vetter
On Thu, Dec 06, 2012 at 10:46:30PM +0100, Daniel Vetter wrote: > On Thu, Dec 06, 2012 at 10:07:48AM -0800, Aaron Plattner wrote: > > Instead of reimplementing all of the dma_buf functionality in every driver, > > create helpers drm_prime_import and drm_prime_export that implement them in > > terms

[PATCH 1/4] drm: add prime helpers

2012-12-06 Thread Daniel Vetter
On Thu, Dec 06, 2012 at 10:07:48AM -0800, Aaron Plattner wrote: > Instead of reimplementing all of the dma_buf functionality in every driver, > create helpers drm_prime_import and drm_prime_export that implement them in > terms of new, lower-level hook functions: > > gem_prime_pin: callback when

Re: [PATCH 1/4] drm: add prime helpers

2012-12-06 Thread Daniel Vetter
On Thu, Dec 06, 2012 at 10:46:30PM +0100, Daniel Vetter wrote: > On Thu, Dec 06, 2012 at 10:07:48AM -0800, Aaron Plattner wrote: > > Instead of reimplementing all of the dma_buf functionality in every driver, > > create helpers drm_prime_import and drm_prime_export that implement them in > > terms

Re: [PATCH 1/4] drm: add prime helpers

2012-12-06 Thread Daniel Vetter
On Thu, Dec 06, 2012 at 10:07:48AM -0800, Aaron Plattner wrote: > Instead of reimplementing all of the dma_buf functionality in every driver, > create helpers drm_prime_import and drm_prime_export that implement them in > terms of new, lower-level hook functions: > > gem_prime_pin: callback when

[PATCH 1/4] drm: add prime helpers

2012-12-06 Thread Aaron Plattner
Instead of reimplementing all of the dma_buf functionality in every driver, create helpers drm_prime_import and drm_prime_export that implement them in terms of new, lower-level hook functions: gem_prime_pin: callback when a buffer is created, used to pin buffers into GTT gem_prime_get_pages:

[PATCH 1/4] drm: add prime helpers

2012-12-06 Thread Aaron Plattner
Instead of reimplementing all of the dma_buf functionality in every driver, create helpers drm_prime_import and drm_prime_export that implement them in terms of new, lower-level hook functions: gem_prime_pin: callback when a buffer is created, used to pin buffers into GTT gem_prime_get_pages: