mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-07 20:18:03 +02:00
Use EDID data to set screen physical size at server startup.
Screen physical size is set to a random value before the RandR code gets control, override that and reset it to a value based on the compat_output physical size (if available). If that output has no physical size, just use 96dpi as the default resolution and set the physical size as appropriate.
This commit is contained in:
parent
bcade98cca
commit
843077f23a
1 changed files with 22 additions and 2 deletions
|
|
@ -422,8 +422,28 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen)
|
|||
}
|
||||
else
|
||||
{
|
||||
mmWidth = pScreen->mmWidth;
|
||||
mmHeight = pScreen->mmHeight;
|
||||
xf86OutputPtr output = config->output[config->compat_output];
|
||||
xf86CrtcPtr crtc = output->crtc;
|
||||
|
||||
if (crtc && crtc->mode.HDisplay &&
|
||||
output->mm_width && output->mm_height)
|
||||
{
|
||||
/*
|
||||
* If the output has a mode and a declared size, use that
|
||||
* to scale the screen size
|
||||
*/
|
||||
DisplayModePtr mode = &crtc->mode;
|
||||
mmWidth = output->mm_width * width / mode->HDisplay;
|
||||
mmHeight = output->mm_height * height / mode->VDisplay;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Otherwise, just set the screen to 96dpi
|
||||
*/
|
||||
mmWidth = width * 25.4 / 96;
|
||||
mmHeight = height * 25.4 / 96;
|
||||
}
|
||||
}
|
||||
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
|
||||
"Setting screen physical size to %d x %d\n",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue