[Mesa-dev] [PATCH 1/4] r600g, radeonsi: force VRAM placement for DRI2 buffers

Marek Olšák maraeo at gmail.com
Mon Feb 3 09:07:15 PST 2014


Do you mean something like:

write_domains = VRAM
read_domains = VRAM | GTT

I don't think it's perfect. We should treat rendering by an app and
blitting by u_blitter (= texture transfers) differently. We don't want
u_blitter to mess up our idea about which textures are used as a
framebuffer, because once u_blitter comes into play, everything can be
a framebuffer.

I've got the following idea:

1) Set the domain to VRAM | GTT by default for all buffers and textures.
2) In set_framebuffer_state, if u_blitter isn't blitting, do this to
the domains of all renderbuffers: if (domains & VRAM) domains &= ~GTT;

That said, I'm not too excited about this. Allowing more stuff to be
moved to GTT will have an adverse effect on performance. Being more
aggressive and trying to put more stuff in VRAM should almost always
be better if you can avoid buffer ping-ponging. I have been messing
with the domains since ever and what we have now seems to work best.
It's not perfect, but I have already tried all the other options and
they weren't better.

Marek

On Mon, Feb 3, 2014 at 4:13 AM, Michel Dänzer <michel at daenzer.net> wrote:
> On Sam, 2014-02-01 at 15:08 +0100, Marek Olšák wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> ---
>>  src/gallium/drivers/radeon/r600_texture.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
>> index f80a6a2..434a651 100644
>> --- a/src/gallium/drivers/radeon/r600_texture.c
>> +++ b/src/gallium/drivers/radeon/r600_texture.c
>> @@ -668,7 +668,7 @@ r600_texture_create_object(struct pipe_screen *screen,
>>       } else {
>>               resource->buf = buf;
>>               resource->cs_buf = rscreen->ws->buffer_get_cs_handle(buf);
>> -             resource->domains = RADEON_DOMAIN_GTT | RADEON_DOMAIN_VRAM;
>> +             resource->domains = RADEON_DOMAIN_VRAM;
>
> This will force all textures read by a compositor using OpenGL to VRAM
> as well. I think we need to manage the domains separately for reads and
> writes.
>
>
> The other patches in the series look good to me.
>
>
> --
> Earthling Michel Dänzer            |                  http://www.amd.com
> Libre software enthusiast          |                Mesa and X developer
>


More information about the mesa-dev mailing list