-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wayland windowing system #12664
Wayland windowing system #12664
Conversation
Nice :-) I followed every issue and every issue review - really nice work. From my pov can go in every time if it does not break anything. Perhaps - only a suggestion - it would be good to add "Wayland:" to the commits actually doing wayland features. This is especially useful when going just through a git log without seeing directly which file it changes. But it's on your mentor to decide on this minor - only a suggestion. |
iOS is OK now, Windows fail is unrelated Regarding actually building the Wayland stuff, should I just copy linux64 to linux64wayland so that it can be added to jenkins? |
@@ -1,7 +1,5 @@ | |||
#pragma once |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/guilib/GraphicContext.cpp
Outdated
// change is confirmed. | ||
// But other windowing code expects these variables to be already set when | ||
// SetFullScreen() is called, so set them anyway and remember the old values. | ||
int origScreenWidth = m_iScreenWidth, origScreenHeight = m_iScreenHeight, origScreenId = m_iScreenId; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -196,6 +196,10 @@ class CRenderManager | |||
ERENDERSTATE m_renderState; | |||
CEvent m_stateEvent; | |||
|
|||
/// Display latency tweak value from AdvancedSettings for the current refresh rate | |||
/// in seconds |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -375,11 +375,7 @@ void CAdvancedSettings::Initialize() | |||
|
|||
m_enableMultimediaKeys = false; | |||
|
|||
#if defined(TARGET_DARWIN_IOS) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
* that was put there | ||
*/ | ||
template<typename OutputIt> | ||
static OutputIt SplitTo(OutputIt d_first, const std::string& input, const std::string& delimiter, unsigned int iMaxStrings = 0) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/windowing/XBMC_events.h
Outdated
@@ -78,6 +80,10 @@ typedef struct XBMC_MoveEvent { | |||
int y; /* New y position */ | |||
} XBMC_MoveEvent; | |||
|
|||
struct XBMC_ModeChangeEvent { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
xbmc/windowing/XkbcommonKeymap.cpp
Outdated
@@ -0,0 +1,351 @@ | |||
/* |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Very good! Some minors then I think this is ready to go in. |
OK I think that was all of the minors |
cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) | ||
|
||
.installed-$(PLATFORM): $(PLATFORM) | ||
cd $(PLATFORM); $(PREFIX)/bin/python setup.py install --prefix=$(PREFIX) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
$(TARBALLS_LOCATION)/$(ARCHIVE): | ||
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) | ||
|
||
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
$(TARBALLS_LOCATION)/$(ARCHIVE): | ||
cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) | ||
|
||
$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
[AS_HELP_STRING([--enable-wayland], | ||
[build libraries needed for Wayland. default is no])], | ||
[enable_wayland=$enableval], | ||
[enable_wayland=no]) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Just give me a ping if this is ready for squashing |
please switch to the new style of component logging which was introduced at #12676 |
leftover from Wayland cleanup
This prevents having WinSystemEGL break other platforms because the if() condition was not updated.
This is useful for debugging AV sync etc. but should usually be disabled because it generates a lot of information.
instead of using hardcoded number of frames and multiplying with refresh rate
The current calculation is weird and the DVD clock which is the only user of this class has its own offset correction anyway.
Previous code was wrong because it fails on slightly imprecise values. For example fmod(60,29.999) is 0.002, which is OK. But fmod(60,30.001) yields is 29.999, which will get rejected as being above 0.01. There is no reason why 30.001 should be rejected while 29.999 is accepted.
…or renderPts Signed-off-by: Philipp Kerling <pkerling@casix.org>
… unit New unit is milliseconds (instead of seconds) since most of the player code uses it. Renaming because the time is not related to the "real" display latency that can somehow be measured, but rather an unspecific tweak. Signed-off-by: Philipp Kerling <pkerling@casix.org>
At least for Wayland, window must have already been created in order to create the OS screen saver implementation as it depends on the window surface. Moving the default value setting until after the window was created should not have any negative effects.
Preparation for adding Wayland windowing implementation
Depending on the windowing implementation, there might be cases when the Kodi resolution must be updated not because of a request of the application, but because the windowing system demands it. In this case, it does not make sense to call e.g. SetFullScreen on windowing because windowing is the entity that initiated the resolution change in the first place. To simplify control flow in windowing implementations that need this functionality and make it more explicit what is going on, add new modesetting event that windowing can generate and then get informed when the resolution was switched. Similarly, call back into windowing when an XBMC_VIDEORESIZE event is processed.
so it can be modified from other threads without problems
* Use in-class default member initializers * Mark default constructor noexcept * Use member initializers in constructors instead of assignment * Use brace-initialization * Do not make references returned from arithmetic operators const * Consistently add (in)equality operators as free functions * Use using instead of typedef * Simplify conditions * Remove superfluous "inline" * Add multiplication and division operators to CPoint
4d3c2a2
to
6a01797
Compare
Done. Had to rebase anyway, squashed while at it. |
@FernetMenta when do you push the button? Need to buy champagne before that I think :-) |
if no objections, I will merge this this evening. |
elseif(WAYLAND_RENDER_SYSTEM STREQUAL "gles") | ||
list(APPEND PLATFORM_REQUIRED_DEPS OpenGLES) | ||
else() | ||
message(SEND_ERROR "You need to decide whether you want to use GL- or GLES-based rendering in combination with the Wayland windowing system. Please set WAYLAND_RENDER_SYSTEM to either \"gl\" or \"gles\". For normal desktop systems, you will usually want to use \"gl\".") |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
congratualtions and many thanks to @pkerling |
Congrats and well done. Also for the other semi related fixes. |
No need to stop helping and improving kodi for us, now that is merged :-) Thanks very much for this milestone work that pushes kodi to the next level into a great standard linux future. Your work is highly appreciated. |
This was exciting to watch. This was the only reason why I don't have fedora in my HTPC, A million thanks to @pkerling |
congrats and thanks a lot pkerling |
And there it goes 🎉 Thanks a lot to @FernetMenta for reviewing all of this stuff and giving valuable advice at every stage :-) |
Thank you so much pkerling!!! Highly appreciated :-) |
Add native Wayland windowing implementation as result of GSoC 2017 project from https://github.com/pkerling/xbmc/
Description
This has been in the works for the last three months.
I have squashed the commits so that modifications and additions to the non-Wayland Kodi code are separate commits and that the Wayland windowing implementation itself is one commit. That implementation of course also has a history and is made up of a large number of commits (available via the linked GitHub repository) that were reviewed in feature chunks by @FernetMenta, but it would probably not be useful to keep it in mainline.
I realize that this is quite a lot of code to merge so I'm open to any suggestions that make it easier to handle.
Building with Wayland is fully integrated into the depends system and can be achieved by calling
tools/depends/configure
with--enable-wayland
, so it should be easily integratable into Jenkins.Motivation and Context
Linux is transitioning to the Wayland protocol instead of X11 for the long term. To offer a competitive user experience on Linux and get all the shiny new features, Kodi must support Wayland natively instead of running via Xwayland X11 emulation.
How Has This Been Tested?
Build and run test on linux64 with GL and GLES
Screenshots (if appropriate):
It really looks just like on X :-)
(except for the window decorations which are better not shown off)
Types of change
(This PR is mostly "new feature," but contains some commits that fix or improve core Kodi. I can list them individually if it helps.)
Checklist: