Re: [PATCH] drm/i915/gem: Allow importing of shmemfs objects into any device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: Intel-gfx <intel-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of
>Matthew Auld
>Sent: Wednesday, January 20, 2021 12:46 PM
>To: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
>Cc: Intel Graphics Development <intel-gfx@xxxxxxxxxxxxxxxxxxxxx>; Auld,
>Matthew <matthew.auld@xxxxxxxxx>
>Subject: Re:  [PATCH] drm/i915/gem: Allow importing of shmemfs
>objects into any device
>
>On Wed, 20 Jan 2021 at 15:40, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote:
>>
>> If we import a shmemfs object between devices, for example from
>> Tigerlake to DG1, we can simply reuse the native object and its backing
>> store.
>
>Hmmm interesting, so does that include re-using the actual sg mapping
>for the backing pages? Does that work out-of-the-box between different
>devices assuming we have iommu enabled?
>
>>
>> Suggested-by: Imre Deak <imre.deak@xxxxxxxxx>
>> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
>> Cc: Matthew Auld <matthew.auld@xxxxxxxxx>
>> Cc: Imre Deak <imre.deak@xxxxxxxxx>
>> ---
>>  drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
>b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
>> index 04e9c04545ad..4816f08c4009 100644
>> --- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
>> +++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
>> @@ -242,6 +242,13 @@ struct drm_gem_object
>*i915_gem_prime_import(struct drm_device *dev,
>>                          */
>>                         return &i915_gem_object_get(obj)->base;
>>                 }
>> +
>> +               /*
>> +                * If the object is in plain system memory, we can reuse the
>> +                * same backing store in any device.
>> +                */
>> +               if (i915_gem_object_is_shmem(obj))
>> +                       return &i915_gem_object_get(obj)->base;
>>         }

So this would mean sharing all of the object attributes between devices (pin count, etc)?

I.e. vma list etc?

Would that work?

Mike

>>         /* need to attach */
>> --
>> 2.20.1
>>
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>_______________________________________________
>Intel-gfx mailing list
>Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
>https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux