libva icon indicating copy to clipboard operation
libva copied to clipboard

[glx] fbconfig[0] is not 8 bits RGB with Mesa 18.x or newer

Open ghost opened this issue 4 years ago • 5 comments

Mesa has enabled "allow_rgb10_configs" by default. Note that 10bpc affects both GLX and EGL. The requirement from EGL is that 10bpc formats must be first in the list of configs. This breaks applications that just use the first config, which used to be 8bpc and now it's 10bpc. Here's related bug report and some discussions from Mesa list: https://bugs.freedesktop.org/show_bug.cgi?id=109548 https://lists.freedesktop.org/archives/mesa-dev/2019-February/214610.html

In va/glx/va_glx_impl.c: static int create_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)

    glx_pixmap = pOpenGLVTable->glx_create_pixmap(
                     ctx->native_dpy,
                     fbconfig[0],
                     pixmap,
                     pixmap_attrs

Chossing the first fbconfig[0] breaks applications wanting 8bit config on mesa 18X or newer, or when allow_rgb10_configs=true is set. You should iterate over FBConfig and select 8 bit color size !

ghost avatar Feb 02 '22 10:02 ghost

Acutally, juste specifying the alpha size seems to be enough.

diff --git a/va/glx/va_glx_impl.c b/va/glx/va_glx_impl.c
index 3ad01a6..c1ca999 100644
--- a/va/glx/va_glx_impl.c
+++ b/va/glx/va_glx_impl.c
@@ -521,6 +521,7 @@ static int create_tfp_surface(VADriverContextP ctx, VASurfaceGLXP pSurfaceGLX)
         GLX_RED_SIZE,           8,
         GLX_GREEN_SIZE,         8,
         GLX_BLUE_SIZE,          8,
+        GLX_ALPHA_SIZE,         8,
         /*
          * depth test isn't enabled in the implementaion of VA GLX,
          * so depth buffer is unnecessary. However to workaround a
(END)

ghost avatar Feb 02 '22 13:02 ghost

associated PR https://github.com/intel/libva/pull/570

ghost avatar Feb 02 '22 14:02 ghost

I think this issue could be closed...

kwizart avatar Jun 14 '22 13:06 kwizart

The PR was closed without being merged and I just ran into it so I don't think it can be closed.

jbrownsw avatar Oct 09 '23 19:10 jbrownsw

Thanks, for confirming the issue is still here.

Do you have a simple reproducer (with sample) ?

kwizart avatar Oct 11 '23 12:10 kwizart