[PATCH v4 01/19] drm: Add |struct drm_gem_vram_object| and helpers
Thomas Zimmermann
tzimmermann at suse.de
Mon May 6 13:53:57 UTC 2019
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 at lists.freedesktop.org
> 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)
-------------- 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/20190506/6e6ed059/attachment.sig>
More information about the dri-devel
mailing list