diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2011-08-30 12:22:53 +0200 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2011-08-31 14:39:21 +0200 |
commit | 3c2f9cc43f7d36952e78d10d224da0ba68ecefea (patch) | |
tree | c4b31562faf98ca2b2408c7a4d086983b0af3020 | |
parent | f17abaa926fdbedab1e6236e109fa746fcc2320b (diff) |
vmwgfx-xorg: Avoid enabling unwanted outputs in initial configuration
Add a hack so that we avoid enabling all connected outputs during the
initial configuration. On older X servers they would be enabled as cloned,
which didn't really cause any problem, but on later X servers they would
initially be enabled next to eachother which looks odd.
A RandR call will still show the disabled outputs as connected, and if there
is a monitor section in the config file for the output in question,
it will also have a connected status, so that it may be explicitly enabled
or disabled from a config file.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
-rw-r--r-- | vmwgfx/vmwgfx_driver.c | 2 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_driver.h | 2 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_output.c | 20 |
3 files changed, 23 insertions, 1 deletions
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c index 629638e..a682e55 100644 --- a/vmwgfx/vmwgfx_driver.c +++ b/vmwgfx/vmwgfx_driver.c @@ -426,10 +426,12 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags) xorg_crtc_init(pScrn); xorg_output_init(pScrn); + ms->initialization = TRUE; if (!xf86InitialConfiguration(pScrn, TRUE)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes.\n"); return FALSE; } + ms->initialization = FALSE; /* * If the driver can do gamma correction, it should call xf86SetGamma() here. diff --git a/vmwgfx/vmwgfx_driver.h b/vmwgfx/vmwgfx_driver.h index cb92bc9..8b3017d 100644 --- a/vmwgfx/vmwgfx_driver.h +++ b/vmwgfx/vmwgfx_driver.h @@ -112,6 +112,8 @@ typedef struct _modesettingRec #ifdef DRI2 Bool dri2_available; #endif + + Bool initialization; } modesettingRec, *modesettingPtr; #define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate)) diff --git a/vmwgfx/vmwgfx_output.c b/vmwgfx/vmwgfx_output.c index 2081f2a..5ec84a1 100644 --- a/vmwgfx/vmwgfx_output.c +++ b/vmwgfx/vmwgfx_output.c @@ -104,7 +104,25 @@ output_detect(xf86OutputPtr output) switch (drm_connector->connection) { case DRM_MODE_CONNECTED: - status = XF86OutputStatusConnected; + /* + * Hack to avoid enabling outputs during the intial + * configuration that are connected but that we don't + * really want to have enabled just yet. + * + * If we are in initial config, and + * an output higher than LVDS1 is connected, + * and it has no monitor section in the config file, + * status will be reported as unknown, which means + * the xorg modesetting code will think it is + * disconnected. + */ + + if (ms->initialization && + drm_connector->connector_type_id != 1 && + !output->conf_monitor) + status = XF86OutputStatusUnknown; + else + status = XF86OutputStatusConnected; break; case DRM_MODE_DISCONNECTED: status = XF86OutputStatusDisconnected; |