Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace

The hdmi_colorspace enum was defined to represent the colorspace value
of the HDMI infoframes. It was later used by some HDMI drivers to
express the output format they should be setting up.

During the introduction of the HDMI helpers, it then was used to
represent it in the drm_connector_hdmi_state structure.

However, it's always been somewhat redundant with the DRM_COLOR_FORMAT_*
defines, and now with the drm_output_color_format enum. Let's
consolidate around drm_output_color_format in drm_connector_hdmi_state
to facilitate the current effort to provide a global output format
selection mechanism.

Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260305-drm-rework-color-formats-v3-14-f3935f6db579@kernel.org
Signed-off-by: Maxime Ripard <mripard@kernel.org>

+213 -187
+3 -3
drivers/gpu/drm/bridge/inno-hdmi.c
··· 653 653 v_VIDEO_INPUT_CSP(0); 654 654 hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); 655 655 656 - if (conn_state->hdmi.output_format == HDMI_COLORSPACE_RGB) { 656 + if (conn_state->hdmi.output_format == DRM_OUTPUT_COLOR_FORMAT_RGB444) { 657 657 if (conn_state->hdmi.is_limited_range) { 658 658 csc_mode = CSC_RGB_0_255_TO_RGB_16_235_8BIT; 659 659 auto_csc = AUTO_CSC_DISABLE; ··· 672 672 } 673 673 } else { 674 674 if (colorimetry == HDMI_COLORIMETRY_ITU_601) { 675 - if (conn_state->hdmi.output_format == HDMI_COLORSPACE_YUV444) { 675 + if (conn_state->hdmi.output_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR444) { 676 676 csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; 677 677 auto_csc = AUTO_CSC_DISABLE; 678 678 c0_c2_change = C0_C2_CHANGE_DISABLE; 679 679 csc_enable = v_CSC_ENABLE; 680 680 } 681 681 } else { 682 - if (conn_state->hdmi.output_format == HDMI_COLORSPACE_YUV444) { 682 + if (conn_state->hdmi.output_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR444) { 683 683 csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; 684 684 auto_csc = AUTO_CSC_DISABLE; 685 685 c0_c2_change = C0_C2_CHANGE_DISABLE;
+1 -1
drivers/gpu/drm/bridge/ite-it6263.c
··· 666 666 { 667 667 unsigned long long rate; 668 668 669 - rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); 669 + rate = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444); 670 670 if (rate == 0) 671 671 return MODE_NOCLOCK; 672 672
+2 -2
drivers/gpu/drm/display/drm_bridge_connector.c
··· 789 789 struct drm_connector *connector; 790 790 struct i2c_adapter *ddc = NULL; 791 791 struct drm_bridge *panel_bridge __free(drm_bridge_put) = NULL; 792 - unsigned int supported_formats = BIT(HDMI_COLORSPACE_RGB); 792 + unsigned int supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444); 793 793 unsigned int max_bpc = 8; 794 794 bool support_hdcp = false; 795 795 int connector_type; ··· 960 960 961 961 if (bridge_connector->bridge_hdmi) { 962 962 if (!connector->ycbcr_420_allowed) 963 - supported_formats &= ~BIT(HDMI_COLORSPACE_YUV420); 963 + supported_formats &= ~BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 964 964 965 965 bridge_connector->hdmi_funcs = drm_bridge_connector_hdmi_funcs; 966 966
+4 -3
drivers/gpu/drm/display/drm_hdmi_helper.c
··· 210 210 */ 211 211 unsigned long long 212 212 drm_hdmi_compute_mode_clock(const struct drm_display_mode *mode, 213 - unsigned int bpc, enum hdmi_colorspace fmt) 213 + unsigned int bpc, 214 + enum drm_output_color_format fmt) 214 215 { 215 216 unsigned long long clock = mode->clock * 1000ULL; 216 217 unsigned int vic = drm_match_cea_mode(mode); ··· 223 222 if (vic == 1 && bpc != 8) 224 223 return 0; 225 224 226 - if (fmt == HDMI_COLORSPACE_YUV422) { 225 + if (fmt == DRM_OUTPUT_COLOR_FORMAT_YCBCR422) { 227 226 /* 228 227 * HDMI 1.0 Spec, section 6.5 - Pixel Encoding states that 229 228 * YUV422 sends 24 bits over three channels, with Cb and Cr ··· 249 248 * specifies that YUV420 encoding is carried at a TMDS Character Rate 250 249 * equal to half the pixel clock rate. 251 250 */ 252 - if (fmt == HDMI_COLORSPACE_YUV420) 251 + if (fmt == DRM_OUTPUT_COLOR_FORMAT_YCBCR420) 253 252 clock = clock / 2; 254 253 255 254 if (mode->flags & DRM_MODE_FLAG_DBLCLK)
+37 -15
drivers/gpu/drm/display/drm_hdmi_state_helper.c
··· 326 326 } 327 327 EXPORT_SYMBOL(__drm_atomic_helper_connector_hdmi_reset); 328 328 329 + static enum hdmi_colorspace 330 + output_color_format_to_hdmi_colorspace(const struct drm_connector *connector, 331 + enum drm_output_color_format fmt) 332 + { 333 + switch (fmt) { 334 + case DRM_OUTPUT_COLOR_FORMAT_YCBCR420: 335 + return HDMI_COLORSPACE_YUV420; 336 + case DRM_OUTPUT_COLOR_FORMAT_YCBCR422: 337 + return HDMI_COLORSPACE_YUV422; 338 + case DRM_OUTPUT_COLOR_FORMAT_YCBCR444: 339 + return HDMI_COLORSPACE_YUV444; 340 + default: 341 + drm_warn(connector->dev, "Unsupported output color format. Defaulting to RGB."); 342 + fallthrough; 343 + case DRM_OUTPUT_COLOR_FORMAT_RGB444: 344 + return HDMI_COLORSPACE_RGB; 345 + } 346 + } 347 + 329 348 static const struct drm_display_mode * 330 349 connector_state_get_mode(const struct drm_connector_state *conn_state) 331 350 { ··· 379 360 * i915 just assumes limited range for YCbCr output, so let's 380 361 * just do the same. 381 362 */ 382 - if (conn_state->hdmi.output_format != HDMI_COLORSPACE_RGB) 363 + if (conn_state->hdmi.output_format != DRM_OUTPUT_COLOR_FORMAT_RGB444) 383 364 return true; 384 365 385 366 if (conn_state->hdmi.broadcast_rgb == DRM_HDMI_BROADCAST_RGB_FULL) ··· 398 379 sink_supports_format_bpc(const struct drm_connector *connector, 399 380 const struct drm_display_info *info, 400 381 const struct drm_display_mode *mode, 401 - unsigned int format, unsigned int bpc) 382 + enum drm_output_color_format format, 383 + unsigned int bpc) 402 384 { 403 385 struct drm_device *dev = connector->dev; 404 386 u8 vic = drm_match_cea_mode(mode); ··· 420 400 } 421 401 422 402 if (!info->is_hdmi && 423 - (format != HDMI_COLORSPACE_RGB || bpc != 8)) { 403 + (format != DRM_OUTPUT_COLOR_FORMAT_RGB444 || bpc != 8)) { 424 404 drm_dbg_kms(dev, "DVI Monitors require an RGB output at 8 bpc\n"); 425 405 return false; 426 406 } ··· 431 411 return false; 432 412 } 433 413 434 - if (drm_mode_is_420_only(info, mode) && format != HDMI_COLORSPACE_YUV420) { 414 + if (drm_mode_is_420_only(info, mode) && format != DRM_OUTPUT_COLOR_FORMAT_YCBCR420) { 435 415 drm_dbg_kms(dev, "Mode can be only supported in YUV420 format.\n"); 436 416 return false; 437 417 } 438 418 439 419 switch (format) { 440 - case HDMI_COLORSPACE_RGB: 420 + case DRM_OUTPUT_COLOR_FORMAT_RGB444: 441 421 drm_dbg_kms(dev, "RGB Format, checking the constraints.\n"); 442 422 443 423 /* ··· 465 445 466 446 return true; 467 447 468 - case HDMI_COLORSPACE_YUV420: 448 + case DRM_OUTPUT_COLOR_FORMAT_YCBCR420: 469 449 drm_dbg_kms(dev, "YUV420 format, checking the constraints.\n"); 470 450 471 451 if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420))) { ··· 497 477 498 478 return true; 499 479 500 - case HDMI_COLORSPACE_YUV422: 480 + case DRM_OUTPUT_COLOR_FORMAT_YCBCR422: 501 481 drm_dbg_kms(dev, "YUV422 format, checking the constraints.\n"); 502 482 503 483 if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422))) { ··· 520 500 521 501 return true; 522 502 523 - case HDMI_COLORSPACE_YUV444: 503 + case DRM_OUTPUT_COLOR_FORMAT_YCBCR444: 524 504 drm_dbg_kms(dev, "YUV444 format, checking the constraints.\n"); 525 505 526 506 if (!(info->color_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444))) { ··· 573 553 hdmi_compute_clock(const struct drm_connector *connector, 574 554 struct drm_connector_state *conn_state, 575 555 const struct drm_display_mode *mode, 576 - unsigned int bpc, enum hdmi_colorspace fmt) 556 + unsigned int bpc, enum drm_output_color_format fmt) 577 557 { 578 558 enum drm_mode_status status; 579 559 unsigned long long clock; ··· 595 575 hdmi_try_format_bpc(const struct drm_connector *connector, 596 576 struct drm_connector_state *conn_state, 597 577 const struct drm_display_mode *mode, 598 - unsigned int bpc, enum hdmi_colorspace fmt) 578 + unsigned int bpc, enum drm_output_color_format fmt) 599 579 { 600 580 const struct drm_display_info *info = &connector->display_info; 601 581 struct drm_device *dev = connector->dev; ··· 631 611 hdmi_compute_format_bpc(const struct drm_connector *connector, 632 612 struct drm_connector_state *conn_state, 633 613 const struct drm_display_mode *mode, 634 - unsigned int max_bpc, enum hdmi_colorspace fmt) 614 + unsigned int max_bpc, enum drm_output_color_format fmt) 635 615 { 636 616 struct drm_device *dev = connector->dev; 637 617 unsigned int bpc; ··· 672 652 int ret; 673 653 674 654 ret = hdmi_compute_format_bpc(connector, conn_state, mode, max_bpc, 675 - HDMI_COLORSPACE_RGB); 655 + DRM_OUTPUT_COLOR_FORMAT_RGB444); 676 656 if (ret) { 677 657 if (connector->ycbcr_420_allowed) { 678 658 ret = hdmi_compute_format_bpc(connector, conn_state, 679 659 mode, max_bpc, 680 - HDMI_COLORSPACE_YUV420); 660 + DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 681 661 if (ret) 682 662 drm_dbg_kms(connector->dev, 683 663 "YUV420 output format doesn't work.\n"); ··· 711 691 if (ret) 712 692 return ret; 713 693 714 - frame->colorspace = conn_state->hdmi.output_format; 694 + frame->colorspace = 695 + output_color_format_to_hdmi_colorspace(connector, 696 + conn_state->hdmi.output_format); 715 697 716 698 /* 717 699 * FIXME: drm_hdmi_avi_infoframe_quant_range() doesn't handle ··· 911 889 { 912 890 unsigned long long clock; 913 891 914 - clock = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); 892 + clock = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444); 915 893 if (!clock) 916 894 return MODE_ERROR; 917 895
+1 -1
drivers/gpu/drm/drm_bridge.c
··· 421 421 422 422 if (bridge->ops & DRM_BRIDGE_OP_HDMI) 423 423 bridge->ycbcr_420_allowed = !!(bridge->supported_formats & 424 - BIT(HDMI_COLORSPACE_YUV420)); 424 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)); 425 425 426 426 mutex_lock(&bridge_lock); 427 427 list_add_tail(&bridge->list, &bridge_list);
+8 -8
drivers/gpu/drm/drm_connector.c
··· 552 552 * @hdmi_funcs: HDMI-related callbacks for this connector 553 553 * @connector_type: user visible type of the connector 554 554 * @ddc: optional pointer to the associated ddc adapter 555 - * @supported_formats: Bitmask of @hdmi_colorspace listing supported output formats 555 + * @supported_formats: Bitmask of @drm_output_color_format listing supported output formats 556 556 * @max_bpc: Maximum bits per char the HDMI connector supports 557 557 * 558 558 * Initialises a preallocated HDMI connector. Connectors can be ··· 591 591 connector_type == DRM_MODE_CONNECTOR_HDMIB)) 592 592 return -EINVAL; 593 593 594 - if (!supported_formats || !(supported_formats & BIT(HDMI_COLORSPACE_RGB))) 594 + if (!supported_formats || !(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444))) 595 595 return -EINVAL; 596 596 597 - if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(HDMI_COLORSPACE_YUV420))) 597 + if (connector->ycbcr_420_allowed != !!(supported_formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420))) 598 598 return -EINVAL; 599 599 600 600 if (!(max_bpc == 8 || max_bpc == 10 || max_bpc == 12)) ··· 1431 1431 EXPORT_SYMBOL(drm_hdmi_connector_get_broadcast_rgb_name); 1432 1432 1433 1433 static const char * const output_format_str[] = { 1434 - [HDMI_COLORSPACE_RGB] = "RGB", 1435 - [HDMI_COLORSPACE_YUV420] = "YUV 4:2:0", 1436 - [HDMI_COLORSPACE_YUV422] = "YUV 4:2:2", 1437 - [HDMI_COLORSPACE_YUV444] = "YUV 4:4:4", 1434 + [DRM_OUTPUT_COLOR_FORMAT_RGB444] = "RGB", 1435 + [DRM_OUTPUT_COLOR_FORMAT_YCBCR420] = "YUV 4:2:0", 1436 + [DRM_OUTPUT_COLOR_FORMAT_YCBCR422] = "YUV 4:2:2", 1437 + [DRM_OUTPUT_COLOR_FORMAT_YCBCR444] = "YUV 4:4:4", 1438 1438 }; 1439 1439 1440 1440 /* ··· 1445 1445 * valid. 1446 1446 */ 1447 1447 const char * 1448 - drm_hdmi_connector_get_output_format_name(enum hdmi_colorspace fmt) 1448 + drm_hdmi_connector_get_output_format_name(enum drm_output_color_format fmt) 1449 1449 { 1450 1450 if (fmt >= ARRAY_SIZE(output_format_str)) 1451 1451 return NULL;
+4 -4
drivers/gpu/drm/mediatek/mtk_hdmi_v2.c
··· 747 747 748 748 switch (conn_state->hdmi.output_format) { 749 749 default: 750 - case HDMI_COLORSPACE_RGB: 751 - case HDMI_COLORSPACE_YUV444: 750 + case DRM_OUTPUT_COLOR_FORMAT_RGB444: 751 + case DRM_OUTPUT_COLOR_FORMAT_YCBCR444: 752 752 /* Disable YUV420 downsampling for RGB and YUV444 */ 753 753 mtk_hdmi_yuv420_downsampling(hdmi, false); 754 754 break; 755 - case HDMI_COLORSPACE_YUV422: 755 + case DRM_OUTPUT_COLOR_FORMAT_YCBCR422: 756 756 /* 757 757 * YUV420 downsampling is special and needs a bit of setup 758 758 * so we disable everything there before doing anything else. ··· 763 763 regmap_set_bits(hdmi->regs, VID_DOWNSAMPLE_CONFIG, 764 764 C444_C422_CONFIG_ENABLE); 765 765 break; 766 - case HDMI_COLORSPACE_YUV420: 766 + case DRM_OUTPUT_COLOR_FORMAT_YCBCR420: 767 767 mtk_hdmi_yuv420_downsampling(hdmi, true); 768 768 break; 769 769 }
+1 -1
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c
··· 661 661 &sun4i_hdmi_hdmi_connector_funcs, 662 662 DRM_MODE_CONNECTOR_HDMIA, 663 663 hdmi->ddc_i2c, 664 - BIT(HDMI_COLORSPACE_RGB), 664 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 665 665 8); 666 666 if (ret) { 667 667 dev_err(dev,
+40 -40
drivers/gpu/drm/tests/drm_connector_test.c
··· 675 675 &dummy_hdmi_funcs, 676 676 DRM_MODE_CONNECTOR_HDMIA, 677 677 &priv->ddc, 678 - BIT(HDMI_COLORSPACE_RGB), 678 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 679 679 8); 680 680 KUNIT_EXPECT_EQ(test, ret, 0); 681 681 } ··· 695 695 &dummy_hdmi_funcs, 696 696 DRM_MODE_CONNECTOR_HDMIA, 697 697 NULL, 698 - BIT(HDMI_COLORSPACE_RGB), 698 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 699 699 8); 700 700 KUNIT_EXPECT_EQ(test, ret, 0); 701 701 } ··· 715 715 &dummy_hdmi_funcs, 716 716 DRM_MODE_CONNECTOR_HDMIA, 717 717 &priv->ddc, 718 - BIT(HDMI_COLORSPACE_RGB), 718 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 719 719 8); 720 720 KUNIT_EXPECT_LT(test, ret, 0); 721 721 } ··· 735 735 &dummy_hdmi_funcs, 736 736 DRM_MODE_CONNECTOR_HDMIA, 737 737 &priv->ddc, 738 - BIT(HDMI_COLORSPACE_RGB), 738 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 739 739 8); 740 740 KUNIT_EXPECT_LT(test, ret, 0); 741 741 } ··· 761 761 &dummy_hdmi_funcs, 762 762 DRM_MODE_CONNECTOR_HDMIA, 763 763 &priv->ddc, 764 - BIT(HDMI_COLORSPACE_RGB), 764 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 765 765 8); 766 766 KUNIT_EXPECT_EQ(test, ret, 0); 767 767 KUNIT_EXPECT_MEMEQ(test, ··· 794 794 &dummy_hdmi_funcs, 795 795 DRM_MODE_CONNECTOR_HDMIA, 796 796 &priv->ddc, 797 - BIT(HDMI_COLORSPACE_RGB), 797 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 798 798 8); 799 799 KUNIT_EXPECT_EQ(test, ret, 0); 800 800 KUNIT_EXPECT_MEMEQ(test, ··· 821 821 &dummy_hdmi_funcs, 822 822 DRM_MODE_CONNECTOR_HDMIA, 823 823 &priv->ddc, 824 - BIT(HDMI_COLORSPACE_RGB), 824 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 825 825 8); 826 826 KUNIT_EXPECT_LT(test, ret, 0); 827 827 } ··· 847 847 &dummy_hdmi_funcs, 848 848 DRM_MODE_CONNECTOR_HDMIA, 849 849 &priv->ddc, 850 - BIT(HDMI_COLORSPACE_RGB), 850 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 851 851 8); 852 852 KUNIT_EXPECT_EQ(test, ret, 0); 853 853 KUNIT_EXPECT_MEMEQ(test, ··· 879 879 &dummy_hdmi_funcs, 880 880 DRM_MODE_CONNECTOR_HDMIA, 881 881 &priv->ddc, 882 - BIT(HDMI_COLORSPACE_RGB), 882 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 883 883 8); 884 884 KUNIT_EXPECT_EQ(test, ret, 0); 885 885 KUNIT_EXPECT_MEMEQ(test, ··· 906 906 &dummy_hdmi_funcs, 907 907 DRM_MODE_CONNECTOR_HDMIA, 908 908 &priv->ddc, 909 - BIT(HDMI_COLORSPACE_RGB), 909 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 910 910 8); 911 911 KUNIT_EXPECT_LT(test, ret, 0); 912 912 } ··· 926 926 &dummy_hdmi_funcs, 927 927 DRM_MODE_CONNECTOR_HDMIA, 928 928 &priv->ddc, 929 - BIT(HDMI_COLORSPACE_RGB), 929 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 930 930 9); 931 931 KUNIT_EXPECT_LT(test, ret, 0); 932 932 } ··· 946 946 &dummy_hdmi_funcs, 947 947 DRM_MODE_CONNECTOR_HDMIA, 948 948 &priv->ddc, 949 - BIT(HDMI_COLORSPACE_RGB), 949 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 950 950 0); 951 951 KUNIT_EXPECT_LT(test, ret, 0); 952 952 } ··· 971 971 &dummy_hdmi_funcs, 972 972 DRM_MODE_CONNECTOR_HDMIA, 973 973 &priv->ddc, 974 - BIT(HDMI_COLORSPACE_RGB), 974 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 975 975 8); 976 976 KUNIT_EXPECT_EQ(test, ret, 0); 977 977 ··· 1012 1012 &dummy_hdmi_funcs, 1013 1013 DRM_MODE_CONNECTOR_HDMIA, 1014 1014 &priv->ddc, 1015 - BIT(HDMI_COLORSPACE_RGB), 1015 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1016 1016 10); 1017 1017 KUNIT_EXPECT_EQ(test, ret, 0); 1018 1018 ··· 1053 1053 &dummy_hdmi_funcs, 1054 1054 DRM_MODE_CONNECTOR_HDMIA, 1055 1055 &priv->ddc, 1056 - BIT(HDMI_COLORSPACE_RGB), 1056 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1057 1057 12); 1058 1058 KUNIT_EXPECT_EQ(test, ret, 0); 1059 1059 ··· 1109 1109 &dummy_hdmi_funcs, 1110 1110 DRM_MODE_CONNECTOR_HDMIA, 1111 1111 &priv->ddc, 1112 - BIT(HDMI_COLORSPACE_YUV422), 1112 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422), 1113 1113 8); 1114 1114 KUNIT_EXPECT_LT(test, ret, 0); 1115 1115 } ··· 1122 1122 1123 1123 #define YUV420_ALLOWED_TEST(_formats, _allowed, _result) \ 1124 1124 { \ 1125 - .supported_formats = BIT(HDMI_COLORSPACE_RGB) | (_formats), \ 1125 + .supported_formats = BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | (_formats), \ 1126 1126 .yuv420_allowed = _allowed, \ 1127 1127 .expected_result = _result, \ 1128 1128 } 1129 1129 1130 1130 static const struct drm_connector_hdmi_init_formats_yuv420_allowed_test 1131 1131 drm_connector_hdmi_init_formats_yuv420_allowed_tests[] = { 1132 - YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV420), true, 0), 1133 - YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV420), false, -EINVAL), 1134 - YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV422), true, -EINVAL), 1135 - YUV420_ALLOWED_TEST(BIT(HDMI_COLORSPACE_YUV422), false, 0), 1132 + YUV420_ALLOWED_TEST(BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420), true, 0), 1133 + YUV420_ALLOWED_TEST(BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420), false, -EINVAL), 1134 + YUV420_ALLOWED_TEST(BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422), true, -EINVAL), 1135 + YUV420_ALLOWED_TEST(BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422), false, 0), 1136 1136 }; 1137 1137 1138 1138 static void ··· 1188 1188 &dummy_hdmi_funcs, 1189 1189 connector_type, 1190 1190 &priv->ddc, 1191 - BIT(HDMI_COLORSPACE_RGB), 1191 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1192 1192 8); 1193 1193 KUNIT_EXPECT_EQ(test, ret, 0); 1194 1194 } ··· 1223 1223 &dummy_hdmi_funcs, 1224 1224 connector_type, 1225 1225 &priv->ddc, 1226 - BIT(HDMI_COLORSPACE_RGB), 1226 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1227 1227 8); 1228 1228 KUNIT_EXPECT_LT(test, ret, 0); 1229 1229 } ··· 1432 1432 static const 1433 1433 struct drm_hdmi_connector_get_output_format_name_test 1434 1434 drm_hdmi_connector_get_output_format_name_valid_tests[] = { 1435 - OUTPUT_FORMAT_TEST(HDMI_COLORSPACE_RGB, "RGB"), 1436 - OUTPUT_FORMAT_TEST(HDMI_COLORSPACE_YUV420, "YUV 4:2:0"), 1437 - OUTPUT_FORMAT_TEST(HDMI_COLORSPACE_YUV422, "YUV 4:2:2"), 1438 - OUTPUT_FORMAT_TEST(HDMI_COLORSPACE_YUV444, "YUV 4:4:4"), 1435 + OUTPUT_FORMAT_TEST(DRM_OUTPUT_COLOR_FORMAT_RGB444, "RGB"), 1436 + OUTPUT_FORMAT_TEST(DRM_OUTPUT_COLOR_FORMAT_YCBCR420, "YUV 4:2:0"), 1437 + OUTPUT_FORMAT_TEST(DRM_OUTPUT_COLOR_FORMAT_YCBCR422, "YUV 4:2:2"), 1438 + OUTPUT_FORMAT_TEST(DRM_OUTPUT_COLOR_FORMAT_YCBCR444, "YUV 4:4:4"), 1439 1439 }; 1440 1440 1441 1441 static void ··· 1500 1500 &dummy_hdmi_funcs, 1501 1501 DRM_MODE_CONNECTOR_HDMIA, 1502 1502 &priv->ddc, 1503 - BIT(HDMI_COLORSPACE_RGB), 1503 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1504 1504 8); 1505 1505 KUNIT_EXPECT_EQ(test, ret, 0); 1506 1506 ··· 1540 1540 1541 1541 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); 1542 1542 1543 - rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); 1543 + rate = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1544 1544 KUNIT_ASSERT_GT(test, rate, 0); 1545 1545 KUNIT_EXPECT_EQ(test, mode->clock * 1000ULL, rate); 1546 1546 } ··· 1561 1561 1562 1562 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); 1563 1563 1564 - rate = drm_hdmi_compute_mode_clock(mode, 10, HDMI_COLORSPACE_RGB); 1564 + rate = drm_hdmi_compute_mode_clock(mode, 10, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1565 1565 KUNIT_ASSERT_GT(test, rate, 0); 1566 1566 KUNIT_EXPECT_EQ(test, mode->clock * 1250, rate); 1567 1567 } ··· 1580 1580 mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); 1581 1581 KUNIT_ASSERT_NOT_NULL(test, mode); 1582 1582 1583 - rate = drm_hdmi_compute_mode_clock(mode, 10, HDMI_COLORSPACE_RGB); 1583 + rate = drm_hdmi_compute_mode_clock(mode, 10, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1584 1584 KUNIT_EXPECT_EQ(test, rate, 0); 1585 1585 } 1586 1586 ··· 1600 1600 1601 1601 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); 1602 1602 1603 - rate = drm_hdmi_compute_mode_clock(mode, 12, HDMI_COLORSPACE_RGB); 1603 + rate = drm_hdmi_compute_mode_clock(mode, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1604 1604 KUNIT_ASSERT_GT(test, rate, 0); 1605 1605 KUNIT_EXPECT_EQ(test, mode->clock * 1500, rate); 1606 1606 } ··· 1619 1619 mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); 1620 1620 KUNIT_ASSERT_NOT_NULL(test, mode); 1621 1621 1622 - rate = drm_hdmi_compute_mode_clock(mode, 12, HDMI_COLORSPACE_RGB); 1622 + rate = drm_hdmi_compute_mode_clock(mode, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1623 1623 KUNIT_EXPECT_EQ(test, rate, 0); 1624 1624 } 1625 1625 ··· 1639 1639 1640 1640 KUNIT_ASSERT_TRUE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); 1641 1641 1642 - rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_RGB); 1642 + rate = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1643 1643 KUNIT_ASSERT_GT(test, rate, 0); 1644 1644 KUNIT_EXPECT_EQ(test, (mode->clock * 1000ULL) * 2, rate); 1645 1645 } ··· 1662 1662 1663 1663 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); 1664 1664 1665 - rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_YUV420); 1665 + rate = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 1666 1666 KUNIT_ASSERT_GT(test, rate, 0); 1667 1667 KUNIT_EXPECT_EQ(test, (mode->clock * 1000ULL) / 2, rate); 1668 1668 } ··· 1699 1699 1700 1700 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); 1701 1701 1702 - rate = drm_hdmi_compute_mode_clock(mode, 10, HDMI_COLORSPACE_YUV420); 1702 + rate = drm_hdmi_compute_mode_clock(mode, 10, DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 1703 1703 KUNIT_ASSERT_GT(test, rate, 0); 1704 1704 1705 1705 KUNIT_EXPECT_EQ(test, mode->clock * 625, rate); ··· 1724 1724 1725 1725 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); 1726 1726 1727 - rate = drm_hdmi_compute_mode_clock(mode, 12, HDMI_COLORSPACE_YUV420); 1727 + rate = drm_hdmi_compute_mode_clock(mode, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 1728 1728 KUNIT_ASSERT_GT(test, rate, 0); 1729 1729 1730 1730 KUNIT_EXPECT_EQ(test, mode->clock * 750, rate); ··· 1747 1747 1748 1748 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); 1749 1749 1750 - rate = drm_hdmi_compute_mode_clock(mode, 8, HDMI_COLORSPACE_YUV422); 1750 + rate = drm_hdmi_compute_mode_clock(mode, 8, DRM_OUTPUT_COLOR_FORMAT_YCBCR422); 1751 1751 KUNIT_ASSERT_GT(test, rate, 0); 1752 1752 KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate); 1753 1753 } ··· 1769 1769 1770 1770 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); 1771 1771 1772 - rate = drm_hdmi_compute_mode_clock(mode, 10, HDMI_COLORSPACE_YUV422); 1772 + rate = drm_hdmi_compute_mode_clock(mode, 10, DRM_OUTPUT_COLOR_FORMAT_YCBCR422); 1773 1773 KUNIT_ASSERT_GT(test, rate, 0); 1774 1774 KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate); 1775 1775 } ··· 1791 1791 1792 1792 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); 1793 1793 1794 - rate = drm_hdmi_compute_mode_clock(mode, 12, HDMI_COLORSPACE_YUV422); 1794 + rate = drm_hdmi_compute_mode_clock(mode, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR422); 1795 1795 KUNIT_ASSERT_GT(test, rate, 0); 1796 1796 KUNIT_EXPECT_EQ(test, mode->clock * 1000, rate); 1797 1797 }
+91 -91
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
··· 239 239 enc->possible_crtcs = drm_crtc_mask(priv->crtc); 240 240 241 241 conn = &priv->connector; 242 - conn->ycbcr_420_allowed = !!(formats & BIT(HDMI_COLORSPACE_YUV420)); 242 + conn->ycbcr_420_allowed = !!(formats & BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420)); 243 243 244 244 ret = drmm_connector_hdmi_init(drm, conn, 245 245 "Vendor", "Product", ··· 300 300 int ret; 301 301 302 302 priv = drm_kunit_helper_connector_hdmi_init(test, 303 - BIT(HDMI_COLORSPACE_RGB), 303 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 304 304 8); 305 305 KUNIT_ASSERT_NOT_NULL(test, priv); 306 306 ··· 375 375 int ret; 376 376 377 377 priv = drm_kunit_helper_connector_hdmi_init(test, 378 - BIT(HDMI_COLORSPACE_RGB), 378 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 379 379 8); 380 380 KUNIT_ASSERT_NOT_NULL(test, priv); 381 381 ··· 450 450 int ret; 451 451 452 452 priv = drm_kunit_helper_connector_hdmi_init(test, 453 - BIT(HDMI_COLORSPACE_RGB), 453 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 454 454 8); 455 455 KUNIT_ASSERT_NOT_NULL(test, priv); 456 456 ··· 517 517 int ret; 518 518 519 519 priv = drm_kunit_helper_connector_hdmi_init(test, 520 - BIT(HDMI_COLORSPACE_RGB), 520 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 521 521 8); 522 522 KUNIT_ASSERT_NOT_NULL(test, priv); 523 523 ··· 584 584 int ret; 585 585 586 586 priv = drm_kunit_helper_connector_hdmi_init(test, 587 - BIT(HDMI_COLORSPACE_RGB), 587 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 588 588 8); 589 589 KUNIT_ASSERT_NOT_NULL(test, priv); 590 590 ··· 653 653 int ret; 654 654 655 655 priv = drm_kunit_helper_connector_hdmi_init(test, 656 - BIT(HDMI_COLORSPACE_RGB), 656 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 657 657 8); 658 658 KUNIT_ASSERT_NOT_NULL(test, priv); 659 659 ··· 722 722 int ret; 723 723 724 724 priv = drm_kunit_helper_connector_hdmi_init(test, 725 - BIT(HDMI_COLORSPACE_RGB), 725 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 726 726 8); 727 727 KUNIT_ASSERT_NOT_NULL(test, priv); 728 728 ··· 791 791 int ret; 792 792 793 793 priv = drm_kunit_helper_connector_hdmi_init(test, 794 - BIT(HDMI_COLORSPACE_RGB), 794 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 795 795 8); 796 796 KUNIT_ASSERT_NOT_NULL(test, priv); 797 797 ··· 863 863 broadcast_rgb = *(enum drm_hdmi_broadcast_rgb *)test->param_value; 864 864 865 865 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 866 - BIT(HDMI_COLORSPACE_RGB) | 867 - BIT(HDMI_COLORSPACE_YUV420), 866 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | 867 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420), 868 868 8, 869 869 &dummy_connector_hdmi_funcs, 870 870 test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); ··· 918 918 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, conn_state); 919 919 920 920 KUNIT_ASSERT_EQ(test, conn_state->hdmi.broadcast_rgb, broadcast_rgb); 921 - KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_YUV420); 921 + KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 922 922 923 923 KUNIT_EXPECT_TRUE(test, conn_state->hdmi.is_limited_range); 924 924 ··· 963 963 int ret; 964 964 965 965 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 966 - BIT(HDMI_COLORSPACE_RGB), 966 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 967 967 10, 968 968 &dummy_connector_hdmi_funcs, 969 969 test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); ··· 1045 1045 int ret; 1046 1046 1047 1047 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1048 - BIT(HDMI_COLORSPACE_RGB), 1048 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1049 1049 10, 1050 1050 &dummy_connector_hdmi_funcs, 1051 1051 test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); ··· 1122 1122 int ret; 1123 1123 1124 1124 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1125 - BIT(HDMI_COLORSPACE_RGB) | 1126 - BIT(HDMI_COLORSPACE_YUV422) | 1127 - BIT(HDMI_COLORSPACE_YUV444), 1125 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | 1126 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | 1127 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), 1128 1128 12, 1129 1129 &dummy_connector_hdmi_funcs, 1130 1130 test_edid_dvi_1080p); ··· 1157 1157 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1158 1158 1159 1159 KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 8); 1160 - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 1160 + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1161 1161 1162 1162 drm_modeset_drop_locks(&ctx); 1163 1163 drm_modeset_acquire_fini(&ctx); ··· 1179 1179 int ret; 1180 1180 1181 1181 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1182 - BIT(HDMI_COLORSPACE_RGB), 1182 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1183 1183 8, 1184 1184 &dummy_connector_hdmi_funcs, 1185 1185 test_edid_hdmi_1080p_rgb_max_200mhz); ··· 1210 1210 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1211 1211 1212 1212 KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_bpc, 8); 1213 - KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 1213 + KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1214 1214 KUNIT_EXPECT_EQ(test, conn_state->hdmi.tmds_char_rate, preferred->clock * 1000); 1215 1215 1216 1216 drm_modeset_drop_locks(&ctx); ··· 1234 1234 int ret; 1235 1235 1236 1236 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1237 - BIT(HDMI_COLORSPACE_RGB), 1237 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1238 1238 10, 1239 1239 &dummy_connector_hdmi_funcs, 1240 1240 test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz); ··· 1265 1265 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1266 1266 1267 1267 KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_bpc, 10); 1268 - KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 1268 + KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1269 1269 KUNIT_EXPECT_EQ(test, conn_state->hdmi.tmds_char_rate, preferred->clock * 1250); 1270 1270 1271 1271 drm_modeset_drop_locks(&ctx); ··· 1289 1289 int ret; 1290 1290 1291 1291 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1292 - BIT(HDMI_COLORSPACE_RGB), 1292 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1293 1293 12, 1294 1294 &dummy_connector_hdmi_funcs, 1295 1295 test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz); ··· 1320 1320 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1321 1321 1322 1322 KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_bpc, 12); 1323 - KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 1323 + KUNIT_ASSERT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1324 1324 KUNIT_EXPECT_EQ(test, conn_state->hdmi.tmds_char_rate, preferred->clock * 1500); 1325 1325 1326 1326 drm_modeset_drop_locks(&ctx); ··· 1348 1348 int ret; 1349 1349 1350 1350 priv = drm_kunit_helper_connector_hdmi_init(test, 1351 - BIT(HDMI_COLORSPACE_RGB), 1351 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1352 1352 8); 1353 1353 KUNIT_ASSERT_NOT_NULL(test, priv); 1354 1354 ··· 1416 1416 int ret; 1417 1417 1418 1418 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1419 - BIT(HDMI_COLORSPACE_RGB), 1419 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1420 1420 12, 1421 1421 &dummy_connector_hdmi_funcs, 1422 1422 test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); ··· 1433 1433 KUNIT_ASSERT_NOT_NULL(test, preferred); 1434 1434 KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK); 1435 1435 1436 - rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB); 1436 + rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1437 1437 KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000); 1438 1438 1439 - rate = drm_hdmi_compute_mode_clock(preferred, 10, HDMI_COLORSPACE_RGB); 1439 + rate = drm_hdmi_compute_mode_clock(preferred, 10, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1440 1440 KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); 1441 1441 1442 1442 drm_modeset_acquire_init(&ctx, 0); ··· 1457 1457 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1458 1458 1459 1459 KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 10); 1460 - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 1460 + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1461 1461 KUNIT_EXPECT_EQ(test, conn_state->hdmi.tmds_char_rate, preferred->clock * 1250); 1462 1462 1463 1463 drm_modeset_drop_locks(&ctx); ··· 1490 1490 int ret; 1491 1491 1492 1492 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1493 - BIT(HDMI_COLORSPACE_RGB) | 1494 - BIT(HDMI_COLORSPACE_YUV420), 1493 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | 1494 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420), 1495 1495 12, 1496 1496 &dummy_connector_hdmi_funcs, 1497 1497 test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); ··· 1509 1509 KUNIT_ASSERT_NOT_NULL(test, yuv420_only_mode); 1510 1510 KUNIT_ASSERT_TRUE(test, drm_mode_is_420_only(info, yuv420_only_mode)); 1511 1511 1512 - rate = drm_hdmi_compute_mode_clock(yuv420_only_mode, 12, HDMI_COLORSPACE_YUV420); 1512 + rate = drm_hdmi_compute_mode_clock(yuv420_only_mode, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 1513 1513 KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000); 1514 1514 1515 - rate = drm_hdmi_compute_mode_clock(yuv420_only_mode, 10, HDMI_COLORSPACE_YUV420); 1515 + rate = drm_hdmi_compute_mode_clock(yuv420_only_mode, 10, DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 1516 1516 KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); 1517 1517 1518 1518 drm_modeset_acquire_init(&ctx, 0); ··· 1531 1531 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1532 1532 1533 1533 KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 10); 1534 - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_YUV420); 1534 + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 1535 1535 KUNIT_EXPECT_EQ(test, conn_state->hdmi.tmds_char_rate, yuv420_only_mode->clock * 625); 1536 1536 1537 1537 drm_modeset_drop_locks(&ctx); ··· 1565 1565 int ret; 1566 1566 1567 1567 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1568 - BIT(HDMI_COLORSPACE_RGB) | 1569 - BIT(HDMI_COLORSPACE_YUV422) | 1570 - BIT(HDMI_COLORSPACE_YUV444), 1568 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | 1569 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | 1570 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), 1571 1571 12, 1572 1572 &dummy_connector_hdmi_funcs, 1573 1573 test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); ··· 1584 1584 KUNIT_ASSERT_NOT_NULL(test, preferred); 1585 1585 KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK); 1586 1586 1587 - rate = drm_hdmi_compute_mode_clock(preferred, 10, HDMI_COLORSPACE_RGB); 1587 + rate = drm_hdmi_compute_mode_clock(preferred, 10, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1588 1588 KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); 1589 1589 1590 - rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB); 1590 + rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1591 1591 KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000); 1592 1592 1593 - rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422); 1593 + rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR422); 1594 1594 KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); 1595 1595 1596 1596 drm_modeset_acquire_init(&ctx, 0); ··· 1611 1611 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1612 1612 1613 1613 KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 10); 1614 - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 1614 + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1615 1615 1616 1616 drm_modeset_drop_locks(&ctx); 1617 1617 drm_modeset_acquire_fini(&ctx); ··· 1644 1644 int ret; 1645 1645 1646 1646 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1647 - BIT(HDMI_COLORSPACE_RGB) | 1648 - BIT(HDMI_COLORSPACE_YUV420), 1647 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | 1648 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR420), 1649 1649 12, 1650 1650 &dummy_connector_hdmi_funcs, 1651 1651 test_edid_hdmi_4k_rgb_yuv420_dc_max_340mhz); ··· 1664 1664 KUNIT_ASSERT_FALSE(test, preferred->flags & DRM_MODE_FLAG_DBLCLK); 1665 1665 KUNIT_ASSERT_TRUE(test, drm_mode_is_420_also(info, preferred)); 1666 1666 1667 - rate = drm_hdmi_compute_mode_clock(preferred, 8, HDMI_COLORSPACE_RGB); 1667 + rate = drm_hdmi_compute_mode_clock(preferred, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1668 1668 KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); 1669 1669 1670 - rate = drm_hdmi_compute_mode_clock(preferred, 10, HDMI_COLORSPACE_RGB); 1670 + rate = drm_hdmi_compute_mode_clock(preferred, 10, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1671 1671 KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000); 1672 1672 1673 - rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV420); 1673 + rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR420); 1674 1674 KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); 1675 1675 1676 1676 drm_modeset_acquire_init(&ctx, 0); ··· 1689 1689 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1690 1690 1691 1691 KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 8); 1692 - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 1692 + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1693 1693 1694 1694 drm_modeset_drop_locks(&ctx); 1695 1695 drm_modeset_acquire_fini(&ctx); ··· 1715 1715 int ret; 1716 1716 1717 1717 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1718 - BIT(HDMI_COLORSPACE_RGB), 1718 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1719 1719 12, 1720 1720 &dummy_connector_hdmi_funcs, 1721 1721 test_edid_hdmi_1080p_rgb_yuv_4k_yuv420_dc_max_200mhz); ··· 1750 1750 1751 1751 conn_state = conn->state; 1752 1752 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1753 - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 1753 + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1754 1754 1755 1755 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); 1756 1756 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, state); ··· 1800 1800 int ret; 1801 1801 1802 1802 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1803 - BIT(HDMI_COLORSPACE_RGB) | 1804 - BIT(HDMI_COLORSPACE_YUV422) | 1805 - BIT(HDMI_COLORSPACE_YUV444), 1803 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | 1804 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | 1805 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), 1806 1806 12, 1807 1807 &dummy_connector_hdmi_funcs, 1808 1808 test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); ··· 1847 1847 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1848 1848 1849 1849 KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 8); 1850 - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 1850 + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1851 1851 1852 1852 drm_modeset_drop_locks(&ctx); 1853 1853 drm_modeset_acquire_fini(&ctx); ··· 1871 1871 int ret; 1872 1872 1873 1873 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1874 - BIT(HDMI_COLORSPACE_RGB), 1874 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 1875 1875 12, 1876 1876 &dummy_connector_hdmi_funcs, 1877 1877 test_edid_hdmi_1080p_rgb_yuv_dc_max_200mhz); ··· 1896 1896 * But since the driver only supports RGB, we should fallback to 1897 1897 * a lower bpc with RGB. 1898 1898 */ 1899 - rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB); 1899 + rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1900 1900 KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000); 1901 1901 1902 - rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422); 1902 + rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR422); 1903 1903 KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); 1904 1904 1905 1905 drm_modeset_acquire_init(&ctx, 0); ··· 1920 1920 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1921 1921 1922 1922 KUNIT_EXPECT_LT(test, conn_state->hdmi.output_bpc, 12); 1923 - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 1923 + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1924 1924 1925 1925 drm_modeset_drop_locks(&ctx); 1926 1926 drm_modeset_acquire_fini(&ctx); ··· 1944 1944 int ret; 1945 1945 1946 1946 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 1947 - BIT(HDMI_COLORSPACE_RGB) | 1948 - BIT(HDMI_COLORSPACE_YUV422) | 1949 - BIT(HDMI_COLORSPACE_YUV444), 1947 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | 1948 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | 1949 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), 1950 1950 12, 1951 1951 &dummy_connector_hdmi_funcs, 1952 1952 test_edid_hdmi_1080p_rgb_max_200mhz); ··· 1971 1971 * But since the display only supports RGB, we should fallback to 1972 1972 * a lower bpc with RGB. 1973 1973 */ 1974 - rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB); 1974 + rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1975 1975 KUNIT_ASSERT_GT(test, rate, info->max_tmds_clock * 1000); 1976 1976 1977 - rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_YUV422); 1977 + rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_YCBCR422); 1978 1978 KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); 1979 1979 1980 1980 drm_modeset_acquire_init(&ctx, 0); ··· 1995 1995 KUNIT_ASSERT_NOT_NULL(test, conn_state); 1996 1996 1997 1997 KUNIT_EXPECT_LT(test, conn_state->hdmi.output_bpc, 12); 1998 - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 1998 + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 1999 1999 2000 2000 drm_modeset_drop_locks(&ctx); 2001 2001 drm_modeset_acquire_fini(&ctx); ··· 2020 2020 int ret; 2021 2021 2022 2022 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 2023 - BIT(HDMI_COLORSPACE_RGB), 2023 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2024 2024 8, 2025 2025 &dummy_connector_hdmi_funcs, 2026 2026 test_edid_hdmi_1080p_rgb_yuv_dc_max_340mhz); ··· 2040 2040 * We're making sure that we have headroom on the TMDS character 2041 2041 * clock to actually use 12bpc. 2042 2042 */ 2043 - rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB); 2043 + rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444); 2044 2044 KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); 2045 2045 2046 2046 drm_modeset_acquire_init(&ctx, 0); ··· 2061 2061 KUNIT_ASSERT_NOT_NULL(test, conn_state); 2062 2062 2063 2063 KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 8); 2064 - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 2064 + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 2065 2065 2066 2066 drm_modeset_drop_locks(&ctx); 2067 2067 drm_modeset_acquire_fini(&ctx); ··· 2086 2086 int ret; 2087 2087 2088 2088 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 2089 - BIT(HDMI_COLORSPACE_RGB) | 2090 - BIT(HDMI_COLORSPACE_YUV422) | 2091 - BIT(HDMI_COLORSPACE_YUV444), 2089 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | 2090 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | 2091 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), 2092 2092 12, 2093 2093 &dummy_connector_hdmi_funcs, 2094 2094 test_edid_hdmi_1080p_rgb_max_340mhz); ··· 2108 2108 * We're making sure that we have headroom on the TMDS character 2109 2109 * clock to actually use 12bpc. 2110 2110 */ 2111 - rate = drm_hdmi_compute_mode_clock(preferred, 12, HDMI_COLORSPACE_RGB); 2111 + rate = drm_hdmi_compute_mode_clock(preferred, 12, DRM_OUTPUT_COLOR_FORMAT_RGB444); 2112 2112 KUNIT_ASSERT_LT(test, rate, info->max_tmds_clock * 1000); 2113 2113 2114 2114 drm_modeset_acquire_init(&ctx, 0); ··· 2129 2129 KUNIT_ASSERT_NOT_NULL(test, conn_state); 2130 2130 2131 2131 KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_bpc, 8); 2132 - KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, HDMI_COLORSPACE_RGB); 2132 + KUNIT_EXPECT_EQ(test, conn_state->hdmi.output_format, DRM_OUTPUT_COLOR_FORMAT_RGB444); 2133 2133 2134 2134 drm_modeset_drop_locks(&ctx); 2135 2135 drm_modeset_acquire_fini(&ctx); ··· 2150 2150 int ret; 2151 2151 2152 2152 priv = drm_kunit_helper_connector_hdmi_init(test, 2153 - BIT(HDMI_COLORSPACE_RGB), 2153 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2154 2154 8); 2155 2155 KUNIT_ASSERT_NOT_NULL(test, priv); 2156 2156 ··· 2255 2255 struct drm_connector *conn; 2256 2256 2257 2257 priv = drm_kunit_helper_connector_hdmi_init(test, 2258 - BIT(HDMI_COLORSPACE_RGB), 2258 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2259 2259 8); 2260 2260 KUNIT_ASSERT_NOT_NULL(test, priv); 2261 2261 ··· 2277 2277 struct drm_connector *conn; 2278 2278 2279 2279 priv = drm_kunit_helper_connector_hdmi_init(test, 2280 - BIT(HDMI_COLORSPACE_RGB), 2280 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2281 2281 8); 2282 2282 KUNIT_ASSERT_NOT_NULL(test, priv); 2283 2283 ··· 2301 2301 struct drm_connector *conn; 2302 2302 2303 2303 priv = drm_kunit_helper_connector_hdmi_init(test, 2304 - BIT(HDMI_COLORSPACE_RGB), 2304 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2305 2305 10); 2306 2306 KUNIT_ASSERT_NOT_NULL(test, priv); 2307 2307 ··· 2325 2325 struct drm_connector *conn; 2326 2326 2327 2327 priv = drm_kunit_helper_connector_hdmi_init(test, 2328 - BIT(HDMI_COLORSPACE_RGB), 2328 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2329 2329 12); 2330 2330 KUNIT_ASSERT_NOT_NULL(test, priv); 2331 2331 ··· 2347 2347 struct drm_connector *conn; 2348 2348 2349 2349 priv = drm_kunit_helper_connector_hdmi_init(test, 2350 - BIT(HDMI_COLORSPACE_RGB) | 2351 - BIT(HDMI_COLORSPACE_YUV422) | 2352 - BIT(HDMI_COLORSPACE_YUV444), 2350 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | 2351 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | 2352 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), 2353 2353 8); 2354 2354 KUNIT_ASSERT_NOT_NULL(test, priv); 2355 2355 ··· 2369 2369 struct drm_connector *conn; 2370 2370 2371 2371 priv = drm_kunit_helper_connector_hdmi_init(test, 2372 - BIT(HDMI_COLORSPACE_RGB) | 2373 - BIT(HDMI_COLORSPACE_YUV422) | 2374 - BIT(HDMI_COLORSPACE_YUV444), 2372 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | 2373 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | 2374 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), 2375 2375 12); 2376 2376 KUNIT_ASSERT_NOT_NULL(test, priv); 2377 2377 ··· 2407 2407 struct drm_display_mode *preferred; 2408 2408 2409 2409 priv = drm_kunit_helper_connector_hdmi_init(test, 2410 - BIT(HDMI_COLORSPACE_RGB), 2410 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2411 2411 8); 2412 2412 KUNIT_ASSERT_NOT_NULL(test, priv); 2413 2413 ··· 2431 2431 struct drm_display_mode *preferred; 2432 2432 2433 2433 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 2434 - BIT(HDMI_COLORSPACE_RGB), 2434 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2435 2435 8, 2436 2436 &reject_100mhz_connector_hdmi_funcs, 2437 2437 test_edid_hdmi_1080p_rgb_max_200mhz); ··· 2463 2463 int ret; 2464 2464 2465 2465 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 2466 - BIT(HDMI_COLORSPACE_RGB), 2466 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2467 2467 8, 2468 2468 &reject_connector_hdmi_funcs, 2469 2469 no_edid); ··· 2493 2493 struct drm_display_mode *preferred; 2494 2494 2495 2495 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 2496 - BIT(HDMI_COLORSPACE_RGB), 2496 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2497 2497 8, 2498 2498 &dummy_connector_hdmi_funcs, 2499 2499 test_edid_hdmi_1080p_rgb_max_100mhz); ··· 2540 2540 int ret; 2541 2541 2542 2542 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 2543 - BIT(HDMI_COLORSPACE_RGB), 2543 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2544 2544 8, 2545 2545 &dummy_connector_hdmi_funcs, 2546 2546 test_edid_hdmi_1080p_rgb_max_200mhz); ··· 2643 2643 int ret; 2644 2644 2645 2645 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 2646 - BIT(HDMI_COLORSPACE_RGB), 2646 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2647 2647 8, 2648 2648 &reject_avi_infoframe_hdmi_funcs, 2649 2649 test_edid_hdmi_1080p_rgb_max_200mhz); ··· 2747 2747 int ret; 2748 2748 2749 2749 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 2750 - BIT(HDMI_COLORSPACE_RGB), 2750 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2751 2751 8, 2752 2752 &reject_hdr_infoframe_hdmi_funcs, 2753 2753 test_edid_hdmi_1080p_rgb_max_200mhz_hdr); ··· 2861 2861 int ret; 2862 2862 2863 2863 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 2864 - BIT(HDMI_COLORSPACE_RGB), 2864 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 2865 2865 10, 2866 2866 &reject_hdr_infoframe_hdmi_funcs, 2867 2867 test_edid_hdmi_1080p_rgb_max_200mhz_hdr); ··· 2996 2996 int ret; 2997 2997 2998 2998 priv = drm_kunit_helper_connector_hdmi_init_with_edid_funcs(test, 2999 - BIT(HDMI_COLORSPACE_RGB), 2999 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444), 3000 3000 8, 3001 3001 &reject_audio_infoframe_hdmi_funcs, 3002 3002 test_edid_hdmi_1080p_rgb_max_200mhz);
+9 -9
drivers/gpu/drm/vc4/vc4_hdmi.c
··· 133 133 134 134 static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode, 135 135 unsigned int bpc, 136 - enum hdmi_colorspace fmt) 136 + enum drm_output_color_format fmt) 137 137 { 138 138 unsigned long long clock = drm_hdmi_compute_mode_clock(mode, bpc, fmt); 139 139 ··· 444 444 const struct drm_display_mode *mode; 445 445 446 446 list_for_each_entry(mode, &connector->probed_modes, head) { 447 - if (vc4_hdmi_mode_needs_scrambling(mode, 8, HDMI_COLORSPACE_RGB)) { 447 + if (vc4_hdmi_mode_needs_scrambling(mode, 8, DRM_OUTPUT_COLOR_FORMAT_RGB444)) { 448 448 drm_warn_once(drm, "The core clock cannot reach frequencies high enough to support 4k @ 60Hz."); 449 449 drm_warn_once(drm, "Please change your config.txt file to add hdmi_enable_4kp60."); 450 450 } ··· 547 547 &vc4_hdmi_hdmi_connector_funcs, 548 548 DRM_MODE_CONNECTOR_HDMIA, 549 549 vc4_hdmi->ddc, 550 - BIT(HDMI_COLORSPACE_RGB) | 551 - BIT(HDMI_COLORSPACE_YUV422) | 552 - BIT(HDMI_COLORSPACE_YUV444), 550 + BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444) | 551 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422) | 552 + BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444), 553 553 max_bpc); 554 554 if (ret) 555 555 return ret; ··· 1214 1214 spin_lock_irqsave(&vc4_hdmi->hw_lock, flags); 1215 1215 1216 1216 switch (state->hdmi.output_format) { 1217 - case HDMI_COLORSPACE_YUV444: 1217 + case DRM_OUTPUT_COLOR_FORMAT_YCBCR444: 1218 1218 csc = vc5_hdmi_find_yuv_csc_coeffs(vc4_hdmi, state->colorspace, !!lim_range); 1219 1219 1220 1220 vc5_hdmi_set_csc_coeffs_swap(vc4_hdmi, csc); 1221 1221 break; 1222 1222 1223 - case HDMI_COLORSPACE_YUV422: 1223 + case DRM_OUTPUT_COLOR_FORMAT_YCBCR422: 1224 1224 csc = vc5_hdmi_find_yuv_csc_coeffs(vc4_hdmi, state->colorspace, !!lim_range); 1225 1225 1226 1226 csc_ctl |= VC4_SET_FIELD(VC5_MT_CP_CSC_CTL_FILTER_MODE_444_TO_422_STANDARD, ··· 1237 1237 vc5_hdmi_set_csc_coeffs(vc4_hdmi, csc); 1238 1238 break; 1239 1239 1240 - case HDMI_COLORSPACE_RGB: 1240 + case DRM_OUTPUT_COLOR_FORMAT_RGB444: 1241 1241 if_xbar = 0x354021; 1242 1242 1243 1243 vc5_hdmi_set_csc_coeffs(vc4_hdmi, vc5_hdmi_csc_full_rgb_to_rgb[lim_range]); ··· 1394 1394 * YCC422 is always 36-bit and not considered deep colour so 1395 1395 * doesn't signal in GCP. 1396 1396 */ 1397 - if (state->hdmi.output_format == HDMI_COLORSPACE_YUV422) { 1397 + if (state->hdmi.output_format == DRM_OUTPUT_COLOR_FORMAT_YCBCR422) { 1398 1398 gcp = 0; 1399 1399 } 1400 1400
+1 -1
drivers/gpu/drm/vc4/vc4_hdmi.h
··· 210 210 * @drm_connector_state.hdmi.output_format for use outside of 211 211 * KMS hooks. Protected by @mutex. 212 212 */ 213 - enum hdmi_colorspace output_format; 213 + enum drm_output_color_format output_format; 214 214 215 215 /** 216 216 * @hdmi_jack: Represents the connection state of the HDMI plug, for
+1 -1
include/drm/bridge/dw_hdmi_qp.h
··· 25 25 int main_irq; 26 26 int cec_irq; 27 27 unsigned long ref_clk_rate; 28 - /* Supported output formats: bitmask of @hdmi_colorspace */ 28 + /* Supported output formats: bitmask of @drm_output_color_format */ 29 29 unsigned int supported_formats; 30 30 /* Maximum bits per color channel: 8, 10 or 12 */ 31 31 unsigned int max_bpc;
+2 -1
include/drm/display/drm_hdmi_helper.h
··· 8 8 struct drm_connector; 9 9 struct drm_connector_state; 10 10 struct drm_display_mode; 11 + enum drm_output_color_format; 11 12 12 13 void 13 14 drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame, ··· 27 26 28 27 unsigned long long 29 28 drm_hdmi_compute_mode_clock(const struct drm_display_mode *mode, 30 - unsigned int bpc, enum hdmi_colorspace fmt); 29 + unsigned int bpc, enum drm_output_color_format fmt); 31 30 32 31 void 33 32 drm_hdmi_acr_get_n_cts(unsigned long long tmds_char_rate,
+3 -2
include/drm/drm_bridge.h
··· 1188 1188 const char *product; 1189 1189 1190 1190 /** 1191 - * @supported_formats: Bitmask of @hdmi_colorspace listing supported 1192 - * output formats. This is only relevant if @DRM_BRIDGE_OP_HDMI is set. 1191 + * @supported_formats: Bitmask of @drm_output_color_format listing 1192 + * supported output formats. This is only relevant if 1193 + * @DRM_BRIDGE_OP_HDMI is set. 1193 1194 */ 1194 1195 unsigned int supported_formats; 1195 1196
+5 -4
include/drm/drm_connector.h
··· 402 402 403 403 const char * 404 404 drm_hdmi_connector_get_broadcast_rgb_name(enum drm_hdmi_broadcast_rgb broadcast_rgb); 405 - const char * 406 - drm_hdmi_connector_get_output_format_name(enum hdmi_colorspace fmt); 407 405 408 406 /** 409 407 * struct drm_monitor_range_info - Panel's Monitor range in EDID for ··· 578 580 DRM_OUTPUT_COLOR_FORMAT_YCBCR422, 579 581 DRM_OUTPUT_COLOR_FORMAT_YCBCR420, 580 582 }; 583 + 584 + const char * 585 + drm_hdmi_connector_get_output_format_name(enum drm_output_color_format fmt); 581 586 582 587 /** 583 588 * enum drm_bus_flags - bus_flags info for &drm_display_info ··· 1013 1012 /** 1014 1013 * @output_format: Pixel format to output in. 1015 1014 */ 1016 - enum hdmi_colorspace output_format; 1015 + enum drm_output_color_format output_format; 1017 1016 1018 1017 /** 1019 1018 * @tmds_char_rate: TMDS Character Rate, in Hz. ··· 1901 1900 unsigned char product[DRM_CONNECTOR_HDMI_PRODUCT_LEN] __nonstring; 1902 1901 1903 1902 /** 1904 - * @supported_formats: Bitmask of @hdmi_colorspace 1903 + * @supported_formats: Bitmask of @drm_output_color_format 1905 1904 * supported by the controller. 1906 1905 */ 1907 1906 unsigned long supported_formats;