[PATCH weston v3 3/3] simple-dmabuf-drm: name ALIGN FD_ALIGN

Guido Günther agx at sigxcpu.org
Mon Mar 19 12:38:13 UTC 2018


Other backends might have different alignment requirements and since we
can have several backends we want a less generic name.

Signed-off-by: Guido Günther <agx at sigxcpu.org>
---
 clients/simple-dmabuf-drm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clients/simple-dmabuf-drm.c b/clients/simple-dmabuf-drm.c
index 08e794c8..2779712e 100644
--- a/clients/simple-dmabuf-drm.c
+++ b/clients/simple-dmabuf-drm.c
@@ -222,7 +222,7 @@ intel_device_destroy(struct buffer *my_buf)
 
 #endif /* HAVE_LIBDRM_INTEL */
 #ifdef HAVE_LIBDRM_FREEDRENO
-#define ALIGN(v, a) ((v + a - 1) & ~(a - 1))
+#define FD_ALIGN(v, a) ((v + a - 1) & ~(a - 1))
 
 static int
 fd_alloc_bo(struct buffer *buf)
@@ -230,7 +230,7 @@ fd_alloc_bo(struct buffer *buf)
 	int flags = DRM_FREEDRENO_GEM_CACHE_WCOMBINE;
 	int size = buf->width * buf->height * buf->bpp / 8;
 
-	buf->stride = ALIGN(buf->width, 32) * buf->bpp / 8;
+	buf->stride = FD_ALIGN(buf->width, 32) * buf->bpp / 8;
 	size = buf->stride * buf->height * buf->bpp / 8;
 	buf->fd_dev = fd_device_new(buf->drm_fd);
 	buf->fd_bo = fd_bo_new(buf->fd_dev, size, flags);
-- 
2.16.1



More information about the wayland-devel mailing list