mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-03 15:54:39 +00:00
KMSDRM: better detection for the current video mode
This commit is contained in:
parent
b382ea2a33
commit
3953659901
@ -27,7 +27,7 @@ uint32_t g_connector_id = 0;
|
||||
int g_drm_fd = 0;
|
||||
uint32_t g_crtc_id = 0;
|
||||
|
||||
static drmModeCrtc *g_orig_crtc = NULL;
|
||||
drmModeCrtc *g_orig_crtc = NULL;
|
||||
|
||||
static drmModeRes *g_drm_resources = NULL;
|
||||
drmModeConnector *g_drm_connector = NULL;
|
||||
|
@ -39,6 +39,7 @@ extern struct pollfd g_drm_fds;
|
||||
|
||||
extern drmModeConnector *g_drm_connector;
|
||||
extern drmModeModeInfo *g_drm_mode;
|
||||
extern drmModeCrtc *g_orig_crtc;
|
||||
|
||||
extern drmEventContext g_drm_evctx;
|
||||
|
||||
|
@ -388,10 +388,16 @@ nextgpu:
|
||||
|
||||
drm_setup(fd);
|
||||
|
||||
/* First mode is assumed to be the "optimal"
|
||||
* one for get_video_size() purposes. */
|
||||
drm->fb_width = g_drm_connector->modes[0].hdisplay;
|
||||
drm->fb_height = g_drm_connector->modes[0].vdisplay;
|
||||
/* Choose the optimal video mode for get_video_size():
|
||||
- the current video mode from the CRTC
|
||||
- otherwise pick first connector mode */
|
||||
if (g_orig_crtc->mode_valid) {
|
||||
drm->fb_width = g_orig_crtc->mode.hdisplay;
|
||||
drm->fb_height = g_orig_crtc->mode.vdisplay;
|
||||
} else {
|
||||
drm->fb_width = g_drm_connector->modes[0].hdisplay;
|
||||
drm->fb_height = g_drm_connector->modes[0].vdisplay;
|
||||
}
|
||||
|
||||
drmSetMaster(g_drm_fd);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user