[Spice-devel] [PATCH 0/4] drm: Generic dumb_map_offset for TTM-based drivers

Thomas Zimmermann tzimmermann at suse.de
Thu Apr 8 11:34:03 UTC 2021


Hi

Am 08.04.21 um 13:16 schrieb Daniel Vetter:
> On Tue, Apr 06, 2021 at 10:29:38AM +0200, Thomas Zimmermann wrote:
>> The implementation of drm_driver.dumb_map_offset is the same for several
>> TTM-based drivers. Provide a common function in GEM-TTM helpers.
> 
> Out of curiosity, why does this not fit for radeon/amdgpu?

These drivers perform additional permission checks in their implementations.

But those checks are also part of the actual mmap code. I want to 
propose a patch to use the generic drm_gem_ttm_map_offset in 
amdgpu/radeon, and then rely on mmap to fail if necessary. It might 
result in a longer discussion, so that's for another patchset.

Best regards
Thomas

> -Daniel
> 
>>
>> Thomas Zimmermann (4):
>>    drm/gem-ttm-helper: Provide helper for struct
>>      drm_driver.dumb_map_offset
>>    drm/vram-helper: Use drm_gem_ttm_dumb_map_offset()
>>    drm/nouveau: Use drm_gem_ttm_dumb_map_offset()
>>    drm/qxl: Use drm_gem_ttm_dumb_map_offset()
>>
>>   drivers/gpu/drm/drm_gem_ttm_helper.c      | 33 ++++++++++++++++
>>   drivers/gpu/drm/drm_gem_vram_helper.c     | 48 -----------------------
>>   drivers/gpu/drm/nouveau/nouveau_display.c | 18 ---------
>>   drivers/gpu/drm/nouveau/nouveau_display.h |  2 -
>>   drivers/gpu/drm/nouveau/nouveau_drm.c     |  3 +-
>>   drivers/gpu/drm/qxl/qxl_drv.c             |  3 +-
>>   drivers/gpu/drm/qxl/qxl_drv.h             |  3 --
>>   drivers/gpu/drm/qxl/qxl_dumb.c            | 17 --------
>>   drivers/gpu/drm/qxl/qxl_ioctl.c           |  4 +-
>>   drivers/gpu/drm/qxl/qxl_object.h          |  5 ---
>>   include/drm/drm_gem_ttm_helper.h          |  5 ++-
>>   include/drm/drm_gem_vram_helper.h         |  7 +---
>>   12 files changed, 45 insertions(+), 103 deletions(-)
>>
>> --
>> 2.30.2
>>
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20210408/8ad72e7c/attachment.sig>


More information about the Spice-devel mailing list