Hi Am 06.05.19 um 15:17 schrieb Gerd Hoffmann: > Hi, > >> This misses the call to drm_gem_vram_placement(), where >> drm_gem_vram_push_to_system() enforces placement in system memory. > > Ah, missed that detail. > >> We >> could build a common implementation out of both interfaces, but that >> would obfuscate the code IMHO. I'd just leave it as it is. > > Ok. > >>>> +struct drm_gem_vram_object { >>>> + /* Supported placements are %TTM_PL_VRAM and %TTM_PL_SYSTEM */ >>>> + struct ttm_placement placement; >>>> + struct ttm_place placements[3]; >>> >>> placements[2] should be enough I guess? >> >> TTM_PL_VRAM has index 2 and TTM_PL_SYSTEM has index 0. There's TTM_PL_TT >> at index 1. We don't use all three array entries here, but I'm not sure >> if something in TTM does. I took the line from the drivers and didn't >> change it for that reason. > > TTM_PL_* isn't an index into that array. See drm_gem_vram_placement() > which fills that array. It'll use one or two entries of that array. The field 'placements' is assigned to 'placement.placements' and 'placement.busy_placement'. The placement field is later given to ttm_bo_validate() for internal use by TTM. From reading ttm_bo.c, that's apparently not a problem. I'm just being defensive here, but let's remove the additional entry if it's just overhead. Best regards Thomas > cheers, > Gerd > > _______________________________________________ > dri-devel mailing list > dri-devel@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/dri-devel > -- 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)
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization