[PATCH 1/7] etnaviv: always assume pixmap 3D usage if DRI2 is enabled

Lucas Stach l.stach at pengutronix.de
Tue Nov 22 11:44:14 UTC 2016


The texture-from-pixmap extension allows to construct a GL
texture from any pixmap. The GL textures can then be bound
to an FBO for rendering, so all pixmaps must be properly
aligned to be used with the 3D core if DRI2 is enabled.

Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
This, together with the renderonly removal on the MESA side,
fixes piglit/glx-tfp.
---
 etnaviv/etnaviv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/etnaviv/etnaviv.c b/etnaviv/etnaviv.c
index 2662fc32ef58..bd391a3d2656 100644
--- a/etnaviv/etnaviv.c
+++ b/etnaviv/etnaviv.c
@@ -724,6 +724,16 @@ static PixmapPtr etnaviv_CreatePixmap(ScreenPtr pScreen, int w, int h,
 	    w <= 32 && h <= 32)
 		goto fallback;
 
+#ifdef HAVE_DRI2
+	/*
+	 * With the texture-from-pixmap extension any pixmap may end up as a
+	 * GL texture, which in turn can be bound to an FBO for rendering, so
+	 * all pixmaps must be aligned properly for 3D usage if DRI2 is
+	 * enabled.
+	 */
+	if (etnaviv->dri2_enabled)
+		usage_hint |= CREATE_PIXMAP_USAGE_3D;
+#endif
 	pixmap = etnaviv->CreatePixmap(pScreen, 0, 0, depth, usage_hint);
 	if (pixmap == NullPixmap || w == 0 || h == 0)
 		return pixmap;
-- 
2.10.2



More information about the etnaviv mailing list