[PATCH] modesetting: fix up output naming convention

Dave Airlie airlied at gmail.com
Mon Sep 7 16:54:13 PDT 2015


On 5 September 2015 at 08:56, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> A user on a nouveau-driven card ran into a problem where DVI-D-1 and
> DVI-I-1 were aliasing. The simplest fix is to provide the full connector
> names. While we're at it, rename the output names to match what is in
> the kernel, and start counting the connectors from 1 rather than 0. The
> only deviation is HDMI vs HDMI-A, which kept its original name.
>
> This will break backwards compatibility with existing xorg.conf's that
> reference output names, but the alternative is to create a separate
> counting system, further disconnecting from the kernel names.
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

Reviewed-by: Dave Airlie <airlied at redhat.com>

Keith can you apply please since it fixes some problems.

Dave.

> ---
>  hw/xfree86/drivers/modesetting/drmmode_display.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
> index 4d8892f..736bfc4 100644
> --- a/hw/xfree86/drivers/modesetting/drmmode_display.c
> +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
> @@ -1292,17 +1292,17 @@ static int subpixel_conv_table[7] = {
>  static const char *const output_names[] = {
>      "None",
>      "VGA",
> -    "DVI",
> -    "DVI",
> -    "DVI",
> +    "DVI-I",
> +    "DVI-D",
> +    "DVI-A",
>      "Composite",
> -    "S-video",
> +    "SVIDEO",
>      "LVDS",
> -    "CTV",
> +    "Component",
>      "DIN",
> -    "DisplayPort",
> -    "HDMI",
> +    "DP",
>      "HDMI",
> +    "HDMI-B",
>      "TV",
>      "eDP",
>      "Virtual",
> @@ -1377,13 +1377,13 @@ drmmode_create_name(ScrnInfoPtr pScrn, drmModeConnectorPtr koutput, char *name,
>
>   fallback:
>      if (koutput->connector_type >= MS_ARRAY_SIZE(output_names))
> -        snprintf(name, 32, "Unknown-%d", koutput->connector_type_id - 1);
> +        snprintf(name, 32, "Unknown%d-%d", koutput->connector_type, koutput->connector_type_id);
>  #ifdef MODESETTING_OUTPUT_SLAVE_SUPPORT
>      else if (pScrn->is_gpu)
> -        snprintf(name, 32, "%s-%d-%d", output_names[koutput->connector_type], pScrn->scrnIndex - GPU_SCREEN_OFFSET + 1, koutput->connector_type_id - 1);
> +        snprintf(name, 32, "%s-%d-%d", output_names[koutput->connector_type], pScrn->scrnIndex - GPU_SCREEN_OFFSET + 1, koutput->connector_type_id);
>  #endif
>      else
> -        snprintf(name, 32, "%s-%d", output_names[koutput->connector_type], koutput->connector_type_id - 1);
> +        snprintf(name, 32, "%s-%d", output_names[koutput->connector_type], koutput->connector_type_id);
>  }
>
>  static unsigned int
> --
> 2.4.6
>


More information about the xorg-devel mailing list