diff options
author | Jakob Bornecrantz <[email protected]> | 2009-06-30 11:49:43 +0200 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2009-06-30 12:20:39 +0200 |
commit | 303cbb45b558a2b94e6922252cf57d115ba60b82 (patch) | |
tree | d56f9e58b8a3944ed7885bc1a72b1f786c98338e /src/gallium/state_trackers/egl | |
parent | efe9faf0612778db2423a4f8835b318b95d9efd7 (diff) |
drm/st: Return drm_api struct from a function
Diffstat (limited to 'src/gallium/state_trackers/egl')
-rw-r--r-- | src/gallium/state_trackers/egl/egl_context.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/egl_surface.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/egl_tracker.c | 5 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/egl_tracker.h | 1 |
4 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/egl/egl_context.c b/src/gallium/state_trackers/egl/egl_context.c index 36548fae263..edd49486e5b 100644 --- a/src/gallium/state_trackers/egl/egl_context.c +++ b/src/gallium/state_trackers/egl/egl_context.c @@ -115,7 +115,7 @@ drm_create_context(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext _eglInitContext(drv, dpy, &ctx->base, config, attrib_list); - ctx->pipe = drm_api_hooks.create_context(dev->screen); + ctx->pipe = dev->api->create_context(dev->api, dev->screen); if (!ctx->pipe) goto err_pipe; diff --git a/src/gallium/state_trackers/egl/egl_surface.c b/src/gallium/state_trackers/egl/egl_surface.c index 489aa8d9af5..de8194a46af 100644 --- a/src/gallium/state_trackers/egl/egl_surface.c +++ b/src/gallium/state_trackers/egl/egl_surface.c @@ -132,7 +132,7 @@ drm_create_texture(_EGLDriver *drv, scrn->front.width = w; scrn->front.height = h; scrn->front.pitch = pitch; - drm_api_hooks.handle_from_buffer(screen, scrn->buffer, &scrn->front.handle); + dev->api->handle_from_buffer(dev->api, screen, scrn->buffer, &scrn->front.handle); if (0) goto err_handle; diff --git a/src/gallium/state_trackers/egl/egl_tracker.c b/src/gallium/state_trackers/egl/egl_tracker.c index 8e620084617..521c91d8958 100644 --- a/src/gallium/state_trackers/egl/egl_tracker.c +++ b/src/gallium/state_trackers/egl/egl_tracker.c @@ -35,6 +35,8 @@ _eglMain(_EGLDisplay *dpy, const char *args) return NULL; } + drm->api = drm_api_create(); + /* First fill in the dispatch table with defaults */ _eglInitDriverFallbacks(&drm->base); /* then plug in our Drm-specific functions */ @@ -146,7 +148,7 @@ drm_initialize(_EGLDriver *drv, EGLDisplay dpy, EGLint *major, EGLint *minor) dev->drmFD = fd; drm_get_device_id(dev); - dev->screen = drm_api_hooks.create_screen(dev->drmFD, NULL); + dev->screen = dev->api->create_screen(dev->api, dev->drmFD, NULL); if (!dev->screen) goto err_screen; dev->winsys = dev->screen->winsys; @@ -234,6 +236,7 @@ drm_terminate(_EGLDriver *drv, EGLDisplay dpy) dev->screen->destroy(dev->screen); dev->winsys = NULL; + dev->api->destroy(dev->api); drmClose(dev->drmFD); diff --git a/src/gallium/state_trackers/egl/egl_tracker.h b/src/gallium/state_trackers/egl/egl_tracker.h index ce2717de639..3b8836720d6 100644 --- a/src/gallium/state_trackers/egl/egl_tracker.h +++ b/src/gallium/state_trackers/egl/egl_tracker.h @@ -38,6 +38,7 @@ struct drm_device * pipe */ + struct drm_api *api; struct pipe_winsys *winsys; struct pipe_screen *screen; |