[RFC PATCH] radeonsi: set a per-buffer flag that disables inter-process sharing (v2)

Marek Olšák maraeo at gmail.com
Tue Jul 18 21:32:28 UTC 2017


On Tue, Jul 18, 2017 at 5:11 PM, Michel Dänzer <michel at daenzer.net> wrote:
> On 18/07/17 04:08 PM, Marek Olšák wrote:
>>
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> For lower overhead in the CS ioctl.
>> Winsys allocators are not used with interprocess-sharable resources.
>>
>> v2: It shouldn't crash anymore, but the kernel will reject the new flag.
>> ---
>>   src/gallium/drivers/radeon/r600_buffer_common.c |  7 +++++
>>   src/gallium/drivers/radeon/radeon_winsys.h      | 20 +++++++++++---
>>   src/gallium/winsys/amdgpu/drm/amdgpu_bo.c       | 36
>> ++++++++++++++++---------
>>   src/gallium/winsys/radeon/drm/radeon_drm_bo.c   | 27 +++++++++++--------
>>   4 files changed, 62 insertions(+), 28 deletions(-)
>>
>> diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c
>> b/src/gallium/drivers/radeon/r600_buffer_common.c
>> index dd1c209..2747ac4 100644
>> --- a/src/gallium/drivers/radeon/r600_buffer_common.c
>> +++ b/src/gallium/drivers/radeon/r600_buffer_common.c
>> @@ -160,20 +160,27 @@ void r600_init_resource_fields(struct
>> r600_common_screen *rscreen,
>>         }
>>         /* Tiled textures are unmappable. Always put them in VRAM. */
>>         if ((res->b.b.target != PIPE_BUFFER && !rtex->surface.is_linear)
>> ||
>>             res->flags & R600_RESOURCE_FLAG_UNMAPPABLE) {
>>                 res->domains = RADEON_DOMAIN_VRAM;
>>                 res->flags |= RADEON_FLAG_NO_CPU_ACCESS |
>>                          RADEON_FLAG_GTT_WC;
>>         }
>>   +     /* Only displayable single-sample textures can be shared between
>> +        * processes. */
>> +       if (res->b.b.target == PIPE_BUFFER ||
>> +           res->b.b.nr_samples >= 2 ||
>> +           rtex->surface.micro_tile_mode != RADEON_MICRO_MODE_DISPLAY)
>> +               res->flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING;
>
>
> We might want to share non-displayable textures at some point for
> performance, right? Will we still be able to flag some textures as
> non-shareable in that case?

Yes if we weren't CPU-bound in 2D acceleration on VI. As long as we
are CPU-bound, GPU optimizations won't probably make much difference.

Marek


More information about the amd-gfx mailing list