Commit graph

80 commits

Author SHA1 Message Date
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
Martin Gräßlin
5558d62220 [backends/virtual] Add possibility to have multiple virtual screens
Very basic: all screens have same size and are ordered from left to
right. It's mostly meant to allow easy test cases with multi-screen.

The quick tiling test demonstrates how it's used.
2015-10-14 16:38:17 +02:00
Martin Gräßlin
66e27b69bb [backends/hwcomposer] Drop dependency on hybrissync library
No longer used and not needed.
2015-10-14 14:33:49 +02:00
l10n daemon script
db3ac9a536 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-14 10:26:47 +00:00
Martin Graesslin
28fe78a94f Adjust to newer upstream libhybris version
Based on a previous patch done by David Edmundson and heavily
inspired by qt5-qpa-hwcomposer-plugin [1].

The change requires a newer libhybris than the one used by Ubuntu. In
fact it allows to build against current master (at the day of writing [2]).

REVIEW: 125606

[1] https://github.com/mer-hybris/qt5-qpa-hwcomposer-plugin
[2] bd6df6a306
2015-10-14 08:14:24 +02:00
Martin Graesslin
425e703dff Drop Android input handling
Libinput does work on libhybris enabled devices. There is no need to
use Android's input stack. This simplifies our code a lot and increases
sharing with normal Linux systems.

What's tricky is to convince the system to use libinput through with our
logind helper. Logind fails to open the files for us if we start KWin
over either ssh or adb shell. We need to get it into a proper session, so
only a kwin started through a helper like simplelogin will be able to use
libinput.

REVIEW: 125608
2015-10-14 08:13:37 +02:00
l10n daemon script
f4069deb5c 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-13 12:48:07 +00:00
l10n daemon script
8e17059be7 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-09 11:48:28 +00:00
Martin Gräßlin
a025791d7b [backends/virtual] Add a virtual rendering OpenGLBackend
The backend is based on drm's gbm backend and also uses the GBM
platform, but with the default display allowing the driver to pick
a device. In addition it doesn't use a surface, but a surfaceless
context with a framebuffer object to render to. Given that it diverged
too much from drm's backend to allow more code sharing.

If KWin is started from a tty it gets a proper driver, if KWin is started
in a X11 session it only gets llvmpipe. Given that there is a chance that
the autotests using the virtual backend will fail. In that case a follow
up patch will enforce either O2 or Q.
2015-10-08 16:12:09 +02:00
Martin Gräßlin
2e888da70e [backends/virtual] Move save screenshot functionality to the backend
Allows code reusability when adding an OpenGL backend.
2015-10-08 15:53:03 +02:00
l10n daemon script
83cc5f5842 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-05 10:23:58 +00:00
l10n daemon script
43c35c1c6c 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-04 10:50:57 +00:00
l10n daemon script
c342be5961 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-03 11:20:49 +00:00
l10n daemon script
4b74b294ab 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-02 10:17:30 +00:00
Martin Gräßlin
bfa9646d1d [wayland] Add a virtual framebuffer backend
A new backend which doesn't present the rendered output. It uses a
QPainter scene, renders to a QImage but doesn't present it anywhere.
Thus a real virtual backend.

By exporting the environment variable KWIN_WAYLAND_VIRTUAL_SCREENSHOTS
the backend creates a temporary dir, prints the path to std-out and
saves each rendered frame into that directory. Of course with exit it
will be deleted again.
2015-10-02 10:58:33 +02:00
Martin Gräßlin
fc0272f3c4 [wayland] Add a --list-backends command line arg for listing available backends
Distributions do package each backend plugin in a dedicated package,
which means just because KWin got compiled with a specific backend,
doesn't mean it is also available at runtime.

In order to better support this reality this change introduces a
list-backends command line option. Each of the plugins got the json
metadata extended by the KPlugin syntax, so that we have a name and
description to print.

As we already locate all plugins anyway, the additional findPlugins for
the selected backend is changed to search the list of all plugin meta
data.
2015-10-02 09:31:47 +02:00
Martin Gräßlin
e5fbb20e8b [backends/x11] Allow grab keyboard/pointer
When pressing right control key the input gets grabbed/released.
The grab is for both keyboard and pointer and pointer is also confined
to the window.

How to grab/ungrab is added to the window title.
2015-09-30 07:40:45 +02:00
Martin Gräßlin
4fa01583cb [backends/x11] Use NETWinInfo for our window. 2015-09-30 07:40:45 +02:00
Martin Gräßlin
6326d96c02 [backends/x11] Set a black background pixel on our rendering window
By setting a black background pixel the window doesn't open with
garbage content (garbage being copy content of what was in the
framebuffer).
2015-09-18 11:06:33 +02:00
Martin Gräßlin
873b4ed717 Fix build with some compilers
If it's a QPointer the connect needs a .data()
2015-09-11 14:53:34 +02:00
Martin Gräßlin
43f6c1e041 [wayland] Add support for DpmsInterface
Our server announces the DpmsManagerInterface and in the DRM backend
we announce support for Dpms on the OutputInterface (if the Output
supports it) and we connect to changing Dpms requests.
2015-09-10 14:32:41 +02:00
Martin Gräßlin
ffa075490e [drm] Mark outputs as disabled in backend depending on DPMS state
Whenever the dpms of an output changes we update the outputs enabled
state in the AbstractBackend.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
e3ff85d4d9 [drm] Re-enable Output on input event
If an Output went into DPMS standby we need to re-enable the Output
once we get any input event.

For this we connect to the signals of InputRedirection once we go
to standby. Once we enable again, we disconnect (to not handle the
events all the time), blank the screen (initial modesetting) and
trigger a complete repaint.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
6281cf84b4 [drm] Make DrmOutput a QObject
Needs to emit signals when DPMS changes and also needs private slots
when DPMS changes.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
a1bcc8e848 [drm] Don't present on an output which is in dpms standby
It will fail if the output is not on, so let's don't try to present
on a disabled output.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
902bdb6cf0 [drm] Add initial support for DPMS
We read the drm property for the connector and set dpms initialy to On.
2015-09-10 14:31:46 +02:00
Martin Gräßlin
5d946e3762 Make X11_XCB a build dependency of X11 windowed backend
Let's rather not build the plugin if we don't have the dependency
then building it without OpenGL support. Simplifies the code a bit
and makes the backend overall more useful and goes along with e.g.
the Wayland one which has EGL also as a hard dependency for the
plugin.

REVIEW: 124697
2015-08-12 11:39:20 +02:00
Martin Gräßlin
06aacf4f65 Drop cmakedefine HAVE_WAYLAND_EGL
Now a required build dependency.
2015-08-12 11:39:20 +02:00
Martin Gräßlin
a6c6408f54 Drop cmakedefine HAVE_WAYLAND_CURSOR
Now a required build-dep.
2015-08-12 11:39:20 +02:00
Martin Gräßlin
c24e315a9b Drop build option KWIN_BUILD_EGL
It doesn't make much sense any more as we do no longer link EGL since the
switch to epoxy. And epoxy pulls it in at runtime if needed.
Even more on Wayland it's just plain stupid to have EGL disabled. So
removing the option just simplifies our code base without any
disadvantages.

REVIEW: 124695
2015-08-11 11:15:25 +02:00
Martin Gräßlin
125cc5082f Change default logging category to QtCriticalMsg
Less noisy KWin by default.
2015-07-31 13:29:58 +02:00
Martin Gräßlin
53004b95ff Port left over qDebug to qCDebug 2015-07-31 13:25:51 +02:00
Martin Gräßlin
339d9de351 [backends/drm] Drm backend support syncsToVBlank 2015-07-17 20:39:37 +02:00
Martin Gräßlin
4c03115882 [backends/drm] Fix crash in cleanup of DrmOutput
During cleanup the KWayland::OutputInterface is already destroyed before
we hit the cleanup code of DrmOutput. Thus guard with a QPointer to not
delete twice.
2015-06-29 12:47:29 +02:00
Martin Gräßlin
67734050e6 [hwcomposer] Get refresh rate 2015-06-25 18:04:06 +02:00
Martin Gräßlin
53dcd98b8b [hwcomposer] Switch to format HAL_PIXEL_FORMAT_RGB_888
We clearly do not need an alpha channel for our scene.
2015-06-25 15:49:52 +02:00