tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.17-wip head: 576e538e5fe6ac103cde6b269c6210985b026689 commit: 3c6dcef49f42b8843a589a73fa4d968cbe3bb689 [31/42] drm/amd/display: Rename encoder_info_packet to dc_info_packet config: x86_64-randconfig-g0-03280443 (attached as .config) compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4 reproduce: git checkout 3c6dcef49f42b8843a589a73fa4d968cbe3bb689 # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c: In function 'set_avi_info_frame': >> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1847:8: warning: missing braces around initializer [-Wmissing-braces] union hdmi_info_packet hdmi_info = {0}; ^ drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1847:8: warning: (near initialization for 'hdmi_info.bits') [-Wmissing-braces] Cyclomatic Complexity 3 include/linux/string.h:memset Cyclomatic Complexity 4 include/linux/string.h:memcmp Cyclomatic Complexity 1 include/linux/math64.h:div64_s64 Cyclomatic Complexity 1 drivers/gpu/drm/amd/amdgpu/../display/include/signal_types.h:dc_is_hdmi_signal Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/include/signal_types.h:dc_is_dp_signal Cyclomatic Complexity 1 drivers/gpu/drm/amd/amdgpu/../display/include/signal_types.h:dc_is_embedded_signal Cyclomatic Complexity 2 drivers/gpu/drm/amd/amdgpu/../display/include/signal_types.h:dc_is_dvi_signal Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/include/signal_types.h:dc_is_audio_capable_signal Cyclomatic Complexity 12 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:convert_pixel_format_to_dalsurface Cyclomatic Complexity 1 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:rect_swap_helper Cyclomatic Complexity 15 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:calculate_viewport Cyclomatic Complexity 15 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:calculate_recout Cyclomatic Complexity 5 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:acquire_first_split_pipe Cyclomatic Complexity 4 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:is_timing_changed Cyclomatic Complexity 4 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:are_stream_backends_same Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:update_stream_engine_usage Cyclomatic Complexity 4 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:acquire_first_free_pipe Cyclomatic Complexity 7 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:find_first_free_match_stream_enc_for_link Cyclomatic Complexity 7 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:find_first_free_audio Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:patch_gamut_packet_checksum Cyclomatic Complexity 31 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:set_avi_info_frame Cyclomatic Complexity 13 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:set_vendor_info_packet Cyclomatic Complexity 9 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:set_spd_info_packet Cyclomatic Complexity 8 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:set_hdr_static_info_packet Cyclomatic Complexity 5 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:set_vsc_info_packet Cyclomatic Complexity 8 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:get_norm_pix_clk Cyclomatic Complexity 2 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:calculate_phy_pix_clks Cyclomatic Complexity 6 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:update_num_audio Cyclomatic Complexity 5 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:calculate_scaling_ratios Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:dal_fixed31_32_from_int Cyclomatic Complexity 1 drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:dal_fixed31_32_div_int Cyclomatic Complexity 1 drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:dal_fixed31_32_add_int Cyclomatic Complexity 1 drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:dal_fixed31_32_mul_int Cyclomatic Complexity 32 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:calculate_inits_and_adj_vp Cyclomatic Complexity 10 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_parse_asic_id Cyclomatic Complexity 12 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_create_resource_pool Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_destroy_resource_pool Cyclomatic Complexity 16 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_construct Cyclomatic Complexity 4 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_unreference_clock_source Cyclomatic Complexity 4 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_reference_clock_source Cyclomatic Complexity 9 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_are_streams_timing_synchronizable Cyclomatic Complexity 9 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:is_sharable_clk_src Cyclomatic Complexity 5 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:find_pll_sharable_stream Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_find_used_clk_src_for_sharing Cyclomatic Complexity 9 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_build_scaling_params Cyclomatic Complexity 5 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_build_scaling_params_for_context Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:find_idle_secondary_pipe Cyclomatic Complexity 4 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_get_head_pipe_for_stream Cyclomatic Complexity 8 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:acquire_free_pipe_for_stream Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_get_tail_pipe_for_stream Cyclomatic Complexity 11 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_add_plane_to_context Cyclomatic Complexity 6 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:add_all_planes_for_stream Cyclomatic Complexity 14 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_remove_plane_from_context Cyclomatic Complexity 7 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_rem_all_planes_for_stream Cyclomatic Complexity 2 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_add_all_planes_for_stream Cyclomatic Complexity 2 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_is_stream_unchanged Cyclomatic Complexity 5 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_is_stream_scaling_unchanged Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:update_audio_usage Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_is_stream_unchanged Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_add_stream_to_ctx Cyclomatic Complexity 12 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_remove_stream_from_ctx Cyclomatic Complexity 12 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_map_pool_resources Cyclomatic Complexity 1 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_resource_state_construct Cyclomatic Complexity 11 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_validate_global_state Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_resource_state_destruct Cyclomatic Complexity 6 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_resource_state_copy_construct Cyclomatic Complexity 1 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_resource_state_copy_construct_current Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_resource_find_first_free_pll Cyclomatic Complexity 3 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_build_info_frame Cyclomatic Complexity 7 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_map_clock_resources Cyclomatic Complexity 9 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:pipe_need_reprogram Cyclomatic Complexity 28 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:resource_build_bit_depth_reduction_params Cyclomatic Complexity 5 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_validate_stream Cyclomatic Complexity 2 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:dc_validate_plane vim +1847 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c 1831 1832 static void set_avi_info_frame( 1833 struct dc_info_packet *info_packet, 1834 struct pipe_ctx *pipe_ctx) 1835 { 1836 struct dc_stream_state *stream = pipe_ctx->stream; 1837 enum dc_color_space color_space = COLOR_SPACE_UNKNOWN; 1838 uint32_t pixel_encoding = 0; 1839 enum scanning_type scan_type = SCANNING_TYPE_NODATA; 1840 enum dc_aspect_ratio aspect = ASPECT_RATIO_NO_DATA; 1841 bool itc = false; 1842 uint8_t itc_value = 0; 1843 uint8_t cn0_cn1 = 0; 1844 unsigned int cn0_cn1_value = 0; 1845 uint8_t *check_sum = NULL; 1846 uint8_t byte_index = 0; > 1847 union hdmi_info_packet hdmi_info = {0}; 1848 union display_content_support support = {0}; 1849 unsigned int vic = pipe_ctx->stream->timing.vic; 1850 enum dc_timing_3d_format format; 1851 1852 color_space = pipe_ctx->stream->output_color_space; 1853 if (color_space == COLOR_SPACE_UNKNOWN) 1854 color_space = (stream->timing.pixel_encoding == PIXEL_ENCODING_RGB) ? 1855 COLOR_SPACE_SRGB:COLOR_SPACE_YCBCR709; 1856 1857 /* Initialize header */ 1858 hdmi_info.bits.header.info_frame_type = HDMI_INFOFRAME_TYPE_AVI; 1859 /* InfoFrameVersion_3 is defined by CEA861F (Section 6.4), but shall 1860 * not be used in HDMI 2.0 (Section 10.1) */ 1861 hdmi_info.bits.header.version = 2; 1862 hdmi_info.bits.header.length = HDMI_AVI_INFOFRAME_SIZE; 1863 1864 /* 1865 * IDO-defined (Y2,Y1,Y0 = 1,1,1) shall not be used by devices built 1866 * according to HDMI 2.0 spec (Section 10.1) 1867 */ 1868 1869 switch (stream->timing.pixel_encoding) { 1870 case PIXEL_ENCODING_YCBCR422: 1871 pixel_encoding = 1; 1872 break; 1873 1874 case PIXEL_ENCODING_YCBCR444: 1875 pixel_encoding = 2; 1876 break; 1877 case PIXEL_ENCODING_YCBCR420: 1878 pixel_encoding = 3; 1879 break; 1880 1881 case PIXEL_ENCODING_RGB: 1882 default: 1883 pixel_encoding = 0; 1884 } 1885 1886 /* Y0_Y1_Y2 : The pixel encoding */ 1887 /* H14b AVI InfoFrame has extension on Y-field from 2 bits to 3 bits */ 1888 hdmi_info.bits.Y0_Y1_Y2 = pixel_encoding; 1889 1890 /* A0 = 1 Active Format Information valid */ 1891 hdmi_info.bits.A0 = ACTIVE_FORMAT_VALID; 1892 1893 /* B0, B1 = 3; Bar info data is valid */ 1894 hdmi_info.bits.B0_B1 = BAR_INFO_BOTH_VALID; 1895 1896 hdmi_info.bits.SC0_SC1 = PICTURE_SCALING_UNIFORM; 1897 1898 /* S0, S1 : Underscan / Overscan */ 1899 /* TODO: un-hardcode scan type */ 1900 scan_type = SCANNING_TYPE_UNDERSCAN; 1901 hdmi_info.bits.S0_S1 = scan_type; 1902 1903 /* C0, C1 : Colorimetry */ 1904 if (color_space == COLOR_SPACE_YCBCR709 || 1905 color_space == COLOR_SPACE_YCBCR709_LIMITED) 1906 hdmi_info.bits.C0_C1 = COLORIMETRY_ITU709; 1907 else if (color_space == COLOR_SPACE_YCBCR601 || 1908 color_space == COLOR_SPACE_YCBCR601_LIMITED) 1909 hdmi_info.bits.C0_C1 = COLORIMETRY_ITU601; 1910 else { 1911 hdmi_info.bits.C0_C1 = COLORIMETRY_NO_DATA; 1912 } 1913 if (color_space == COLOR_SPACE_2020_RGB_FULLRANGE || 1914 color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE || 1915 color_space == COLOR_SPACE_2020_YCBCR) { 1916 hdmi_info.bits.EC0_EC2 = COLORIMETRYEX_BT2020RGBYCBCR; 1917 hdmi_info.bits.C0_C1 = COLORIMETRY_EXTENDED; 1918 } else if (color_space == COLOR_SPACE_ADOBERGB) { 1919 hdmi_info.bits.EC0_EC2 = COLORIMETRYEX_ADOBERGB; 1920 hdmi_info.bits.C0_C1 = COLORIMETRY_EXTENDED; 1921 } 1922 1923 /* TODO: un-hardcode aspect ratio */ 1924 aspect = stream->timing.aspect_ratio; 1925 1926 switch (aspect) { 1927 case ASPECT_RATIO_4_3: 1928 case ASPECT_RATIO_16_9: 1929 hdmi_info.bits.M0_M1 = aspect; 1930 break; 1931 1932 case ASPECT_RATIO_NO_DATA: 1933 case ASPECT_RATIO_64_27: 1934 case ASPECT_RATIO_256_135: 1935 default: 1936 hdmi_info.bits.M0_M1 = 0; 1937 } 1938 1939 /* Active Format Aspect ratio - same as Picture Aspect Ratio. */ 1940 hdmi_info.bits.R0_R3 = ACTIVE_FORMAT_ASPECT_RATIO_SAME_AS_PICTURE; 1941 1942 /* TODO: un-hardcode cn0_cn1 and itc */ 1943 1944 cn0_cn1 = 0; 1945 cn0_cn1_value = 0; 1946 1947 itc = true; 1948 itc_value = 1; 1949 1950 support = stream->sink->edid_caps.content_support; 1951 1952 if (itc) { 1953 if (!support.bits.valid_content_type) { 1954 cn0_cn1_value = 0; 1955 } else { 1956 if (cn0_cn1 == DISPLAY_CONTENT_TYPE_GRAPHICS) { 1957 if (support.bits.graphics_content == 1) { 1958 cn0_cn1_value = 0; 1959 } 1960 } else if (cn0_cn1 == DISPLAY_CONTENT_TYPE_PHOTO) { 1961 if (support.bits.photo_content == 1) { 1962 cn0_cn1_value = 1; 1963 } else { 1964 cn0_cn1_value = 0; 1965 itc_value = 0; 1966 } 1967 } else if (cn0_cn1 == DISPLAY_CONTENT_TYPE_CINEMA) { 1968 if (support.bits.cinema_content == 1) { 1969 cn0_cn1_value = 2; 1970 } else { 1971 cn0_cn1_value = 0; 1972 itc_value = 0; 1973 } 1974 } else if (cn0_cn1 == DISPLAY_CONTENT_TYPE_GAME) { 1975 if (support.bits.game_content == 1) { 1976 cn0_cn1_value = 3; 1977 } else { 1978 cn0_cn1_value = 0; 1979 itc_value = 0; 1980 } 1981 } 1982 } 1983 hdmi_info.bits.CN0_CN1 = cn0_cn1_value; 1984 hdmi_info.bits.ITC = itc_value; 1985 } 1986 1987 /* TODO : We should handle YCC quantization */ 1988 /* but we do not have matrix calculation */ 1989 if (stream->sink->edid_caps.qs_bit == 1 && 1990 stream->sink->edid_caps.qy_bit == 1) { 1991 if (color_space == COLOR_SPACE_SRGB || 1992 color_space == COLOR_SPACE_2020_RGB_FULLRANGE) { 1993 hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_FULL_RANGE; 1994 hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_FULL_RANGE; 1995 } else if (color_space == COLOR_SPACE_SRGB_LIMITED || 1996 color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE) { 1997 hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_LIMITED_RANGE; 1998 hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE; 1999 } else { 2000 hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_DEFAULT_RANGE; 2001 hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE; 2002 } 2003 } else { 2004 hdmi_info.bits.Q0_Q1 = RGB_QUANTIZATION_DEFAULT_RANGE; 2005 hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE; 2006 } 2007 2008 ///VIC 2009 format = stream->timing.timing_3d_format; 2010 /*todo, add 3DStereo support*/ 2011 if (format != TIMING_3D_FORMAT_NONE) { 2012 // Based on HDMI specs hdmi vic needs to be converted to cea vic when 3D is enabled 2013 switch (pipe_ctx->stream->timing.hdmi_vic) { 2014 case 1: 2015 vic = 95; 2016 break; 2017 case 2: 2018 vic = 94; 2019 break; 2020 case 3: 2021 vic = 93; 2022 break; 2023 case 4: 2024 vic = 98; 2025 break; 2026 default: 2027 break; 2028 } 2029 } 2030 hdmi_info.bits.VIC0_VIC7 = vic; 2031 2032 /* pixel repetition 2033 * PR0 - PR3 start from 0 whereas pHwPathMode->mode.timing.flags.pixel 2034 * repetition start from 1 */ 2035 hdmi_info.bits.PR0_PR3 = 0; 2036 2037 /* Bar Info 2038 * barTop: Line Number of End of Top Bar. 2039 * barBottom: Line Number of Start of Bottom Bar. 2040 * barLeft: Pixel Number of End of Left Bar. 2041 * barRight: Pixel Number of Start of Right Bar. */ 2042 hdmi_info.bits.bar_top = stream->timing.v_border_top; 2043 hdmi_info.bits.bar_bottom = (stream->timing.v_total 2044 - stream->timing.v_border_bottom + 1); 2045 hdmi_info.bits.bar_left = stream->timing.h_border_left; 2046 hdmi_info.bits.bar_right = (stream->timing.h_total 2047 - stream->timing.h_border_right + 1); 2048 2049 /* check_sum - Calculate AFMT_AVI_INFO0 ~ AFMT_AVI_INFO3 */ 2050 check_sum = &hdmi_info.packet_raw_data.sb[0]; 2051 2052 *check_sum = HDMI_INFOFRAME_TYPE_AVI + HDMI_AVI_INFOFRAME_SIZE + 2; 2053 2054 for (byte_index = 1; byte_index <= HDMI_AVI_INFOFRAME_SIZE; byte_index++) 2055 *check_sum += hdmi_info.packet_raw_data.sb[byte_index]; 2056 2057 /* one byte complement */ 2058 *check_sum = (uint8_t) (0x100 - *check_sum); 2059 2060 /* Store in hw_path_mode */ 2061 info_packet->hb0 = hdmi_info.packet_raw_data.hb0; 2062 info_packet->hb1 = hdmi_info.packet_raw_data.hb1; 2063 info_packet->hb2 = hdmi_info.packet_raw_data.hb2; 2064 2065 for (byte_index = 0; byte_index < sizeof(hdmi_info.packet_raw_data.sb); byte_index++) 2066 info_packet->sb[byte_index] = hdmi_info.packet_raw_data.sb[byte_index]; 2067 2068 info_packet->valid = true; 2069 } 2070 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel