From 303cbb45b558a2b94e6922252cf57d115ba60b82 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 30 Jun 2009 11:49:43 +0200 Subject: drm/st: Return drm_api struct from a function --- src/gallium/state_trackers/xorg/xorg_driver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gallium/state_trackers/xorg/xorg_driver.c') diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 45e831f0c2..e01e5294b1 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -300,6 +300,7 @@ PreInit(ScrnInfoPtr pScrn, int flags) ms->PciInfo->dev, ms->PciInfo->func ); + ms->api = drm_api_create(); ms->fd = drmOpen(NULL, BusID); if (ms->fd < 0) @@ -476,7 +477,7 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } if (!ms->screen) { - ms->screen = drm_api_hooks.create_screen(ms->fd, NULL); + ms->screen = ms->api->create_screen(ms->api, ms->fd, NULL); if (!ms->screen) { FatalError("Could not init pipe_screen\n"); @@ -678,6 +679,8 @@ CloseScreen(int scrnIndex, ScreenPtr pScreen) if (ms->exa) xorg_exa_close(pScrn); + ms->api->destroy(ms->api); + ms->api = NULL; drmClose(ms->fd); ms->fd = -1; -- cgit v1.2.3