mirror of
https://github.com/libretro/RetroArch
synced 2025-04-02 07:20:34 +00:00
Merge pull request #9801 from cmitu/kms-video-mode-selection
KMSDRM: better detection for the current video mode
This commit is contained in:
commit
002f2ab6e7
@ -27,7 +27,7 @@ uint32_t g_connector_id = 0;
|
|||||||
int g_drm_fd = 0;
|
int g_drm_fd = 0;
|
||||||
uint32_t g_crtc_id = 0;
|
uint32_t g_crtc_id = 0;
|
||||||
|
|
||||||
static drmModeCrtc *g_orig_crtc = NULL;
|
drmModeCrtc *g_orig_crtc = NULL;
|
||||||
|
|
||||||
static drmModeRes *g_drm_resources = NULL;
|
static drmModeRes *g_drm_resources = NULL;
|
||||||
drmModeConnector *g_drm_connector = NULL;
|
drmModeConnector *g_drm_connector = NULL;
|
||||||
|
@ -39,6 +39,7 @@ extern struct pollfd g_drm_fds;
|
|||||||
|
|
||||||
extern drmModeConnector *g_drm_connector;
|
extern drmModeConnector *g_drm_connector;
|
||||||
extern drmModeModeInfo *g_drm_mode;
|
extern drmModeModeInfo *g_drm_mode;
|
||||||
|
extern drmModeCrtc *g_orig_crtc;
|
||||||
|
|
||||||
extern drmEventContext g_drm_evctx;
|
extern drmEventContext g_drm_evctx;
|
||||||
|
|
||||||
|
@ -388,10 +388,16 @@ nextgpu:
|
|||||||
|
|
||||||
drm_setup(fd);
|
drm_setup(fd);
|
||||||
|
|
||||||
/* First mode is assumed to be the "optimal"
|
/* Choose the optimal video mode for get_video_size():
|
||||||
* one for get_video_size() purposes. */
|
- the current video mode from the CRTC
|
||||||
drm->fb_width = g_drm_connector->modes[0].hdisplay;
|
- otherwise pick first connector mode */
|
||||||
drm->fb_height = g_drm_connector->modes[0].vdisplay;
|
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);
|
drmSetMaster(g_drm_fd);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user