amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Hamza Mahfooz <hamza.mahfooz@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: stylon.wang@amd.com, Sunpeng.Li@amd.com, Harry.Wentland@amd.com,
	qingqing.zhuo@amd.com, Rodrigo.Siqueira@amd.com,
	roman.li@amd.com, solomon.chiu@amd.com, jerry.zuo@amd.com,
	Aurabindo.Pillai@amd.com, hamza.mahfooz@amd.com,
	wayne.lin@amd.com, Bhawanpreet.Lakha@amd.com,
	agustin.gutierrez@amd.com, pavle.kotarac@amd.com
Subject: [PATCH 07/16] drm/amd/display: Cap OLED brightness per max frame-average luminance
Date: Fri, 3 Jun 2022 16:11:38 -0400	[thread overview]
Message-ID: <20220603201147.121817-8-hamza.mahfooz@amd.com> (raw)
In-Reply-To: <20220603201147.121817-1-hamza.mahfooz@amd.com>

From: Roman Li <roman.li@amd.com>

[Why]
For OLED eDP the Display Manager uses max_cll value as a limit
for brightness control.
max_cll defines the content light luminance for individual pixel.
Whereas max_fall defines frame-average level luminance.
The user may not observe the difference in brightness in between
max_fall and max_cll.
That negatively impacts the user experience.

[How]
Use max_fall value instead of max_cll as a limit for brightness control.

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 8345bdb7c7b3..5e1cfae96ab2 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2813,7 +2813,7 @@ static struct drm_mode_config_helper_funcs amdgpu_dm_mode_config_helperfuncs = {
 
 static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
 {
-	u32 max_cll, min_cll, max, min, q, r;
+	u32 max_avg, min_cll, max, min, q, r;
 	struct amdgpu_dm_backlight_caps *caps;
 	struct amdgpu_display_manager *dm;
 	struct drm_connector *conn_base;
@@ -2843,7 +2843,7 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
 	caps = &dm->backlight_caps[i];
 	caps->ext_caps = &aconnector->dc_link->dpcd_sink_ext_caps;
 	caps->aux_support = false;
-	max_cll = conn_base->hdr_sink_metadata.hdmi_type1.max_cll;
+	max_avg = conn_base->hdr_sink_metadata.hdmi_type1.max_fall;
 	min_cll = conn_base->hdr_sink_metadata.hdmi_type1.min_cll;
 
 	if (caps->ext_caps->bits.oled == 1 /*||
@@ -2871,8 +2871,8 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector)
 	 * The results of the above expressions can be verified at
 	 * pre_computed_values.
 	 */
-	q = max_cll >> 5;
-	r = max_cll % 32;
+	q = max_avg >> 5;
+	r = max_avg % 32;
 	max = (1 << q) * pre_computed_values[r];
 
 	// min luminance: maxLum * (CV/255)^2 / 100
-- 
2.36.1


  parent reply	other threads:[~2022-06-03 20:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-03 20:11 [PATCH 00/16] DC Patches May 30, 2022 Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 01/16] drm/amd/display: Update optimized blank calc and programming Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 02/16] drm/amd/display: Detect dpcd_rev when hotplug mst monitor Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 03/16] Revert "drm/amd/display: Pass the new context into disable OTG WA" Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 04/16] drm/amd/display: Blank eDP on enable drv if odm enabled Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 05/16] drm/amd/display: Correct min comp buffer size Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 06/16] drm/amd/display: add DP sanity checks during enable stream Hamza Mahfooz
2022-06-03 20:11 ` Hamza Mahfooz [this message]
2022-06-08 10:02   ` [PATCH 07/16] drm/amd/display: Cap OLED brightness per max frame-average luminance Aaron Ma
2022-06-08 19:02     ` Li, Roman
2022-06-03 20:11 ` [PATCH 08/16] drm/amd/display: Enable 3 plane MPO Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 09/16] drm/amd/display: [FW Promotion] Release 0.0.119.0 Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 10/16] drm/amd/display: 3.2.188 Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 11/16] drm/amd/display: Fix dpp dto for disabled pipes Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 12/16] drm/amd/display: Fix entry into transient encoder assignment mode Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 13/16] drm/amd/display: Avoid reading LTTPR caps in non-LTTPR mode Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 14/16] drm/amd/display: Extend soc BB capabilitiy Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 15/16] drm/amd/display: Add HDMI member to DTO Hamza Mahfooz
2022-06-03 20:11 ` [PATCH 16/16] drm/amd/display: 3.2.189 Hamza Mahfooz
2022-06-06 13:38 ` [PATCH 00/16] DC Patches May 30, 2022 Wheeler, Daniel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220603201147.121817-8-hamza.mahfooz@amd.com \
    --to=hamza.mahfooz@amd.com \
    --cc=Aurabindo.Pillai@amd.com \
    --cc=Bhawanpreet.Lakha@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Sunpeng.Li@amd.com \
    --cc=agustin.gutierrez@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=jerry.zuo@amd.com \
    --cc=pavle.kotarac@amd.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=roman.li@amd.com \
    --cc=solomon.chiu@amd.com \
    --cc=stylon.wang@amd.com \
    --cc=wayne.lin@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).