[PATCH v3 3/3] drm/vram: Implement lazy unmapping for GEM VRAM buffers

Thomas Zimmermann tzimmermann at suse.de
Fri Sep 6 10:37:47 UTC 2019


Hi

Am 06.09.19 um 11:39 schrieb Gerd Hoffmann:
>> +void drm_gem_vram_bo_driver_move_notify(struct ttm_buffer_object *bo,
>> +					bool evict,
>> +					struct ttm_mem_reg *new_mem)
>> +{
> [ ... ]
>> +	if (!kmap->virtual)
>> +		return;
>> +	ttm_bo_kunmap(kmap);
>> +	kmap->virtual = NULL;
>> +}
> 
> I think ttm_buffer_object_destroy() needs "if (kmap->virtual)
> ttm_bo_kunmap()" too, due to the lazy unmap you can land there
> with an active mapping.

Hmm, from my understanding, that final call to move_notify() is done by
ttm_bo_cleanup_memtype_use(), which is called from within ttm_bo_put().

If we want to add a final kunmap, There's also the release_notify()
callback, which is probably the right place to put it.

Best regards
Thomas

> 
> cheers,
>   Gerd
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20190906/e2b7bfe7/attachment-0001.sig>


More information about the dri-devel mailing list