Android-x86
Fork
Spenden

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-gbm_gralloc: Commit

external/gbm_gralloc


Commit MetaInfo

Revision0afe1961cda99527fa8827cfaeece393b77b57fc (tree)
Zeit2019-01-14 14:16:42
AutorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

Open the DRM device of the primary framebuffer (fb0)

With the new added drmOpenByFB function in libdrm, it's easy to find
the correct DRM device of the primary framebuffer.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>

Ändern Zusammenfassung

Diff

--- a/gralloc_gbm.cpp
+++ b/gralloc_gbm.cpp
@@ -34,6 +34,7 @@
3434 #include <sys/stat.h>
3535 #include <fcntl.h>
3636 #include <assert.h>
37+#include <xf86drm.h>
3738
3839 #include <hardware/gralloc.h>
3940 #include <system/graphics.h>
@@ -313,8 +314,11 @@ struct gbm_device *gbm_dev_create(bool master)
313314 char path[PROPERTY_VALUE_MAX];
314315 int fd;
315316
316- property_get("gralloc.gbm.device", path, master ? "/dev/dri/card0" : "/dev/dri/renderD128");
317- fd = open(path, O_RDWR | O_CLOEXEC);
317+ if (property_get("gralloc.gbm.device", path, NULL) > 0)
318+ fd = open(path, O_RDWR | O_CLOEXEC);
319+ else
320+ fd = drmOpenByFB(0, master ? DRM_NODE_PRIMARY : DRM_NODE_RENDER);
321+
318322 if (fd < 0) {
319323 ALOGE("failed to open %s", path);
320324 return NULL;
Show on old repository browser