diff options
author | Benjamin Franzke <[email protected]> | 2011-05-30 09:55:14 +0200 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2011-06-07 10:28:20 -0400 |
commit | a433755ec5c48088a0d8a340851a1a8be9e58897 (patch) | |
tree | ec07d218e029d03b609ff3d391a32cb07fdffbb2 /src/gallium/state_trackers/egl/wayland | |
parent | 7f881c43dfb4f1aeeab3a84125b5c106c191a43f (diff) |
targets/egl: Support driver name lookup using pci lists
Make use of this in drm and wayland st/egl backends.
Reviewed-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/egl/wayland')
-rw-r--r-- | src/gallium/state_trackers/egl/wayland/native_drm.c | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/src/gallium/state_trackers/egl/wayland/native_drm.c b/src/gallium/state_trackers/egl/wayland/native_drm.c index f643c7cbbba..15383e89301 100644 --- a/src/gallium/state_trackers/egl/wayland/native_drm.c +++ b/src/gallium/state_trackers/egl/wayland/native_drm.c @@ -37,10 +37,6 @@ #include "native_wayland.h" -/* see get_drm_screen_name */ -#include <radeon_drm.h> -#include "radeon/drm/radeon_drm_public.h" - #include <wayland-client.h> #include "wayland-drm-client-protocol.h" #include "wayland-egl-priv.h" @@ -143,27 +139,6 @@ wayland_create_drm_buffer(struct wayland_display *display, width, height, wsh.stride, visual); } -static const char * -get_drm_screen_name(int fd, drmVersionPtr version) -{ - const char *name = version->name; - - if (name && !strcmp(name, "radeon")) { - int chip_id; - struct drm_radeon_info info; - - memset(&info, 0, sizeof(info)); - info.request = RADEON_INFO_DEVICE_ID; - info.value = pointer_to_intptr(&chip_id); - if (drmCommandWriteRead(fd, DRM_RADEON_INFO, &info, sizeof(info)) != 0) - return NULL; - - name = is_r3xx(chip_id) ? "r300" : "r600"; - } - - return name; -} - static void drm_handle_device(void *data, struct wl_drm *drm, const char *device) { @@ -202,8 +177,6 @@ static boolean wayland_drm_display_init_screen(struct native_display *ndpy) { struct wayland_drm_display *drmdpy = wayland_drm_display(ndpy); - drmVersionPtr version; - const char *driver_name; uint32_t id; id = wl_display_get_global(drmdpy->base.dpy, "wl_drm", 1); @@ -226,20 +199,9 @@ wayland_drm_display_init_screen(struct native_display *ndpy) if (!drmdpy->authenticated) return FALSE; - version = drmGetVersion(drmdpy->fd); - if (!version) { - _eglLog(_EGL_WARNING, "invalid fd %d", drmdpy->fd); - return FALSE; - } - - /* FIXME: share this with native_drm or egl_dri2 */ - driver_name = get_drm_screen_name(drmdpy->fd, version); - drmdpy->base.base.screen = drmdpy->event_handler->new_drm_screen(&drmdpy->base.base, - driver_name, drmdpy->fd); - drmFreeVersion(version); - + NULL, drmdpy->fd); if (!drmdpy->base.base.screen) { _eglLog(_EGL_WARNING, "failed to create DRM screen"); return FALSE; |