2 * Copyright 2015 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
26 #include "dm_services.h"
27 #include "core_types.h"
28 #include "timing_generator.h"
29 #include "hw_sequencer.h"
31 /* used as index in array of black_color_format */
32 enum black_color_format {
33 BLACK_COLOR_FORMAT_RGB_FULLRANGE = 0,
34 BLACK_COLOR_FORMAT_RGB_LIMITED,
35 BLACK_COLOR_FORMAT_YUV_TV,
36 BLACK_COLOR_FORMAT_YUV_CV,
37 BLACK_COLOR_FORMAT_YUV_SUPER_AA,
38 BLACK_COLOR_FORMAT_DEBUG,
41 static const struct tg_color black_color_format[] = {
42 /* BlackColorFormat_RGB_FullRange */
44 /* BlackColorFormat_RGB_Limited */
46 /* BlackColorFormat_YUV_TV */
48 /* BlackColorFormat_YUV_CV */
50 /* BlackColorFormat_YUV_SuperAA */
52 /* visual confirm debug */
56 void color_space_to_black_color(
58 enum dc_color_space colorspace,
59 struct tg_color *black_color)
62 case COLOR_SPACE_YCBCR601:
63 case COLOR_SPACE_YCBCR709:
64 case COLOR_SPACE_YCBCR601_LIMITED:
65 case COLOR_SPACE_YCBCR709_LIMITED:
66 *black_color = black_color_format[BLACK_COLOR_FORMAT_YUV_CV];
69 case COLOR_SPACE_SRGB_LIMITED:
71 black_color_format[BLACK_COLOR_FORMAT_RGB_LIMITED];
75 /* fefault is sRGB black (full range). */
77 black_color_format[BLACK_COLOR_FORMAT_RGB_FULLRANGE];
78 /* default is sRGB black 0. */
83 bool hwss_wait_for_blank_complete(
84 struct timing_generator *tg)
88 for (counter = 0; counter < 100; counter++) {
89 if (tg->funcs->is_blanked(tg))
96 dm_error("DC: failed to blank crtc!\n");