*
*/
+#include <stdio.h>
#include <xf86drm.h>
#include <nouveau_drm.h>
#include "nouveau_driver.h"
GLX_NONE, GLX_SWAP_UNDEFINED_OML
};
- for (i = 0; i < Elements(formats); i++) {
+ for (i = 0; i < ARRAY_SIZE(formats); i++) {
__DRIconfig **config;
config = driCreateConfigs(formats[i],
depth_bits, stencil_bits,
- Elements(depth_bits),
+ ARRAY_SIZE(depth_bits),
back_buffer_modes,
- Elements(back_buffer_modes),
+ ARRAY_SIZE(back_buffer_modes),
msaa_samples,
- Elements(msaa_samples),
+ ARRAY_SIZE(msaa_samples),
GL_TRUE);
assert(config);
if (!screen)
return NULL;
+ dri_screen->driverPrivate = screen;
+
/* Open the DRM device. */
ret = nouveau_device_wrap(dri_screen->fd, 0, &screen->device);
if (ret) {
dri_screen->max_gl_es1_version = 10;
break;
default:
- assert(0);
+ nouveau_error("Unknown chipset: %02X\n",
+ screen->device->chipset);
+ goto fail;
}
- dri_screen->driverPrivate = screen;
dri_screen->extensions = nouveau_screen_extensions;
screen->dri_screen = dri_screen;