Bug 86651

Summary: [i965 Bisected]Piglit glx_glx-pixmap-multi fails, with DRI3 disabled
Product: piglit Reporter: lu hua <huax.lu>
Component: testsAssignee: Ian Romanick <idr>
Status: RESOLVED FIXED QA Contact: Piglit Mailing List <piglit>
Severity: normal    
Priority: high    
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description lu hua 2014-11-24 05:38:21 UTC
System Environment:
--------------------------
Platform: HSW+
Libdrm:		(master)libdrm-2.4.58-8-g29bb4c6911b21c026c3863799dcbeaa29981bf7e
Mesa:		(master)89b9ef937c11598817e0ec2d20d70b5254d4e406
Xserver:	(master)xorg-server-1.16.99.901-4-g65cc0982afb1d47d17e655efaef40d4a82e7574a
Xf86_video_intel:(master)2.99.916-154-g0f15b8b45bb6de10ce1926db303247a5bd3c1c08
Libva:		(master)fd83a7d44f790d40626eaa90fda18fb5c42b2c45
Libva_intel_driver:(master)edbb8cdada09cd116103e68f942b0889fd767391
Kernel:   (drm-intel-nightly)0f8cb1fb8e01c53f9ad47344e9448d72df49fcf2

Bug detailed description:
-----------------------------
It fails on HSW+ platforms. It's Xf86_video_intel regression.

glx_glx-swap-event_interval and glx_GLX_MESA_query_renderer_coverage also fail on HSW+ platforms with same bisect commit.

Following cases also fail on BDW and BSW with same bisect commit:
spec_OpenGL_1.1_read-front_clear-front-first_samples=2
spec_OpenGL_1.1_read-front_clear-front-first_samples=4
spec_OpenGL_1.1_read-front_clear-front-first_samples=6
spec_OpenGL_1.1_read-front_clear-front-first_samples=8

Bisect shows: b6eeb7a1f7efa591504070b606be655e27e6e9c2 is the first bad commit
commit b6eeb7a1f7efa591504070b606be655e27e6e9c2
Author:     Chris Wilson <chris@chris-wilson.co.uk>
AuthorDate: Wed Nov 5 13:03:41 2014 +0000
Commit:     Chris Wilson <chris@chris-wilson.co.uk>
CommitDate: Wed Nov 19 13:15:36 2014 +0000

    Disable DRI3 by default

    The external libraries, both in git, and especially shipping already
    enabled in distributions, are buggy and lead to server crashes and
    lockups. Caveat emptor.

    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


output:
failed to create pixmap
failed to create drawable
PIGLIT: {"result": "fail" }

Reproduce steps:
---------------------------- 
1. xinit
2. bin/glx-pixmap-multi -auto -fbo
Comment 1 lu hua 2014-11-25 02:36:59 UTC
glx_glx-buffer-age and glx_glx-buffer-age_vblank_mode=0 skip due to DRI3 disabled.
Comment 2 Chris Wilson 2014-12-30 22:29:04 UTC
Bisecting the server reveals:

commit d0da0e9c3bb8fe0cd4879ecb24d21715bfaa209b
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Sep 4 10:59:40 2014 -0700

    glx: Disable indirect GLX contexts by default.
    
    Almost every situation of someone running indirect GLX is a mistake
    that results in X Server crashes.  Indirect GLX is the cause of
    regular security vulnerabilities, and rarely provides any capability
    to the user.  Just disable it unless someone wants to enable it for
    their special use case (using +iglx on the command line).
    
    Signed-off-by: Eric Anholt <eric@anholt.net>
    Acked-by:  Keith Packard <keithp@keithp.com>
    Signed-off-by: Keith Packard <keithp@keithp.com>

So the question is why is mesa creating an indirect context in this case?
Comment 3 Chris Wilson 2014-12-31 09:40:45 UTC
Actually it is a bug in the test:

diff --git a/tests/spec/glx_mesa_query_renderer/coverage.c b/tests/spec/glx_mesa_query_renderer/coverage.c
index b55be16..0d36f4c 100644
--- a/tests/spec/glx_mesa_query_renderer/coverage.c
+++ b/tests/spec/glx_mesa_query_renderer/coverage.c
@@ -257,7 +257,7 @@ int main(int argc, char **argv)
        win = piglit_get_glx_window_unmapped(dpy, visinfo);
        glxWin = glXCreateWindow(dpy, fbconfig, win, NULL);
 
-       ctx = glXCreateNewContext(dpy, fbconfig, GLX_RGBA, NULL, True);
+       ctx = glXCreateNewContext(dpy, fbconfig, GLX_RGBA_TYPE, NULL, True);
        if (ctx == NULL) {
                fprintf(stderr, "Unable to create OpenGL context!\n");
                piglit_report_result(PIGLIT_FAIL);
Comment 4 Fabian Bieler 2017-12-19 00:12:56 UTC
Fixed by:
758a28d06cac0c0bd4b41bf0b07400cf3398c989
glx-query-renderer-coverage: Fix broken glXCreateNewContext call

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.