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

drm/amd/display: Expand documentation for timing

The timing programming inside DCN is far from trivial, it has multiple
parameters associated with that, and the lack of documentation does not
help comprehend this already complicated topic. This commit tries to
improve this situation by expanding the documentation of dc_crtc_timing
and the VTG program function.

Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Rodrigo Siqueira and committed by
Alex Deucher
bf0dec46 ea76895f

+100
+86
drivers/gpu/drm/amd/display/dc/dc_hw_types.h
··· 812 812 bool is_dp; /* indicate if DSC is applied based on DP's capability */ 813 813 uint32_t mst_pbn; /* pbn of display on dsc mst hub */ 814 814 }; 815 + 816 + /** 817 + * struct dc_crtc_timing - Timing parameters used to configure DCN blocks 818 + * 819 + * DCN provides multiple signals and parameters that can be used to adjust 820 + * timing parameters, this struct aggregate multiple of these values for easy 821 + * access. In this struct, fields prefixed with h_* are related to horizontal 822 + * timing, and v_* to vertical timing. Keep in mind that when we talk about 823 + * vertical timings, the values, in general, are described in the number of 824 + * lines; on the other hand, the horizontal values are in pixels. 825 + */ 815 826 struct dc_crtc_timing { 827 + /** 828 + * @h_total: The total number of pixels from the rising edge of HSync 829 + * until the rising edge of the current HSync. 830 + */ 816 831 uint32_t h_total; 832 + 833 + /** 834 + * @h_border_left: The black pixels related to the left border 835 + */ 817 836 uint32_t h_border_left; 837 + 838 + /** 839 + * @h_addressable: It is the range of pixels displayed horizontally. 840 + * For example, if the display resolution is 3840@2160, the horizontal 841 + * addressable area is 3840. 842 + */ 818 843 uint32_t h_addressable; 844 + 845 + /** 846 + * @h_border_right: The black pixels related to the right border 847 + */ 819 848 uint32_t h_border_right; 849 + 850 + /** 851 + * @h_front_porch: Period (in pixels) between HBlank start and the 852 + * rising edge of HSync. 853 + */ 820 854 uint32_t h_front_porch; 855 + 856 + /** 857 + * @h_sync_width: HSync duration in pixels. 858 + */ 821 859 uint32_t h_sync_width; 822 860 861 + /** 862 + * @v_total: It is the total number of lines from the rising edge of 863 + * the previous VSync until the rising edge of the current VSync. 864 + * 865 + * |--------------------------| 866 + * +-+ V_TOTAL +-+ 867 + * | | | | 868 + * VSync ---+ +--------- // -----------+ +--- 869 + */ 823 870 uint32_t v_total; 871 + 872 + /** 873 + * @v_border_top: The black border on the top. 874 + */ 824 875 uint32_t v_border_top; 876 + 877 + /** 878 + * @v_addressable: It is the range of the scanout at which the 879 + * framebuffer is displayed. For example, if the display resolution is 880 + * 3840@2160, the addressable area is 2160 lines, or if the resolution 881 + * is 1920x1080, the addressable area is 1080 lines. 882 + */ 825 883 uint32_t v_addressable; 884 + 885 + /** 886 + * @v_border_bottom: The black border on the bottom. 887 + */ 826 888 uint32_t v_border_bottom; 889 + 890 + /** 891 + * @v_front_porch: Period (in lines) between VBlank start and rising 892 + * edge of VSync. 893 + * +-+ 894 + * VSync | | 895 + * ----------+ +--------... 896 + * +------------------... 897 + * VBlank | 898 + * --+ 899 + * |-------| 900 + * v_front_porch 901 + */ 827 902 uint32_t v_front_porch; 903 + 904 + /** 905 + * @v_sync_width: VSync signal width in lines. 906 + */ 828 907 uint32_t v_sync_width; 829 908 909 + /** 910 + * @pix_clk_100hz: Pipe pixel precision 911 + * 912 + * This field is used to communicate pixel clocks with 100 Hz accuracy 913 + * from dc_crtc_timing to BIOS command table. 914 + */ 830 915 uint32_t pix_clk_100hz; 916 + 831 917 uint32_t min_refresh_in_uhz; 832 918 833 919 uint32_t vic;
+14
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c
··· 312 312 } 313 313 } 314 314 315 + /** 316 + * optc1_set_vtg_params - Set Vertical Timing Generator (VTG) parameters 317 + * 318 + * @optc: timing_generator struct used to extract the optc parameters 319 + * @dc_crtc_timing: Timing parameters configured 320 + * @program_fp2: Boolean value indicating if FP2 will be programmed or not 321 + * 322 + * OTG is responsible for generating the global sync signals, including 323 + * vertical timing information for each HUBP in the dcfclk domain. Each VTG is 324 + * associated with one OTG that provides HUBP with vertical timing information 325 + * (i.e., there is 1:1 correspondence between OTG and VTG). This function is 326 + * responsible for setting the OTG parameters to the VTG during the pipe 327 + * programming. 328 + */ 315 329 void optc1_set_vtg_params(struct timing_generator *optc, 316 330 const struct dc_crtc_timing *dc_crtc_timing, bool program_fp2) 317 331 {