summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-01-22 03:15:17 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-01-22 03:15:17 +0000
commitaa10f78d156f18a5b8cd07b6501b2d1b5d3b7d5c (patch)
tree41eae03edef4f9d2b148c02a40e1dca883e88d66
parent3a32d23693a6e046641fd845a7f571a489e18f4f (diff)
drm/amd/display: get dprefclk ss info from integration info table
From Charlene Liu a5ba95c226b5c25cd5c8b9df29a1953c85a1531e in linux-6.6.y/6.6.13 51e7b64690776a9981355428b537af9048308a95 in mainline linux
-rw-r--r--sys/dev/pci/drm/amd/display/dc/bios/bios_parser2.c19
-rw-r--r--sys/dev/pci/drm/amd/display/include/grph_object_ctrl_defs.h2
2 files changed, 16 insertions, 5 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/bios/bios_parser2.c b/sys/dev/pci/drm/amd/display/dc/bios/bios_parser2.c
index 484d62bcf2c..518c5672d38 100644
--- a/sys/dev/pci/drm/amd/display/dc/bios/bios_parser2.c
+++ b/sys/dev/pci/drm/amd/display/dc/bios/bios_parser2.c
@@ -1015,13 +1015,20 @@ static enum bp_result get_ss_info_v4_5(
DC_LOG_BIOS("AS_SIGNAL_TYPE_HDMI ss_percentage: %d\n", ss_info->spread_spectrum_percentage);
break;
case AS_SIGNAL_TYPE_DISPLAY_PORT:
- ss_info->spread_spectrum_percentage =
+ if (bp->base.integrated_info) {
+ DC_LOG_BIOS("gpuclk_ss_percentage (unit of 0.001 percent): %d\n", bp->base.integrated_info->gpuclk_ss_percentage);
+ ss_info->spread_spectrum_percentage =
+ bp->base.integrated_info->gpuclk_ss_percentage;
+ ss_info->type.CENTER_MODE =
+ bp->base.integrated_info->gpuclk_ss_type;
+ } else {
+ ss_info->spread_spectrum_percentage =
disp_cntl_tbl->dp_ss_percentage;
- ss_info->spread_spectrum_range =
+ ss_info->spread_spectrum_range =
disp_cntl_tbl->dp_ss_rate_10hz * 10;
- if (disp_cntl_tbl->dp_ss_mode & ATOM_SS_CENTRE_SPREAD_MODE)
- ss_info->type.CENTER_MODE = true;
-
+ if (disp_cntl_tbl->dp_ss_mode & ATOM_SS_CENTRE_SPREAD_MODE)
+ ss_info->type.CENTER_MODE = true;
+ }
DC_LOG_BIOS("AS_SIGNAL_TYPE_DISPLAY_PORT ss_percentage: %d\n", ss_info->spread_spectrum_percentage);
break;
case AS_SIGNAL_TYPE_GPU_PLL:
@@ -2826,6 +2833,8 @@ static enum bp_result get_integrated_info_v2_2(
info->ma_channel_number = info_v2_2->umachannelnumber;
info->dp_ss_control =
le16_to_cpu(info_v2_2->reserved1);
+ info->gpuclk_ss_percentage = info_v2_2->gpuclk_ss_percentage;
+ info->gpuclk_ss_type = info_v2_2->gpuclk_ss_type;
for (i = 0; i < NUMBER_OF_UCHAR_FOR_GUID; ++i) {
info->ext_disp_conn_info.gu_id[i] =
diff --git a/sys/dev/pci/drm/amd/display/include/grph_object_ctrl_defs.h b/sys/dev/pci/drm/amd/display/include/grph_object_ctrl_defs.h
index bc96d021136..813463ffe15 100644
--- a/sys/dev/pci/drm/amd/display/include/grph_object_ctrl_defs.h
+++ b/sys/dev/pci/drm/amd/display/include/grph_object_ctrl_defs.h
@@ -417,6 +417,8 @@ struct integrated_info {
/* V2.1 */
struct edp_info edp1_info;
struct edp_info edp2_info;
+ uint32_t gpuclk_ss_percentage;
+ uint32_t gpuclk_ss_type;
};
/*