From: Imre Vadasz Date: Wed, 2 Dec 2015 21:55:12 +0000 (+0100) Subject: drm: fb_get_options() can just use the unmodified connector-name. X-Git-Tag: v4.6.0rc~1262 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/17707afb124f9fe484dbaed452ae09e5c0b61267 drm: fb_get_options() can just use the unmodified connector-name. There was apparently never an actual need for using a modified connector name in the video mode tunable. e.g. instead of drm.video.dvid1="1024x768" one can just use drm.video.DVI-D-1="1024x768" which is more similar to the Linux command line option. --- diff --git a/share/man/man4/drm.4 b/share/man/man4/drm.4 index b3245483c2..f98e2165db 100644 --- a/share/man/man4/drm.4 +++ b/share/man/man4/drm.4 @@ -119,8 +119,7 @@ and use different naming conventions for connector names. This tunable only applies for KMS drivers. .It Va drm.video. -Can be used to set framebuffer parameters for drm(4) connector -in lower case form and without dashes. +Can be used to set framebuffer parameters for drm(4) connector. Mode specifier format: .Pp .Dl x[M][R][-][@][i][m][eDd] diff --git a/sys/dev/drm/drm_dragonfly.c b/sys/dev/drm/drm_dragonfly.c index ea87ce9b9f..6f5919abd8 100644 --- a/sys/dev/drm/drm_dragonfly.c +++ b/sys/dev/drm/drm_dragonfly.c @@ -36,36 +36,24 @@ int fb_get_options(const char *connector_name, char **option) { char buf[128], str[1024]; - int i; /* - * This hack allows us to use drm.video.lvds1="" - * in loader.conf, where linux would use video=LVDS-1:. - * e.g. drm.video.lvds1=1024x768 sets the LVDS-1 connector to + * Where on linux one would use the command line option + * video=LVDS-1:, the corresponding tunable is + * drm.video.LVDS-1=. + * e.g. drm.video.LVDS-1=1024x768 sets the LVDS-1 connector to * a 1024x768 video mode in the syscons framebuffer console. * See https://wiki.archlinux.org/index.php/Kernel_mode_setting * for an explanation of the video mode command line option. - * (This corresponds to the video= Linux kernel command-line - * option) */ memset(str, 0, sizeof(str)); ksnprintf(buf, sizeof(buf), "drm.video.%s", connector_name); - i = 0; - while (i < strlen(buf)) { - buf[i] = tolower(buf[i]); - if (buf[i] == '-') { - memmove(&buf[i], &buf[i+1], strlen(buf)-i); - } else { - i++; - } - } - kprintf("looking up kenv for \"%s\"\n", buf); if (kgetenv_string(buf, str, sizeof(str)-1)) { kprintf("found kenv %s=%s\n", buf, str); *option = kstrdup(str, M_DRM); return (0); } else { - kprintf("didn't find value for kenv %s\n", buf); + kprintf("tunable %s is not set\n", buf); return (1); } }