dc_link_set_test_pattern(
                link,
                test_pattern,
+               DP_TEST_PATTERN_COLOR_SPACE_RGB,
                &link_training_settings,
                custom_pattern,
                10);
 
 
 void dc_link_set_test_pattern(struct dc_link *link,
                              enum dp_test_pattern test_pattern,
+                             enum dp_test_pattern_color_space test_pattern_color_space,
                              const struct link_training_settings *p_link_settings,
                              const unsigned char *p_custom_pattern,
                              unsigned int cust_pattern_size)
                dc_link_dp_set_test_pattern(
                        link,
                        test_pattern,
+                       test_pattern_color_space,
                        p_link_settings,
                        p_custom_pattern,
                        cust_pattern_size);
 
        dc_link_dp_set_test_pattern(
                link,
                test_pattern,
+               DP_TEST_PATTERN_COLOR_SPACE_UNDEFINED,
                &link_training_settings,
                test_80_bit_pattern,
                (DP_TEST_80BIT_CUSTOM_PATTERN_79_72 -
        union link_test_pattern dpcd_test_pattern;
        union test_misc dpcd_test_params;
        enum dp_test_pattern test_pattern;
+       enum dp_test_pattern_color_space test_pattern_color_space =
+                       DP_TEST_PATTERN_COLOR_SPACE_UNDEFINED;
 
        memset(&dpcd_test_pattern, 0, sizeof(dpcd_test_pattern));
        memset(&dpcd_test_params, 0, sizeof(dpcd_test_params));
        break;
        }
 
+       test_pattern_color_space = dpcd_test_params.bits.YCBCR_COEFS ?
+                       DP_TEST_PATTERN_COLOR_SPACE_YCBCR709 :
+                       DP_TEST_PATTERN_COLOR_SPACE_YCBCR601;
+
        dc_link_dp_set_test_pattern(
                        link,
                        test_pattern,
+                       test_pattern_color_space,
                        NULL,
                        NULL,
                        0);
 
 static void set_crtc_test_pattern(struct dc_link *link,
                                struct pipe_ctx *pipe_ctx,
-                               enum dp_test_pattern test_pattern)
+                               enum dp_test_pattern test_pattern,
+                               enum dp_test_pattern_color_space test_pattern_color_space)
 {
        enum controller_dp_test_pattern controller_test_pattern;
        enum dc_color_depth color_depth = pipe_ctx->
                                controller_test_pattern, color_depth);
                else if (opp->funcs->opp_set_disp_pattern_generator) {
                        struct pipe_ctx *odm_pipe;
+                       enum controller_dp_color_space controller_color_space;
                        int opp_cnt = 1;
 
+                       switch (test_pattern_color_space) {
+                       case DP_TEST_PATTERN_COLOR_SPACE_RGB:
+                               controller_color_space = CONTROLLER_DP_COLOR_SPACE_RGB;
+                               break;
+                       case DP_TEST_PATTERN_COLOR_SPACE_YCBCR601:
+                               controller_color_space = CONTROLLER_DP_COLOR_SPACE_YCBCR601;
+                               break;
+                       case DP_TEST_PATTERN_COLOR_SPACE_YCBCR709:
+                               controller_color_space = CONTROLLER_DP_COLOR_SPACE_YCBCR709;
+                               break;
+                       case DP_TEST_PATTERN_COLOR_SPACE_UNDEFINED:
+                       default:
+                               controller_color_space = CONTROLLER_DP_COLOR_SPACE_UDEFINED;
+                               DC_LOG_ERROR("%s: Color space must be defined for test pattern", __func__);
+                               ASSERT(0);
+                               break;
+                       }
+
                        for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe)
                                opp_cnt++;
 
                                odm_opp->funcs->opp_program_bit_depth_reduction(odm_opp, ¶ms);
                                odm_opp->funcs->opp_set_disp_pattern_generator(odm_opp,
                                        controller_test_pattern,
+                                       controller_color_space,
                                        color_depth,
                                        NULL,
                                        width,
                        }
                        opp->funcs->opp_set_disp_pattern_generator(opp,
                                controller_test_pattern,
+                               controller_color_space,
                                color_depth,
                                NULL,
                                width,
                                odm_opp->funcs->opp_program_bit_depth_reduction(odm_opp, ¶ms);
                                odm_opp->funcs->opp_set_disp_pattern_generator(odm_opp,
                                        CONTROLLER_DP_TEST_PATTERN_VIDEOMODE,
+                                       CONTROLLER_DP_COLOR_SPACE_UDEFINED,
                                        color_depth,
                                        NULL,
                                        width,
                        }
                        opp->funcs->opp_set_disp_pattern_generator(opp,
                                CONTROLLER_DP_TEST_PATTERN_VIDEOMODE,
+                               CONTROLLER_DP_COLOR_SPACE_UDEFINED,
                                color_depth,
                                NULL,
                                width,
 bool dc_link_dp_set_test_pattern(
        struct dc_link *link,
        enum dp_test_pattern test_pattern,
+       enum dp_test_pattern_color_space test_pattern_color_space,
        const struct link_training_settings *p_link_settings,
        const unsigned char *p_custom_pattern,
        unsigned int cust_pattern_size)
        if (link->test_pattern_enabled && test_pattern ==
                        DP_TEST_PATTERN_VIDEO_MODE) {
                /* Set CRTC Test Pattern */
-               set_crtc_test_pattern(link, pipe_ctx, test_pattern);
+               set_crtc_test_pattern(link, pipe_ctx, test_pattern, test_pattern_color_space);
                dp_set_hw_test_pattern(link, test_pattern,
                                (uint8_t *)p_custom_pattern,
                                (uint32_t)cust_pattern_size);
                }
        } else {
        /* CRTC Patterns */
-               set_crtc_test_pattern(link, pipe_ctx, test_pattern);
+               set_crtc_test_pattern(link, pipe_ctx, test_pattern, test_pattern_color_space);
                /* Set Test Pattern state */
                link->test_pattern_enabled = true;
        }
 
 
 union test_misc {
        struct dpcd_test_misc_bits {
-               unsigned char SYNC_CLOCK :1;
+               unsigned char SYNC_CLOCK  :1;
                /* dpcd_test_color_format */
-               unsigned char CLR_FORMAT :2;
+               unsigned char CLR_FORMAT  :2;
                /* dpcd_test_dyn_range */
-               unsigned char DYN_RANGE  :1;
-               unsigned char YCBCR      :1;
+               unsigned char DYN_RANGE   :1;
+               unsigned char YCBCR_COEFS :1;
                /* dpcd_test_bit_depth */
-               unsigned char BPC        :3;
+               unsigned char BPC         :3;
        } bits;
        unsigned char raw;
 };
 
 bool dc_link_dp_set_test_pattern(
        struct dc_link *link,
        enum dp_test_pattern test_pattern,
+       enum dp_test_pattern_color_space test_pattern_color_space,
        const struct link_training_settings *p_link_settings,
        const unsigned char *p_custom_pattern,
        unsigned int cust_pattern_size);
 void dc_link_disable_hpd(const struct dc_link *link);
 void dc_link_set_test_pattern(struct dc_link *link,
                        enum dp_test_pattern test_pattern,
+                       enum dp_test_pattern_color_space test_pattern_color_space,
                        const struct link_training_settings *p_link_settings,
                        const unsigned char *p_custom_pattern,
                        unsigned int cust_pattern_size);
 
        opp->funcs->opp_set_disp_pattern_generator(
                        opp,
                        CONTROLLER_DP_TEST_PATTERN_SOLID_COLOR,
+                       CONTROLLER_DP_COLOR_SPACE_UDEFINED,
                        COLOR_DEPTH_UNDEFINED,
                        &black_color,
                        otg_active_width,
                bottom_opp->funcs->opp_set_disp_pattern_generator(
                                bottom_opp,
                                CONTROLLER_DP_TEST_PATTERN_SOLID_COLOR,
+                               CONTROLLER_DP_COLOR_SPACE_UDEFINED,
                                COLOR_DEPTH_UNDEFINED,
                                &black_color,
                                otg_active_width,
        struct dc_stream_state *stream = pipe_ctx->stream;
        enum dc_color_space color_space = stream->output_color_space;
        enum controller_dp_test_pattern test_pattern = CONTROLLER_DP_TEST_PATTERN_SOLID_COLOR;
+       enum controller_dp_color_space test_pattern_color_space = CONTROLLER_DP_COLOR_SPACE_UDEFINED;
        struct pipe_ctx *odm_pipe;
        int odm_cnt = 1;
 
                if (stream_res->abm)
                        stream_res->abm->funcs->set_abm_immediate_disable(stream_res->abm);
 
-               if (dc->debug.visual_confirm != VISUAL_CONFIRM_DISABLE)
+               if (dc->debug.visual_confirm != VISUAL_CONFIRM_DISABLE) {
                        test_pattern = CONTROLLER_DP_TEST_PATTERN_COLORSQUARES;
+                       test_pattern_color_space = CONTROLLER_DP_COLOR_SPACE_RGB;
+               }
        } else {
                test_pattern = CONTROLLER_DP_TEST_PATTERN_VIDEOMODE;
        }
        stream_res->opp->funcs->opp_set_disp_pattern_generator(
                        stream_res->opp,
                        test_pattern,
+                       test_pattern_color_space,
                        stream->timing.display_color_depth,
                        &black_color,
                        width,
                                odm_pipe->stream_res.opp,
                                dc->debug.visual_confirm != VISUAL_CONFIRM_DISABLE && blank ?
                                                CONTROLLER_DP_TEST_PATTERN_COLORRAMP : test_pattern,
+                               test_pattern_color_space,
                                stream->timing.display_color_depth,
                                &black_color,
                                width,
 
 void opp2_set_disp_pattern_generator(
                struct output_pixel_processor *opp,
                enum controller_dp_test_pattern test_pattern,
+               enum controller_dp_color_space color_space,
                enum dc_color_depth color_depth,
                const struct tg_color *solid_color,
                int width,
                                TEST_PATTERN_DYN_RANGE_CEA :
                                TEST_PATTERN_DYN_RANGE_VESA);
 
+               switch (color_space) {
+               case CONTROLLER_DP_COLOR_SPACE_YCBCR601:
+                       mode = TEST_PATTERN_MODE_COLORSQUARES_YCBCR601;
+               break;
+               case CONTROLLER_DP_COLOR_SPACE_YCBCR709:
+                       mode = TEST_PATTERN_MODE_COLORSQUARES_YCBCR709;
+               break;
+               case CONTROLLER_DP_COLOR_SPACE_RGB:
+               default:
+                       mode = TEST_PATTERN_MODE_COLORSQUARES_RGB;
+               break;
+               }
+
                REG_UPDATE_6(DPG_CONTROL,
                        DPG_EN, 1,
-                       DPG_MODE, TEST_PATTERN_MODE_COLORSQUARES_RGB,
+                       DPG_MODE, mode,
                        DPG_DYNAMIC_RANGE, dyn_range,
                        DPG_BIT_DEPTH, bit_depth,
                        DPG_VRES, 6,
 
 void opp2_set_disp_pattern_generator(
        struct output_pixel_processor *opp,
        enum controller_dp_test_pattern test_pattern,
+       enum controller_dp_color_space color_space,
        enum dc_color_depth color_depth,
        const struct tg_color *solid_color,
        int width,
 
        CONTROLLER_DP_TEST_PATTERN_SOLID_COLOR
 };
 
+enum controller_dp_color_space {
+       CONTROLLER_DP_COLOR_SPACE_RGB,
+       CONTROLLER_DP_COLOR_SPACE_YCBCR601,
+       CONTROLLER_DP_COLOR_SPACE_YCBCR709,
+       CONTROLLER_DP_COLOR_SPACE_UDEFINED
+};
+
 enum dc_lut_mode {
        LUT_BYPASS,
        LUT_RAM_A,
 
        void (*opp_set_disp_pattern_generator)(
                        struct output_pixel_processor *opp,
                        enum controller_dp_test_pattern test_pattern,
+                       enum controller_dp_color_space color_space,
                        enum dc_color_depth color_depth,
                        const struct tg_color *solid_color,
                        int width,
 
        DP_TEST_PATTERN_UNSUPPORTED
 };
 
+enum dp_test_pattern_color_space {
+       DP_TEST_PATTERN_COLOR_SPACE_RGB,
+       DP_TEST_PATTERN_COLOR_SPACE_YCBCR601,
+       DP_TEST_PATTERN_COLOR_SPACE_YCBCR709,
+       DP_TEST_PATTERN_COLOR_SPACE_UNDEFINED
+};
+
 enum dp_panel_mode {
        /* not required */
        DP_PANEL_MODE_DEFAULT,