[PATCH 3/4] drm/amdgpu: add IOCTL interface for per VM BOs v2
Michel Dänzer
michel at daenzer.net
Wed Aug 30 07:52:48 UTC 2017
On 30/08/17 04:43 PM, Christian König wrote:
> Am 30.08.2017 um 09:39 schrieb Michel Dänzer:
>> On 30/08/17 04:34 PM, Christian König wrote:
>>> Am 30.08.2017 um 08:46 schrieb Michel Dänzer:
>>>> On 30/08/17 03:42 PM, Michel Dänzer wrote:
>>>>> On 30/08/17 03:09 PM, Christian König wrote:
>>>>>> Am 29.08.2017 um 19:20 schrieb Deucher, Alexander:
>>>>>>>> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On
>>>>>>>> Behalf
>>>>>>>> Of Christian König
>>>>>>>>
>>>>>>>> @@ -89,6 +89,8 @@ extern "C" {
>>>>>>>> #define AMDGPU_GEM_CREATE_SHADOW (1 << 4)
>>>>>>>> /* Flag that allocating the BO should use linear VRAM */
>>>>>>>> #define AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS (1 << 5)
>>>>>>>> +/* Flag that BO is local in the VM */
>>>>>>>> +#define AMDGPU_GEM_CREATE_LOCAL (1 << 6)
>>>>>>> I'm not crazy about the name LOCAL. Maybe something like
>>>>>>> ALWAYS_VALID?
>>>>>> Works for me as well. Dave any other opinion?
>>>>>>
>>>>>> If everybody is ok with ALWAYS_VALID I'm going to use that one.
>>>>> FWIW, I like LOCAL better than ALWAYS_VALID. The latter suggests that
>>>>> the BO is valid under any circumstances, whereas LOCAL indicates
>>>>> that it
>>>>> cannot be used outside of the GPUVM it was created in.
>>>>>
>>>>> I don't feel strongly about it though, feel free to go with either.
>>>> Another idea:
>>>>
>>>> /* The BO can only be used in the VM it was created in */
>>>> #define AMDGPU_GEM_CREATE_UNSHAREABLE (1 << 6)
>>> That in turn doesn't note that it is always available.
>>>
>>> Additional to that I only limited sharing the BO because of the bad
>>> performance and memory usage. In theory we could share them pretty well.
>>>
>>> How about VM_LOCAL ?
>> Hmm, well if such BOs might become shareable in the future, ALWAYS_VALID
>> might be best after all.
>
> Well this would be misleading as well, cause when you share them with
> another process they need to be specified in the BO list again.
Seems fine to me: The flag is only relevant for the original creator of
the BO; if the BO is later imported somewhere else, it will be clear
that the imported BO must be in the BO list (it's not possible to even
determine there that this flag was passed when the BO was originally
created).
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the amd-gfx
mailing list