Mesa (9.0): nouveau: use pre-calculated stride for resource_get_handle

Marcin Åšlusarz mslusarz at kemper.freedesktop.org
Sun Oct 21 20:27:00 UTC 2012


Module: Mesa
Branch: 9.0
Commit: 77b1d2e09cfe968a01978a9042ad4edcaad3ada2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=77b1d2e09cfe968a01978a9042ad4edcaad3ada2

Author: Marcin Slusarz <marcin.slusarz at gmail.com>
Date:   Tue Oct  2 01:52:23 2012 +0200

nouveau: use pre-calculated stride for resource_get_handle

Fixes FDO#55294.

NOTE: This is a candidate for the 9.0 branch.
(cherry picked from commit 93eba269351c6e256db3a4cc7c7018f5a3fae5a1)

---

 src/gallium/drivers/nv30/nv30_miptree.c |    3 +--
 src/gallium/drivers/nv50/nv50_miptree.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c
index 7e67729..18e40e1 100644
--- a/src/gallium/drivers/nv30/nv30_miptree.c
+++ b/src/gallium/drivers/nv30/nv30_miptree.c
@@ -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);
 }
diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index 7b8dfb8..70e8c77 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -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,




More information about the mesa-commit mailing list