summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/dri2/dri_screen.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-04-28 11:23:11 +0200
committerThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-04-28 11:25:56 +0200
commit638261b3530106b70819c2fe0c3cd613c0d85777 (patch)
tree120e783f5c7402ced10d07b288112c503261c67a /src/gallium/state_trackers/dri2/dri_screen.c
parent359a58230e0644a39c1904a74bc25803dc6cab6f (diff)
gallium: Update the drm_api.
Make it possible to pass state-tracker-specific data to the init_screen function, and even open the door for device-specific state-tracker screen initialization. Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
Diffstat (limited to 'src/gallium/state_trackers/dri2/dri_screen.c')
-rw-r--r--src/gallium/state_trackers/dri2/dri_screen.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/src/gallium/state_trackers/dri2/dri_screen.c b/src/gallium/state_trackers/dri2/dri_screen.c
index ab5878a4bc..ab33003f51 100644
--- a/src/gallium/state_trackers/dri2/dri_screen.c
+++ b/src/gallium/state_trackers/dri2/dri_screen.c
@@ -67,37 +67,6 @@ static const __DRIextension *dri_screen_extensions[] = {
NULL
};
-
-static void
-dri_get_drm_minor(struct dri_screen *screen)
-{
- /* TODO get the real minor */
- screen->minor = 0;
-}
-
-
-static void
-dri_get_device_id(struct dri_screen *screen)
-{
- char path[512];
- FILE *file;
-
- /*
- * There must be a better way to get the deviceID.
- * XXX this only works on Linux.
- */
- snprintf(path, sizeof(path), "/sys/class/drm/card%d/device/device", screen->minor);
- file = fopen(path, "r");
- if (!file) {
- return;
- }
-
- fgets(path, sizeof(path), file);
- sscanf(path, "%x", &screen->deviceID);
- fclose(file);
-}
-
-
static const __DRIconfig **
dri_fill_in_modes(__DRIscreenPrivate *psp,
unsigned pixel_bits, unsigned depth_bits,
@@ -212,13 +181,11 @@ dri_init_screen2(__DRIscreenPrivate *sPriv)
screen->sPriv = sPriv;
screen->fd = sPriv->fd;
- dri_get_drm_minor(screen);
- dri_get_device_id(screen);
sPriv->private = (void *) screen;
sPriv->extensions = dri_screen_extensions;
- screen->pipe_screen = drm_api_hooks.create_screen(screen->fd, screen->deviceID);
+ screen->pipe_screen = drm_api_hooks.create_screen(screen->fd, NULL);
if (!screen->pipe_screen) {
debug_printf("%s: failed to create pipe_screen\n", __FUNCTION__);
goto fail;