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

drm/amd/display: Assume LTTPR interop for DCN31+

[WHY]
For DCN31 onward, LTTPR is to be enabled and set to Transparent by
VBIOS. Driver is to assume that VBIOS has done this without needing to
check the VBIOS interop bit.

[HOW]
Add LTTPR enable and interop VBIOS bits into dc->caps, and force-set the
interop bit to true for DCN31+.

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Wesley Chalmers <Wesley.Chalmers@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Wesley Chalmers and committed by
Alex Deucher
ffb9ee8e 5706cb3c

+40 -19
+2
drivers/gpu/drm/amd/display/dc/dc.h
··· 183 183 unsigned int cursor_cache_size; 184 184 struct dc_plane_cap planes[MAX_PLANES]; 185 185 struct dc_color_caps color; 186 + bool vbios_lttpr_aware; 187 + bool vbios_lttpr_enable; 186 188 }; 187 189 188 190 struct dc_bug_wa {
+20
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
··· 2617 2617 dc->caps.color.mpc.ogam_rom_caps.hlg = 0; 2618 2618 dc->caps.color.mpc.ocsc = 1; 2619 2619 2620 + /* read VBIOS LTTPR caps */ 2621 + { 2622 + if (ctx->dc_bios->funcs->get_lttpr_caps) { 2623 + enum bp_result bp_query_result; 2624 + uint8_t is_vbios_lttpr_enable = 0; 2625 + 2626 + bp_query_result = ctx->dc_bios->funcs->get_lttpr_caps(ctx->dc_bios, &is_vbios_lttpr_enable); 2627 + dc->caps.vbios_lttpr_enable = (bp_query_result == BP_RESULT_OK) && !!is_vbios_lttpr_enable; 2628 + } 2629 + 2630 + if (ctx->dc_bios->funcs->get_lttpr_interop) { 2631 + enum bp_result bp_query_result; 2632 + uint8_t is_vbios_interop_enabled = 0; 2633 + 2634 + bp_query_result = ctx->dc_bios->funcs->get_lttpr_interop(ctx->dc_bios, 2635 + &is_vbios_interop_enabled); 2636 + dc->caps.vbios_lttpr_aware = (bp_query_result == BP_RESULT_OK) && !!is_vbios_interop_enabled; 2637 + } 2638 + } 2639 + 2620 2640 if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV) 2621 2641 dc->debug = debug_defaults_drv; 2622 2642 else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS) {
+16
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c
··· 1968 1968 dc->caps.color.mpc.ogam_rom_caps.hlg = 0; 1969 1969 dc->caps.color.mpc.ocsc = 1; 1970 1970 1971 + /* read VBIOS LTTPR caps */ 1972 + { 1973 + if (ctx->dc_bios->funcs->get_lttpr_caps) { 1974 + enum bp_result bp_query_result; 1975 + uint8_t is_vbios_lttpr_enable = 0; 1976 + 1977 + bp_query_result = ctx->dc_bios->funcs->get_lttpr_caps(ctx->dc_bios, &is_vbios_lttpr_enable); 1978 + dc->caps.vbios_lttpr_enable = (bp_query_result == BP_RESULT_OK) && !!is_vbios_lttpr_enable; 1979 + } 1980 + 1981 + /* interop bit is implicit */ 1982 + { 1983 + dc->caps.vbios_lttpr_aware = true; 1984 + } 1985 + } 1986 + 1971 1987 if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV) 1972 1988 dc->debug = debug_defaults_drv; 1973 1989 else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS) {