diff -Nru kodi-18.0+git20181108.0201-5a42446/addons/resource.language.en_gb/resources/strings.po kodi-18.0+git20181109.0201-a948f99/addons/resource.language.en_gb/resources/strings.po --- kodi-18.0+git20181108.0201-5a42446/addons/resource.language.en_gb/resources/strings.po 2018-11-05 01:01:32.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/addons/resource.language.en_gb/resources/strings.po 2018-11-09 01:01:31.000000000 +0000 @@ -6879,6 +6879,7 @@ msgid "There are no settings available\nfor this visualisation" msgstr "" +#: xbmc/ContextMenus.h #: xbmc/dialogs/GUIDialogContextMenu.cpp #: xbmc/dialogs/GUIDialogPlayEject.cpp msgctxt "#13391" @@ -7015,6 +7016,7 @@ msgid "Software" msgstr "" +#: xbmc/ContextMenus.h #: xbmc/dialogs/GUIDialogContextMenu.cpp msgctxt "#13420" msgid "Remove safely" diff -Nru kodi-18.0+git20181108.0201-5a42446/BUILDDATE kodi-18.0+git20181109.0201-a948f99/BUILDDATE --- kodi-18.0+git20181108.0201-5a42446/BUILDDATE 2018-11-08 01:01:43.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/BUILDDATE 2018-11-09 01:01:46.000000000 +0000 @@ -1 +1 @@ -20181108 +20181109 diff -Nru kodi-18.0+git20181108.0201-5a42446/cmake/modules/FindFmt.cmake kodi-18.0+git20181109.0201-a948f99/cmake/modules/FindFmt.cmake --- kodi-18.0+git20181108.0201-5a42446/cmake/modules/FindFmt.cmake 2018-07-31 18:47:37.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/cmake/modules/FindFmt.cmake 2018-11-09 01:01:31.000000000 +0000 @@ -40,6 +40,7 @@ PREFIX ${CORE_BUILD_DIR}/fmt CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -DCMAKE_INSTALL_LIBDIR=lib -DFMT_DOC=OFF -DFMT_TEST=OFF "${EXTRA_ARGS}" diff -Nru kodi-18.0+git20181108.0201-5a42446/cmake/modules/FindLibDRM.cmake kodi-18.0+git20181109.0201-a948f99/cmake/modules/FindLibDRM.cmake --- kodi-18.0+git20181108.0201-5a42446/cmake/modules/FindLibDRM.cmake 2018-06-21 18:59:46.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/cmake/modules/FindLibDRM.cmake 2018-11-09 01:01:31.000000000 +0000 @@ -14,7 +14,7 @@ # LibDRM::LibDRM - The LibDRM library if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_LIBDRM libdrm>=2.4.71 QUIET) + pkg_check_modules(PC_LIBDRM libdrm>=2.4.74 QUIET) endif() find_path(LIBDRM_INCLUDE_DIR NAMES drm.h diff -Nru kodi-18.0+git20181108.0201-5a42446/debian/changelog kodi-18.0+git20181109.0201-a948f99/debian/changelog --- kodi-18.0+git20181108.0201-5a42446/debian/changelog 2018-11-08 01:02:11.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/debian/changelog 2018-11-09 01:02:15.000000000 +0000 @@ -1,4 +1,47 @@ -kodi (2:18.0+git20181108.0201-5a42446-0cosmic) cosmic; urgency=high +kodi (2:18.0+git20181109.0201-a948f99-0cosmic) cosmic; urgency=high + + [Rechi] + * [cmake] fix building with internal fmt + + [Kai Sommerfeld] + * [macos] DAOperationContext: improve naming of members and fuctions. + + [Kai Sommerfeld] + * [macos] CDarwinStorageProvider::Eject: Fix crash due to double release of DADiskRef instance. + + [Lukas Rusak] + * windowing/gbm: set default plane formats and use the getter methods to retrieve them + + [Kai Sommerfeld] + * [macos] Implement eject/unmount functionality for removable drives. + + [peak3d] + * [Settings] Implement FindIntInList in CSettingList + + [Lukas Rusak] + * windowing/gbm: use the drm fd for the vaapi proxy + + [Lukas Rusak] + * windowing/gbm: open the render node for the given module + + [Lukas Rusak] + * windowing/gbm: use drmOpenWithType + + [Memphiz] + * [osx/windowing] - fix "blank other displays" by using the actual screen idx instead of always using screen 0 + + [Kai Sommerfeld] + * Fix filemenager context menu regression: Re-Introduce 'Remove safely' and 'Eject / Load' for removable drives. + + [Jonas Karlman] + * windowing/gbm: fallback to non-alpha visual id + + [Jonas Karlman] + * windowing/gbm: use visual id to create gbm surface + + [Jonas Karlman] + * windowing/gbm: move CreateNewWindow to WinSystemGbmEGLContext + [peak3d] * [GUI] reinitialize addon path after returning with .. directory item diff -Nru kodi-18.0+git20181108.0201-5a42446/debian/changelog.tmp kodi-18.0+git20181109.0201-a948f99/debian/changelog.tmp --- kodi-18.0+git20181108.0201-5a42446/debian/changelog.tmp 2018-11-08 01:02:11.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/debian/changelog.tmp 2018-11-09 01:02:15.000000000 +0000 @@ -1,4 +1,47 @@ -kodi (2:18.0+git20181108.0201-5a42446-0dist) dist; urgency=high +kodi (2:18.0+git20181109.0201-a948f99-0dist) dist; urgency=high + + [Rechi] + * [cmake] fix building with internal fmt + + [Kai Sommerfeld] + * [macos] DAOperationContext: improve naming of members and fuctions. + + [Kai Sommerfeld] + * [macos] CDarwinStorageProvider::Eject: Fix crash due to double release of DADiskRef instance. + + [Lukas Rusak] + * windowing/gbm: set default plane formats and use the getter methods to retrieve them + + [Kai Sommerfeld] + * [macos] Implement eject/unmount functionality for removable drives. + + [peak3d] + * [Settings] Implement FindIntInList in CSettingList + + [Lukas Rusak] + * windowing/gbm: use the drm fd for the vaapi proxy + + [Lukas Rusak] + * windowing/gbm: open the render node for the given module + + [Lukas Rusak] + * windowing/gbm: use drmOpenWithType + + [Memphiz] + * [osx/windowing] - fix "blank other displays" by using the actual screen idx instead of always using screen 0 + + [Kai Sommerfeld] + * Fix filemenager context menu regression: Re-Introduce 'Remove safely' and 'Eject / Load' for removable drives. + + [Jonas Karlman] + * windowing/gbm: fallback to non-alpha visual id + + [Jonas Karlman] + * windowing/gbm: use visual id to create gbm surface + + [Jonas Karlman] + * windowing/gbm: move CreateNewWindow to WinSystemGbmEGLContext + [peak3d] * [GUI] reinitialize addon path after returning with .. directory item diff -Nru kodi-18.0+git20181108.0201-5a42446/debian/changelog.tmp.old kodi-18.0+git20181109.0201-a948f99/debian/changelog.tmp.old --- kodi-18.0+git20181108.0201-5a42446/debian/changelog.tmp.old 2018-11-08 01:01:43.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/debian/changelog.tmp.old 2018-11-09 01:01:46.000000000 +0000 @@ -1,6 +1,10 @@ kodi (2:18.0+git20180719.0202-3231481-0dist) dist; urgency=high [peak3d] + * [GUI] reinitialize addon path after returning with .. directory item + + + [peak3d] * [GUI] re-evaluate playcount (watched state) when reading from filecache [Arne Morten Kvarving] diff -Nru kodi-18.0+git20181108.0201-5a42446/VERSION kodi-18.0+git20181109.0201-a948f99/VERSION --- kodi-18.0+git20181108.0201-5a42446/VERSION 2018-11-08 01:01:43.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/VERSION 2018-11-09 01:01:46.000000000 +0000 @@ -1 +1 @@ -5a42446 +a948f99 diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp 2018-10-23 16:19:50.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecDRMPRIME.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -250,7 +250,7 @@ pConfig->device_type == AV_HWDEVICE_TYPE_DRM) { CWinSystemGbm* winSystem = dynamic_cast(CServiceBroker::GetWinSystem()); - if (av_hwdevice_ctx_create(&m_pCodecContext->hw_device_ctx, AV_HWDEVICE_TYPE_DRM, winSystem->GetDevicePath().c_str(), nullptr, 0) < 0) + if (av_hwdevice_ctx_create(&m_pCodecContext->hw_device_ctx, AV_HWDEVICE_TYPE_DRM, drmGetDeviceNameFromFd2(winSystem->GetDrm()->GetFileDescriptor()), nullptr, 0) < 0) { CLog::Log(LOGNOTICE, "CDVDVideoCodecDRMPRIME::%s - unable to create hwdevice context", __FUNCTION__); avcodec_free_context(&m_pCodecContext); diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/dialogs/GUIDialogContextMenu.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/dialogs/GUIDialogContextMenu.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/dialogs/GUIDialogContextMenu.cpp 2018-10-23 16:19:50.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/dialogs/GUIDialogContextMenu.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -208,6 +208,19 @@ void CGUIDialogContextMenu::GetContextButtons(const std::string &type, const CFileItemPtr& item, CContextButtons &buttons) { + // Add buttons to the ContextMenu that should be visible for both sources and autosourced items + if (item && item->IsRemovable()) + { + if (item->IsDVD() || item->IsCDDA()) + { + buttons.Add(CONTEXT_BUTTON_EJECT_DISC, 13391); // Eject / Load + } + else // Must be HDD + { + buttons.Add(CONTEXT_BUTTON_EJECT_DRIVE, 13420); // Remove safely + } + } + // Next, Add buttons to the ContextMenu that should ONLY be visible for sources and not autosourced items CMediaSource *share = GetShare(type, item.get()); @@ -260,11 +273,27 @@ bool CGUIDialogContextMenu::OnContextButton(const std::string &type, const CFileItemPtr& item, CONTEXT_BUTTON button) { // buttons that are available on both sources and autosourced items - if (!item) return false; + if (!item) + return false; + + switch (button) + { + case CONTEXT_BUTTON_EJECT_DRIVE: + return g_mediaManager.Eject(item->GetPath()); +#ifdef HAS_DVD_DRIVE + case CONTEXT_BUTTON_EJECT_DISC: + g_mediaManager.ToggleTray(g_mediaManager.TranslateDevicePath(item->GetPath())[0]); +#endif + return true; + default: + break; + } // the rest of the operations require a valid share CMediaSource *share = GetShare(type, item.get()); - if (!share) return false; + if (!share) + return false; + switch (button) { case CONTEXT_BUTTON_EDIT_SOURCE: diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/dialogs/GUIDialogContextMenu.h kodi-18.0+git20181109.0201-a948f99/xbmc/dialogs/GUIDialogContextMenu.h --- kodi-18.0+git20181108.0201-5a42446/xbmc/dialogs/GUIDialogContextMenu.h 2018-07-31 18:47:39.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/dialogs/GUIDialogContextMenu.h 2018-11-09 01:01:31.000000000 +0000 @@ -26,6 +26,8 @@ CONTEXT_BUTTON_RIP_CD, CONTEXT_BUTTON_CANCEL_RIP_CD, CONTEXT_BUTTON_RIP_TRACK, + CONTEXT_BUTTON_EJECT_DISC, + CONTEXT_BUTTON_EJECT_DRIVE, CONTEXT_BUTTON_EDIT_SOURCE, CONTEXT_BUTTON_REMOVE_SOURCE, CONTEXT_BUTTON_SET_DEFAULT, diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/platform/darwin/osx/SDLMain.mm kodi-18.0+git20181109.0201-a948f99/xbmc/platform/darwin/osx/SDLMain.mm --- kodi-18.0+git20181108.0201-5a42446/xbmc/platform/darwin/osx/SDLMain.mm 2018-07-31 18:47:40.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/platform/darwin/osx/SDLMain.mm 2018-11-09 01:01:31.000000000 +0000 @@ -407,7 +407,13 @@ // calling into c++ code, need to use autorelease pools NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - CDarwinStorageProvider::SetEvent(); + NSString* volumeLabel = [note.userInfo objectForKey:@"NSWorkspaceVolumeLocalizedNameKey"]; + const char* label = [volumeLabel UTF8String]; + + NSString* volumePath = [note.userInfo objectForKey:@"NSDevicePath"]; + const char* path = [volumePath UTF8String]; + + CDarwinStorageProvider::VolumeMountNotification(label, path); [pool release]; } @@ -416,7 +422,13 @@ // calling into c++ code, need to use autorelease pools NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - CDarwinStorageProvider::SetEvent(); + NSString* volumeLabel = [note.userInfo objectForKey:@"NSWorkspaceVolumeLocalizedNameKey"]; + const char* label = [volumeLabel UTF8String]; + + NSString* volumePath = [note.userInfo objectForKey:@"NSDevicePath"]; + const char* path = [volumePath UTF8String]; + + CDarwinStorageProvider::VolumeUnmountNotification(label, path); [pool release]; } diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/platform/darwin/osx/storage/DarwinStorageProvider.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/platform/darwin/osx/storage/DarwinStorageProvider.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/platform/darwin/osx/storage/DarwinStorageProvider.cpp 2018-07-31 18:47:40.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/platform/darwin/osx/storage/DarwinStorageProvider.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -21,7 +21,8 @@ #endif #include "platform/darwin/osx/CocoaInterface.h" -bool CDarwinStorageProvider::m_event = false; +std::vector> CDarwinStorageProvider::m_mountsToNotify; +std::vector> CDarwinStorageProvider::m_unmountsToNotify; IStorageProvider* IStorageProvider::CreateInstance() { @@ -137,6 +138,7 @@ CMediaSource share; share.strPath = mountpoint; + share.m_iDriveType = CMediaSource::SOURCE_TYPE_REMOVABLE; Cocoa_GetVolumeNameFromMountPoint(mountpoint.c_str(), share.strName); share.m_ignore = true; // detect if its a cd or dvd @@ -186,19 +188,185 @@ return result; } +#if defined(TARGET_DARWIN_OSX) +namespace +{ + class DAOperationContext + { + public: + explicit DAOperationContext(const std::string& mountpath); + ~DAOperationContext(); + + DADiskRef GetDisk() const { return m_disk; } + + void Reset(); + bool WaitForCompletion(CFTimeInterval timeout); + void Completed(bool success); + + static void CompletionCallback(DADiskRef disk, DADissenterRef dissenter, void* context); + + private: + DAOperationContext() = delete; + + static void RunloopPerformCallback(void* info) {} + CFRunLoopSourceContext m_runLoopSourceContext = { .perform = RunloopPerformCallback }; + + bool m_success; + bool m_completed; + const DASessionRef m_session; + const CFRunLoopRef m_runloop; + const CFRunLoopSourceRef m_runloopSource; + DADiskRef m_disk; + }; + + DAOperationContext::DAOperationContext(const std::string& mountpath) + : m_success(true), + m_completed(false), + m_session(DASessionCreate(kCFAllocatorDefault)), + m_runloop(CFRunLoopGetCurrent()), // not owner! + m_runloopSource(CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &m_runLoopSourceContext)) + { + if (m_session && m_runloop && m_runloopSource) + { + CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (const UInt8 *)mountpath.c_str(), mountpath.size(), TRUE); + if (url) + { + m_disk = DADiskCreateFromVolumePath(kCFAllocatorDefault, m_session, url); + CFRelease(url); + } + + DASessionScheduleWithRunLoop(m_session, m_runloop, kCFRunLoopDefaultMode); + CFRunLoopAddSource(m_runloop, m_runloopSource, kCFRunLoopDefaultMode); + } + } + + DAOperationContext::~DAOperationContext() + { + if (m_session && m_runloop && m_runloopSource) + { + CFRunLoopRemoveSource(m_runloop, m_runloopSource, kCFRunLoopDefaultMode); + DASessionUnscheduleFromRunLoop(m_session, m_runloop, kCFRunLoopDefaultMode); + CFRunLoopSourceInvalidate(m_runloopSource); + } + + if (m_disk) + CFRelease(m_disk); + if (m_runloopSource) + CFRelease(m_runloopSource); + if (m_session) + CFRelease(m_session); + } + + bool DAOperationContext::WaitForCompletion(CFTimeInterval timeout) + { + while (!m_completed) + { + if (CFRunLoopRunInMode(kCFRunLoopDefaultMode, timeout, TRUE) == kCFRunLoopRunTimedOut) + break; + } + return m_success; + } + + void DAOperationContext::Completed(bool success) + { + m_success = success; + m_completed = true; + CFRunLoopSourceSignal(m_runloopSource); + CFRunLoopWakeUp(m_runloop); + } + + void DAOperationContext::Reset() + { + m_success = true; + m_completed = false; + } + + void DAOperationContext::CompletionCallback(DADiskRef disk, DADissenterRef dissenter, void* context) + { + DAOperationContext* dacontext = static_cast(context); + + bool success = true; + if (dissenter) + { + DAReturn status = DADissenterGetStatus(dissenter); + success = (status == kDAReturnSuccess || status == kDAReturnUnsupported); + } + + dacontext->Completed(success); + } + +} // unnamed namespace +#endif + bool CDarwinStorageProvider::Eject(const std::string& mountpath) { +#if defined(TARGET_DARWIN_OSX) + if (mountpath.empty()) + return false; + + DAOperationContext ctx(mountpath); + DADiskRef disk = ctx.GetDisk(); + + if (!disk) + return false; + + bool success = false; + + CFDictionaryRef details = DADiskCopyDescription(disk); + if (details) + { + // Does the device need to be unmounted first? + if (CFDictionaryGetValueIfPresent(details, kDADiskDescriptionVolumePathKey, NULL)) + { + DADiskUnmount(disk, kDADiskUnmountOptionDefault, DAOperationContext::CompletionCallback, &ctx); + success = ctx.WaitForCompletion(30.0); // timeout after 30 secs + } + + if (success) + { + ctx.Reset(); + DADiskEject(disk, kDADiskEjectOptionDefault, DAOperationContext::CompletionCallback, &ctx); + success = ctx.WaitForCompletion(30.0); // timeout after 30 secs + } + + CFRelease(details); + } + + return success; +#else return false; +#endif } bool CDarwinStorageProvider::PumpDriveChangeEvents(IStorageEventsCallback *callback) { - bool event = m_event; - m_event = false; - return event; + bool changed = !m_mountsToNotify.empty() || !m_unmountsToNotify.empty(); + + if (callback) + { + for (const auto& mountToNotify : m_mountsToNotify) + { + callback->OnStorageAdded(mountToNotify.first, mountToNotify.second); + } + m_mountsToNotify.clear(); + + for (const auto& unmountToNotify : m_unmountsToNotify) + { + callback->OnStorageSafelyRemoved(unmountToNotify.first); + } + m_unmountsToNotify.clear(); + } + return changed; +} + +void CDarwinStorageProvider::VolumeMountNotification(const char* label, const char* mountpoint) +{ + if (label && mountpoint) + m_mountsToNotify.emplace_back(std::make_pair(label, mountpoint)); } -void CDarwinStorageProvider::SetEvent(void) +void CDarwinStorageProvider::VolumeUnmountNotification(const char* label, const char* mountpoint) { - CDarwinStorageProvider::m_event = true; + if (label && mountpoint) + m_unmountsToNotify.emplace_back(std::make_pair(label, mountpoint)); } diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/platform/darwin/osx/storage/DarwinStorageProvider.h kodi-18.0+git20181109.0201-a948f99/xbmc/platform/darwin/osx/storage/DarwinStorageProvider.h --- kodi-18.0+git20181108.0201-5a42446/xbmc/platform/darwin/osx/storage/DarwinStorageProvider.h 2018-07-31 18:47:40.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/platform/darwin/osx/storage/DarwinStorageProvider.h 2018-11-09 01:01:31.000000000 +0000 @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include "storage/IStorageProvider.h" @@ -31,8 +32,10 @@ virtual bool PumpDriveChangeEvents(IStorageEventsCallback *callback); - static void SetEvent(void); + static void VolumeMountNotification(const char* label, const char* mountpoint); + static void VolumeUnmountNotification(const char* label, const char* mountpoint); private: - static bool m_event; + static std::vector> m_mountsToNotify; // label, mountpoint + static std::vector> m_unmountsToNotify; // label, mountpoint }; diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/settings/lib/Setting.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/settings/lib/Setting.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/settings/lib/Setting.cpp 2018-07-31 18:47:40.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/settings/lib/Setting.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -7,6 +7,7 @@ */ #include +#include #include "Setting.h" #include "SettingDefinitions.h" @@ -402,6 +403,14 @@ SetValue(values); } +bool CSettingList::FindIntInList(int value) const +{ + return std::find_if(m_values.cbegin(), m_values.cend(), [&](const SettingPtr& setting) + { + return setting->GetType() == SettingType::Integer && std::static_pointer_cast(setting)->GetValue() == value; + }) != m_values.cend(); +} + bool CSettingList::FromString(const std::vector &value) { SettingList values; diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/settings/lib/Setting.h kodi-18.0+git20181109.0201-a948f99/xbmc/settings/lib/Setting.h --- kodi-18.0+git20181108.0201-5a42446/xbmc/settings/lib/Setting.h 2018-07-31 18:47:40.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/settings/lib/Setting.h 2018-11-09 01:01:31.000000000 +0000 @@ -194,6 +194,7 @@ bool SetValue(const SettingList &values); const SettingList& GetDefault() const { return m_defaults; } void SetDefault(const SettingList &values); + bool FindIntInList(int value) const; protected: void copy(const CSettingList &setting); diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/settings/lib/SettingsManager.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/settings/lib/SettingsManager.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/settings/lib/SettingsManager.cpp 2018-11-04 08:12:29.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/settings/lib/SettingsManager.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -705,15 +705,9 @@ bool CSettingsManager::FindIntInList(const std::string &id, int value) const { CSharedLock lock(m_settingsCritical); - SettingPtr setting = GetSetting(id); - if (setting == nullptr || setting->GetType() != SettingType::List) - return false; + std::shared_ptr setting(std::dynamic_pointer_cast(GetSetting(id))); - for (const auto item : std::static_pointer_cast(setting)->GetValue()) - if (item->GetType() == SettingType::Integer && std::static_pointer_cast(item)->GetValue() == value) - return true; - - return false; + return setting && setting->FindIntInList(value); } bool CSettingsManager::SetDefault(const std::string &id) diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/utils/EGLUtils.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/utils/EGLUtils.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/utils/EGLUtils.cpp 2018-11-04 08:12:29.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/utils/EGLUtils.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -279,7 +279,7 @@ if (visualId != 0 && visualId != id) { - CLog::Log(LOGDEBUG, "failed to find matching EGL visual id"); + CLog::Log(LOGDEBUG, "failed to find EGL config with EGL_NATIVE_VISUAL_ID={}", visualId); return false; } @@ -298,6 +298,14 @@ return true; } +EGLint CEGLContextUtils::GetConfigAttrib(EGLint attribute) const +{ + EGLint value{0}; + if (eglGetConfigAttrib(m_eglDisplay, m_eglConfig, attribute, &value) != EGL_TRUE) + CEGLUtils::LogError("failed to query EGL attibute"); + return value; +} + bool CEGLContextUtils::CreateContext(CEGLAttributesVec contextAttribs) { if (m_eglContext != EGL_NO_CONTEXT) diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/utils/EGLUtils.h kodi-18.0+git20181109.0201-a948f99/xbmc/utils/EGLUtils.h --- kodi-18.0+git20181108.0201-5a42446/xbmc/utils/EGLUtils.h 2018-11-04 08:12:29.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/utils/EGLUtils.h 2018-11-09 01:01:31.000000000 +0000 @@ -194,6 +194,7 @@ bool SetVSync(bool enable); bool TrySwapBuffers(); bool IsPlatformSupported() const; + EGLint GetConfigAttrib(EGLint attribute) const; EGLDisplay GetEGLDisplay() const { diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/DRMAtomic.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/DRMAtomic.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/DRMAtomic.cpp 2018-11-04 08:12:29.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/DRMAtomic.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -101,9 +101,9 @@ if (rendered) { if (videoLayer) - m_overlay_plane->format = CDRMUtils::FourCCWithAlpha(m_overlay_plane->GetFormat()); + m_overlay_plane->SetFormat(CDRMUtils::FourCCWithAlpha(m_overlay_plane->GetFormat())); else - m_overlay_plane->format = CDRMUtils::FourCCWithoutAlpha(m_overlay_plane->GetFormat()); + m_overlay_plane->SetFormat(CDRMUtils::FourCCWithoutAlpha(m_overlay_plane->GetFormat())); drm_fb = CDRMUtils::DrmFbGetFromBo(bo); if (!drm_fb) diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/DRMUtils.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/DRMUtils.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/DRMUtils.cpp 2018-11-04 08:12:29.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/DRMUtils.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -73,7 +73,7 @@ struct drm_fb *fb = static_cast(gbm_bo_get_user_data(bo)); if(fb) { - if (m_overlay_plane->format == fb->format) + if (m_overlay_plane->GetFormat() == fb->format) return fb; else DrmFbDestroyCallback(bo, gbm_bo_get_user_data(bo)); @@ -82,7 +82,7 @@ struct drm_fb *fb = new drm_fb; fb->bo = bo; - fb->format = m_overlay_plane->format; + fb->format = m_overlay_plane->GetFormat(); uint32_t width, height, @@ -425,15 +425,13 @@ m_primary_plane->plane = FindPlane(plane_resources, m_crtc_index, KODI_VIDEO_PLANE); m_overlay_plane->plane = FindPlane(plane_resources, m_crtc_index, KODI_GUI_10_PLANE); - m_overlay_plane->format = DRM_FORMAT_XRGB2101010; - m_overlay_plane->fallbackFormat = DRM_FORMAT_XRGB8888; /* fallback to 8bit plane if 10bit plane doesn't exist */ if (m_overlay_plane->plane == nullptr) { drmModeFreePlane(m_overlay_plane->plane); m_overlay_plane->plane = FindPlane(plane_resources, m_crtc_index, KODI_GUI_PLANE); - m_overlay_plane->format = DRM_FORMAT_XRGB8888; + m_overlay_plane->SetFormat(DRM_FORMAT_XRGB8888); } drmModeFreePlaneResources(plane_resources); @@ -465,7 +463,7 @@ CLog::Log(LOGDEBUG, "CDRMUtils::%s - no drm modifiers present for the overlay plane", __FUNCTION__); m_overlay_plane->modifiers_map.emplace(DRM_FORMAT_ARGB8888, std::vector{DRM_FORMAT_MOD_LINEAR}); m_overlay_plane->modifiers_map.emplace(DRM_FORMAT_XRGB8888, std::vector{DRM_FORMAT_MOD_LINEAR}); - m_overlay_plane->modifiers_map.emplace(DRM_FORMAT_XRGB2101010, std::vector{DRM_FORMAT_MOD_LINEAR}); + m_overlay_plane->modifiers_map.emplace(DRM_FORMAT_ARGB2101010, std::vector{DRM_FORMAT_MOD_LINEAR}); m_overlay_plane->modifiers_map.emplace(DRM_FORMAT_XRGB2101010, std::vector{DRM_FORMAT_MOD_LINEAR}); } @@ -529,42 +527,42 @@ "meson" }; - for(int i = 0; i < 10; ++i) + for (auto module : modules) { - std::string device = "/dev/dri/card"; - device.append(std::to_string(i)); - - for (auto module : modules) + m_fd.attach(drmOpenWithType(module, nullptr, DRM_NODE_PRIMARY)); + if (m_fd) { - m_fd.attach(drmOpen(module, device.c_str())); - if (m_fd) + if(!GetResources()) { - if(!GetResources()) + continue; + } + + if (needConnector) + { + if(!FindConnector()) { continue; } - if (needConnector) - { - if(!FindConnector()) - { - continue; - } + drmModeFreeConnector(m_connector->connector); + m_connector->connector = nullptr; + FreeProperties(m_connector); + } - drmModeFreeConnector(m_connector->connector); - m_connector->connector = nullptr; - FreeProperties(m_connector); - } + drmModeFreeResources(m_drm_resources); + m_drm_resources = nullptr; - drmModeFreeResources(m_drm_resources); - m_drm_resources = nullptr; + m_module = module; - m_module = module; - m_device_path = device; + CLog::Log(LOGDEBUG, "CDRMUtils::%s - opened device: %s using module: %s", __FUNCTION__, drmGetDeviceNameFromFd2(m_fd), module); - CLog::Log(LOGDEBUG, "CDRMUtils::%s - opened device: %s using module: %s", __FUNCTION__, device.c_str(), module); - return true; + m_renderFd.attach(drmOpenWithType(module, nullptr, DRM_NODE_RENDER)); + if (m_renderFd) + { + CLog::Log(LOGDEBUG, "CDRMUtils::%s - opened render node: %s using module: %s", __FUNCTION__, drmGetDeviceNameFromFd2(m_renderFd), module); } + + return true; } } @@ -693,6 +691,7 @@ CLog::Log(LOGDEBUG, "CDRMUtils::%s - failed to drop drm master: %s", __FUNCTION__, strerror(errno)); } + m_renderFd.reset(); m_fd.reset(); drmModeFreeResources(m_drm_resources); diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/DRMUtils.h kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/DRMUtils.h --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/DRMUtils.h 2018-11-04 08:12:29.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/DRMUtils.h 2018-11-09 01:01:31.000000000 +0000 @@ -44,9 +44,16 @@ struct plane : drm_object { drmModePlanePtr plane = nullptr; - uint32_t format{0}; - uint32_t fallbackFormat{0}; bool useFallbackFormat{false}; + std::map> modifiers_map; + + void SetFormat(uint32_t newFormat) + { + if (useFallbackFormat) + fallbackFormat = newFormat; + else + format = newFormat; + } uint32_t GetFormat() { @@ -56,7 +63,9 @@ return format; } - std::map> modifiers_map; +private: + uint32_t format{DRM_FORMAT_XRGB2101010}; + uint32_t fallbackFormat{DRM_FORMAT_XRGB8888}; }; struct connector : drm_object @@ -93,8 +102,8 @@ virtual void DestroyDrm(); std::string GetModule() const { return m_module; } - std::string GetDevicePath() const { return m_device_path; } int GetFileDescriptor() const { return m_fd; } + int GetRenderNodeFileDescriptor() const { return m_renderFd; } struct plane* GetPrimaryPlane() const { return m_primary_plane; } struct plane* GetOverlayPlane() const { return m_overlay_plane; } std::vector *GetPrimaryPlaneModifiersForFormat(uint32_t format) { return &m_primary_plane->modifiers_map[format]; } @@ -146,9 +155,9 @@ RESOLUTION_INFO GetResolutionInfo(drmModeModeInfoPtr mode); bool CheckConnector(int connectorId); + KODI::UTILS::POSIX::CFileHandle m_renderFd; int m_crtc_index; std::string m_module; - std::string m_device_path; drmModeResPtr m_drm_resources = nullptr; drmModeCrtcPtr m_orig_crtc = nullptr; diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/OptionalsReg.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/OptionalsReg.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/OptionalsReg.cpp 2018-10-23 16:19:51.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/OptionalsReg.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -26,47 +26,26 @@ class CVaapiProxy : public VAAPI::IVaapiWinSystem { public: - CVaapiProxy() = default; + CVaapiProxy(int fd) : m_fd(fd) {}; virtual ~CVaapiProxy() = default; VADisplay GetVADisplay() override; void *GetEGLDisplay() override { return eglDisplay; }; VADisplay vaDpy; void *eglDisplay; + +private: + int m_fd{-1}; }; VADisplay CVaapiProxy::GetVADisplay() { - int const buf_size{128}; - char name[buf_size]; - int fd{-1}; - - // 128 is the start of the NUM in renderD - for (int i = 128; i < (128 + 16); i++) - { - snprintf(name, buf_size, "/dev/dri/renderD%u", i); - - fd = open(name, O_RDWR); - - if (fd < 0) - { - continue; - } - - auto display = vaGetDisplayDRM(fd); - - if (display != nullptr) - { - return display; - } - } - - return nullptr; + return vaGetDisplayDRM(m_fd); } -CVaapiProxy* VaapiProxyCreate() +CVaapiProxy* VaapiProxyCreate(int fd) { - return new CVaapiProxy(); + return new CVaapiProxy(fd); } void VaapiProxyDelete(CVaapiProxy *proxy) @@ -107,7 +86,7 @@ { }; -CVaapiProxy* VaapiProxyCreate() +CVaapiProxy* VaapiProxyCreate(int fd) { return nullptr; } diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/OptionalsReg.h kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/OptionalsReg.h --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/OptionalsReg.h 2018-10-23 16:19:51.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/OptionalsReg.h 2018-11-09 01:01:31.000000000 +0000 @@ -21,7 +21,7 @@ { class CVaapiProxy; -CVaapiProxy* VaapiProxyCreate(); +CVaapiProxy* VaapiProxyCreate(int fd); void VaapiProxyDelete(CVaapiProxy *proxy); void VaapiProxyConfig(CVaapiProxy *proxy, void *eglDpy); void VAAPIRegister(CVaapiProxy *winSystem, bool deepColor); diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbm.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbm.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbm.cpp 2018-11-04 08:12:29.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbm.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -109,7 +109,6 @@ bool CWinSystemGbm::DestroyWindowSystem() { - m_GBM->DestroySurface(); m_GBM->DestroyDevice(); CLog::Log(LOGDEBUG, "CWinSystemGbm::%s - deinitialized DRM", __FUNCTION__); @@ -119,47 +118,6 @@ return true; } -bool CWinSystemGbm::CreateNewWindow(const std::string& name, - bool fullScreen, - RESOLUTION_INFO& res) -{ - //Notify other subsystems that we change resolution - OnLostDevice(); - - if(!m_DRM->SetMode(res)) - { - CLog::Log(LOGERROR, "CWinSystemGbm::%s - failed to set DRM mode", __FUNCTION__); - return false; - } - - std::vector *modifiers = m_DRM->GetOverlayPlaneModifiersForFormat(m_DRM->GetOverlayPlane()->format); - - // the gbm format needs alpha support - uint32_t format = CDRMUtils::FourCCWithAlpha(m_DRM->GetOverlayPlane()->GetFormat()); - - if (!m_GBM->CreateSurface(res.iWidth, res.iHeight, format, modifiers->data(), modifiers->size())) - { - CLog::Log(LOGERROR, "CWinSystemGbm::%s - failed to initialize GBM", __FUNCTION__); - return false; - } - - m_bFullScreen = fullScreen; - m_nWidth = res.iWidth; - m_nHeight = res.iHeight; - m_fRefreshRate = res.fRefreshRate; - - CLog::Log(LOGDEBUG, "CWinSystemGbm::%s - initialized GBM", __FUNCTION__); - return true; -} - -bool CWinSystemGbm::DestroyWindow() -{ - m_GBM->DestroySurface(); - - CLog::Log(LOGDEBUG, "CWinSystemGbm::%s - deinitialized GBM", __FUNCTION__); - return true; -} - void CWinSystemGbm::UpdateResolutions() { RESOLUTION_INFO current = m_DRM->GetCurrentMode(); diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp 2018-11-04 08:12:29.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbmEGLContext.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -22,9 +22,6 @@ return false; } - // we need to provide an alpha format to egl to workaround a mesa bug - int visualId = CDRMUtils::FourCCWithAlpha(CWinSystemGbm::GetDrm()->GetOverlayPlane()->format); - if (!m_eglContext.CreatePlatformDisplay(m_GBM->GetDevice(), m_GBM->GetDevice())) { return false; @@ -35,13 +32,18 @@ return false; } - if (!m_eglContext.ChooseConfig(renderableType, visualId)) + uint32_t visualId = m_DRM->GetOverlayPlane()->GetFormat(); + + // prefer alpha visual id, fallback to non-alpha visual id + if (!m_eglContext.ChooseConfig(renderableType, CDRMUtils::FourCCWithAlpha(visualId)) && + !m_eglContext.ChooseConfig(renderableType, CDRMUtils::FourCCWithoutAlpha(visualId))) { // fallback to 8bit format if no EGL config was found for 10bit - CWinSystemGbm::GetDrm()->GetOverlayPlane()->useFallbackFormat = true; - visualId = CDRMUtils::FourCCWithAlpha(CWinSystemGbm::GetDrm()->GetOverlayPlane()->GetFormat()); + m_DRM->GetOverlayPlane()->useFallbackFormat = true; + visualId = m_DRM->GetOverlayPlane()->GetFormat(); - if (!m_eglContext.ChooseConfig(renderableType, visualId)) + if (!m_eglContext.ChooseConfig(renderableType, CDRMUtils::FourCCWithAlpha(visualId)) && + !m_eglContext.ChooseConfig(renderableType, CDRMUtils::FourCCWithoutAlpha(visualId))) { return false; } @@ -59,15 +61,26 @@ bool fullScreen, RESOLUTION_INFO& res) { - m_eglContext.DestroySurface(); + //Notify other subsystems that we change resolution + OnLostDevice(); + + if (!DestroyWindow()) + { + return false; + } - if (!CWinSystemGbm::DestroyWindow()) + if (!m_DRM->SetMode(res)) { + CLog::Log(LOGERROR, "CWinSystemGbmEGLContext::{} - failed to set DRM mode", __FUNCTION__); return false; } - if (!CWinSystemGbm::CreateNewWindow(name, fullScreen, res)) + uint32_t format = m_eglContext.GetConfigAttrib(EGL_NATIVE_VISUAL_ID); + std::vector *modifiers = m_DRM->GetOverlayPlaneModifiersForFormat(format); + + if (!m_GBM->CreateSurface(res.iWidth, res.iHeight, format, modifiers->data(), modifiers->size())) { + CLog::Log(LOGERROR, "CWinSystemGbmEGLContext::{} - failed to initialize GBM", __FUNCTION__); return false; } @@ -84,6 +97,21 @@ return false; } + m_bFullScreen = fullScreen; + m_nWidth = res.iWidth; + m_nHeight = res.iHeight; + m_fRefreshRate = res.fRefreshRate; + + CLog::Log(LOGDEBUG, "CWinSystemGbmEGLContext::{} - initialized GBM", __FUNCTION__); + return true; +} + +bool CWinSystemGbmEGLContext::DestroyWindow() +{ + m_eglContext.DestroySurface(); + m_GBM->DestroySurface(); + + CLog::Log(LOGDEBUG, "CWinSystemGbmEGLContext::{} - deinitialized GBM", __FUNCTION__); return true; } diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbmEGLContext.h kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbmEGLContext.h --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbmEGLContext.h 2018-10-23 16:19:51.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbmEGLContext.h 2018-11-09 01:01:31.000000000 +0000 @@ -30,6 +30,7 @@ bool CreateNewWindow(const std::string& name, bool fullScreen, RESOLUTION_INFO& res) override; + bool DestroyWindow() override; EGLDisplay GetEGLDisplay() const; EGLSurface GetEGLSurface() const; diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp 2018-10-23 16:19:51.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbmGLContext.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -45,7 +45,7 @@ } bool general, deepColor; - m_vaapiProxy.reset(VaapiProxyCreate()); + m_vaapiProxy.reset(VaapiProxyCreate(m_DRM->GetRenderNodeFileDescriptor())); VaapiProxyConfig(m_vaapiProxy.get(), m_eglContext.GetEGLDisplay()); VAAPIRegisterRender(m_vaapiProxy.get(), general, deepColor); diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp 2018-10-23 16:19:51.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbmGLESContext.cpp 2018-11-09 01:01:31.000000000 +0000 @@ -53,7 +53,7 @@ } bool general, deepColor; - m_vaapiProxy.reset(GBM::VaapiProxyCreate()); + m_vaapiProxy.reset(GBM::VaapiProxyCreate(m_DRM->GetRenderNodeFileDescriptor())); GBM::VaapiProxyConfig(m_vaapiProxy.get(), m_eglContext.GetEGLDisplay()); GBM::VAAPIRegisterRender(m_vaapiProxy.get(), general, deepColor); diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbm.h kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbm.h --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/gbm/WinSystemGbm.h 2018-11-04 08:12:29.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/gbm/WinSystemGbm.h 2018-11-09 01:01:31.000000000 +0000 @@ -36,12 +36,6 @@ bool InitWindowSystem() override; bool DestroyWindowSystem() override; - bool CreateNewWindow(const std::string& name, - bool fullScreen, - RESOLUTION_INFO& res) override; - - bool DestroyWindow() override; - bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) override; bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays) override; @@ -61,7 +55,6 @@ void RegisterVideoLayerBridge(std::shared_ptr bridge) { m_videoLayerBridge = bridge; }; std::string GetModule() const { return m_DRM->GetModule(); } - std::string GetDevicePath() const { return m_DRM->GetDevicePath(); } struct gbm_device *GetGBMDevice() const { return m_GBM->GetDevice(); } std::shared_ptr GetDrm() const { return m_DRM; } diff -Nru kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/osx/WinSystemOSX.mm kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/osx/WinSystemOSX.mm --- kodi-18.0+git20181108.0201-5a42446/xbmc/windowing/osx/WinSystemOSX.mm 2018-11-04 08:12:29.000000000 +0000 +++ kodi-18.0+git20181109.0201-a948f99/xbmc/windowing/osx/WinSystemOSX.mm 2018-11-09 01:01:31.000000000 +0000 @@ -1008,7 +1008,7 @@ // Blank other displays if requested. if (blankOtherDisplays) - BlankOtherDisplays(0); + BlankOtherDisplays(m_lastDisplayNr); // Hide the mouse. [NSCursor hide];