MESA_drm_image spec mentions that the EGL_DRM_BUFFER_STRIDE_MESA
attribute is expressed in bytes. However, the eglCreateImageKHR()
implementation assumes the attribute is expressed in pixels, which
is what the DRI create image API expects.
---
 src/egl/drivers/dri2/egl_dri2.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index e2fb9f3..c4d4f2f 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1073,10 +1073,11 @@ dri2_create_image_mesa_drm_buffer(_EGLDisplay *disp, 
_EGLContext *ctx,
       return NULL;
    }
 
+   pitch = attrs.DRMBufferStrideMESA;
    switch (attrs.DRMBufferFormatMESA) {
    case EGL_DRM_BUFFER_FORMAT_ARGB32_MESA:
       format = __DRI_IMAGE_FORMAT_ARGB8888;
-      pitch = attrs.DRMBufferStrideMESA;
+      pitch /= 4;
       break;
    default:
       _eglError(EGL_BAD_PARAMETER,
-- 
1.7.5.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to