[RFC xserver 4/4] modesetting: Treat inactive outputs as disconnected during PreInit

Adam Jackson ajax at nwnk.net
Fri Oct 30 07:34:32 PDT 2015


On Thu, 2015-10-29 at 14:58 +0100, Daniel Martin wrote:

> @@ -868,6 +868,14 @@ drmmode_output_detect(xf86OutputPtr output)
>      switch (drmmode_output->mode_output->connection) {
>      case DRM_MODE_CONNECTED:
>          status = XF86OutputStatusConnected;
> +
> +        /* During PreInit (!configured), we shouldn't try to setup an output
> +         * where the kernel didn't assigned an encoder yet. Because, if we
> +         * fail to set it up at this point to server will exit. Treat it as
> +         * disconnected for the moment. */
> +        if (!output->scrn->configured &&
> +            !drmmode_output->mode_output->encoder_id)
> +            status = XF86OutputStatusDisconnected;
>          break;
>      case DRM_MODE_DISCONNECTED:
>          status = XF86OutputStatusDisconnected;

I think to be screechingly correct this check should go above the
switch. Even for "connected" outputs in the HPD sense you'd still want
to ignore things without an encoder, and I think doing that check
before the switch means we'd inherit exactly the set of lit outputs
from before X startup, which would be nice.  Does your lid-closed
scenario still work correctly if you do that?

- ajax


More information about the xorg-devel mailing list