Lines Matching full:test

3  * Kunit test for drm_modes functions
17 #include <kunit/test.h>
59 static int drm_test_connector_init(struct kunit *test) in drm_test_connector_init() argument
65 dev = drm_kunit_helper_alloc_device(test); in drm_test_connector_init()
66 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dev); in drm_test_connector_init()
68 priv = drm_kunit_helper_alloc_drm_device(test, dev, in drm_test_connector_init()
71 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv); in drm_test_connector_init()
79 KUNIT_ASSERT_EQ(test, ret, 0); in drm_test_connector_init()
81 ret = kunit_add_action_or_reset(test, i2c_del_adapter_wrapper, &priv->ddc); in drm_test_connector_init()
82 KUNIT_ASSERT_EQ(test, ret, 0); in drm_test_connector_init()
84 test->priv = priv; in drm_test_connector_init()
89 * Test that the registration of a bog standard connector works as
92 static void drm_test_drmm_connector_init(struct kunit *test) in drm_test_drmm_connector_init() argument
94 struct drm_connector_init_priv *priv = test->priv; in drm_test_drmm_connector_init()
101 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_drmm_connector_init()
105 * Test that the registration of a connector without a DDC adapter
108 static void drm_test_drmm_connector_init_null_ddc(struct kunit *test) in drm_test_drmm_connector_init_null_ddc() argument
110 struct drm_connector_init_priv *priv = test->priv; in drm_test_drmm_connector_init_null_ddc()
117 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_drmm_connector_init_null_ddc()
121 * Test that the registration of a connector succeeds for all possible
124 static void drm_test_drmm_connector_init_type_valid(struct kunit *test) in drm_test_drmm_connector_init_type_valid() argument
126 struct drm_connector_init_priv *priv = test->priv; in drm_test_drmm_connector_init_type_valid()
127 unsigned int connector_type = *(unsigned int *)test->param_value; in drm_test_drmm_connector_init_type_valid()
134 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_drmm_connector_init_type_valid()
185 * Test that the registration of a bog standard connector works as
188 static void drm_test_connector_hdmi_init_valid(struct kunit *test) in drm_test_connector_hdmi_init_valid() argument
190 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_valid()
201 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_valid()
205 * Test that the registration of a connector without a DDC adapter
208 static void drm_test_connector_hdmi_init_null_ddc(struct kunit *test) in drm_test_connector_hdmi_init_null_ddc() argument
210 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_null_ddc()
221 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_null_ddc()
225 * Test that the registration of an HDMI connector with a NULL vendor
228 static void drm_test_connector_hdmi_init_null_vendor(struct kunit *test) in drm_test_connector_hdmi_init_null_vendor() argument
230 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_null_vendor()
241 KUNIT_EXPECT_LT(test, ret, 0); in drm_test_connector_hdmi_init_null_vendor()
245 * Test that the registration of an HDMI connector with a NULL product
248 static void drm_test_connector_hdmi_init_null_product(struct kunit *test) in drm_test_connector_hdmi_init_null_product() argument
250 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_null_product()
261 KUNIT_EXPECT_LT(test, ret, 0); in drm_test_connector_hdmi_init_null_product()
265 * Test that the registration of a connector with a valid, shorter than
268 static void drm_test_connector_hdmi_init_product_valid(struct kunit *test) in drm_test_connector_hdmi_init_product_valid() argument
270 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_product_valid()
277 KUNIT_ASSERT_LT(test, strlen(product_name), DRM_CONNECTOR_HDMI_PRODUCT_LEN); in drm_test_connector_hdmi_init_product_valid()
287 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_product_valid()
288 KUNIT_EXPECT_MEMEQ(test, in drm_test_connector_hdmi_init_product_valid()
295 * Test that the registration of a connector with a valid, at max
299 static void drm_test_connector_hdmi_init_product_length_exact(struct kunit *test) in drm_test_connector_hdmi_init_product_length_exact() argument
301 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_product_length_exact()
310 KUNIT_ASSERT_EQ(test, strlen(product_name), DRM_CONNECTOR_HDMI_PRODUCT_LEN); in drm_test_connector_hdmi_init_product_length_exact()
320 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_product_length_exact()
321 KUNIT_EXPECT_MEMEQ(test, in drm_test_connector_hdmi_init_product_length_exact()
328 * Test that the registration of a connector with a product name larger
331 static void drm_test_connector_hdmi_init_product_length_too_long(struct kunit *test) in drm_test_connector_hdmi_init_product_length_too_long() argument
333 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_product_length_too_long()
337 KUNIT_ASSERT_GT(test, strlen(product_name), DRM_CONNECTOR_HDMI_PRODUCT_LEN); in drm_test_connector_hdmi_init_product_length_too_long()
347 KUNIT_EXPECT_LT(test, ret, 0); in drm_test_connector_hdmi_init_product_length_too_long()
351 * Test that the registration of a connector with a vendor name smaller
354 static void drm_test_connector_hdmi_init_vendor_valid(struct kunit *test) in drm_test_connector_hdmi_init_vendor_valid() argument
356 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_vendor_valid()
363 KUNIT_ASSERT_LT(test, strlen(vendor_name), DRM_CONNECTOR_HDMI_VENDOR_LEN); in drm_test_connector_hdmi_init_vendor_valid()
373 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_vendor_valid()
374 KUNIT_EXPECT_MEMEQ(test, in drm_test_connector_hdmi_init_vendor_valid()
381 * Test that the registration of a connector with a vendor name at the
385 static void drm_test_connector_hdmi_init_vendor_length_exact(struct kunit *test) in drm_test_connector_hdmi_init_vendor_length_exact() argument
387 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_vendor_length_exact()
395 KUNIT_ASSERT_EQ(test, strlen(vendor_name), DRM_CONNECTOR_HDMI_VENDOR_LEN); in drm_test_connector_hdmi_init_vendor_length_exact()
405 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_vendor_length_exact()
406 KUNIT_EXPECT_MEMEQ(test, in drm_test_connector_hdmi_init_vendor_length_exact()
413 * Test that the registration of a connector with a vendor name larger
416 static void drm_test_connector_hdmi_init_vendor_length_too_long(struct kunit *test) in drm_test_connector_hdmi_init_vendor_length_too_long() argument
418 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_vendor_length_too_long()
422 KUNIT_ASSERT_GT(test, strlen(vendor_name), DRM_CONNECTOR_HDMI_VENDOR_LEN); in drm_test_connector_hdmi_init_vendor_length_too_long()
432 KUNIT_EXPECT_LT(test, ret, 0); in drm_test_connector_hdmi_init_vendor_length_too_long()
436 * Test that the registration of a connector with an invalid maximum bpc
439 static void drm_test_connector_hdmi_init_bpc_invalid(struct kunit *test) in drm_test_connector_hdmi_init_bpc_invalid() argument
441 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_bpc_invalid()
452 KUNIT_EXPECT_LT(test, ret, 0); in drm_test_connector_hdmi_init_bpc_invalid()
456 * Test that the registration of a connector with a null maximum bpc
459 static void drm_test_connector_hdmi_init_bpc_null(struct kunit *test) in drm_test_connector_hdmi_init_bpc_null() argument
461 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_bpc_null()
472 KUNIT_EXPECT_LT(test, ret, 0); in drm_test_connector_hdmi_init_bpc_null()
476 * Test that the registration of a connector with a maximum bpc count of
480 static void drm_test_connector_hdmi_init_bpc_8(struct kunit *test) in drm_test_connector_hdmi_init_bpc_8() argument
482 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_bpc_8()
497 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_bpc_8()
500 KUNIT_ASSERT_NOT_NULL(test, prop); in drm_test_connector_hdmi_init_bpc_8()
501 KUNIT_EXPECT_NOT_NULL(test, drm_mode_obj_find_prop_id(&connector->base, prop->base.id)); in drm_test_connector_hdmi_init_bpc_8()
504 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_bpc_8()
505 KUNIT_EXPECT_EQ(test, val, 8); in drm_test_connector_hdmi_init_bpc_8()
508 KUNIT_EXPECT_EQ(test, state->max_bpc, 8); in drm_test_connector_hdmi_init_bpc_8()
509 KUNIT_EXPECT_EQ(test, state->max_requested_bpc, 8); in drm_test_connector_hdmi_init_bpc_8()
512 KUNIT_ASSERT_NOT_NULL(test, prop); in drm_test_connector_hdmi_init_bpc_8()
513 KUNIT_EXPECT_NULL(test, drm_mode_obj_find_prop_id(&connector->base, prop->base.id)); in drm_test_connector_hdmi_init_bpc_8()
517 * Test that the registration of a connector with a maximum bpc count of
521 static void drm_test_connector_hdmi_init_bpc_10(struct kunit *test) in drm_test_connector_hdmi_init_bpc_10() argument
523 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_bpc_10()
538 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_bpc_10()
541 KUNIT_ASSERT_NOT_NULL(test, prop); in drm_test_connector_hdmi_init_bpc_10()
542 KUNIT_EXPECT_NOT_NULL(test, drm_mode_obj_find_prop_id(&connector->base, prop->base.id)); in drm_test_connector_hdmi_init_bpc_10()
545 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_bpc_10()
546 KUNIT_EXPECT_EQ(test, val, 10); in drm_test_connector_hdmi_init_bpc_10()
549 KUNIT_EXPECT_EQ(test, state->max_bpc, 10); in drm_test_connector_hdmi_init_bpc_10()
550 KUNIT_EXPECT_EQ(test, state->max_requested_bpc, 10); in drm_test_connector_hdmi_init_bpc_10()
553 KUNIT_ASSERT_NOT_NULL(test, prop); in drm_test_connector_hdmi_init_bpc_10()
554 KUNIT_EXPECT_NOT_NULL(test, drm_mode_obj_find_prop_id(&connector->base, prop->base.id)); in drm_test_connector_hdmi_init_bpc_10()
558 * Test that the registration of a connector with a maximum bpc count of
562 static void drm_test_connector_hdmi_init_bpc_12(struct kunit *test) in drm_test_connector_hdmi_init_bpc_12() argument
564 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_bpc_12()
579 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_bpc_12()
582 KUNIT_ASSERT_NOT_NULL(test, prop); in drm_test_connector_hdmi_init_bpc_12()
583 KUNIT_EXPECT_NOT_NULL(test, drm_mode_obj_find_prop_id(&connector->base, prop->base.id)); in drm_test_connector_hdmi_init_bpc_12()
586 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_bpc_12()
587 KUNIT_EXPECT_EQ(test, val, 12); in drm_test_connector_hdmi_init_bpc_12()
590 KUNIT_EXPECT_EQ(test, state->max_bpc, 12); in drm_test_connector_hdmi_init_bpc_12()
591 KUNIT_EXPECT_EQ(test, state->max_requested_bpc, 12); in drm_test_connector_hdmi_init_bpc_12()
594 KUNIT_ASSERT_NOT_NULL(test, prop); in drm_test_connector_hdmi_init_bpc_12()
595 KUNIT_EXPECT_NOT_NULL(test, drm_mode_obj_find_prop_id(&connector->base, prop->base.id)); in drm_test_connector_hdmi_init_bpc_12()
599 * Test that the registration of an HDMI connector with no supported
602 static void drm_test_connector_hdmi_init_formats_empty(struct kunit *test) in drm_test_connector_hdmi_init_formats_empty() argument
604 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_formats_empty()
615 KUNIT_EXPECT_LT(test, ret, 0); in drm_test_connector_hdmi_init_formats_empty()
619 * Test that the registration of an HDMI connector not listing RGB as a
622 static void drm_test_connector_hdmi_init_formats_no_rgb(struct kunit *test) in drm_test_connector_hdmi_init_formats_no_rgb() argument
624 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_formats_no_rgb()
635 KUNIT_EXPECT_LT(test, ret, 0); in drm_test_connector_hdmi_init_formats_no_rgb()
639 * Test that the registration of an HDMI connector with an HDMI
642 static void drm_test_connector_hdmi_init_type_valid(struct kunit *test) in drm_test_connector_hdmi_init_type_valid() argument
644 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_type_valid()
645 unsigned int connector_type = *(unsigned int *)test->param_value; in drm_test_connector_hdmi_init_type_valid()
656 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_connector_hdmi_init_type_valid()
674 * Test that the registration of an HDMI connector with an !HDMI
677 static void drm_test_connector_hdmi_init_type_invalid(struct kunit *test) in drm_test_connector_hdmi_init_type_invalid() argument
679 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_type_invalid()
680 unsigned int connector_type = *(unsigned int *)test->param_value; in drm_test_connector_hdmi_init_type_invalid()
691 KUNIT_EXPECT_LT(test, ret, 0); in drm_test_connector_hdmi_init_type_invalid()
762 static void drm_test_get_tv_mode_from_name_valid(struct kunit *test) in drm_test_get_tv_mode_from_name_valid() argument
764 const struct drm_get_tv_mode_from_name_test *params = test->param_value; in drm_test_get_tv_mode_from_name_valid()
766 KUNIT_EXPECT_EQ(test, in drm_test_get_tv_mode_from_name_valid()
794 static void drm_test_get_tv_mode_from_name_truncated(struct kunit *test) in drm_test_get_tv_mode_from_name_truncated() argument
800 KUNIT_EXPECT_LT(test, ret, 0); in drm_test_get_tv_mode_from_name_truncated()
826 static void drm_test_drm_hdmi_connector_get_broadcast_rgb_name(struct kunit *test) in drm_test_drm_hdmi_connector_get_broadcast_rgb_name() argument
829 test->param_value; in drm_test_drm_hdmi_connector_get_broadcast_rgb_name()
831 KUNIT_EXPECT_STREQ(test, in drm_test_drm_hdmi_connector_get_broadcast_rgb_name()
855 static void drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid(struct kunit *test) in drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid() argument
857 KUNIT_EXPECT_NULL(test, drm_hdmi_connector_get_broadcast_rgb_name(3)); in drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid()
883 static void drm_test_drm_hdmi_connector_get_output_format_name(struct kunit *test) in drm_test_drm_hdmi_connector_get_output_format_name() argument
886 test->param_value; in drm_test_drm_hdmi_connector_get_output_format_name()
888 KUNIT_EXPECT_STREQ(test, in drm_test_drm_hdmi_connector_get_output_format_name()
913 static void drm_test_drm_hdmi_connector_get_output_format_name_invalid(struct kunit *test) in drm_test_drm_hdmi_connector_get_output_format_name_invalid() argument
915 KUNIT_EXPECT_NULL(test, drm_hdmi_connector_get_output_format_name(4)); in drm_test_drm_hdmi_connector_get_output_format_name_invalid()
930 static void drm_test_drm_connector_attach_broadcast_rgb_property(struct kunit *test) in drm_test_drm_connector_attach_broadcast_rgb_property() argument
932 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_connector_attach_broadcast_rgb_property()
941 KUNIT_ASSERT_EQ(test, ret, 0); in drm_test_drm_connector_attach_broadcast_rgb_property()
944 KUNIT_ASSERT_EQ(test, ret, 0); in drm_test_drm_connector_attach_broadcast_rgb_property()
947 KUNIT_ASSERT_NOT_NULL(test, prop); in drm_test_drm_connector_attach_broadcast_rgb_property()
948 KUNIT_EXPECT_NOT_NULL(test, drm_mode_obj_find_prop_id(&connector->base, prop->base.id)); in drm_test_drm_connector_attach_broadcast_rgb_property()
951 static void drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector(struct kunit *test) in drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector() argument
953 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector()
966 KUNIT_EXPECT_EQ(test, ret, 0); in drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector()
969 KUNIT_ASSERT_EQ(test, ret, 0); in drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector()
972 KUNIT_ASSERT_NOT_NULL(test, prop); in drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector()
973 KUNIT_EXPECT_NOT_NULL(test, drm_mode_obj_find_prop_id(&connector->base, prop->base.id)); in drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector()
989 * Test that for a given mode, with 8bpc and an RGB output the TMDS
992 static void drm_test_drm_hdmi_compute_mode_clock_rgb(struct kunit *test) in drm_test_drm_hdmi_compute_mode_clock_rgb() argument
994 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb()
999 mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); in drm_test_drm_hdmi_compute_mode_clock_rgb()
1000 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_drm_hdmi_compute_mode_clock_rgb()
1002 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); in drm_test_drm_hdmi_compute_mode_clock_rgb()
1005 KUNIT_ASSERT_GT(test, rate, 0); in drm_test_drm_hdmi_compute_mode_clock_rgb()
1006 KUNIT_EXPECT_EQ(test, mode->clock * 1000ULL, rate); in drm_test_drm_hdmi_compute_mode_clock_rgb()
1010 * Test that for a given mode, with 10bpc and an RGB output the TMDS
1013 static void drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc(struct kunit *test) in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc() argument
1015 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc()
1020 mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc()
1021 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc()
1023 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc()
1026 KUNIT_ASSERT_GT(test, rate, 0); in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc()
1027 KUNIT_EXPECT_EQ(test, mode->clock * 1250, rate); in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc()
1031 * Test that for the VIC-1 mode, with 10bpc and an RGB output the TMDS
1034 static void drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1(struct kunit *test) in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1() argument
1036 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1()
1041 mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1()
1042 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1()
1045 KUNIT_EXPECT_EQ(test, rate, 0); in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1()
1049 * Test that for a given mode, with 12bpc and an RGB output the TMDS
1052 static void drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc(struct kunit *test) in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc() argument
1054 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc()
1059 mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc()
1060 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc()
1062 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc()
1065 KUNIT_ASSERT_GT(test, rate, 0); in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc()
1066 KUNIT_EXPECT_EQ(test, mode->clock * 1500, rate); in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc()
1070 * Test that for the VIC-1 mode, with 12bpc and an RGB output the TMDS
1073 static void drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1(struct kunit *test) in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1() argument
1075 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1()
1080 mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1()
1081 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1()
1084 KUNIT_EXPECT_EQ(test, rate, 0); in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1()
1088 * Test that for a mode with the pixel repetition flag, the TMDS
1091 static void drm_test_drm_hdmi_compute_mode_clock_rgb_double(struct kunit *test) in drm_test_drm_hdmi_compute_mode_clock_rgb_double() argument
1093 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb_double()
1098 mode = drm_kunit_display_mode_from_cea_vic(test, drm, 6); in drm_test_drm_hdmi_compute_mode_clock_rgb_double()
1099 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_drm_hdmi_compute_mode_clock_rgb_double()
1101 KUNIT_ASSERT_TRUE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); in drm_test_drm_hdmi_compute_mode_clock_rgb_double()
1104 KUNIT_ASSERT_GT(test, rate, 0); in drm_test_drm_hdmi_compute_mode_clock_rgb_double()
1105 KUNIT_EXPECT_EQ(test, (mode->clock * 1000ULL) * 2, rate); in drm_test_drm_hdmi_compute_mode_clock_rgb_double()
1109 * Test that the TMDS character rate computation for the VIC modes
1113 static void drm_test_connector_hdmi_compute_mode_clock_yuv420_valid(struct kunit *test) in drm_test_connector_hdmi_compute_mode_clock_yuv420_valid() argument
1115 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv420_valid()
1119 unsigned int vic = *(unsigned int *)test->param_value; in drm_test_connector_hdmi_compute_mode_clock_yuv420_valid()
1121 mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic); in drm_test_connector_hdmi_compute_mode_clock_yuv420_valid()
1122 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_connector_hdmi_compute_mode_clock_yuv420_valid()
1124 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); in drm_test_connector_hdmi_compute_mode_clock_yuv420_valid()
1127 KUNIT_ASSERT_GT(test, rate, 0); in drm_test_connector_hdmi_compute_mode_clock_yuv420_valid()
1128 KUNIT_EXPECT_EQ(test, (mode->clock * 1000ULL) / 2, rate); in drm_test_connector_hdmi_compute_mode_clock_yuv420_valid()
1145 * Test that for a given mode listed supporting it and an YUV420 output
1149 static void drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc(struct kunit *test) in drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc() argument
1151 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc()
1158 mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic); in drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc()
1159 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc()
1161 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); in drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc()
1164 KUNIT_ASSERT_GT(test, rate, 0); in drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc()
1166 KUNIT_EXPECT_EQ(test, mode->clock * 625, rate); in drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc()
1170 * Test that for a given mode listed supporting it and an YUV420 output
1174 static void drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc(struct kunit *test) in drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc() argument
1176 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc()
1183 mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic); in drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc()
1184 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc()
1186 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); in drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc()
1189 KUNIT_ASSERT_GT(test, rate, 0); in drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc()
1191 KUNIT_EXPECT_EQ(test, mode->clock * 750, rate); in drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc()
1195 * Test that for a given mode, the computation of the TMDS character
1199 static void drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc(struct kunit *test) in drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc() argument
1201 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc()
1206 mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); in drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc()
1207 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc()
1209 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); in drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc()
1212 KUNIT_ASSERT_GT(test, rate, 0); in drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc()
1213 KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate); in drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc()
1217 * Test that for a given mode, the computation of the TMDS character
1221 static void drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc(struct kunit *test) in drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc() argument
1223 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc()
1228 mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); in drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc()
1229 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc()
1231 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); in drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc()
1234 KUNIT_ASSERT_GT(test, rate, 0); in drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc()
1235 KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate); in drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc()
1239 * Test that for a given mode, the computation of the TMDS character
1243 static void drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc(struct kunit *test) in drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc() argument
1245 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc()
1250 mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); in drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc()
1251 KUNIT_ASSERT_NOT_NULL(test, mode); in drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc()
1253 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); in drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc()
1256 KUNIT_ASSERT_GT(test, rate, 0); in drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc()
1257 KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate); in drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc()
1294 MODULE_DESCRIPTION("Kunit test for drm_modes functions");