st/egl image: multiply drm buf-stride with blocksize
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Sun, 31 Oct 2010 15:01:52 +0000 (16:01 +0100)
committerChia-I Wu <olv@lunarg.com>
Sun, 31 Oct 2010 17:03:53 +0000 (01:03 +0800)
[olv: formatted for 80-column wrapping]

src/gallium/state_trackers/egl/common/egl_g3d_image.c

index be9c88e5e478654f309791be002914d0db11cfa4..0c8ad339cc28da8076c0af9a7cf5cb37ab679154 100644 (file)
@@ -178,7 +178,8 @@ egl_g3d_reference_drm_buffer(_EGLDisplay *dpy, EGLint name,
 
    memset(&wsh, 0, sizeof(wsh));
    wsh.handle = (unsigned) name;
-   wsh.stride = attrs.DRMBufferStrideMESA;
+   wsh.stride =
+      attrs.DRMBufferStrideMESA * util_format_get_blocksize(templ.format);
 
    return screen->resource_from_handle(screen, &templ, &wsh);
 }