diff options
-rw-r--r-- | src/egl/drivers/android/droid.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/egl/drivers/android/droid.c b/src/egl/drivers/android/droid.c index 04e07b8f21..a902b2d86e 100644 --- a/src/egl/drivers/android/droid.c +++ b/src/egl/drivers/android/droid.c @@ -512,8 +512,12 @@ droid_load_driver(_EGLDisplay *dpy, const char *driver_name) } #include <xf86drm.h> +/* for i915 */ #include <i915_drm.h> #include "dri/intel/intel_chipset.h" +/* for radeon */ +#include <radeon_drm.h> +#include "radeon/drm/radeon_drm_public.h" static const char * droid_get_driver_name(int fd) { @@ -546,6 +550,21 @@ droid_get_driver_name(int fd) name = (IS_965(id)) ? "i965" : "i915"; } } + else if (strcmp(version->name, "radeon") == 0) { + struct drm_radeon_info info; + int id, ret; + + memset(&info, 0, sizeof(info)); + info.request = RADEON_INFO_DEVICE_ID; + info.value = (long) &id; + ret = drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info)); + if (ret) { + _eglLog(_EGL_WARNING, "failed to get info for radeon"); + } + else { + name = (is_r3xx(id)) ? "r300" : "r600"; + } + } drmFreeVersion(version); |