diff options
-rw-r--r-- | src/i830_modes.c | 18 | ||||
-rw-r--r-- | src/i830_video.c | 26 |
2 files changed, 30 insertions, 14 deletions
diff --git a/src/i830_modes.c b/src/i830_modes.c index f4870b74..bc4536d5 100644 --- a/src/i830_modes.c +++ b/src/i830_modes.c @@ -651,11 +651,27 @@ static MonPtr i830GetLVDSMonitor(ScrnInfoPtr pScrn) { MonPtr mon; + DisplayModePtr mode; mon = xnfcalloc(1, sizeof(*mon)); mon->Modes = i830GetLVDSModes(pScrn, pScrn->display->modes); mon->Last = i830GetModeListTail(mon->Modes); - + /* + * Find the preferred mode, use the display resolution to compute + * the effective monitor size + */ + for (mode = mon->Modes; mode; mode = mode->next) + if (mode->type & M_T_PREFERRED) + break; + if (!mode) + mode = mon->Modes; + if (mode) + { +#define MMPERINCH 25.4 + mon->widthmm = (double) mode->HDisplay / pScrn->xDpi * MMPERINCH; + mon->heightmm = (double) mode->VDisplay / pScrn->yDpi * MMPERINCH; + } + return mon; } diff --git a/src/i830_video.c b/src/i830_video.c index 6a18f932..47f4a03f 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -454,19 +454,6 @@ I830InitVideo(ScreenPtr pScreen) xvBrightness = MAKE_ATOM("XV_BRIGHTNESS"); xvContrast = MAKE_ATOM("XV_CONTRAST"); - /* Set up overlay video if we can do it at this depth. */ - if (!IS_I965G(pI830) && pScrn->bitsPerPixel != 8) { - overlayAdaptor = I830SetupImageVideoOverlay(pScreen); - if (overlayAdaptor != NULL) { - adaptors[num_adaptors++] = overlayAdaptor; - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Set up overlay video\n"); - } else { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Failed to set up overlay video\n"); - } - I830InitOffscreenImages(pScreen); - } - /* Set up textured video if we can do it at this depth and we are on * supported hardware. */ @@ -481,6 +468,19 @@ I830InitVideo(ScreenPtr pScreen) } } + /* Set up overlay video if we can do it at this depth. */ + if (!IS_I965G(pI830) && pScrn->bitsPerPixel != 8) { + overlayAdaptor = I830SetupImageVideoOverlay(pScreen); + if (overlayAdaptor != NULL) { + adaptors[num_adaptors++] = overlayAdaptor; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Set up overlay video\n"); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Failed to set up overlay video\n"); + } + I830InitOffscreenImages(pScreen); + } + if (num_adaptors) xf86XVScreenInit(pScreen, adaptors, num_adaptors); |