xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Dec 17 19:14:49 UTC 2023


 hw/vfb/InitOutput.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 43a7bb3c92c54bb8f9d37426d75166e775dde316
Author: Twaik Yont <twaikyont at gmail.com>
Date:   Fri Mar 10 16:10:46 2023 +0200

    xvfb: Use RROutputSetPhysicalSize to set physical size of display
    
    Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1532
    Signed-off-by: Twaik Yont <twaikyont at gmail.com>

diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index 48efb61b2..29223ceef 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -753,6 +753,8 @@ vfbRRScreenSetSize(ScreenPtr  pScreen,
                    CARD32     mmWidth,
                    CARD32     mmHeight)
 {
+    rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
+
     // Prevent screen updates while we change things around
     SetRootClip(pScreen, ROOT_CLIP_NONE);
 
@@ -767,7 +769,7 @@ vfbRRScreenSetSize(ScreenPtr  pScreen,
     RRScreenSizeNotify (pScreen);
     RRTellChanged(pScreen);
 
-    return TRUE;
+    return RROutputSetPhysicalSize(pScrPriv->outputs[pScreen->myNum], mmWidth, mmHeight);
 }
 
 static Bool
@@ -803,6 +805,7 @@ vfbRandRInit(ScreenPtr pScreen)
     xRRModeInfo modeInfo;
     char       name[64];
 #endif
+    int mmWidth, mmHeight;
 
     if (!RRScreenInit (pScreen))
        return FALSE;
@@ -818,6 +821,9 @@ vfbRandRInit(ScreenPtr pScreen)
     pScrPriv->rrOutputValidateMode = vfbRROutputValidateMode;
     pScrPriv->rrModeDestroy = NULL;
 
+    mmWidth = pScreen->width * 25.4 / monitorResolution;
+    mmHeight = pScreen->height * 25.4 / monitorResolution;
+
     RRScreenSetSizeRange (pScreen,
                          1, 1,
                          pScreen->width, pScreen->height);
@@ -850,6 +856,8 @@ vfbRandRInit(ScreenPtr pScreen)
        return FALSE;
     if (!RROutputSetConnection (output, RR_Connected))
        return FALSE;
+    if (!RROutputSetPhysicalSize (output, mmWidth, mmHeight))
+       return FALSE;
     RRCrtcNotify (crtc, mode, 0, 0, RR_Rotate_0, NULL, 1, &output);
 #endif
     return TRUE;
@@ -958,6 +966,9 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv)
     int i;
     int NumFormats = 0;
 
+    if (!monitorResolution)
+               monitorResolution = 96;
+
     /* initialize pixmap formats */
 
     /* must have a pixmap depth to match every screen depth */


More information about the xorg-commit mailing list