Re: [PATCH 1/3] drm: add gem ttm helpers

2019-08-07 Thread Daniel Vetter
On Wed, Aug 07, 2019 at 01:51:33PM +0200, Gerd Hoffmann wrote: > Hi, > > > > > > I don't think so. drm_gem_dumb_map_offset() calls > > > > > drm_gem_create_mmap_offset(), which I think is not correct for ttm > > > > > objects because ttm_bo_init() handles vma_node initialization. > > > Ok I lo

Re: [PATCH 1/3] drm: add gem ttm helpers

2019-08-07 Thread Gerd Hoffmann
Hi, > > > > I don't think so. drm_gem_dumb_map_offset() calls > > > > drm_gem_create_mmap_offset(), which I think is not correct for ttm > > > > objects because ttm_bo_init() handles vma_node initialization. > Ok I looked again, and your ttm version seems to exactly match > drm_gem_dumb_map_of

Re: [PATCH 1/3] drm: add gem ttm helpers

2019-08-07 Thread Daniel Vetter
On Wed, Aug 7, 2019 at 12:36 PM Gerd Hoffmann wrote: > > Hi, > > > > > Same for this, you're just upcasting to ttm_bo and then downcasting to > > > > gem_bo again ... I think just a series to roll out the existing gem > > > > helpers everywhere should work? > > > > > > I don't think so. drm_gem

Re: [PATCH 1/3] drm: add gem ttm helpers

2019-08-07 Thread Gerd Hoffmann
Hi, > > > Same for this, you're just upcasting to ttm_bo and then downcasting to > > > gem_bo again ... I think just a series to roll out the existing gem > > > helpers everywhere should work? > > > > I don't think so. drm_gem_dumb_map_offset() calls > > drm_gem_create_mmap_offset(), which I th

Re: [PATCH 1/3] drm: add gem ttm helpers

2019-08-07 Thread Daniel Vetter
On Wed, Aug 7, 2019 at 9:29 AM Gerd Hoffmann wrote: > > > > +/** > > > + * drm_gem_ttm_mmap_offset() - Returns a GEM ttm object's mmap offset > > > + * @gbo: the GEM ttm object > > > + * > > > + * See drm_vma_node_offset_addr() for more information. > > > + * > > > + * Returns: > > > + * The buf

Re: [PATCH 1/3] drm: add gem ttm helpers

2019-08-07 Thread Gerd Hoffmann
> > +/** > > + * drm_gem_ttm_mmap_offset() - Returns a GEM ttm object's mmap offset > > + * @gbo: the GEM ttm object > > + * > > + * See drm_vma_node_offset_addr() for more information. > > + * > > + * Returns: > > + * The buffer object's offset for userspace mappings on success, or > > + * 0 if

Re: [PATCH 1/3] drm: add gem ttm helpers

2019-08-06 Thread Sam Ravnborg
Hi Gerd. On Tue, Aug 06, 2019 at 03:34:52PM +0200, Gerd Hoffmann wrote: > Now with ttm_buffer_object being a subclass of drm_gem_object we can > easily lookup ttm_buffer_object for a given drm_gem_object, which in > turm allows to create common helper functions. This patch starts off > with dump

Re: [PATCH 1/3] drm: add gem ttm helpers

2019-08-06 Thread Sam Ravnborg
Hi Gerd. On Tue, Aug 06, 2019 at 03:34:52PM +0200, Gerd Hoffmann wrote: > Now with ttm_buffer_object being a subclass of drm_gem_object we can > easily lookup ttm_buffer_object for a given drm_gem_object, which in > turm allows to create common helper functions. This patch starts off > with dump

Re: [PATCH 1/3] drm: add gem ttm helpers

2019-08-06 Thread Daniel Vetter
On Tue, Aug 06, 2019 at 03:34:52PM +0200, Gerd Hoffmann wrote: > Now with ttm_buffer_object being a subclass of drm_gem_object we can > easily lookup ttm_buffer_object for a given drm_gem_object, which in > turm allows to create common helper functions. This patch starts off > with dump mmap helpe