Bug 42131

Summary: Problem with resizing OpenGL windows when using XCB
Product: Mesa Reporter: nilschrbrause
Component: Mesa coreAssignee: mesa-dev
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium CC: j.keil, psychon, srodal
Version: 7.11   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Test program demonstrating the problem
Demonstration how it may work
Complete with Makefile

Description nilschrbrause 2011-10-23 10:40:52 UTC
Created attachment 52651 [details]
Test program demonstrating the problem

The attached program creates a window using XCB and draws a rectangle inside it using OpenGL. When using indirect software rendering (LIBGL_ALWAYS_INDIRECT=1), everything works as expected. But when using the R600 Gallium3D driver, the OpenGL view port doesn't seem to get resized properly and the window contents get screwed up.
Comment 1 ikrabbe.ask 2012-01-03 07:05:34 UTC
I can confirm this bug. It seems that there are some internal events, forwarded to the DRI(2) module that get lost, as xcb doesn't use XEvents. That's why it works, when you use the Xlib Event Loop { if (XPending(D)) XNextEvent(D,&E); } with XSetEventQueueOwner(Xlib...);

When you use the xcb event loop mechanism, mesa does not detect the events, that need to be reacted on by the DRI module.

So after all, this problem has to be solved within mesa, not within xcb. Obviously there where some experiments that care about xcb and mesa, but I haven't found a good development branch yet.

What I do about this problem now is to create a glXCreateWindow (overlay) at full screen size and render my scene into the visible part of the window, by translation and scaling.
Comment 2 ikrabbe.ask 2012-01-03 08:03:49 UTC
Created attachment 55087 [details]
Demonstration how it may work

This program is a bit bigger, than actually needed for this bug, but I'm too lazy to strip the example from my test repository.
Comment 3 ikrabbe.ask 2012-01-03 08:07:48 UTC
Created attachment 55088 [details]
Complete with Makefile

Edit the MESA and XCB Variables in the Makefile or optionally in your own, config.mk. Currently they are setup to compile against my test setup, with
quite recent git origin/master installations.
Comment 4 ikrabbe.ask 2012-01-05 03:17:58 UTC
*** Bug 35945 has been marked as a duplicate of this bug. ***

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.