[PATCH] glamor: Use GL_STREAM_READ also for read/write access to a PBO

Michel Dänzer michel at daenzer.net
Thu Sep 25 00:14:03 PDT 2014


On 25.09.2014 15:57, Markus Wick wrote:
> Am 2014-09-25 08:27, schrieb Michel Dänzer:
>> From: Michel Dänzer <michel.daenzer at amd.com>
>>
>> Otherwise the CPU may end up reading from non-cacheable memory, which is
>> very slow.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84178
>> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
>> ---
>>
>> Keeping gl_usage in case we need to add back GLAMOR_ACCESS_WO.
>>
>>  glamor/glamor_prepare.c | 5 +----
>>  1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c
>> index 561c55d..fb85d90 100644
>> --- a/glamor/glamor_prepare.c
>> +++ b/glamor/glamor_prepare.c
>> @@ -84,10 +84,7 @@ glamor_prep_pixmap_box(PixmapPtr pixmap,
>> glamor_access_t access, BoxPtr box)
>>              if (priv->base.pbo == 0)
>>                  glGenBuffers(1, &priv->base.pbo);
>>
>> -            if (access == GLAMOR_ACCESS_RW)
>> -                gl_usage = GL_DYNAMIC_DRAW;
>> -            else
>> -                gl_usage = GL_STREAM_READ;
>> +            gl_usage = GL_STREAM_READ;
>>
>>              glBindBuffer(GL_PIXEL_PACK_BUFFER, priv->base.pbo);
>>              glBufferData(GL_PIXEL_PACK_BUFFER,
>
> Was the write only patch merged?

No, nothing's needed GLAMOR_ACCESS_WO yet.

> If so, this should be changed to use GL_STREAM_DRAW for WO.

Agreed.


> But you're right, for RW, it should be STREAM (used once) READ (accessed
> by the CPU), so
>
> Reviewed-by: Markus Wick <markus at selfnet.de>

Thanks!


-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer


More information about the xorg-devel mailing list