From: Marek Olšák <marek.ol...@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

_______________________________________________
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to