[PATCH xserver] glamor: an FBO is not needed for Xv pixmaps
Olivier Fourdan
ofourdan at redhat.com
Fri Apr 21 07:05:51 UTC 2017
It appears that on some hardware/diver combo such as nv30/nouveau, using
GL_ALPHA as format for 8-bit depth will cause an incomplete attachment
error (GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT) when trying to bind the
texture.
As a result, the FBO is NULL and glamor segfaults when trying to access
the FBO width/height in pixmap_priv_get_scale() in glamor_xv_render().
This happens with glamor-xv which uses 8-bit pixmaps, meaning that on
such hardware/driver, trying to play a video using Xv will lead to a
crash of the Xserver. This affects Xwayland, Xephyr, modesetting driver
with glamor accel.
But the use of an FBO is not actually needed for glamox-xv, so by
disabling FBO at pixmap creation, we can avoid the issue entirely.
Fix suggested by Eric Anholt <eric at anholt.net>
Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=100710
Fixes: https://bugzilla.redhat.com/1412814
---
glamor/glamor_xv.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/glamor/glamor_xv.c b/glamor/glamor_xv.c
index 3bcf909..31320d1 100644
--- a/glamor/glamor_xv.c
+++ b/glamor/glamor_xv.c
@@ -430,11 +430,14 @@ glamor_xv_put_image(glamor_port_private *port_priv,
glamor_destroy_pixmap(port_priv->src_pix[i]);
port_priv->src_pix[0] =
- glamor_create_pixmap(pScreen, width, height, 8, 0);
+ glamor_create_pixmap(pScreen, width, height, 8,
+ GLAMOR_CREATE_FBO_NO_FBO);
port_priv->src_pix[1] =
- glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, 0);
+ glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8,
+ GLAMOR_CREATE_FBO_NO_FBO);
port_priv->src_pix[2] =
- glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8, 0);
+ glamor_create_pixmap(pScreen, width >> 1, height >> 1, 8,
+ GLAMOR_CREATE_FBO_NO_FBO);
port_priv->src_pix_w = width;
port_priv->src_pix_h = height;
--
2.9.3
More information about the xorg-devel
mailing list