From 617f82be560724754e441be830b7f685c0d7e3da Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Thu, 13 Dec 2018 21:48:20 +0800 Subject: [PATCH] retroarch: Use first crtc when failed to get encoder from connector Signed-off-by: Jeffy Chen --- gfx/common/drm_common.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gfx/common/drm_common.c b/gfx/common/drm_common.c index 081a87c..7d5112f 100644 --- a/gfx/common/drm_common.c +++ b/gfx/common/drm_common.c @@ -176,7 +176,7 @@ bool drm_get_encoder(int fd) if (!g_drm_encoder) { RARCH_WARN("[DRM]: Couldn't find DRM encoder.\n"); - return false; + //return false; } for (i = 0; (int)i < g_drm_connector->count_modes; i++) @@ -194,7 +194,10 @@ bool drm_get_encoder(int fd) void drm_setup(int fd) { - g_crtc_id = g_drm_encoder->crtc_id; + if (g_drm_encoder) + g_crtc_id = g_drm_encoder->crtc_id; + else + g_crtc_id = g_drm_resources->crtcs[0]; g_connector_id = g_drm_connector->connector_id; g_orig_crtc = drmModeGetCrtc(fd, g_crtc_id); if (!g_orig_crtc) -- 2.11.0