This should make most linux-solo drivers work again. Mainly a fix

for changing SAREA size form DRM_PAGE_SIZE to SAREA_MAX. fb driver
is still broken.
This commit is contained in:
Jon Smirl
2004-06-29 04:50:29 +00:00
parent 7c1207a2ec
commit c61c7cb8e4
6 changed files with 7 additions and 45 deletions
+1 -33
View File
@@ -911,24 +911,6 @@ static int __read_config_file( Display *dpy )
static int InitDriver( Display *dpy )
{
char * str;
char * srvLibname = NULL;
srvLibname = strdup(dpy->clientDriverName);
if (!srvLibname) {
goto failed;
}
/*
* Construct server library name. Assume clientDriverName ends
* with dri.so. Replace dri.so with srv.so.
*/
str = strstr(srvLibname, "dri.so");
if (!str) {
goto failed;
}
strcpy(str, "srv.so");
/*
* Begin DRI setup.
* We're kind of combining the per-display and per-screen information
@@ -941,16 +923,9 @@ static int InitDriver( Display *dpy )
goto failed;
}
dpy->dlHandleSrv = dlopen(srvLibname, RTLD_NOW | RTLD_GLOBAL);
if (!dpy->dlHandleSrv) {
fprintf(stderr, "Unable to open %s: %s\n", dpy->clientDriverName,
dlerror());
goto failed;
}
/* Pull in Mini GLX specific hooks:
*/
dpy->driver = (struct DRIDriverRec *) dlsym(dpy->dlHandleSrv,
dpy->driver = (struct DRIDriverRec *) dlsym(dpy->dlHandle,
"__driDriver");
if (!dpy->driver) {
fprintf(stderr, "Couldn't find __driDriver in %s\n",
@@ -971,13 +946,6 @@ static int InitDriver( Display *dpy )
return GL_TRUE;
failed:
if (srvLibname) {
free(srvLibname);
}
if (dpy->dlHandleSrv) {
dlclose(dpy->dlHandleSrv);
dpy->dlHandleSrv = 0;
}
if (dpy->dlHandle) {
dlclose(dpy->dlHandle);
dpy->dlHandle = 0;
-4
View File
@@ -166,10 +166,6 @@ struct MiniGLXDisplayRec {
* \brief handle to the client dynamic
* library
*/
void *dlHandleSrv; /**<
* \brief handle to the server dynamic
* library
*/
/*@}*/
/**
+2 -4
View File
@@ -1,7 +1,5 @@
# -*-makefile-*-
TOP = ../../../../..
MESA_MODULES = $(TOP)/src/mesa/mesa.a
@@ -36,7 +34,7 @@ endif
### Include directories
SHARED_INCLUDES = \
-I. \
-I../common \
-I$(TOP)/src/mesa/drivers/dri/common \
-Iserver \
-I$(DRM_SOURCE_PATH)/shared \
-I$(TOP)/include \
@@ -75,7 +73,7 @@ default: depend symlinks $(LIB_DIR)/$(LIBNAME)
# $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile ../Makefile.template
$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(GL_LIB_DEPS)
+2 -2
View File
@@ -657,7 +657,7 @@ __driInitFBDev( struct DRIDriverContextRec *ctx )
ctx->shared.hFrameBuffer = ctx->FBStart;
ctx->shared.fbSize = ctx->FBSize;
ctx->shared.hSAREA = 0xB37D;
ctx->shared.SAREASize = DRM_PAGE_SIZE;
ctx->shared.SAREASize = SAREA_MAX;
id = shmget(ctx->shared.hSAREA, ctx->shared.SAREASize, IPC_CREAT | IPC_EXCL | S_IRUSR | S_IWUSR);
if (id == -1) {
/* segment will already exist if previous server segfaulted */
@@ -672,7 +672,7 @@ __driInitFBDev( struct DRIDriverContextRec *ctx )
fprintf(stderr, "fb: shmat failed\n");
return 0;
}
memset(ctx->pSAREA, 0, DRM_PAGE_SIZE);
memset(ctx->pSAREA, 0, SAREA_MAX);
return 1;
}
+1 -1
View File
@@ -747,7 +747,7 @@ static GLboolean R128DRIScreenInit(DRIDriverContext *ctx)
}
info->registerSize = ctx->MMIOSize;
ctx->shared.SAREASize = DRM_PAGE_SIZE;
ctx->shared.SAREASize = SAREA_MAX;
/* Note that drmOpen will try to load the kernel module, if needed. */
ctx->drmFD = drmOpen("r128", NULL );
@@ -767,7 +767,7 @@ static int RADEONScreenInit( DRIDriverContext *ctx, RADEONInfoPtr info )
}
info->registerSize = ctx->MMIOSize;
ctx->shared.SAREASize = DRM_PAGE_SIZE;
ctx->shared.SAREASize = SAREA_MAX;
/* Note that drmOpen will try to load the kernel module, if needed. */
ctx->drmFD = drmOpen("radeon", NULL );