st/dri: ask the driver to update its internal copies on reimport
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 19 Jan 2017 14:05:37 +0000 (15:05 +0100)
committerLucas Stach <l.stach@pengutronix.de>
Fri, 20 Jan 2017 14:30:29 +0000 (15:30 +0100)
For imported buffers that can't be used directly as a source to the
texture samplers, the pipe driver might need to create an internal
copy, for example in a different tiling layout. When buffers are
reimported they may contain new image data, so the driver internal
copies need to be recreated.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
src/gallium/state_trackers/dri/dri2.c

index 77523e98ffed170413405ff2274ac6fd6a3a4158..c4f2c57d1cf0331cf46936aec8e329f7874a16b7 100644 (file)
@@ -1168,6 +1168,10 @@ dri2_from_planar(__DRIimage *image, int plane, void *loaderPrivate)
    if (img == NULL)
       return NULL;
 
+   if (img->texture->screen->resource_changed)
+      img->texture->screen->resource_changed(img->texture->screen,
+                                             img->texture);
+
    /* set this to 0 for sub images. */
    img->dri_components = 0;
    return img;