Request a high-priority EGL contexts
ClosedPublic

Authored by hein on Mar 22 2018, 9:29 AM.

Details

Summary

This patch implements using EGL_IMG_context_priority to request
high-priority rendering contexts if the extension is available.

EGL_IMG_context_priority is currently used in this fashion by
e.g. Android's SurfaceFlinger (RenderEngine.cpp) and libweston
(gl-renderer.c) and seems promising given this widespread
acceptance.

Diff Detail

Repository
R108 KWin
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
hein created this revision.Mar 22 2018, 9:29 AM
Restricted Application added a project: KWin. · View Herald TranscriptMar 22 2018, 9:29 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
hein requested review of this revision.Mar 22 2018, 9:29 AM
hein updated this revision to Diff 30201.

Add missing default value.

davidedmundson requested changes to this revision.Mar 22 2018, 11:06 AM

+1 to the concept

platformsupport/scenes/opengl/abstract_egl_backend.cpp
235

GL contexts can arbitrary not be created even if it claims to support something.

The current code is effectively doing something like:

if (haveRobust) {

contextProps->setRobust(true);
push_back(contextProps);

}
contextProps->setRobust(false);
push_back(contextProps)

but for a tonne of combinations

This new attribute should follow that same pattern.

This revision now requires changes to proceed.Mar 22 2018, 11:06 AM
hein added a comment.Mar 22 2018, 11:21 AM

It seems super fugly to create all these multiplying permutations, this code will become a huge mess. I was hoping we could avoid this.

hein updated this revision to Diff 30270.Mar 23 2018, 6:27 AM

Try all permutations.

hein added a comment.Mar 23 2018, 6:37 AM

BTW: I tested this patch both on kernels 4.12 and 4.15 on my Intel Skylake hw. 4.12 does not support EGL_IMG_context_priority yet, but 4.15 does. Things still work fine on both, including debug confirming I got a high priority context on the newer kernel.

Only one minor change left:
updating ./opengl_context_attribute_builder_test.cpp

then ++ from me.

hein updated this revision to Diff 30310.Mar 23 2018, 1:37 PM

Fill in autotest.

hein updated this revision to Diff 30312.Mar 23 2018, 1:38 PM

Fix test case names.

davidedmundson accepted this revision.Mar 23 2018, 1:50 PM
This revision is now accepted and ready to land.Mar 23 2018, 1:50 PM
romangg accepted this revision.Mar 29 2018, 11:51 AM
This revision was automatically updated to reflect the committed changes.