diff options
Diffstat (limited to 'xorg-server/hw')
-rw-r--r-- | xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c b/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c index 4633d4867..c5b799079 100644 --- a/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c +++ b/xorg-server/hw/xwin/swrastwgl_dri/swrastwgl_dri.c @@ -49,6 +49,7 @@ struct __DRIdrawableRec HBITMAP hBitmap;
int winWidth;
int winHeight;
+ int bitsPerPixel;
VOID *bits;
void *driverPrivate;
@@ -290,6 +291,7 @@ void setupDIB(__DRIdrawable * pdp) bmiSize = sizeof(*bmInfo);
bitsPerPixel = GetDeviceCaps(pdp->hDC, BITSPIXEL);
+ pdp->bitsPerPixel=bitsPerPixel;
switch (bitsPerPixel) {
case 8:
@@ -915,6 +917,15 @@ static __DRIscreen *driCreateNewScreen(int scrn, const __DRIextension **extensio static const __DRIextension *emptyExtensionList[] = { NULL };
__DRIscreen *psp;
+ HDC hDc = GetDC(NULL);
+ int bitsPerPixel= GetDeviceCaps(hDc, BITSPIXEL);
+ ReleaseDC(NULL, hDc);
+ if (bitsPerPixel<24)
+ {
+ PRINTF(__FUNCTION__": bitsPerPixel not supported %d\n", bitsPerPixel);
+ return NULL;
+ }
+
psp = calloc(sizeof(struct __DRIscreenRec),1);
if (!psp)
return NULL;
|