intel / libva

Libva is an implementation for VA-API (Video Acceleration API)
https://01.org/linuxmedia
Other
637 stars 299 forks source link

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

Open ghost opened 2 years ago

ghost commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

kwizart commented 2 years ago

I think this issue could be closed...

jbrownsw commented 8 months ago

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

kwizart commented 8 months ago

Thanks, for confirming the issue is still here.

Do you have a simple reproducer (with sample) ?