src/video/kmsdrm/SDL_kmsdrmvideo.c
changeset 13577 d28975f16368
parent 13555 936b1869a34a
child 13592 3ff45857428d
equal deleted inserted replaced
13576:dce2898245ef 13577:d28975f16368
   648     viddata->windows = NULL;
   648     viddata->windows = NULL;
   649     viddata->max_windows = 0;
   649     viddata->max_windows = 0;
   650     viddata->num_windows = 0;
   650     viddata->num_windows = 0;
   651 
   651 
   652     /* Restore saved CRTC settings */
   652     /* Restore saved CRTC settings */
   653     if (viddata->drm_fd >= 0 && dispdata->conn && dispdata->saved_crtc) {
   653     if (viddata->drm_fd >= 0 && dispdata && dispdata->conn && dispdata->saved_crtc) {
   654         drmModeConnector *conn = dispdata->conn;
   654         drmModeConnector *conn = dispdata->conn;
   655         drmModeCrtc *crtc = dispdata->saved_crtc;
   655         drmModeCrtc *crtc = dispdata->saved_crtc;
   656 
   656 
   657         int ret = KMSDRM_drmModeSetCrtc(viddata->drm_fd, crtc->crtc_id, crtc->buffer_id,
   657         int ret = KMSDRM_drmModeSetCrtc(viddata->drm_fd, crtc->crtc_id, crtc->buffer_id,
   658                                         crtc->x, crtc->y, &conn->connector_id, 1, &crtc->mode);
   658                                         crtc->x, crtc->y, &conn->connector_id, 1, &crtc->mode);
   659 
   659 
   660         if (ret != 0) {
   660         if (ret != 0) {
   661             SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "Could not restore original CRTC mode");
   661             SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "Could not restore original CRTC mode");
   662         }
   662         }
   663     }
   663     }
   664     if (dispdata->conn) {
   664     if (dispdata && dispdata->conn) {
   665         KMSDRM_drmModeFreeConnector(dispdata->conn);
   665         KMSDRM_drmModeFreeConnector(dispdata->conn);
   666         dispdata->conn = NULL;
   666         dispdata->conn = NULL;
   667     }
   667     }
   668     if (dispdata->saved_crtc) {
   668     if (dispdata && dispdata->saved_crtc) {
   669         KMSDRM_drmModeFreeCrtc(dispdata->saved_crtc);
   669         KMSDRM_drmModeFreeCrtc(dispdata->saved_crtc);
   670         dispdata->saved_crtc = NULL;
   670         dispdata->saved_crtc = NULL;
   671     }
   671     }
   672     if (viddata->gbm) {
   672     if (viddata->gbm) {
   673         KMSDRM_gbm_device_destroy(viddata->gbm);
   673         KMSDRM_gbm_device_destroy(viddata->gbm);