| @@ -286,19 +286,12 @@ demoMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface rea | |||
| } | |||
| /* | |||
| * Just to silence warning | |||
| */ | |||
| extern _EGLDriver * | |||
| _eglMain(NativeDisplayType dpy); | |||
| /** | |||
| * The bootstrap function. Return a new DemoDriver object and | |||
| * plug in API functions. | |||
| */ | |||
| _EGLDriver * | |||
| _eglMain(NativeDisplayType dpy) | |||
| _eglMain(_EGLDisplay *dpy) | |||
| { | |||
| DemoDriver *demo; | |||
| @@ -45,7 +45,7 @@ _eglChooseDriver(EGLDisplay display) | |||
| else if (name[0] == ':' && (name[1] >= '0' && name[1] <= '9') && !name[2]) { | |||
| printf("EGL: Use driver for screen: %s\n", name); | |||
| /* XXX probe hardware here to determine which driver to open */ | |||
| /* driverName = "something"; */ | |||
| driverName = "libEGLdri"; | |||
| } | |||
| else if (name[0] == '!') { | |||
| /* use specified driver name */ | |||
| @@ -71,44 +71,40 @@ _eglChooseDriver(EGLDisplay display) | |||
| _EGLDriver * | |||
| _eglOpenDriver(_EGLDisplay *dpy, const char *driverName) | |||
| { | |||
| _EGLDriver *drv; | |||
| _EGLMain_t mainFunc; | |||
| void *lib; | |||
| char driverFilename[1000]; | |||
| /* XXX also prepend a directory path??? */ | |||
| sprintf(driverFilename, "%s.so", driverName); | |||
| #if 1 | |||
| lib = dlopen(driverFilename, RTLD_NOW); | |||
| if (lib) { | |||
| _EGLDriver *drv; | |||
| _EGLMain_t mainFunc; | |||
| mainFunc = (_EGLMain_t) dlsym(lib, "_eglMain"); | |||
| if (!mainFunc) { | |||
| fprintf(stderr, "_eglMain not found in %s", (char *) driverFilename); | |||
| dlclose(lib); | |||
| return NULL; | |||
| } | |||
| drv = mainFunc(dpy); | |||
| if (!drv) { | |||
| dlclose(lib); | |||
| return NULL; | |||
| } | |||
| if (!lib) { | |||
| fprintf(stderr, "EGLdebug: Error opening %s: %s\n", driverFilename, dlerror()); | |||
| return NULL; | |||
| } | |||
| drv->LibHandle = lib; | |||
| drv->Display = dpy; | |||
| return drv; | |||
| mainFunc = (_EGLMain_t) dlsym(lib, "_eglMain"); | |||
| if (!mainFunc) { | |||
| fprintf(stderr, "_eglMain not found in %s", (char *) driverFilename); | |||
| dlclose(lib); | |||
| return NULL; | |||
| } | |||
| else { | |||
| fprintf(stderr, "EGLdebug: Error opening %s: %s\n", | |||
| driverFilename, dlerror()); | |||
| drv = mainFunc(dpy); | |||
| if (!drv) { | |||
| dlclose(lib); | |||
| return NULL; | |||
| } | |||
| #else | |||
| /* use built-in driver */ | |||
| return _eglDefaultMain(d); | |||
| #endif | |||
| /* with a recurvise open you want the inner most handle */ | |||
| if (!drv->LibHandle) | |||
| drv->LibHandle = lib; | |||
| else | |||
| dlclose(lib); | |||
| drv->Display = dpy; | |||
| return drv; | |||
| } | |||
| @@ -125,10 +125,7 @@ struct _egl_driver | |||
| }; | |||
| extern _EGLDriver * | |||
| _eglDefaultMain(NativeDisplayType d); | |||
| extern _EGLDriver *_eglMain(_EGLDisplay *dpy); | |||
| extern _EGLDriver * | |||
| @@ -53,7 +53,8 @@ SHARED_INCLUDES = \ | |||
| -I$(TOP)/src/mesa/shader \ | |||
| -I$(TOP)/src/mesa/swrast \ | |||
| -I$(TOP)/src/mesa/swrast_setup \ | |||
| -I$(TOP)/src/egl/main | |||
| -I$(TOP)/src/egl/main \ | |||
| -I$(TOP)/src/egl/drivers/dri | |||
| ##### RULES ##### | |||
| @@ -842,19 +842,12 @@ fbSwapBuffers(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw) | |||
| } | |||
| /* | |||
| * Just to silence warning | |||
| */ | |||
| extern _EGLDriver * | |||
| _eglMain(NativeDisplayType dpy); | |||
| /** | |||
| * The bootstrap function. Return a new fbDriver object and | |||
| * plug in API functions. | |||
| */ | |||
| _EGLDriver * | |||
| _eglMain(NativeDisplayType dpy) | |||
| _eglMain(_EGLDisplay *dpy) | |||
| { | |||
| fbDriver *fb; | |||
| @@ -38,6 +38,21 @@ | |||
| #include "xf86drm.h" /* drm_handle_t, etc */ | |||
| # define RADEON_AGP_1X_MODE 0x01 | |||
| # define RADEON_AGP_2X_MODE 0x02 | |||
| # define RADEON_AGP_4X_MODE 0x04 | |||
| # define RADEON_AGP_FW_MODE 0x10 | |||
| # define RADEON_AGP_MODE_MASK 0x17 | |||
| #define RADEON_CP_CSQ_CNTL 0x0740 | |||
| # define RADEON_CSQ_CNT_PRIMARY_MASK (0xff << 0) | |||
| # define RADEON_CSQ_PRIDIS_INDDIS (0 << 28) | |||
| # define RADEON_CSQ_PRIPIO_INDDIS (1 << 28) | |||
| # define RADEON_CSQ_PRIBM_INDDIS (2 << 28) | |||
| # define RADEON_CSQ_PRIPIO_INDBM (3 << 28) | |||
| # define RADEON_CSQ_PRIBM_INDBM (4 << 28) | |||
| # define RADEON_CSQ_PRIPIO_INDPIO (15 << 28) | |||
| #define PCI_CHIP_R200_BB 0x4242 | |||
| #define PCI_CHIP_RV250_Id 0x4964 | |||
| #define PCI_CHIP_RV250_Ie 0x4965 | |||
| @@ -455,7 +455,7 @@ static int RADEONDRIPciInit(const DRIDriverContext *ctx, RADEONInfoPtr info) | |||
| return 0; | |||
| } | |||
| fprintf(stderr, | |||
| "[pci] %d kB allocated with handle 0x%08x\n", | |||
| "[pci] %d kB allocated with handle 0x%08lx\n", | |||
| info->gartSize*1024, info->gartMemHandle); | |||
| info->gartOffset = 0; | |||