diff options
author | Jakob Bornecrantz <[email protected]> | 2010-05-27 00:38:30 +0200 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2010-06-06 12:29:28 +0100 |
commit | f9d9574913c5edb92191ac3f5e8d011452427852 (patch) | |
tree | abdab8c910f4c07e3e11b05bce997df3a9ae3ae3 /src/gallium/state_trackers/xorg | |
parent | 76aed4b070be8950fd8ea5caff59321885ff0a06 (diff) |
gallium: Convert state trackers to drm driver interface
Diffstat (limited to 'src/gallium/state_trackers/xorg')
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_crtc.c | 1 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_dri2.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_driver.c | 27 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_tracker.h | 2 |
4 files changed, 8 insertions, 24 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index f1a07bd863b..627754a0a4f 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -50,6 +50,7 @@ #include <X11/extensions/dpms.h> #endif +#include "state_tracker/drm_driver.h" #include "util/u_inlines.h" #include "util/u_rect.h" diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index 4e01bd10306..704aed6a82c 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -42,6 +42,8 @@ #include "util/u_format.h" +#include "state_tracker/drm_driver.h" + /* Make all the #if cases in the code esier to read */ #ifndef DRI2INFOREC_VERSION #define DRI2INFOREC_VERSION 1 diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 6b6e2009fea..9357cd5763f 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -51,6 +51,7 @@ #include <pciaccess.h> +#include "state_tracker/drm_driver.h" #include "pipe/p_context.h" #include "xorg_tracker.h" #include "xorg_winsys.h" @@ -267,18 +268,12 @@ drv_init_drm(ScrnInfoPtr pScrn) ); - ms->api = drm_api_create(); - ms->fd = drmOpen(ms->api ? ms->api->driver_name : NULL, BusID); + ms->fd = drmOpen(driver_descriptor.driver_name, BusID); xfree(BusID); if (ms->fd >= 0) return TRUE; - if (ms->api && ms->api->destroy) - ms->api->destroy(ms->api); - - ms->api = NULL; - return FALSE; } @@ -290,10 +285,6 @@ drv_close_drm(ScrnInfoPtr pScrn) { modesettingPtr ms = modesettingPTR(pScrn); - if (ms->api && ms->api->destroy) - ms->api->destroy(ms->api); - ms->api = NULL; - drmClose(ms->fd); ms->fd = -1; @@ -314,17 +305,10 @@ drv_init_resource_management(ScrnInfoPtr pScrn) if (ms->screen || ms->kms) return TRUE; - if (ms->api) { - ms->screen = ms->api->create_screen(ms->api, ms->fd); - - if (ms->screen) - return TRUE; + ms->screen = driver_descriptor.create_screen(ms->fd); - if (ms->api->destroy) - ms->api->destroy(ms->api); - - ms->api = NULL; - } + if (ms->screen) + return TRUE; #ifdef HAVE_LIBKMS if (!kms_create(ms->fd, &ms->kms)) @@ -430,7 +414,6 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags) } ms->fd = -1; - ms->api = NULL; if (!drv_init_drm(pScrn)) return FALSE; diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h index 25da9b1a3bd..cc2d379af15 100644 --- a/src/gallium/state_trackers/xorg/xorg_tracker.h +++ b/src/gallium/state_trackers/xorg/xorg_tracker.h @@ -49,7 +49,6 @@ #include "pipe/p_screen.h" #include "util/u_inlines.h" #include "util/u_debug.h" -#include "state_tracker/drm_api.h" #define DRV_ERROR(msg) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg); @@ -123,7 +122,6 @@ typedef struct _modesettingRec struct kms_bo *root_bo; /* gallium */ - struct drm_api *api; struct pipe_screen *screen; struct pipe_context *ctx; boolean d_depth_bits_last; |