From f07e572f6447465d8938679533d604e402b0f066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 18 Feb 2021 18:04:33 +0100 Subject: bcm27xx: import latest patches from the RPi foundation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bcm2708: boot tested on RPi B+ v1.2 bcm2709: boot tested on RPi 3B v1.2 and RPi 4B v1.1 4G bcm2710: boot tested on RPi 3B v1.2 bcm2711: boot tested on RPi 4B v1.1 4G Signed-off-by: Álvaro Fernández Rojas --- ...arse_cmdline-Accept-extras-directly-after.patch | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 target/linux/bcm27xx/patches-5.4/950-0471-drm-modes-parse_cmdline-Accept-extras-directly-after.patch (limited to 'target/linux/bcm27xx/patches-5.4/950-0471-drm-modes-parse_cmdline-Accept-extras-directly-after.patch') diff --git a/target/linux/bcm27xx/patches-5.4/950-0471-drm-modes-parse_cmdline-Accept-extras-directly-after.patch b/target/linux/bcm27xx/patches-5.4/950-0471-drm-modes-parse_cmdline-Accept-extras-directly-after.patch new file mode 100644 index 0000000000..8d9a92ec0d --- /dev/null +++ b/target/linux/bcm27xx/patches-5.4/950-0471-drm-modes-parse_cmdline-Accept-extras-directly-after.patch @@ -0,0 +1,77 @@ +From bc4d8c5519c74b9bdf4d35369ba76bac01be8ca2 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 18 Nov 2019 16:51:25 +0100 +Subject: [PATCH] drm/modes: parse_cmdline: Accept extras directly + after mode combined with options + +Commit cfb0881b8f621b656a9e23b31944a5db94cf5842 upstream. + +Before this commit it was impossible to combine an extra mode argument +specified directly after the resolution with an option, e.g. +video=HDMI-1:720x480e,rotate=180 would not work, either the "e" to force +enable would need to be dropped or the ",rotate=180", otherwise the +mode_option would not be accepted. + +This commit fixes this by setting parse_extras to true in this case, so +that drm_mode_parse_cmdline_res_mode() parses the extra arguments directly +after the resolution. + +Acked-by: Maxime Ripard +Signed-off-by: Hans de Goede +Link: https://patchwork.freedesktop.org/patch/msgid/20191118155134.30468-4-hdegoede@redhat.com +--- + drivers/gpu/drm/drm_modes.c | 1 + + .../gpu/drm/selftests/drm_cmdline_selftests.h | 1 + + .../drm/selftests/test-drm_cmdline_parser.c | 24 +++++++++++++++++++ + 3 files changed, 26 insertions(+) + +--- a/drivers/gpu/drm/drm_modes.c ++++ b/drivers/gpu/drm/drm_modes.c +@@ -1801,6 +1801,7 @@ bool drm_mode_parse_command_line_for_con + mode_end = refresh_off; + } else if (options_ptr) { + mode_end = options_off; ++ parse_extras = true; + } else { + mode_end = strlen(name); + parse_extras = true; +--- a/drivers/gpu/drm/selftests/drm_cmdline_selftests.h ++++ b/drivers/gpu/drm/selftests/drm_cmdline_selftests.h +@@ -62,3 +62,4 @@ cmdline_test(drm_cmdline_test_margin_opt + cmdline_test(drm_cmdline_test_multiple_options) + cmdline_test(drm_cmdline_test_invalid_option) + cmdline_test(drm_cmdline_test_bpp_extra_and_option) ++cmdline_test(drm_cmdline_test_extra_and_option) +--- a/drivers/gpu/drm/selftests/test-drm_cmdline_parser.c ++++ b/drivers/gpu/drm/selftests/test-drm_cmdline_parser.c +@@ -1029,6 +1029,30 @@ static int drm_cmdline_test_bpp_extra_an + return 0; + } + ++static int drm_cmdline_test_extra_and_option(void *ignored) ++{ ++ struct drm_cmdline_mode mode = { }; ++ ++ FAIL_ON(!drm_mode_parse_command_line_for_connector("720x480e,rotate=180", ++ &no_connector, ++ &mode)); ++ FAIL_ON(!mode.specified); ++ FAIL_ON(mode.xres != 720); ++ FAIL_ON(mode.yres != 480); ++ FAIL_ON(mode.rotation_reflection != DRM_MODE_ROTATE_180); ++ ++ FAIL_ON(mode.refresh_specified); ++ FAIL_ON(mode.bpp_specified); ++ ++ FAIL_ON(mode.rb); ++ FAIL_ON(mode.cvt); ++ FAIL_ON(mode.interlace); ++ FAIL_ON(mode.margins); ++ FAIL_ON(mode.force != DRM_FORCE_ON); ++ ++ return 0; ++} ++ + #include "drm_selftest.c" + + static int __init test_drm_cmdline_init(void) -- cgit v1.2.3