[PATCH v2 xserver 01/11] modesetting: add MS_ALL_IN_ONE handling

Qiang Yu Qiang.Yu at amd.com
Sat Jan 7 08:01:22 UTC 2017


MS_ALL_IN_ONE merge all devives passed to modesetting driver
to use the same screen.

Signed-off-by: Qiang Yu <Qiang.Yu at amd.com>
---
 hw/xfree86/drivers/modesetting/driver.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index a27b327..ebaeba9 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -413,15 +413,28 @@ ms_platform_probe(DriverPtr driver,
         scr_flags = XF86_ALLOCATE_GPU_SCREEN;
 
     if (probe_hw(path, dev)) {
-        scrn = xf86AllocateScreen(driver, scr_flags);
+        static ScrnInfoPtr scrn_all = NULL;
+
+        if (getenv("MS_ALL_IN_ONE")) {
+            if (!scrn_all) {
+                scrn_all = xf86AllocateScreen(driver, 0);
+                ms_setup_scrn_hooks(scrn_all);
+            }
+            scrn = scrn_all;
+        }
+        else {
+            scrn = xf86AllocateScreen(driver, scr_flags);
+            ms_setup_scrn_hooks(scrn);
+        }
+
         if (xf86IsEntitySharable(entity_num))
             xf86SetEntityShared(entity_num);
         xf86AddEntityToScreen(scrn, entity_num);
 
-        ms_setup_scrn_hooks(scrn);
-
         xf86DrvMsg(scrn->scrnIndex, X_INFO,
-                   "using drv %s\n", path ? path : "default device");
+                   "using drv %s, all in one: %s\n",
+                   path ? path : "default device",
+                   scrn_all ? "enabled" : "disabled");
 
         ms_setup_entity(scrn, entity_num);
     }
@@ -887,7 +900,7 @@ PreInit(ScrnInfoPtr pScrn, int flags)
     int bppflags, connector_count;
     int defaultdepth, defaultbpp;
 
-    if (pScrn->numEntities != 1)
+    if (pScrn->numEntities <= 0)
         return FALSE;
 
     pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
-- 
2.7.4



More information about the xorg-devel mailing list