summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/xorg
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/xorg')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_crtc.c1
-rw-r--r--src/gallium/state_trackers/xorg/xorg_dri2.c2
-rw-r--r--src/gallium/state_trackers/xorg/xorg_driver.c27
-rw-r--r--src/gallium/state_trackers/xorg/xorg_tracker.h2
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 f1a07bd863..627754a0a4 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 4e01bd1030..704aed6a82 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 6b6e2009fe..9357cd5763 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 25da9b1a3b..cc2d379af1 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;