Move the loadTexture for X11 pixmap functionality to the EglOnXBackend
ClosedPublic

Authored by graesslin on Jun 14 2016, 7:10 AM.

Details

Summary

To use eglCreateImageKhr for an X11 pixmap we need an EGLDisplay created
for the same XDisplay as the X11 pixmap. This means if we created an
EGLDisplay for a GBM device, we are not allowed to load a texture from
the X11 pixmap and can result in a crash in the driver.

Similar in the nested X11 setup the EGLDisplay is created for the
rendering window, but the X11 pixmaps are from the Xwayland server KWin
started. They don't belong to the same windowing system.

This change addresses this problem by moving the loading of X11 pixmaps
from AbstractEglTexture to EglTexture of the EglOnX11Backend. Thus for
any usage on a non X11 platform we cannot hit the code path any more.
In addition the nested X11 platform can indicate that it doesn't support
it and thus also doesn't go through the code path.

Test Plan

Tested standalone and nested X11 platform

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 4435.Jun 14 2016, 7:10 AM
graesslin retitled this revision from to Move the loadTexture for X11 pixmap functionality to the EglOnXBackend.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma on Wayland.
Restricted Application added projects: Plasma on Wayland, KWin. · View Herald TranscriptJun 14 2016, 7:10 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
bshah added a subscriber: bshah.Jun 14 2016, 7:50 AM

+1, This patch definitely improved situation then earlier where kwin_wayland used to crash with this backtrace : https://ptpb.pw/Y_W1.txt

bshah accepted this revision.Jun 14 2016, 11:40 AM
bshah added a reviewer: bshah.
This revision is now accepted and ready to land.Jun 14 2016, 11:40 AM
This revision was automatically updated to reflect the committed changes.