src/video/kmsdrm/SDL_kmsdrmvideo.c
changeset 11190 478630f6b756
parent 11186 a01f9b70ff97
child 11217 d9c3f934bd0e
equal deleted inserted replaced
11189:8a23ac7134d2 11190:478630f6b756
   197         return fb_info;
   197         return fb_info;
   198     }
   198     }
   199 
   199 
   200     /* Here a new DRM FB must be created */
   200     /* Here a new DRM FB must be created */
   201     fb_info = (KMSDRM_FBInfo *)SDL_calloc(1, sizeof(KMSDRM_FBInfo));
   201     fb_info = (KMSDRM_FBInfo *)SDL_calloc(1, sizeof(KMSDRM_FBInfo));
       
   202     if (fb_info == NULL) {
       
   203         SDL_OutOfMemory();
       
   204         return NULL;
       
   205     }
   202     fb_info->drm_fd = vdata->drm_fd;
   206     fb_info->drm_fd = vdata->drm_fd;
   203 
   207 
   204     w  = KMSDRM_gbm_bo_get_width(bo);
   208     w  = KMSDRM_gbm_bo_get_width(bo);
   205     h = KMSDRM_gbm_bo_get_height(bo);
   209     h = KMSDRM_gbm_bo_get_height(bo);
   206     stride = KMSDRM_gbm_bo_get_stride(bo);
   210     stride = KMSDRM_gbm_bo_get_stride(bo);
   278 
   282 
   279     SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "KMSDRM_VideoInit()");
   283     SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "KMSDRM_VideoInit()");
   280 
   284 
   281     /* Open /dev/dri/cardNN */
   285     /* Open /dev/dri/cardNN */
   282     devname = (char *) SDL_calloc(1, 16);
   286     devname = (char *) SDL_calloc(1, 16);
       
   287     if (devname == NULL) {
       
   288         ret = SDL_OutOfMemory();
       
   289         goto cleanup;
       
   290     }
   283     SDL_snprintf(devname, 16, "/dev/dri/card%d", vdata->devindex);
   291     SDL_snprintf(devname, 16, "/dev/dri/card%d", vdata->devindex);
   284     vdata->drm_fd = open(devname, O_RDWR | O_CLOEXEC);
   292     vdata->drm_fd = open(devname, O_RDWR | O_CLOEXEC);
   285     SDL_free(devname);
   293     SDL_free(devname);
   286 
   294 
   287     if (vdata->drm_fd < 0) {
   295     if (vdata->drm_fd < 0) {