mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-20 22:16:49 +01:00
[KMS/DRM] Merge patch for bug 5522#: Implement KMSDRM_GetWindowWMInfo().
This commit is contained in:
parent
bfa51c3845
commit
2c76433151
@ -113,6 +113,10 @@ typedef void *EGLSurface;
|
|||||||
#endif
|
#endif
|
||||||
#endif /* SDL_PROTOTYPES_ONLY */
|
#endif /* SDL_PROTOTYPES_ONLY */
|
||||||
|
|
||||||
|
#if defined(SDL_VIDEO_DRIVER_KMSDRM)
|
||||||
|
struct gbm_device;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
@ -138,7 +142,8 @@ typedef enum
|
|||||||
SDL_SYSWM_ANDROID,
|
SDL_SYSWM_ANDROID,
|
||||||
SDL_SYSWM_VIVANTE,
|
SDL_SYSWM_VIVANTE,
|
||||||
SDL_SYSWM_OS2,
|
SDL_SYSWM_OS2,
|
||||||
SDL_SYSWM_HAIKU
|
SDL_SYSWM_HAIKU,
|
||||||
|
SDL_SYSWM_KMSDRM
|
||||||
} SDL_SYSWM_TYPE;
|
} SDL_SYSWM_TYPE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -312,6 +317,15 @@ struct SDL_SysWMinfo
|
|||||||
} vivante;
|
} vivante;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(SDL_VIDEO_DRIVER_KMSDRM)
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
int dev_index; /**< Device index (ex: the X in /dev/dri/cardX) */
|
||||||
|
int drm_fd; /**< DRM FD (unavailable on Vulkan windows) */
|
||||||
|
struct gbm_device *gbm_dev; /**< GBM device (unavailable on Vulkan windows) */
|
||||||
|
} kmsdrm;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Make sure this union is always 64 bytes (8 64-bit pointers). */
|
/* Make sure this union is always 64 bytes (8 64-bit pointers). */
|
||||||
/* Be careful not to overflow this if you add a new target! */
|
/* Be careful not to overflow this if you add a new target! */
|
||||||
Uint8 dummy[64];
|
Uint8 dummy[64];
|
||||||
|
@ -1370,16 +1370,22 @@ KMSDRM_RestoreWindow(_THIS, SDL_Window * window)
|
|||||||
SDL_bool
|
SDL_bool
|
||||||
KMSDRM_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info)
|
KMSDRM_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info)
|
||||||
{
|
{
|
||||||
if (info->version.major <= SDL_MAJOR_VERSION) {
|
SDL_VideoData *viddata = ((SDL_VideoData *)_this->driverdata);
|
||||||
return SDL_TRUE;
|
const Uint32 version = SDL_VERSIONNUM((Uint32)info->version.major,
|
||||||
} else {
|
(Uint32)info->version.minor,
|
||||||
SDL_SetError("application not compiled with SDL %d.%d\n",
|
(Uint32)info->version.patch);
|
||||||
SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
|
|
||||||
return SDL_FALSE;
|
if (version < SDL_VERSIONNUM(2, 0, 15)) {
|
||||||
}
|
SDL_SetError("Version must be 2.0.15 or newer");
|
||||||
|
return SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Failed to get window manager information */
|
info->subsystem = SDL_SYSWM_KMSDRM;
|
||||||
return SDL_FALSE;
|
info->info.kmsdrm.dev_index = viddata->devindex;
|
||||||
|
info->info.kmsdrm.drm_fd = viddata->drm_fd;
|
||||||
|
info->info.kmsdrm.gbm_dev = viddata->gbm_dev;
|
||||||
|
|
||||||
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* SDL_VIDEO_DRIVER_KMSDRM */
|
#endif /* SDL_VIDEO_DRIVER_KMSDRM */
|
||||||
|
Loading…
Reference in New Issue
Block a user