[1/2] Make output name numbering 0-based

Submitted by Jonathon Jongsma on Nov. 12, 2018, 8:06 p.m.

Details

Message ID 20181112200614.25366-2-jjongsma@redhat.com
State New
Series "Minor QXL patches"
Headers show

Commit Message

Jonathon Jongsma Nov. 12, 2018, 8:06 p.m.
The QXL driver names its outputs starting at 0 (e.g. Virtual-0,
Virtual-1, etc). This code was presumably copy/pasted from a different
driver, and is not necessary for the QXL driver. Other drivers simply
use the kernel connector_type_id which starts at 1. For example, the
modesetting driver changed from 1-based names to 1-based names for the
same reason in xserver commit 139e36dd.

This will help to make it easier to identify which xrandr outputs belong
to which drm connector without requiring as many driver-specific
special-cases.

This change might effect custom xorg configurations that references a
specific output name. But the same change was made in modesetting driver
despite that possibility.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
---
 src/qxl_drmmode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/qxl_drmmode.c b/src/qxl_drmmode.c
index a2f84b1..a814859 100644
--- a/src/qxl_drmmode.c
+++ b/src/qxl_drmmode.c
@@ -765,8 +765,7 @@  drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
 		}
 	}
 
-	/* need to do smart conversion here for compat with non-kms ATI driver */
-	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);
 	
 
 	output = xf86OutputCreate (pScrn, &drmmode_output_funcs, name);

Comments

Frediano Ziglio Nov. 12, 2018, 10:06 p.m.
Title should be "Make output name numbering 1-based"
> 
> The QXL driver names its outputs starting at 0 (e.g. Virtual-0,
> Virtual-1, etc). This code was presumably copy/pasted from a different
> driver, and is not necessary for the QXL driver. Other drivers simply
> use the kernel connector_type_id which starts at 1. For example, the
> modesetting driver changed from 1-based names to 1-based names for the

maybe " ... from 0-based names to 1-based names ....", from 1 to 1 does
not change much.

> same reason in xserver commit 139e36dd.
> 
> This will help to make it easier to identify which xrandr outputs belong
> to which drm connector without requiring as many driver-specific
> special-cases.
> 
> This change might effect custom xorg configurations that references a
> specific output name. But the same change was made in modesetting driver
> despite that possibility.
> 
> Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
> Acked-by: Frediano Ziglio <fziglio@redhat.com>

yes, acked.

> ---
>  src/qxl_drmmode.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/qxl_drmmode.c b/src/qxl_drmmode.c
> index a2f84b1..a814859 100644
> --- a/src/qxl_drmmode.c
> +++ b/src/qxl_drmmode.c
> @@ -765,8 +765,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr
> drmmode, int num)
>  		}
>  	}
>  
> -	/* need to do smart conversion here for compat with non-kms ATI driver */
> -	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);
>  	
>  
>  	output = xf86OutputCreate (pScrn, &drmmode_output_funcs, name);

Frediano