Commit graph

115 commits

Author SHA1 Message Date
Martin Gräßlin
2e191bb751 [backends/virtual] Fix include guards
Kudos to kbroulik for telling me, that I cannot copy'n'paste.
2015-12-10 15:19:19 +01:00
Martin Gräßlin
9f8a6d8e24 Merge branch 'Plasma/5.5' 2015-12-01 08:01:00 +01:00
Martin Gräßlin
d89777bcac Make Wayland::EGL optional again
This is needed to make KWin build-able on non-Linux, but is actually
only a workaround. The dependency should also be available on non-Linux.

This disables the EGL integration in the Wayland backend (QPainter still
available) and the EGL fallback in the qpa plugin (preferred context
sharing still available, but requires a working OpenGL Scene).

REVIEW: 126202
2015-12-01 07:58:47 +01:00
Martin Gräßlin
a055e2de82 Only compile VirtualTerminal if libinput is found
The implementation of VirtualTerminal is too linux specific and doesn't
compile on e.g. freebsd. Currently the most usage is in combination with
libinput. Only usage is:
* libinput related functionality in InputRedirection
* backends without custom input handling

Thus binding the feature to whether libinput is available is currently
the least invasive approach to get it compile on non-Linux.

In the long run this needs a different solution. The functionality
provided by VirtualTerminal is required and without the backends don't
work. It's needed to get notified about VT switches, when KWin needs to
stop rendering. So a solution for non-Linux needs to be found if
non-Linux wants to provide Wayland in future.

REVIEW: 126182
2015-12-01 07:57:39 +01:00
l10n daemon script
acfef30207 SVN_SILENT made messages (.desktop file) 2015-11-26 18:12:55 +00:00
l10n daemon script
e24e39b528 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2015-11-26 15:58:56 +00:00
Martin Gräßlin
04ea8ec22f [backends/x11] Add a dedicated EGL backend for multi-surface rendering
Based on the existing EglOnXBackend. Main difference is that this
subclass implements perScreenRendering with support for one EGLSurface
per output.
2015-11-26 08:33:07 +01:00
Martin Gräßlin
b1914b4b2c Add pure virtual OpenGLBackend::init() method
All backends already have an init method so far called from the ctor.
This change moves the call to init out of the OpenGL backends and makes
it the responsibility of the creating code to also call init on the
backend.

This change makes it easier to have virtual methods being called during
the initialization.
2015-11-26 08:33:07 +01:00
Martin Gräßlin
56bd1e7194 [wayland] Add support for initial output count for nested compositors
Added to x11 backend which creates one window per output.

New command line option is called --output-count=<int>.
2015-11-26 08:33:07 +01:00
Martin Gräßlin
1e3013b58c [backends/x11] Prepare for multi-output rendering
The backend is prepared for managing multiple x11 windows. Currently
it's still only one window, but it's all internally working through
the architecture for multiple windows.
2015-11-26 08:33:07 +01:00
Martin Gräßlin
f5905e5e48 [backends/x11] Prepare QPainter backend for multi screen rendering
The backend is in principal ready to render to multiple X11 windows.
This will allow simulating a multi screen setup.
2015-11-26 08:33:07 +01:00
l10n daemon script
c69c46d8ca SVN_SILENT made messages (.desktop file) 2015-11-25 18:20:33 +00:00
Martin Gräßlin
3361373445 [backends/hwcomposer] Announce support for DPMS
Hooked up to toggle blank output dependent on state.

REVIEW: 126095
2015-11-23 11:48:39 +01:00
Martin Gräßlin
01451eea36 Revert "Handle conflicts between epoxy and manually resolved function pointers"
This reverts commit ac1dbac8b1.
2015-11-17 14:58:59 +01:00
Martin Gräßlin
e71a230213 [hwcomposer] Add support for backlight through light_device_t
We use the hw module's backlight and set the color to either 0
or FF depending on whetehr we want to have the screen on or off.
This turns the backlight off properly. It is bound to the toggleBlank
functionality so that we always turn on/off the backlight depending
on whether our compositor is on or off.

In addition we listen to key release events on the power button to
toggle the state.

REVIEW: 126083
2015-11-17 14:45:34 +01:00
Martin Gräßlin
8d00355448 [hwcomposer] Don't waitVsync if we haven't activated vsync yet
Would just hit the timeout, no need to wait 16 msec for nothing.
2015-11-17 14:45:34 +01:00
l10n daemon script
6bb9f6db7b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2015-11-17 13:07:36 +00:00
Martin Gräßlin
57a3cea142 [backends/hwcomposer] Base HwcomposerScreens on BasicScreens 2015-11-17 10:49:09 +01:00
Martin Gräßlin
eb81ddfb86 [backends/fbdev] Use BaseScreens implementation 2015-11-17 10:46:32 +01:00
Martin Gräßlin
898eefc6be [backends/wayland] Use BasicScreens implementation 2015-11-17 10:43:10 +01:00
Martin Gräßlin
7b12e55857 [backends/x11] Use BasicScreens implementation 2015-11-17 10:40:17 +01:00
Martin Gräßlin
cab25fc13f [backends/wayland] Drop warning messages concerning egl backend
From a time before we split into platform plugins.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
75c82fce19 [backends/wayland] Only set socket name if it got sepcified
If we don't have a dedicated device identifier we should use the default
mechanismn which involves using the WAYLAND_DISPLAY or WAYLAND_SOCKET env
variable.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
930e56767e [backends/wayland] Do not query outputs
Not needed, we use a nested window.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
df71c5b61b [backends/wayland] Simplify WaylandScreens by basing on ShellSurface size
It's a screen for a nested setup - no need for integrating with Wayland's
output for that.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
9381d3f88c [backends/wayland] Drop XRandR updating
No longer needed as we use Xwayland.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
3f6cb8812b [backends/wayland] ShellSurface opened as a toplevel instead of fullscreen
Going towards nested setup.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
eafded7127 [backends/wayland] Drop subsurface for cursor
As we don't use the fullscreen shell any more, we use the "normal"
cursor image handling of wl_seat.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
1ca690d4ee [backends/wayland] Drop support for fullscreen shell
We are going to switch to a proper nested approach similar to the
x11 backend. Given that we don't want to run on fullscreen anymore
but just open a nested window.
2015-11-17 09:51:50 +01:00
Martin Gräßlin
6d96b8c4af Move egl context creation into AbstractEglContext
Code was more or less copied into each backend, so it's better to
have a shared implementation.
2015-11-16 09:08:14 +01:00
Martin Gräßlin
3a610ec9f6 [backends/hwcomposer] Do not manually cleanup our HwcomposerWindow
It looks like libhybris already deletes the window when we do
eglDestroySurface resulting in a double delete if we also delete it.
2015-11-13 17:55:02 +01:00
Martin Gräßlin
eb5ff917f6 [backends/hwcomposer] Blank output on tear down
This gives a better tear down experience as it goes to black instead
of showing outdated screen and also it disables vsync which fixes a
crash on teardown.
2015-11-13 17:39:16 +01:00
l10n daemon script
22da928d2b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2015-11-13 10:44:04 +00:00
l10n daemon script
7d8fcbfd72 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2015-11-12 11:51:31 +00:00
Martin Gräßlin
ac1dbac8b1 Handle conflicts between epoxy and manually resolved function pointers
For the functions from GL_FOO_robustness we want to resolve it by
ourselves in order to add a custom implementation if it's not available.
Unfortunately once epoxy.h is included this breaks as epoxy defines the
names and so through the preprocessor epoxy always wins.

So we need different names: all functions from robustness get a "kwin"
prefix and the usage is changed everywhere in kwin source code.

REVIEW: 125883
2015-11-11 08:04:29 +01:00
Martin Gräßlin
cbbd684430 [drm] Support configuring absolute output position
Begin of proper multiscreen support!

We load configuration sets for the connected outputs. Each set of
screens represents a unique configuration. For that we use the md5
sum of the edid+connector as uuid of an output. Each of the md5 sums
is then used to create a uuid of the output set. We can be quite certain
that this will generate unique ids for the use cases we will face.

The uuids are used as group names. And from there we read the global
position.

The uuids are considered internal information. It is not intended for
users to configure manually in the config file. The intended way to
configure will be the OutputManagementInterface which recently got added
to KWayland. Once KWin applies a configuration it will store it to config
so that it can be loaded on next startup.

The configuration looks like:
[DrmOutputs][abcdef0123][0123abcdef]
Position=0,0

[DrmOutputs][abcdef0123][fbca3bcdef]
Position=1280,0

This is an example for two outputs set next to each other.

Reviewed-By: Sebastian Kügler
2015-11-06 14:48:52 +01:00
l10n daemon script
99c3e5c290 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2015-11-06 12:18:24 +00:00
l10n daemon script
3433b05c97 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2015-11-04 17:27:21 +00:00
Martin Gräßlin
14d943caea Runtime depend on GLES in all egl backends
As we don't have GLPLatform before the backend is fully created
the AbstractEglBackend has a new method isOpenGLES() -> bool
which determines based on QOpenGLContext::openGLModuleType().
2015-11-03 09:29:31 +01:00
l10n daemon script
b33a878e45 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2015-11-02 11:12:07 +00:00
Martin Gräßlin
e379d06f34 [hwcomposer] Adjust present strategy for block on retrace
Heavily inspired by how the glxbackend works: present happens on
rendering start and not on end frame. In addition present needs to
check whether there is something to show to not block incorrectly.

This is needed as present might also be called from going to idle.

With this change the Nexus5 has a decend refresh rate shown in the
totally accurate fps effect. Before it was capped at around 30 fps
which indicates that the refresh rate was halfed.

On the tearfing front the change seems to not have any negative
impact.
2015-10-29 14:13:40 +01:00
l10n daemon script
75f3964db7 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2015-10-25 10:45:05 +00:00
Martin Gräßlin
93b5e13308 [hwcomposer] Rework the vsync code
This changes how we synchronize through vsync. We use a mutex and a
wait condition to synchronize the threads. When presenting the frame
our main gui thread blocks and will be woken up by the vsync event
(or a timeout of max 1 frame time slot). In order to minimize the
blocked time we use the blocksForRetrace functionality from the GLX
compositor.

Given this change we no longer need to tell the compositor that we
are swapping the frame, it's blocked anyway. Also we don't need the
failsafe QTimer anymore.

With this change applied on a Nexus 5 it's succeeding the "Martin
tortures phone test". It doesn't tear anymore and has a smooth
experience.

I'm rather disappointed by the fact that we need to block in order
to get vsync. This means Android/hwcomposer is as bad as GLX. So
much for the "Android stack is so awesome", in fact it's not. Anybody
thinking it's awesome should compare to DRM/KMS and especially atomic
modesetting. Yes it's possible to present frames without tearing and
without having to block the rendering thread.

Reviewed-By: Marco Martin and Bhushan Shah
2015-10-20 13:16:05 +02:00
Martin Gräßlin
b38999e0a9 [hwcomposer] Use three rendering buffers
Seems to improve the tearing problem.
2015-10-20 11:39:42 +02:00
Martin Gräßlin
98a669d70f [hwcomposer] Use newer setOutputsEnabled API instead of blocking buffer swap
The newer API is designed for the case that outputs are disabled and
makes sure that we don't have to abuse the aboutToSwapBuffers. This
also prevents possible conflicts between blocking during rendering and
screens being off.

Reviewed-By: Bhushan Shah
2015-10-20 09:39:03 +02:00
Martin Graesslin
d2cb445f4c Delay enabling vsync till first frame is rendered
According to the hwcomposer documentation:
"It is a (silent) error to have HWC_EVENT_VSYNC enabled when calling
hwc_composer_device.set(..., 0, 0, 0) (screen off)".

Because of that we may not enable vsync directly after toggling the
output, but need to wait till after calling the set call.

Reviewed-by: Bhushan Shah
2015-10-19 10:18:48 +02:00
l10n daemon script
b20ccf91c6 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2015-10-18 11:06:54 +00:00
Martin Gräßlin
70e744fe26 [backends/hwcomposer] Add a failsafe timer for vsync events
Apparently we don't get a vsync event for the first frame during startup
which blocks the compositor till the end of days. Thus a timer is added
which calls vsync after 1 sec if we didn't get an event.
2015-10-16 18:19:10 +02:00
l10n daemon script
0c159e0106 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2015-10-15 11:59:46 +00:00
Martin Gräßlin
f36af69a0e [hwcomposer] Add support for vsync
Note: qt5-qpa-hwcomposer-plugin does the vsync in a different way:
it uses a wait condition to truly block in present till the vsync.
Maybe we need to do that as well.
2015-10-15 09:17:57 +02:00