dri: setup libdrm hooks as early as possible.

This is due to radeon doing drm stuff before DRI extension gets initialised
This commit is contained in:
Dave Airlie 2006-11-18 11:26:55 +11:00 committed by airlied
parent f17e3c34df
commit e2f6dacc73
2 changed files with 8 additions and 4 deletions

View File

@ -84,7 +84,7 @@ static RESTYPE DRIDrawablePrivResType;
static RESTYPE DRIContextPrivResType;
static void DRIDestroyDummyContext(ScreenPtr pScreen, Bool hasCtxPriv);
static drmServerInfo DRIDRMServerInfo;
drmServerInfo DRIDRMServerInfo;
/* Wrapper just like xf86DrvMsg, but
without the verbosity level checking.
@ -176,8 +176,6 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD)
else
openbusid = NULL;
drmSetServerInfo(&DRIDRMServerInfo);
/* Note that drmOpen will try to load the kernel module, if needed. */
fd = drmOpen(pDRIInfo->drmDriverName, openbusid);
if (fd < 0) {
@ -593,7 +591,7 @@ static void dri_drm_get_perms(gid_t *group, mode_t *mode)
*mode = xf86ConfigDRI.mode;
}
static drmServerInfo DRIDRMServerInfo = {
drmServerInfo DRIDRMServerInfo = {
dri_drm_debug_print,
xf86LoadKernelModule,
dri_drm_get_perms,

View File

@ -39,8 +39,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xf86Module.h"
#include "globals.h"
#include "xf86drm.h"
static MODULESETUPPROTO(driSetup);
drmServerInfo DRIDRMServerInfo;
static XF86ModuleVersionInfo VersRec =
{
"dri",
@ -81,6 +84,9 @@ driSetup(pointer module, pointer opts, int *errmaj, int *errmin)
} else {
if (errmaj) *errmaj = LDR_ONCEONLY;
}
drmSetServerInfo(&DRIDRMServerInfo);
/* Need a non-NULL return value to indicate success */
return 1;
}