[Piglit] [PATCH] piglit_drm_dma_buf: fix the stride

Marek Olšák maraeo at gmail.com
Sat Jun 17 13:38:37 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

dst_stride is from gbm_bo_map (CPU mapping), but we need the real stride.
This fixes piglit DMABUF tests with tiled surfaces.
---
 tests/util/piglit-framework-gl/piglit_drm_dma_buf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index c3225c3..713763d 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -323,21 +323,21 @@ piglit_gbm_buf_create(unsigned w, unsigned h, unsigned fourcc,
 			      &dst_stride, &map_data);
 	if (!dst_data) {
 		fprintf(stderr, "Failed to map GBM bo\n");
 		gbm_bo_destroy(bo);
 		return NULL;
 	}
 
 	buf->w = w;
 	buf->h = h;
 	buf->offset[0] = 0;
-	buf->stride[0] = dst_stride;
+	buf->stride[0] = gbm_bo_get_stride(bo);
 	buf->fd = -1;
 	buf->priv = bo;
 
 	for (i = 0; i < h; ++i) {
 		memcpy((char *)dst_data + i * dst_stride,
 		       src_data + i * src_stride,
 		       w * cpp);
 	}
 
 	switch (fourcc) {
-- 
2.7.4



More information about the Piglit mailing list