diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2011-03-19 21:07:09 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2011-03-25 03:30:43 +0800 |
commit | f3837c70947ab90b09d8e6c80ddf81b1d9e78efc (patch) | |
tree | 49c0d5d2837a98fbb6d984209950f6f10c3acae6 | |
parent | d8ebb254c23c47f5d2761182583f5186a07fa03b (diff) |
egl_android: add support for loading radeon
For completeness. Not used.
-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); |