[Mesa-dev] Mesa drivers/GLX and fork

Christian König deathsimple at vodafone.de
Wed Oct 16 15:47:08 CEST 2013


Am 15.10.2013 19:46, schrieb Ian Romanick:
> On 10/15/2013 03:45 AM, Christian König wrote:
>> Hi Marek,
>>
>> for the past few days I've been working on solving
>> https://bugs.freedesktop.org/show_bug.cgi?id=70123.
>>
>> The basic problem is that compton forks itself into the background after
>> initializing the X server connection and GLX context. What happens now
>> is that only comptons main thread get's cloned by the fork, but not any
>> background thread created by the radeon winsys to offload the command
>> submission (that is common and very well known pthread behaviour).
>>
>> I'm not 100% sure if comptons behaviour is valid or not and so if we
>> should try to fix it or not. On the one hand it should be transparent to
>> the application that we created another thread to offload some work from
>> the main thread, but on on the other hand dublicating the X connection
>> and GLX context with fork just screams for problems.
>>
>> Any idea what the spec(s) say about this?
> At the very least, if the context is current before the fork, it can't
> be current in the new process after the fork.
>
> Is it a direct rendering context or indirect rendering?  Direct
> rendering contexts can't even be in share groups across address space
> boundaries.

It's a direct context (if I understood it right).

> It doesn't seem like it can ever work.

Yes that's also my impression. Even with my workaround of detecting a 
fork with the pid change and reinitializing everything we still have a 
couple of unsolved corner cases that would need to be addressed.

Thanks for your opinion on that. I'm going to reject the bug report for now.

Christian.

>> Thanks,
>> Christian.
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list