[PATCH v2 07/19] drm/cirrus: Use the drm_driver.dumb_destroy default

Daniel Vetter daniel at ffwll.ch
Wed Aug 16 16:52:16 UTC 2017


On Wed, Aug 16, 2017 at 3:41 PM, Noralf Trønnes <noralf at tronnes.org> wrote:
>
> Den 16.08.2017 09.38, skrev Daniel Vetter:
>>
>> On Sun, Aug 06, 2017 at 05:40:56PM +0200, Noralf Trønnes wrote:
>>>
>>> drm_gem_dumb_destroy() is the drm_driver.dumb_destroy default,
>>> so no need to set it.
>>>
>>> Cc: Dave Airlie <airlied at redhat.com>
>>> Cc: Gerd Hoffmann <kraxel at redhat.com>
>>> Signed-off-by: Noralf Trønnes <noralf at tronnes.org>
>>> ---
>>>   drivers/gpu/drm/cirrus/cirrus_drv.c | 1 -
>>>   1 file changed, 1 deletion(-)
>>>
>>> diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c
>>> b/drivers/gpu/drm/cirrus/cirrus_drv.c
>>> index 910c300..69c4e35 100644
>>> --- a/drivers/gpu/drm/cirrus/cirrus_drv.c
>>> +++ b/drivers/gpu/drm/cirrus/cirrus_drv.c
>>> @@ -142,7 +142,6 @@ static struct drm_driver driver = {
>>>         .gem_free_object_unlocked = cirrus_gem_free_object,
>>>         .dumb_create = cirrus_dumb_create,
>>>         .dumb_map_offset = cirrus_dumb_mmap_offset,
>>
>> I think the cirrus mmap_offset could be replaced too, it's just written
>> slightly differently from what I can tell with the separate helper
>> function.
>
>
> Emil asked about the same, but cirrus uses ttm_buffer_object.vma_node
> to get the offset and not drm_gem_object.vma_node.
> He couldn't answer whether they're the same vma_node or not.

Indeed I misread them all, this is using ttm. In reality we could
replace it all with the gem mmap stuff, but that also means we need to
changed drm_driver->fops->mmap to drm_gem_mmap. Across all drivers
this would delete impressive amounts of code, but quite a bit of work
too. The only drivers which probably should keep the ttm way of mmap
are those who's ttm_bo_driver->very_access is not implemented through
drm_vma_node_verify_access().
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dri-devel mailing list