mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
kmsdrm: Move property initialization a bit further down
KMSDRM_GBMInit() must be called first to set drm_fd and gbm_dev.
This commit is contained in:
@@ -1562,11 +1562,6 @@ bool KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
|
|||||||
windata->viddata = viddata;
|
windata->viddata = viddata;
|
||||||
window->internal = windata;
|
window->internal = windata;
|
||||||
|
|
||||||
SDL_PropertiesID props = SDL_GetWindowProperties(window);
|
|
||||||
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER, viddata->devindex);
|
|
||||||
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DRM_FD_NUMBER, viddata->drm_fd);
|
|
||||||
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER, viddata->gbm_dev);
|
|
||||||
|
|
||||||
// Do we want a double buffering scheme to get low video lag?
|
// Do we want a double buffering scheme to get low video lag?
|
||||||
windata->double_buffer = false;
|
windata->double_buffer = false;
|
||||||
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_DOUBLE_BUFFER, false)) {
|
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_DOUBLE_BUFFER, false)) {
|
||||||
@@ -1670,6 +1665,11 @@ bool KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
|
|||||||
// If we have just created a Vulkan window, establish that we are in Vulkan mode now.
|
// If we have just created a Vulkan window, establish that we are in Vulkan mode now.
|
||||||
viddata->vulkan_mode = is_vulkan;
|
viddata->vulkan_mode = is_vulkan;
|
||||||
|
|
||||||
|
SDL_PropertiesID props = SDL_GetWindowProperties(window);
|
||||||
|
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER, viddata->devindex);
|
||||||
|
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DRM_FD_NUMBER, viddata->drm_fd);
|
||||||
|
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER, viddata->gbm_dev);
|
||||||
|
|
||||||
/* Focus on the newly created window.
|
/* Focus on the newly created window.
|
||||||
SDL_SetMouseFocus() also takes care of calling KMSDRM_ShowCursor() if necessary. */
|
SDL_SetMouseFocus() also takes care of calling KMSDRM_ShowCursor() if necessary. */
|
||||||
SDL_SetMouseFocus(window);
|
SDL_SetMouseFocus(window);
|
||||||
|
Reference in New Issue
Block a user