Rename the gbm device struct from gbm to gbm_dev for better readabilty.

Manuel Alfayate Corchete 2020-07-20 11:42:23 +02:00
parent 155fdc7ac0
commit 412b21b0e8
4 changed files with 14 additions and 14 deletions

View File

@ -90,7 +90,7 @@ KMSDRM_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888);
SDL_assert(surface->pitch == surface->w * 4);
if (!KMSDRM_gbm_device_is_format_supported(viddata->gbm, GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE)) {
if (!KMSDRM_gbm_device_is_format_supported(viddata->gbm_dev, GBM_FORMAT_ARGB8888, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE)) {
printf("Unsupported pixel format for cursor\n");
return NULL;
}
@ -124,7 +124,7 @@ KMSDRM_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
curdata->w = usable_cursor_w;
curdata->h = usable_cursor_h;
curdata->bo = KMSDRM_gbm_bo_create(viddata->gbm, usable_cursor_w, usable_cursor_h, GBM_FORMAT_ARGB8888,
curdata->bo = KMSDRM_gbm_bo_create(viddata->gbm_dev, usable_cursor_w, usable_cursor_h, GBM_FORMAT_ARGB8888,
GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE);
if (!curdata->bo) {

View File

@ -35,7 +35,7 @@
int
KMSDRM_GLES_LoadLibrary(_THIS, const char *path) {
NativeDisplayType display = (NativeDisplayType)((SDL_VideoData *)_this->driverdata)->gbm;
NativeDisplayType display = (NativeDisplayType)((SDL_VideoData *)_this->driverdata)->gbm_dev;
return SDL_EGL_LoadLibrary(_this, path, display, EGL_PLATFORM_GBM_MESA);
}

View File

@ -421,7 +421,7 @@ KMSDRM_CreateSurfaces(_THIS, SDL_Window * window)
EGLContext egl_context;
#endif
if (!KMSDRM_gbm_device_is_format_supported(viddata->gbm, surface_fmt, surface_flags)) {
if (!KMSDRM_gbm_device_is_format_supported(viddata->gbm_dev, surface_fmt, surface_flags)) {
SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "GBM surface format not supported. Trying anyway.");
}
@ -432,7 +432,7 @@ KMSDRM_CreateSurfaces(_THIS, SDL_Window * window)
KMSDRM_DestroySurfaces(_this, window);
windata->gs = KMSDRM_gbm_surface_create(viddata->gbm, width, height, surface_fmt, surface_flags);
windata->gs = KMSDRM_gbm_surface_create(viddata->gbm_dev, width, height, surface_fmt, surface_flags);
if (!windata->gs) {
return SDL_SetError("Could not create GBM surface");
@ -489,8 +489,8 @@ KMSDRM_VideoInit(_THIS)
SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Opened DRM FD (%d)", viddata->drm_fd);
viddata->gbm = KMSDRM_gbm_create_device(viddata->drm_fd);
if (!viddata->gbm) {
viddata->gbm_dev = KMSDRM_gbm_create_device(viddata->drm_fd);
if (!viddata->gbm_dev) {
ret = SDL_SetError("Couldn't create gbm device.");
goto cleanup;
}
@ -663,9 +663,9 @@ cleanup:
KMSDRM_drmModeFreeCrtc(dispdata->saved_crtc);
dispdata->saved_crtc = NULL;
}
if (viddata->gbm) {
KMSDRM_gbm_device_destroy(viddata->gbm);
viddata->gbm = NULL;
if (viddata->gbm_dev) {
KMSDRM_gbm_device_destroy(viddata->gbm_dev);
viddata->gbm_dev = NULL;
}
if (viddata->drm_fd >= 0) {
close(viddata->drm_fd);
@ -714,9 +714,9 @@ KMSDRM_VideoQuit(_THIS)
KMSDRM_drmModeFreeCrtc(dispdata->saved_crtc);
dispdata->saved_crtc = NULL;
}
if (viddata->gbm) {
KMSDRM_gbm_device_destroy(viddata->gbm);
viddata->gbm = NULL;
if (viddata->gbm_dev) {
KMSDRM_gbm_device_destroy(viddata->gbm_dev);
viddata->gbm_dev = NULL;
}
if (viddata->drm_fd >= 0) {
close(viddata->drm_fd);

View File

@ -39,7 +39,7 @@ typedef struct SDL_VideoData
{
int devindex; /* device index that was passed on creation */
int drm_fd; /* DRM file desc */
struct gbm_device *gbm;
struct gbm_device *gbm_dev;
SDL_Window **windows;
int max_windows;