Skip to content

Commit

Permalink
Rename the gbm device struct from gbm to gbm_dev for better readabilty.
Browse files Browse the repository at this point in the history
  • Loading branch information
vanfanel committed Jul 20, 2020
1 parent 155fdc7 commit 412b21b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/video/kmsdrm/SDL_kmsdrmmouse.c
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/video/kmsdrm/SDL_kmsdrmopengles.c
Expand Up @@ -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);
}

Expand Down
20 changes: 10 additions & 10 deletions src/video/kmsdrm/SDL_kmsdrmvideo.c
Expand Up @@ -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.");
}

Expand All @@ -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");
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -663,9 +663,9 @@ KMSDRM_VideoInit(_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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/video/kmsdrm/SDL_kmsdrmvideo.h
Expand Up @@ -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;
Expand Down

0 comments on commit 412b21b

Please sign in to comment.