mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
KMSDRM: valid file descriptors could positive or 0. -1 is invalid. (Bug 4530)
This commit is contained in:
parent
3bc1a8b619
commit
cbe80d4708
@ -250,7 +250,7 @@ KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data)
|
||||
{
|
||||
KMSDRM_FBInfo *fb_info = (KMSDRM_FBInfo *)data;
|
||||
|
||||
if (fb_info && fb_info->drm_fd > 0 && fb_info->fb_id != 0) {
|
||||
if (fb_info && fb_info->drm_fd >= 0 && fb_info->fb_id != 0) {
|
||||
KMSDRM_drmModeRmFB(fb_info->drm_fd, fb_info->fb_id);
|
||||
SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Delete DRM FB %u", fb_info->fb_id);
|
||||
}
|
||||
@ -552,7 +552,7 @@ KMSDRM_VideoQuit(_THIS)
|
||||
}
|
||||
|
||||
if(vdata->saved_crtc != NULL) {
|
||||
if(vdata->drm_fd > 0 && vdata->saved_conn_id > 0) {
|
||||
if(vdata->drm_fd >= 0 && vdata->saved_conn_id > 0) {
|
||||
/* Restore saved CRTC settings */
|
||||
drmModeCrtc *crtc = vdata->saved_crtc;
|
||||
if(KMSDRM_drmModeSetCrtc(vdata->drm_fd, crtc->crtc_id, crtc->buffer_id,
|
||||
|
Loading…
Reference in New Issue
Block a user