On Dec 29, 07 01:25:09 +0100, Matthias Hopf wrote:
Ok, I attach a patch for calculating width and height if none is available (assuming 96dpi always). As I cannot test this for side effects right now, I don't want to commit it yet. Please test. It won't get the exact size, of course, but at least aspect should be good, and most programs should be happy with it.
Ping?
diff --git a/src/rhd_randr.c b/src/rhd_randr.c index c82ec41..bec2932 100644 --- a/src/rhd_randr.c +++ b/src/rhd_randr.c @@ -857,6 +857,25 @@ rhdRROutputGetModes(xf86OutputPtr output) rhdPtr->forceReduced.val.bool;
xf86OutputSetEDID (output, rout->Connector->Monitor->EDID); + + /* If no EDID data is available, calculate mm_size by assuming 96dpi + * for the preferred (or first if no preferred) mode */ + if (! rout->Connector->Monitor->EDID) { + DisplayModePtr m; + for (m = rout->Connector->Monitor->Modes; m; m = m->next) + if (m->type & M_T_PREFERRED) + break; + if (! m) + m = rout->Connector->Monitor->Modes; + if (m) { +#define DEFAULT_MM_PER_DOT (25.4 / 96) + output->mm_width = m->HDisplay * DEFAULT_MM_PER_DOT; + output->mm_height = m->VDisplay * DEFAULT_MM_PER_DOT; + xf86DrvMsg(rhdPtr->scrnIndex, X_WARNING, + "No monitor size info, assuming 96dpi.\n"); + } + } + return rout->Connector->Monitor->Modes; }
Matthias
--
Matthias Hopf