drm: modes: Revert cc344980c7
"replace simple_strtoul by kstrtouint"
My latest commit introduce some case where a valid mode, could be
rejected.
simple_strtox functions stop at first non-digit character, but kstrtox
not.
So args like "video=HDMI-A-1:720x480-16@60" will be reject when checking
16@.
Discussions about this change comes to the conclusion that the best
solution is to revert my commit cc344980c7
.
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449838739-29969-1-git-send-email-clabbe.montjoie@gmail.com
This commit is contained in:
committed by
Daniel Vetter
parent
5dec293b24
commit
d6e6e14fa6
@ -1262,7 +1262,7 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
|
|||||||
unsigned int xres = 0, yres = 0, bpp = 32, refresh = 0;
|
unsigned int xres = 0, yres = 0, bpp = 32, refresh = 0;
|
||||||
bool yres_specified = false, cvt = false, rb = false;
|
bool yres_specified = false, cvt = false, rb = false;
|
||||||
bool interlace = false, margins = false, was_digit = false;
|
bool interlace = false, margins = false, was_digit = false;
|
||||||
int i, err;
|
int i;
|
||||||
enum drm_connector_force force = DRM_FORCE_UNSPECIFIED;
|
enum drm_connector_force force = DRM_FORCE_UNSPECIFIED;
|
||||||
|
|
||||||
#ifdef CONFIG_FB
|
#ifdef CONFIG_FB
|
||||||
@ -1282,9 +1282,7 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
|
|||||||
case '@':
|
case '@':
|
||||||
if (!refresh_specified && !bpp_specified &&
|
if (!refresh_specified && !bpp_specified &&
|
||||||
!yres_specified && !cvt && !rb && was_digit) {
|
!yres_specified && !cvt && !rb && was_digit) {
|
||||||
err = kstrtouint(&name[i + 1], 10, &refresh);
|
refresh = simple_strtol(&name[i+1], NULL, 10);
|
||||||
if (err)
|
|
||||||
return false;
|
|
||||||
refresh_specified = true;
|
refresh_specified = true;
|
||||||
was_digit = false;
|
was_digit = false;
|
||||||
} else
|
} else
|
||||||
@ -1293,9 +1291,7 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
|
|||||||
case '-':
|
case '-':
|
||||||
if (!bpp_specified && !yres_specified && !cvt &&
|
if (!bpp_specified && !yres_specified && !cvt &&
|
||||||
!rb && was_digit) {
|
!rb && was_digit) {
|
||||||
err = kstrtouint(&name[i + 1], 10, &bpp);
|
bpp = simple_strtol(&name[i+1], NULL, 10);
|
||||||
if (err)
|
|
||||||
return false;
|
|
||||||
bpp_specified = true;
|
bpp_specified = true;
|
||||||
was_digit = false;
|
was_digit = false;
|
||||||
} else
|
} else
|
||||||
@ -1303,9 +1299,7 @@ bool drm_mode_parse_command_line_for_connector(const char *mode_option,
|
|||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
if (!yres_specified && was_digit) {
|
if (!yres_specified && was_digit) {
|
||||||
err = kstrtouint(&name[i + 1], 10, &yres);
|
yres = simple_strtol(&name[i+1], NULL, 10);
|
||||||
if (err)
|
|
||||||
return false;
|
|
||||||
yres_specified = true;
|
yres_specified = true;
|
||||||
was_digit = false;
|
was_digit = false;
|
||||||
} else
|
} else
|
||||||
@ -1529,4 +1523,4 @@ int drm_mode_convert_umode(struct drm_display_mode *out,
|
|||||||
|
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
Reference in New Issue
Block a user