From f0820f6433681778bf580f9d85373d7b05759b09 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 18 Jan 2017 15:23:06 +0100 Subject: [PATCH] (DRM) Should fix segfault --- gfx/common/drm_common.c | 4 ++-- gfx/common/drm_common.h | 4 +++- gfx/drivers_context/drm_ctx.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gfx/common/drm_common.c b/gfx/common/drm_common.c index 1cdb2c0f50..ed776e91c9 100644 --- a/gfx/common/drm_common.c +++ b/gfx/common/drm_common.c @@ -64,11 +64,11 @@ bool drm_get_resources(int fd) return true; } -bool drm_get_connector(int fd, unsigned video_monitor_index) +bool drm_get_connector(int fd, video_frame_info_t video_info) { unsigned i; unsigned monitor_index = 0; - unsigned monitor = MAX(video_monitor_index, 1); + unsigned monitor = MAX(video_info.monitor_index, 1); /* Enumerate all connectors. */ diff --git a/gfx/common/drm_common.h b/gfx/common/drm_common.h index 4f2842968e..fbe7583184 100644 --- a/gfx/common/drm_common.h +++ b/gfx/common/drm_common.h @@ -27,6 +27,8 @@ #include #include +#include "../video_driver.h" + RETRO_BEGIN_DECLS extern uint32_t g_connector_id; @@ -51,7 +53,7 @@ void drm_setup(int fd); void drm_free(void); -bool drm_get_connector(int fd, unsigned video_monitor_index); +bool drm_get_connector(int fd, video_frame_info_t video_info); static INLINE bool drm_wait_flip(int timeout) { diff --git a/gfx/drivers_context/drm_ctx.c b/gfx/drivers_context/drm_ctx.c index b8738d3165..9452198716 100644 --- a/gfx/drivers_context/drm_ctx.c +++ b/gfx/drivers_context/drm_ctx.c @@ -393,7 +393,7 @@ nextgpu: if (!drm_get_resources(fd)) goto nextgpu; - if (!drm_get_connector(video_info.monitor_index, fd)) + if (!drm_get_connector(fd, video_info)) goto nextgpu; if (!drm_get_encoder(fd))