[PATCH] drm/amd/display: Fix LTTPR not Enabled on HP ZBook G8 laptop

Lakha, Bhawanpreet Bhawanpreet.Lakha at amd.com
Mon Nov 15 20:04:27 UTC 2021


[AMD Official Use Only]

Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha at amd.com>
________________________________
From: Aurabindo Pillai <aurabindo.pillai at amd.com>
Sent: November 15, 2021 2:59 PM
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Lakha, Bhawanpreet <Bhawanpreet.Lakha at amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira at amd.com>; Pillai, Aurabindo <Aurabindo.Pillai at amd.com>; Wang, Angus <Angus.Wang at amd.com>; Chalmers, Wesley <Wesley.Chalmers at amd.com>; Leung, Martin <Martin.Leung at amd.com>; Zhuo, Qingqing <Qingqing.Zhuo at amd.com>
Subject: [PATCH] drm/amd/display: Fix LTTPR not Enabled on HP ZBook G8 laptop

From: Angus Wang <angus.wang at amd.com>

[WHY]
Previous LTTPR change has caused a regression that led to an
issue where LTTPR is disabled

[HOW]
Extended changes from previous fix to DCN30X

Reviewed-by: Wesley Chalmers <wesley.chalmers at amd.com>
Reviewed-by: Martin Leung <Martin.Leung at amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo at amd.com>
Signed-off-by: Angus Wang <angus.wang at amd.com>
---
 .../amd/display/dc/dcn301/dcn301_resource.c    | 18 ++++++++++++++++++
 .../amd/display/dc/dcn302/dcn302_resource.c    | 18 ++++++++++++++++++
 .../amd/display/dc/dcn303/dcn303_resource.c    | 17 +++++++++++++++++
 3 files changed, 53 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c b/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c
index 2650d3bd50ec..9cc1610360bd 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c
@@ -1485,6 +1485,24 @@ static bool dcn301_resource_construct(
         dc->caps.color.mpc.ogam_rom_caps.hlg = 0;
         dc->caps.color.mpc.ocsc = 1;

+       /* read VBIOS LTTPR caps */
+
+       if (ctx->dc_bios->funcs->get_lttpr_caps) {
+               enum bp_result bp_query_result;
+               uint8_t is_vbios_lttpr_enable = 0;
+
+               bp_query_result = ctx->dc_bios->funcs->get_lttpr_caps(ctx->dc_bios, &is_vbios_lttpr_enable);
+               dc->caps.vbios_lttpr_enable = (bp_query_result == BP_RESULT_OK) && !!is_vbios_lttpr_enable;
+       }
+
+       if (ctx->dc_bios->funcs->get_lttpr_interop) {
+               enum bp_result bp_query_result;
+               uint8_t is_vbios_interop_enabled = 0;
+
+               bp_query_result = ctx->dc_bios->funcs->get_lttpr_interop(ctx->dc_bios, &is_vbios_interop_enabled);
+               dc->caps.vbios_lttpr_aware = (bp_query_result == BP_RESULT_OK) && !!is_vbios_interop_enabled;
+       }
+
         if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
                 dc->debug = debug_defaults_drv;
         else if (dc->ctx->dce_environment == DCE_ENV_FPGA_MAXIMUS) {
diff --git a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
index fcf96cf08c76..058f5d71e037 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
@@ -1557,6 +1557,24 @@ static bool dcn302_resource_construct(
         dc->caps.color.mpc.ogam_rom_caps.hlg = 0;
         dc->caps.color.mpc.ocsc = 1;

+       /* read VBIOS LTTPR caps */
+       if (ctx->dc_bios->funcs->get_lttpr_caps) {
+               enum bp_result bp_query_result;
+               uint8_t is_vbios_lttpr_enable = 0;
+
+               bp_query_result = ctx->dc_bios->funcs->get_lttpr_caps(ctx->dc_bios, &is_vbios_lttpr_enable);
+               dc->caps.vbios_lttpr_enable = (bp_query_result == BP_RESULT_OK) && !!is_vbios_lttpr_enable;
+       }
+
+       if (ctx->dc_bios->funcs->get_lttpr_interop) {
+               enum bp_result bp_query_result;
+               uint8_t is_vbios_interop_enabled = 0;
+
+               bp_query_result = ctx->dc_bios->funcs->get_lttpr_interop(ctx->dc_bios,
+                               &is_vbios_interop_enabled);
+               dc->caps.vbios_lttpr_aware = (bp_query_result == BP_RESULT_OK) && !!is_vbios_interop_enabled;
+       }
+
         if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
                 dc->debug = debug_defaults_drv;
         else
diff --git a/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c b/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
index 4a9b64023675..7024aeb0884c 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
@@ -1500,6 +1500,23 @@ static bool dcn303_resource_construct(
         dc->caps.color.mpc.ogam_rom_caps.hlg = 0;
         dc->caps.color.mpc.ocsc = 1;

+       /* read VBIOS LTTPR caps */
+       if (ctx->dc_bios->funcs->get_lttpr_caps) {
+               enum bp_result bp_query_result;
+               uint8_t is_vbios_lttpr_enable = 0;
+
+               bp_query_result = ctx->dc_bios->funcs->get_lttpr_caps(ctx->dc_bios, &is_vbios_lttpr_enable);
+               dc->caps.vbios_lttpr_enable = (bp_query_result == BP_RESULT_OK) && !!is_vbios_lttpr_enable;
+       }
+
+       if (ctx->dc_bios->funcs->get_lttpr_interop) {
+               enum bp_result bp_query_result;
+               uint8_t is_vbios_interop_enabled = 0;
+
+               bp_query_result = ctx->dc_bios->funcs->get_lttpr_interop(ctx->dc_bios, &is_vbios_interop_enabled);
+               dc->caps.vbios_lttpr_aware = (bp_query_result == BP_RESULT_OK) && !!is_vbios_interop_enabled;
+       }
+
         if (dc->ctx->dce_environment == DCE_ENV_PRODUCTION_DRV)
                 dc->debug = debug_defaults_drv;
         else
--
2.30.2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20211115/49b15ec0/attachment-0001.htm>


More information about the amd-gfx mailing list