mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-21 23:25:09 +00:00
Fix modesetting for non-EGL HEVC streams
This commit is contained in:
parent
b9c73df488
commit
9daf7b5a36
1 changed files with 17 additions and 0 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue