Mesa (master): etnaviv: fill in layer_stride for imported resources

Lucas Stach lynxeye at kemper.freedesktop.org
Thu Jun 29 09:36:24 UTC 2017


Module: Mesa
Branch: master
Commit: b2a87ce34f081671c7e4969874de91ac6953d062
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b2a87ce34f081671c7e4969874de91ac6953d062

Author: Lucas Stach <l.stach at pengutronix.de>
Date:   Thu Jun 22 16:10:48 2017 +0200

etnaviv: fill in layer_stride for imported resources

The layer stride information is used in various parts of the driver,
so it needs to be present regardless if the driver allocated the
buffer itself or merely imported it from an external source.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel at pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>
Reviewed-by: Wladimir J. van der Laan <laanwj at gmail.com>

---

 src/gallium/drivers/etnaviv/etnaviv_resource.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_resource.c b/src/gallium/drivers/etnaviv/etnaviv_resource.c
index 1c098445b1..dfd0870711 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_resource.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_resource.c
@@ -352,6 +352,8 @@ etna_resource_from_handle(struct pipe_screen *pscreen,
 
    level->padded_width = align(level->width, paddingX);
    level->padded_height = align(level->height, paddingY);
+   level->layer_stride = level->stride * util_format_get_nblocksy(prsc->format,
+                                                                  level->padded_height);
 
    /* The DDX must give us a BO which conforms to our padding size.
     * The stride of the BO must be greater or equal to our padded




More information about the mesa-commit mailing list