Skip to contentSkip to conversation

drm/kms: remove spaces from connector names

PATCH In review Alex Deucher 7 participants 14 messages Dec 8, 2010 – Dec 13, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/kms: remove spaces from connector names

Grub doesn't parse spaces in parameters correctly, so this makes it impossible to force video= parameters for kms on the grub kernel command line.

---
 drivers/gpu/drm/drm_crtc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_crtc.c +4 -4
index 6985cb1..7ee7a2f 100644
@@ -156,12 +156,12 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] =
 	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO", 0 },
 	{ DRM_MODE_CONNECTOR_LVDS, "LVDS", 0 },
 	{ DRM_MODE_CONNECTOR_Component, "Component", 0 },
-	{ DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN", 0 },
+	{ DRM_MODE_CONNECTOR_9PinDIN, "9-pin_DIN", 0 },
 	{ DRM_MODE_CONNECTOR_DisplayPort, "DisplayPort", 0 },
-	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI Type A", 0 },
-	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI Type B", 0 },
+	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI_Type_A", 0 },
+	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI_Type_B", 0 },
 	{ DRM_MODE_CONNECTOR_TV, "TV", 0 },
-	{ DRM_MODE_CONNECTOR_eDP, "Embedded DisplayPort", 0 },
+	{ DRM_MODE_CONNECTOR_eDP, "Embedded_DisplayPort", 0 },
 };
 
 static struct drm_prop_enum_list drm_encoder_enum_list[] =
Signature · 1 line
1.7.1.1
#1 lore raw
Quoted 18 lines · Alex Deucher

Grub doesn't parse spaces in parameters correctly, so this makes it impossible to force video= parameters for kms on the grub kernel command line.

---
 drivers/gpu/drm/drm_crtc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_crtc.c +0 -0
index 6985cb1..7ee7a2f 100644

drivers/gpu/drm/drm_crtc.c static struct drm_conn_prop_enum_list drm_connector_enum_list[] = · line 159

Quoted 4 lines
drivers/gpu/drm/drm_crtc.c +0 -1
@@ -156,12 +156,12 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] =
 	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO", 0 },
 	{ DRM_MODE_CONNECTOR_LVDS, "LVDS", 0 },
 	{ DRM_MODE_CONNECTOR_Component, "Component", 0 },
-	{ DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN", 0 },

What kernel version did these options first show up in? Does any other tools rely on the spaces?

thanks,

greg k-h

maintainer
#2 lore raw
Quoted 14 lines · Greg KH
Quoted 13 lines · Alex Deucher

Grub doesn't parse spaces in parameters correctly, so this makes it impossible to force video= parameters for kms on the grub kernel command line.

---
 drivers/gpu/drm/drm_crtc.c |    8 ++++----

 1 files changed, 4 insertions(+), 4 deletions(-)
Quoted 12 lines

drivers/gpu/drm/drm_crtc.c static struct drm_conn_prop_enum_list drm_connector_enum_list[] = · line 159

Quoted 9 lines
drivers/gpu/drm/drm_crtc.c +0 -1
index 6985cb1..7ee7a2f 100644
@@ -156,12 +156,12 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] =
       { DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO", 0 },
       { DRM_MODE_CONNECTOR_LVDS, "LVDS", 0 },
       { DRM_MODE_CONNECTOR_Component, "Component", 0 },
-     { DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN", 0 },

What kernel version did these options first show up in?  Does any other tools rely on the spaces?

No, X doesn't use the names and I can't think of anything shipped that uses the interfaces that would care.

Dave.

#3 lore raw
In reply to Greg KH
Quoted 14 lines · On Wed, 8 Dec 2010 15:30:26 -0800 Greg KH <[email protected]> wrote:
Quoted 13 lines · Alex Deucher

Grub doesn't parse spaces in parameters correctly, so this makes it impossible to force video= parameters for kms on the grub kernel command line.

---
 drivers/gpu/drm/drm_crtc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
Quoted 12 lines

drivers/gpu/drm/drm_crtc.c static struct drm_conn_prop_enum_list drm_connector_enum_list[] = · line 159

Quoted 9 lines
drivers/gpu/drm/drm_crtc.c +0 -1
index 6985cb1..7ee7a2f 100644
@@ -156,12 +156,12 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] =
 	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO", 0 },
 	{ DRM_MODE_CONNECTOR_LVDS, "LVDS", 0 },
 	{ DRM_MODE_CONNECTOR_Component, "Component", 0 },
-	{ DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN", 0 },

What kernel version did these options first show up in? Does any other tools rely on the spaces?

And it's ugly; can't we fix grub instead?

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#4 lore raw

At Thu, 9 Dec 2010 09:18:14 -0800,

Quoted 7 lines · Jesse Barnes
Quoted 2 lines · On Wed, 8 Dec 2010 15:30:26 -0800 Greg KH <[email protected]> wrote:

What kernel version did these options first show up in? Does any other tools rely on the spaces?

And it's ugly; can't we fix grub instead?

I think renaming connectors is good idea anyway. It should be typed before system boot, so names should be short and easy kept in mind.

Such as TV, DIN, VGA, DVI, etc...

#5 lore raw
Quoted 8 lines · On Thu, 09 Dec 2010 20:33:18 +0300 Sergej Pupykin <[email protected]> wrote:

At Thu, 9 Dec 2010 09:18:14 -0800,

Quoted 6 lines · Jesse Barnes
Quoted 2 lines · On Wed, 8 Dec 2010 15:30:26 -0800 Greg KH <[email protected]> wrote:

What kernel version did these options first show up in? Does any other tools rely on the spaces?

Quoted 6 lines
Quoted 1 line

And it's ugly; can't we fix grub instead?

I think renaming connectors is good idea anyway. It should be typed before system boot, so names should be short and easy kept in mind.

Such as TV, DIN, VGA, DVI, etc...

I prefer to keep the user visible names as they are, they're descriptive and easy to read with spaces.

An alternative to fixing grub would be to add aliases like you mention, and/or change the parser to accept "_" as an alias for " ". Then we could leave the sysfs values and string table alone.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#6 lore raw
Quoted 3 lines · Jesse Barnes

An alternative to fixing grub would be to add aliases like you mention, and/or change the parser to accept "_" as an alias for " ". Then we could leave the sysfs values and string table alone.

Is it already case insensitive?

//Peter

#7 lore raw
In reply to Jesse Barnes

At Thu, 9 Dec 2010 09:18:14 -0800,

Quoted 2 lines · Jesse Barnes

And it's ugly; can't we fix grub instead?

I am searching for bootloader which can pass whitespaces. It looks like we should patch grub-legacy (0.97), grub (1.98) and lilo...

(I did not try lilo yet, but man page says nothing about passing spaces in 'append=' option description)

#8 lore raw
Quoted 7 lines · Sergej Pupykin
Quoted 1 line

And it's ugly; can't we fix grub instead?

I am searching for bootloader which can pass whitespaces. It looks like we should patch grub-legacy (0.97), grub (1.98) and lilo...

(I did not try lilo yet, but man page says nothing about passing spaces in 'append=' option description)

append can contain any arbitrary string, which will be parsed by the kernel. I e.g. use:

append="root=/dev/sda2 snd_ac97_codec.power_save=1 usbcore.autosuspend=1 hpet=force quiet drm_kms_helper.poll=0"

And grub also supports an append string with spaces, that is probably used by every distribution.

The question is, what will the kernel parser do about that space?

//Peter

#9 lore raw

At Fri, 10 Dec 2010 19:05:13 +0100,

Quoted 9 lines · Peter Stuge

append can contain any arbitrary string, which will be parsed by the kernel. I e.g. use:

append="root=/dev/sda2 snd_ac97_codec.power_save=1 usbcore.autosuspend=1 hpet=force quiet drm_kms_helper.poll=0"

And grub also supports an append string with spaces, that is probably used by every distribution.

The question is, what will the kernel parser do about that space?

It seems lilo also have no support for such parameters.

append="video=9-pin DIN:1024x768-24@60e"

does not work (kernel panic: DIN: bad variable name)

As I understand, I should pass somehow to kernel string like:

video="9-pin DIN:1024x768-24@60e", but lilo uses doublequotes as r-value bounds.

in_quote variable in next_arg() is set only for " character.

#10 lore raw

At Mon, 13 Dec 2010 13:43:48 +0300,

Quoted 4 lines · Sergej Pupykin

video="9-pin DIN:1024x768-24@60e", but lilo uses doublequotes as r-value bounds.

in_quote variable in next_arg() is set only for " character.

Sorry, biggest part of this problem is in my linux distribution (in /init executable from initcpio image)

#11 lore raw
In reply to Alex Deucher
Quoted 3 lines · Alex Deucher

Grub doesn't parse spaces in parameters correctly, so this makes it impossible to force video= parameters for kms on the grub kernel command line.

I'm sorta tempted to just go the extra step towards DIN, HDMIA, HDMIB, DP and eDP, typing long names on the command line isn't fun.

Dave.

Quoted 31 lines
---
 drivers/gpu/drm/drm_crtc.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_crtc.c +4 -4
index 6985cb1..7ee7a2f 100644
@@ -156,12 +156,12 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] =
 	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO", 0 },
 	{ DRM_MODE_CONNECTOR_LVDS, "LVDS", 0 },
 	{ DRM_MODE_CONNECTOR_Component, "Component", 0 },
-	{ DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN", 0 },
+	{ DRM_MODE_CONNECTOR_9PinDIN, "9-pin_DIN", 0 },
 	{ DRM_MODE_CONNECTOR_DisplayPort, "DisplayPort", 0 },
-	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI Type A", 0 },
-	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI Type B", 0 },
+	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI_Type_A", 0 },
+	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI_Type_B", 0 },
 	{ DRM_MODE_CONNECTOR_TV, "TV", 0 },
-	{ DRM_MODE_CONNECTOR_eDP, "Embedded DisplayPort", 0 },
+	{ DRM_MODE_CONNECTOR_eDP, "Embedded_DisplayPort", 0 },
 };
 
 static struct drm_prop_enum_list drm_encoder_enum_list[] =
#12 lore raw
Quoted 8 lines · Dave Airlie
Quoted 3 lines · Alex Deucher

Grub doesn't parse spaces in parameters correctly, so this makes it impossible to force video= parameters for kms on the grub kernel command line.

I'm sorta tempted to just go the extra step towards DIN, HDMIA, HDMIB, DP and eDP, typing long names on the command line isn't fun.

Works for me.

Alex

Quoted 36 lines

Dave.

Quoted 31 lines

---
 drivers/gpu/drm/drm_crtc.c |    8 ++++----

 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_crtc.c +4 -4
index 6985cb1..7ee7a2f 100644
@@ -156,12 +156,12 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] =
       { DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO", 0 },
       { DRM_MODE_CONNECTOR_LVDS, "LVDS", 0 },
       { DRM_MODE_CONNECTOR_Component, "Component", 0 },
-     { DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN", 0 },
+     { DRM_MODE_CONNECTOR_9PinDIN, "9-pin_DIN", 0 },
       { DRM_MODE_CONNECTOR_DisplayPort, "DisplayPort", 0 },
-     { DRM_MODE_CONNECTOR_HDMIA, "HDMI Type A", 0 },
-     { DRM_MODE_CONNECTOR_HDMIB, "HDMI Type B", 0 },
+     { DRM_MODE_CONNECTOR_HDMIA, "HDMI_Type_A", 0 },
+     { DRM_MODE_CONNECTOR_HDMIB, "HDMI_Type_B", 0 },
       { DRM_MODE_CONNECTOR_TV, "TV", 0 },
-     { DRM_MODE_CONNECTOR_eDP, "Embedded DisplayPort", 0 },
+     { DRM_MODE_CONNECTOR_eDP, "Embedded_DisplayPort", 0 },
  };
 

 static struct drm_prop_enum_list drm_encoder_enum_list[] =

#13 lore raw

PATCH 1/1 drm/kms: remove spaces from connector names (v2)

In reply to Dave Airlie

Grub doesn't parse spaces in parameters correctly, so this makes it impossible to force video= parameters for kms on the grub kernel command line.

v2: shorten the names to make them easier to type.

---
 drivers/gpu/drm/drm_crtc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/drm_crtc.c +5 -5
index 6985cb1..2baa670 100644
@@ -156,12 +156,12 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] =
 	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO", 0 },
 	{ DRM_MODE_CONNECTOR_LVDS, "LVDS", 0 },
 	{ DRM_MODE_CONNECTOR_Component, "Component", 0 },
-	{ DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN", 0 },
-	{ DRM_MODE_CONNECTOR_DisplayPort, "DisplayPort", 0 },
-	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI Type A", 0 },
-	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI Type B", 0 },
+	{ DRM_MODE_CONNECTOR_9PinDIN, "DIN", 0 },
+	{ DRM_MODE_CONNECTOR_DisplayPort, "DP", 0 },
+	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI-A", 0 },
+	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI-B", 0 },
 	{ DRM_MODE_CONNECTOR_TV, "TV", 0 },
-	{ DRM_MODE_CONNECTOR_eDP, "Embedded DisplayPort", 0 },
+	{ DRM_MODE_CONNECTOR_eDP, "eDP", 0 },
 };
 
 static struct drm_prop_enum_list drm_encoder_enum_list[] =
Signature · 1 line
1.7.1.1