From 412b21b0e872ecc55bcb0bad20a41cbde0fc1972 Mon Sep 17 00:00:00 2001 From: Manuel Alfayate Corchete Date: Mon, 20 Jul 2020 11:42:23 +0200 Subject: [PATCH] Rename the gbm device struct from gbm to gbm_dev for better readabilty. --- src/video/kmsdrm/SDL_kmsdrmmouse.c | 4 ++-- src/video/kmsdrm/SDL_kmsdrmopengles.c | 2 +- src/video/kmsdrm/SDL_kmsdrmvideo.c | 20 ++++++++++---------- src/video/kmsdrm/SDL_kmsdrmvideo.h | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/video/kmsdrm/SDL_kmsdrmmouse.c b/src/video/kmsdrm/SDL_kmsdrmmouse.c index 4760d5ba8..19d50b476 100644 --- a/src/video/kmsdrm/SDL_kmsdrmmouse.c +++ b/src/video/kmsdrm/SDL_kmsdrmmouse.c @@ -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) { diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.c b/src/video/kmsdrm/SDL_kmsdrmopengles.c index dcc8d4763..cd6f6a350 100644 --- a/src/video/kmsdrm/SDL_kmsdrmopengles.c +++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c @@ -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); } diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index d0526cf2e..60d014c21 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -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); diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.h b/src/video/kmsdrm/SDL_kmsdrmvideo.h index df6133e31..a1c87f0fd 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.h +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.h @@ -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;