mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-14 21:32:27 +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;
|
||||
}
|
||||
|
||||
// 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);
|
||||
if (resources == nullptr) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||
|
|
Loading…
Reference in a new issue