return GL_FALSE;
/* Create the hardware context */
- nouveauFifoInit(nmesa);
+ if (!nouveauFifoInit(nmesa))
+ return GL_FALSE;
nouveauObjectInit(nmesa);
/* Init default driver functions then plug in our nouveau-specific functions
}
// here we call the fifo initialization ioctl and fill in stuff accordingly
-void nouveauFifoInit(nouveauContextPtr nmesa)
+GLboolean nouveauFifoInit(nouveauContextPtr nmesa)
{
drm_nouveau_fifo_alloc_t fifo_init;
int ret;
ret=drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_FIFO_ALLOC, &fifo_init, sizeof(fifo_init));
- if (ret)
+ if (ret) {
FATAL("Fifo initialization ioctl failed (returned %d)\n",ret);
+ return GL_FALSE;
+ }
- if (drmMap(nmesa->driFd, fifo_init.cmdbuf, fifo_init.cmdbuf_size, &nmesa->fifo.buffer))
+ if (drmMap(nmesa->driFd, fifo_init.cmdbuf, fifo_init.cmdbuf_size, &nmesa->fifo.buffer)) {
FATAL("Unable to map the fifo\n",ret);
- if (drmMap(nmesa->driFd, fifo_init.ctrl, fifo_init.ctrl_size, &nmesa->fifo.mmio))
+ return GL_FALSE;
+ }
+ if (drmMap(nmesa->driFd, fifo_init.ctrl, fifo_init.ctrl_size, &nmesa->fifo.mmio)) {
FATAL("Unable to map the control regs\n",ret);
+ return GL_FALSE;
+ }
MESSAGE("Fifo init ok. Using context %d\n", fifo_init.channel);
}
}while(0)
extern void nouveauWaitForIdle(nouveauContextPtr nmesa);
-extern void nouveauFifoInit(nouveauContextPtr nmesa);
+extern GLboolean nouveauFifoInit(nouveauContextPtr nmesa);
#endif /* __NOUVEAU_FIFO_H__ */
fprintf(stderr, "File %s function %s line %d\n", __FILE__, __FUNCTION__, __LINE__); \
fprintf(stderr, a, ## __VA_ARGS__);\
fprintf(stderr, "***************************************************************************\n");\
- exit(0);\
}while(0)
#define FATAL(a, ...) do{\
fprintf(stderr, "File %s function %s line %d\n", __FILE__, __FUNCTION__, __LINE__); \
fprintf(stderr, a, ## __VA_ARGS__);\
fprintf(stderr, "***************************************************************************\n");\
- exit(0);\
}while(0)
#endif /* __NOUVEAU_MSG_H__ */