Skip to content

Commit 7335f3c

Browse files
6by9pelwell
authored andcommitted
drm/tests: Add cmd line test for reflect_[xy] not being last param
To ensure we don't get a regression on handling reflect_[xy] in the middle of the command line string, add a test for it. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 2c3d694 commit 7335f3c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

drivers/gpu/drm/tests/drm_cmdline_parser_test.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,29 @@ static void drm_test_cmdline_multiple_options(struct kunit *test)
724724
KUNIT_EXPECT_EQ(test, mode.force, DRM_FORCE_UNSPECIFIED);
725725
}
726726

727+
static void drm_test_cmdline_multiple_options2(struct kunit *test)
728+
{
729+
struct drm_cmdline_mode mode = { };
730+
const char *cmdline = "720x480,reflect_x,rotate=270";
731+
732+
KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline,
733+
&no_connector, &mode));
734+
KUNIT_EXPECT_TRUE(test, mode.specified);
735+
KUNIT_EXPECT_EQ(test, mode.xres, 720);
736+
KUNIT_EXPECT_EQ(test, mode.yres, 480);
737+
KUNIT_EXPECT_EQ(test, mode.rotation_reflection, (DRM_MODE_ROTATE_270 | DRM_MODE_REFLECT_X));
738+
739+
KUNIT_EXPECT_FALSE(test, mode.refresh_specified);
740+
741+
KUNIT_EXPECT_FALSE(test, mode.bpp_specified);
742+
743+
KUNIT_EXPECT_FALSE(test, mode.rb);
744+
KUNIT_EXPECT_FALSE(test, mode.cvt);
745+
KUNIT_EXPECT_FALSE(test, mode.interlace);
746+
KUNIT_EXPECT_FALSE(test, mode.margins);
747+
KUNIT_EXPECT_EQ(test, mode.force, DRM_FORCE_UNSPECIFIED);
748+
}
749+
727750
static void drm_test_cmdline_bpp_extra_and_option(struct kunit *test)
728751
{
729752
struct drm_cmdline_mode mode = { };
@@ -1057,6 +1080,7 @@ static struct kunit_case drm_cmdline_parser_tests[] = {
10571080
KUNIT_CASE(drm_test_cmdline_vmirror),
10581081
KUNIT_CASE(drm_test_cmdline_margin_options),
10591082
KUNIT_CASE(drm_test_cmdline_multiple_options),
1083+
KUNIT_CASE(drm_test_cmdline_multiple_options2),
10601084
KUNIT_CASE(drm_test_cmdline_bpp_extra_and_option),
10611085
KUNIT_CASE(drm_test_cmdline_extra_and_option),
10621086
KUNIT_CASE(drm_test_cmdline_freestanding_options),

0 commit comments

Comments
 (0)