2009-08-04 21:52:16 +02:00
|
|
|
Index: hw/xfree86/common/xf86Helper.c
|
2010-03-20 03:42:15 +01:00
|
|
|
================================================================================
|
|
|
|
--- hw/xfree86/common/xf86Helper.c
|
2009-08-04 21:52:16 +02:00
|
|
|
+++ hw/xfree86/common/xf86Helper.c
|
2010-03-20 03:42:15 +01:00
|
|
|
@@ -974,12 +974,22 @@
|
2008-05-26 23:18:34 +02:00
|
|
|
} else if (pScrn->widthmm > 0 || pScrn->heightmm > 0) {
|
|
|
|
from = X_CONFIG;
|
|
|
|
if (pScrn->widthmm > 0) {
|
|
|
|
- pScrn->xDpi =
|
|
|
|
- (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
|
|
|
|
+ if (pScrn->modes && pScrn->modes->HDisplay > 0) {
|
|
|
|
+ pScrn->xDpi =
|
|
|
|
+ (int)((double) pScrn->modes->HDisplay * MMPERINCH / pScrn->widthmm);
|
|
|
|
+ } else {
|
|
|
|
+ pScrn->xDpi =
|
|
|
|
+ (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
if (pScrn->heightmm > 0) {
|
|
|
|
- pScrn->yDpi =
|
|
|
|
- (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
|
|
|
|
+ if (pScrn->modes && pScrn->modes->VDisplay > 0) {
|
|
|
|
+ pScrn->yDpi =
|
|
|
|
+ (int)((double)pScrn->modes->VDisplay * MMPERINCH / pScrn->heightmm);
|
|
|
|
+ } else {
|
|
|
|
+ pScrn->yDpi =
|
|
|
|
+ (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
if (pScrn->xDpi > 0 && pScrn->yDpi <= 0)
|
|
|
|
pScrn->yDpi = pScrn->xDpi;
|
2010-03-20 03:42:15 +01:00
|
|
|
@@ -1014,12 +1024,22 @@
|
2008-05-26 23:18:34 +02:00
|
|
|
pScrn->widthmm = ddcWidthmm;
|
|
|
|
pScrn->heightmm = ddcHeightmm;
|
|
|
|
if (pScrn->widthmm > 0) {
|
|
|
|
- pScrn->xDpi =
|
|
|
|
- (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
|
|
|
|
+ if (pScrn->modes && pScrn->modes->HDisplay > 0) {
|
|
|
|
+ pScrn->xDpi =
|
|
|
|
+ (int)((double) pScrn->modes->HDisplay * MMPERINCH / pScrn->widthmm);
|
|
|
|
+ } else {
|
|
|
|
+ pScrn->xDpi =
|
|
|
|
+ (int)((double)pScrn->virtualX * MMPERINCH / pScrn->widthmm);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
if (pScrn->heightmm > 0) {
|
|
|
|
- pScrn->yDpi =
|
|
|
|
- (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
|
|
|
|
+ if (pScrn->modes && pScrn->modes->VDisplay > 0) {
|
|
|
|
+ pScrn->yDpi =
|
|
|
|
+ (int)((double)pScrn->modes->VDisplay * MMPERINCH / pScrn->heightmm);
|
|
|
|
+ } else {
|
|
|
|
+ pScrn->yDpi =
|
|
|
|
+ (int)((double)pScrn->virtualY * MMPERINCH / pScrn->heightmm);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
if (pScrn->xDpi > 0 && pScrn->yDpi <= 0)
|
|
|
|
pScrn->yDpi = pScrn->xDpi;
|