hc
2023-02-13 e440ec23c5a540cdd3f7464e8779219be6fd3d95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 617f82be560724754e441be830b7f685c0d7e3da Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
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 <jeffy.chen@rock-chips.com>
---
 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