etnaviv: remember data offset into BO
authorLucas Stach <l.stach@pengutronix.de>
Wed, 23 May 2018 15:19:52 +0000 (17:19 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Thu, 8 Aug 2019 14:11:34 +0000 (16:11 +0200)
Imported resources might not start at offset 0 into the buffer object.
Make sure to remember the offset that is provided with the handle on
import.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_resource.c

index 34d4d2449a9ec77a9e9f2af8088c400fbcbae5c0..b03681cc5c0c7d0881b55e80ee4b5b1203246d29 100644 (file)
@@ -556,6 +556,7 @@ etna_resource_from_handle(struct pipe_screen *pscreen,
    level->width = tmpl->width0;
    level->height = tmpl->height0;
    level->depth = tmpl->depth0;
+   level->offset = handle->offset;
 
    /* Determine padding of the imported resource. */
    unsigned paddingX = 0, paddingY = 0;