[PATCH weston v4 2/4] simple-dmabuf-drm: use large enough buffer (freedreno)

Derek Foreman derekf at osg.samsung.com
Mon Mar 19 19:35:40 UTC 2018


On 2018-03-19 12:23 PM, Eric Engestrom wrote:
> On Monday, 2018-03-19 17:45:19 +0100, Guido Günther wrote:
>> Use stride instead of width for buffer calculation.
>>
>> Signed-off-by: Guido Günther <agx at sigxcpu.org>
>> ---
>>   clients/simple-dmabuf-drm.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/clients/simple-dmabuf-drm.c b/clients/simple-dmabuf-drm.c
>> index efe3b7f5..a184d7e7 100644
>> --- a/clients/simple-dmabuf-drm.c
>> +++ b/clients/simple-dmabuf-drm.c
>> @@ -222,13 +222,15 @@ fd_alloc_bo(struct buffer *buf)
>>   {
>>   	int flags = DRM_FREEDRENO_GEM_CACHE_WCOMBINE;
>>   	int size = buf->width * buf->height * buf->bpp / 8;
> 
> You forgot to remove the initialisation here ^

And the commit log is weird, as it's been kept from a previous patch.

As both these problems seem trivial, I've fixed them while landing with 
my Reviewed-by.

Thanks,
Derek

>> -	buf->fd_dev = fd_device_new(buf->drm_fd);
>>   
>> +	buf->fd_dev = fd_device_new(buf->drm_fd);
>> +	buf->stride = ALIGN(buf->width, 32) * buf->bpp / 8;
>> +	size = buf->stride * buf->height;
>> +	buf->fd_dev = fd_device_new(buf->drm_fd);
>>   	buf->fd_bo = fd_bo_new(buf->fd_dev, size, flags);
>>   
>>   	if (!buf->fd_bo)
>>   		return 0;
>> -	buf->stride = ALIGN(buf->width, 32) * buf->bpp / 8;
>>   	return 1;
>>   }
>>   
>> -- 
>> 2.16.1
>>
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 



More information about the wayland-devel mailing list