Lines Matching +full:hdmi +full:- +full:connector
1 // SPDX-License-Identifier: GPL-2.0
23 struct drm_connector connector; member
73 strscpy(priv->ddc.name, "dummy-connector-ddc", sizeof(priv->ddc.name)); in drm_test_connector_init()
74 priv->ddc.owner = THIS_MODULE; in drm_test_connector_init()
75 priv->ddc.algo = &dummy_ddc_algorithm; in drm_test_connector_init()
76 priv->ddc.dev.parent = dev; in drm_test_connector_init()
78 ret = i2c_add_adapter(&priv->ddc); in drm_test_connector_init()
81 ret = kunit_add_action_or_reset(test, i2c_del_adapter_wrapper, &priv->ddc); 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
94 struct drm_connector_init_priv *priv = test->priv; in drm_test_drmm_connector_init()
97 ret = drmm_connector_init(&priv->drm, &priv->connector, in drm_test_drmm_connector_init()
100 &priv->ddc); in drm_test_drmm_connector_init()
105 * Test that the registration of a connector without a DDC adapter
110 struct drm_connector_init_priv *priv = test->priv; in drm_test_drmm_connector_init_null_ddc()
113 ret = drmm_connector_init(&priv->drm, &priv->connector, in drm_test_drmm_connector_init_null_ddc()
121 * Test that the registration of a connector succeeds for all possible
122 * connector types.
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()
130 ret = drmm_connector_init(&priv->drm, &priv->connector, in drm_test_drmm_connector_init_type_valid()
133 &priv->ddc); in drm_test_drmm_connector_init_type_valid()
185 * Test that the registration of a bog standard connector works as
190 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_valid()
193 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_valid()
198 &priv->ddc, in drm_test_connector_hdmi_init_valid()
205 * Test that the registration of a connector without a DDC adapter
210 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_null_ddc()
213 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_null_ddc()
225 * Test that the registration of an HDMI connector with a NULL vendor
230 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_null_vendor()
233 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_null_vendor()
238 &priv->ddc, in drm_test_connector_hdmi_init_null_vendor()
245 * Test that the registration of an HDMI connector with a NULL product
250 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_null_product()
253 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_null_product()
258 &priv->ddc, in drm_test_connector_hdmi_init_null_product()
265 * Test that the registration of a connector with a valid, shorter than
270 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_product_valid()
279 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_product_valid()
284 &priv->ddc, in drm_test_connector_hdmi_init_product_valid()
289 priv->connector.hdmi.product, in drm_test_connector_hdmi_init_product_valid()
291 sizeof(priv->connector.hdmi.product)); in drm_test_connector_hdmi_init_product_valid()
295 * Test that the registration of a connector with a valid, at max
301 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_product_length_exact()
312 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_product_length_exact()
317 &priv->ddc, in drm_test_connector_hdmi_init_product_length_exact()
322 priv->connector.hdmi.product, in drm_test_connector_hdmi_init_product_length_exact()
324 sizeof(priv->connector.hdmi.product)); in drm_test_connector_hdmi_init_product_length_exact()
328 * Test that the registration of a connector with a product name larger
333 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_product_length_too_long()
339 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_product_length_too_long()
344 &priv->ddc, in drm_test_connector_hdmi_init_product_length_too_long()
351 * Test that the registration of a connector with a vendor name smaller
356 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_vendor_valid()
365 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_vendor_valid()
370 &priv->ddc, in drm_test_connector_hdmi_init_vendor_valid()
375 priv->connector.hdmi.vendor, in drm_test_connector_hdmi_init_vendor_valid()
377 sizeof(priv->connector.hdmi.vendor)); in drm_test_connector_hdmi_init_vendor_valid()
381 * Test that the registration of a connector with a vendor name at the
387 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_vendor_length_exact()
397 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_vendor_length_exact()
402 &priv->ddc, in drm_test_connector_hdmi_init_vendor_length_exact()
407 priv->connector.hdmi.vendor, in drm_test_connector_hdmi_init_vendor_length_exact()
409 sizeof(priv->connector.hdmi.vendor)); in drm_test_connector_hdmi_init_vendor_length_exact()
413 * Test that the registration of a connector with a vendor name larger
418 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_vendor_length_too_long()
424 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_vendor_length_too_long()
429 &priv->ddc, in drm_test_connector_hdmi_init_vendor_length_too_long()
436 * Test that the registration of a connector with an invalid maximum bpc
441 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_bpc_invalid()
444 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_bpc_invalid()
449 &priv->ddc, in drm_test_connector_hdmi_init_bpc_invalid()
456 * Test that the registration of a connector with a null maximum bpc
461 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_bpc_null()
464 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_bpc_null()
469 &priv->ddc, in drm_test_connector_hdmi_init_bpc_null()
476 * Test that the registration of a connector with a maximum bpc count of
482 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_bpc_8()
484 struct drm_connector *connector = &priv->connector; in drm_test_connector_hdmi_init_bpc_8() local
489 ret = drmm_connector_hdmi_init(&priv->drm, connector, in drm_test_connector_hdmi_init_bpc_8()
494 &priv->ddc, in drm_test_connector_hdmi_init_bpc_8()
499 prop = connector->max_bpc_property; 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()
503 ret = drm_object_property_get_default_value(&connector->base, prop, &val); in drm_test_connector_hdmi_init_bpc_8()
507 state = connector->state; 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()
511 prop = priv->drm.mode_config.hdr_output_metadata_property; 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
523 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_bpc_10()
525 struct drm_connector *connector = &priv->connector; in drm_test_connector_hdmi_init_bpc_10() local
530 ret = drmm_connector_hdmi_init(&priv->drm, connector, in drm_test_connector_hdmi_init_bpc_10()
535 &priv->ddc, in drm_test_connector_hdmi_init_bpc_10()
540 prop = connector->max_bpc_property; 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()
544 ret = drm_object_property_get_default_value(&connector->base, prop, &val); in drm_test_connector_hdmi_init_bpc_10()
548 state = connector->state; 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()
552 prop = priv->drm.mode_config.hdr_output_metadata_property; 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
564 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_bpc_12()
566 struct drm_connector *connector = &priv->connector; in drm_test_connector_hdmi_init_bpc_12() local
571 ret = drmm_connector_hdmi_init(&priv->drm, connector, in drm_test_connector_hdmi_init_bpc_12()
576 &priv->ddc, in drm_test_connector_hdmi_init_bpc_12()
581 prop = connector->max_bpc_property; 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()
585 ret = drm_object_property_get_default_value(&connector->base, prop, &val); in drm_test_connector_hdmi_init_bpc_12()
589 state = connector->state; 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()
593 prop = priv->drm.mode_config.hdr_output_metadata_property; 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
604 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_formats_empty()
607 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_formats_empty()
612 &priv->ddc, in drm_test_connector_hdmi_init_formats_empty()
619 * Test that the registration of an HDMI connector not listing RGB as a
624 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_init_formats_no_rgb()
627 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_formats_no_rgb()
632 &priv->ddc, in drm_test_connector_hdmi_init_formats_no_rgb()
639 * Test that the registration of an HDMI connector with an HDMI
640 * connector type succeeds.
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()
648 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_type_valid()
653 &priv->ddc, in drm_test_connector_hdmi_init_type_valid()
674 * Test that the registration of an HDMI connector with an !HDMI
675 * connector type fails.
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()
683 ret = drmm_connector_hdmi_init(&priv->drm, &priv->connector, in drm_test_connector_hdmi_init_type_invalid()
688 &priv->ddc, in drm_test_connector_hdmi_init_type_invalid()
764 const struct drm_get_tv_mode_from_name_test *params = test->param_value; in drm_test_get_tv_mode_from_name_valid()
767 drm_get_tv_mode_from_name(params->name, strlen(params->name)), in drm_test_get_tv_mode_from_name_valid()
768 params->expected_mode); in drm_test_get_tv_mode_from_name_valid()
774 TV_MODE_NAME("NTSC-443", DRM_MODE_TV_MODE_NTSC_443),
775 TV_MODE_NAME("NTSC-J", DRM_MODE_TV_MODE_NTSC_J),
777 TV_MODE_NAME("PAL-M", DRM_MODE_TV_MODE_PAL_M),
778 TV_MODE_NAME("PAL-N", DRM_MODE_TV_MODE_PAL_N),
787 sprintf(desc, "%s", t->name); in drm_get_tv_mode_from_name_valid_desc()
829 test->param_value; in drm_test_drm_hdmi_connector_get_broadcast_rgb_name()
832 drm_hdmi_connector_get_broadcast_rgb_name(params->kind), in drm_test_drm_hdmi_connector_get_broadcast_rgb_name()
833 params->expected_name); in drm_test_drm_hdmi_connector_get_broadcast_rgb_name()
848 sprintf(desc, "%s", t->expected_name); in drm_hdmi_connector_get_broadcast_rgb_name_valid_desc()
886 test->param_value; in drm_test_drm_hdmi_connector_get_output_format_name()
889 drm_hdmi_connector_get_output_format_name(params->kind), in drm_test_drm_hdmi_connector_get_output_format_name()
890 params->expected_name); in drm_test_drm_hdmi_connector_get_output_format_name()
906 sprintf(desc, "%s", t->expected_name); in drm_hdmi_connector_get_output_format_name_valid_desc()
932 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_connector_attach_broadcast_rgb_property()
933 struct drm_connector *connector = &priv->connector; in drm_test_drm_connector_attach_broadcast_rgb_property() local
937 ret = drmm_connector_init(&priv->drm, connector, in drm_test_drm_connector_attach_broadcast_rgb_property()
940 &priv->ddc); in drm_test_drm_connector_attach_broadcast_rgb_property()
943 ret = drm_connector_attach_broadcast_rgb_property(connector); in drm_test_drm_connector_attach_broadcast_rgb_property()
946 prop = connector->broadcast_rgb_property; 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()
953 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector()
954 struct drm_connector *connector = &priv->connector; in drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector() local
958 ret = drmm_connector_hdmi_init(&priv->drm, connector, in drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector()
963 &priv->ddc, in drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector()
968 ret = drm_connector_attach_broadcast_rgb_property(connector); in drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector()
971 prop = connector->broadcast_rgb_property; 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()
994 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb()
997 struct drm_device *drm = &priv->drm; 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()
1006 KUNIT_EXPECT_EQ(test, mode->clock * 1000ULL, rate); in drm_test_drm_hdmi_compute_mode_clock_rgb()
1015 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc()
1018 struct drm_device *drm = &priv->drm; 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()
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
1036 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1()
1039 struct drm_device *drm = &priv->drm; in drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1()
1054 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc()
1057 struct drm_device *drm = &priv->drm; 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()
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
1075 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1()
1078 struct drm_device *drm = &priv->drm; in drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1()
1093 struct drm_connector_init_priv *priv = test->priv; in drm_test_drm_hdmi_compute_mode_clock_rgb_double()
1096 struct drm_device *drm = &priv->drm; 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()
1105 KUNIT_EXPECT_EQ(test, (mode->clock * 1000ULL) * 2, rate); in drm_test_drm_hdmi_compute_mode_clock_rgb_double()
1115 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv420_valid()
1117 struct drm_device *drm = &priv->drm; 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()
1124 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); 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()
1151 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc()
1153 struct drm_device *drm = &priv->drm; 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()
1166 KUNIT_EXPECT_EQ(test, mode->clock * 625, rate); in drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc()
1176 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc()
1178 struct drm_device *drm = &priv->drm; 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()
1191 KUNIT_EXPECT_EQ(test, mode->clock * 750, rate); in drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc()
1201 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc()
1203 struct drm_device *drm = &priv->drm; 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()
1213 KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate); in drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc()
1223 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc()
1225 struct drm_device *drm = &priv->drm; 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()
1235 KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate); in drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc()
1245 struct drm_connector_init_priv *priv = test->priv; in drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc()
1247 struct drm_device *drm = &priv->drm; 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()
1257 KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate); in drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc()