nouveau: use pre-calculated stride for resource_get_handle
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Mon, 1 Oct 2012 23:52:23 +0000 (01:52 +0200)
committerMarcin Slusarz <marcin.slusarz@gmail.com>
Tue, 9 Oct 2012 20:23:09 +0000 (22:23 +0200)
Fixes FDO#55294.

NOTE: This is a candidate for the 9.0 branch.

src/gallium/drivers/nv30/nv30_miptree.c
src/gallium/drivers/nv50/nv50_miptree.c

index 5a9a63ba0d9f92bc27c03484e9a355682d312b64..9700fa8cb4b0cc3e8b8b29824c1a05201fb2e6ba 100644 (file)
@@ -56,8 +56,7 @@ nv30_miptree_get_handle(struct pipe_screen *pscreen,
    if (!mt || !mt->base.bo)
       return FALSE;
 
-   stride = util_format_get_stride(mt->base.base.format,
-                                   mt->base.base.width0);
+   stride = mt->level[0].pitch;
 
    return nouveau_screen_bo_get_handle(pscreen, mt->base.bo, stride, handle);
 }
index 7b8dfb83e3eb2afb035deef839b0c186202ed011..70e8c7788ea8be16d7aaf1e1463b1e0c0fc21c9a 100644 (file)
@@ -133,8 +133,7 @@ nv50_miptree_get_handle(struct pipe_screen *pscreen,
    if (!mt || !mt->base.bo)
       return FALSE;
 
-   stride = util_format_get_stride(mt->base.base.format,
-                                   mt->base.base.width0);
+   stride = mt->level[0].pitch;
 
    return nouveau_screen_bo_get_handle(pscreen,
                                        mt->base.bo,