mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 22:23:31 +00:00
Fix modesetting for non-EGL HEVC streams
This commit is contained in:
@@ -206,6 +206,23 @@ bool DrmRenderer::initialize(PDECODER_PARAMETERS params)
|
|||||||
return DIRECT_RENDERING_INIT_FAILED;
|
return DIRECT_RENDERING_INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create a dummy renderer to force SDL to complete the modesetting
|
||||||
|
// operation that the KMSDRM backend keeps pending until the next
|
||||||
|
// time we swap buffers. We have to do this before we enumerate
|
||||||
|
// CRTC modes below.
|
||||||
|
SDL_Renderer* renderer = SDL_CreateRenderer(params->window, -1, SDL_RENDERER_SOFTWARE);
|
||||||
|
if (renderer != nullptr) {
|
||||||
|
SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
|
||||||
|
SDL_RenderClear(renderer);
|
||||||
|
SDL_RenderPresent(renderer);
|
||||||
|
SDL_DestroyRenderer(renderer);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"SDL_CreateRenderer() failed: %s",
|
||||||
|
SDL_GetError());
|
||||||
|
}
|
||||||
|
|
||||||
drmModeRes* resources = drmModeGetResources(m_DrmFd);
|
drmModeRes* resources = drmModeGetResources(m_DrmFd);
|
||||||
if (resources == nullptr) {
|
if (resources == nullptr) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
|||||||
Reference in New Issue
Block a user