distribution/packages/games/emulators/dolphinsa/patches/new/007-drm-conn.patch

49 lines
1.5 KiB
Diff
Raw Normal View History

diff --git a/Source/Core/Common/GL/GLInterface/EGLDRM.cpp b/Source/Core/Common/GL/GLInterface/EGLDRM.cpp
index 55efc47..b96768f 100644
--- a/Source/Core/Common/GL/GLInterface/EGLDRM.cpp
+++ b/Source/Core/Common/GL/GLInterface/EGLDRM.cpp
@@ -371,14 +371,33 @@ static bool drm_get_connector(GFXContextDRMData* drm, int fd)
unsigned i;
unsigned monitor_index_count = 0;
unsigned monitor = 1;
+ int drmConn = 0;
/* Enumerate all connectors. */
INFO_LOG(VIDEO, "[DRM]: Found %d connectors.\n", drm->drm_resources->count_connectors);
+ // batocera
+ {
+ FILE* fdDrmConn;
+ int drmConnRead;
+ if((fdDrmConn = fopen("/var/run/drmConn", "r")) != NULL) {
+ if(fscanf(fdDrmConn, "%i", &drmConnRead) == 1) {
+ if(drmConnRead>=0 && drmConn<drm->drm_resources->count_connectors) {
+ drmConn = drmConnRead;
+ }
+ }
+ }
+ }
+ //
+
for (i = 0; (int)i < drm->drm_resources->count_connectors; i++)
{
- drmModeConnectorPtr conn = drmModeGetConnector(fd, drm->drm_resources->connectors[i]);
+ drmModeConnectorPtr conn;
+
+ if(i != drmConn) continue;
+
+ conn = drmModeGetConnector(fd, drm->drm_resources->connectors[i]);
if (conn)
{
@@ -399,6 +418,8 @@ static bool drm_get_connector(GFXContextDRMData* drm, int fd)
for (i = 0; (int)i < drm->drm_resources->count_connectors; i++)
{
+ if(i != drmConn) continue;
+
drm->drm_connector = drmModeGetConnector(fd, drm->drm_resources->connectors[i]);
if (!drm->drm_connector)