Skip to contentSkip to conversation

drm/display: Add missing OLED Vesa brightnesses definitions

PATCH Superseded Rodrigo Siqueira 4 participants 5 messages Mar 22, 2023 – Mar 25, 2023 DRM drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/display: Add missing OLED Vesa brightnesses definitions

Cc Anthony Koo <[email protected]>
Cc Iswara Negulendran <[email protected]>
Cc Felipe Clark <[email protected]>
Cc Harry Wentland <[email protected]>
---
 include/drm/display/drm_dp.h | 2 ++
 1 file changed, 2 insertions(+)
include/drm/display/drm_dp.h +2 -0
index 632376c291db..d30a9b2f450c 100644
@@ -977,6 +977,8 @@
 # define DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP		(1 << 5)
 # define DP_EDP_DYNAMIC_BACKLIGHT_CAP			(1 << 6)
 # define DP_EDP_VBLANK_BACKLIGHT_UPDATE_CAP		(1 << 7)
+#define DP_EDP_OLED_VESA_BRIGHTNESS_ON      0x80
+# define DP_EDP_OLED_VESA_CAP				(1 << 4)
 
 #define DP_EDP_GENERAL_CAP_2		    0x703
 # define DP_EDP_OVERDRIVE_ENGINE_ENABLED		(1 << 0)
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Rodrigo Siqueira
Cc Anthony Koo <[email protected]>
Cc Iswara Negulendran <[email protected]>
Cc Felipe Clark <[email protected]>
Cc Harry Wentland <[email protected]>

Harry

Quoted 17 lines
---
 include/drm/display/drm_dp.h | 2 ++
 1 file changed, 2 insertions(+)
include/drm/display/drm_dp.h +2 -0
index 632376c291db..d30a9b2f450c 100644
@@ -977,6 +977,8 @@
 # define DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP		(1 << 5)
 # define DP_EDP_DYNAMIC_BACKLIGHT_CAP			(1 << 6)
 # define DP_EDP_VBLANK_BACKLIGHT_UPDATE_CAP		(1 << 7)
+#define DP_EDP_OLED_VESA_BRIGHTNESS_ON      0x80
+# define DP_EDP_OLED_VESA_CAP				(1 << 4)
 
 #define DP_EDP_GENERAL_CAP_2		    0x703
 # define DP_EDP_OVERDRIVE_ENGINE_ENABLED		(1 << 0)
Reviewed-by Harry Wentland
#2 lore raw

[AMD Official Use Only - General]

Hello Rodrigo and Harry,
I would like to propose some changes to keep this patch consistent with the naming scheme and general organization of the drm_dp.h file.

#define DP_EDP_OLED_VESA_BRIGHTNESS_ON 0x80
It would be better to use the (1<<7) representation for this bit to follow the pattern established by the other defines in the file. Also, a more generic name for this macro would be DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE.

# define DP_EDP_OLED_VESA_CAP   (1 << 4)
A more generic name for this macro would be DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE

In terms of the file structure, DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE should appear underneath the definition of DP_EDP_BACKLIGHT_MODE_SET_REGISTER. Similarly, DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE should appear underneath the definition of DP_EDP_GENERAL_CAP_2

For a complete definition of the millinit based brightness control specification the following should also be added:
#define DP_EDP_PANEL_TARGET_LUMINANCE_VALUE 0x734

Here is a suggested pseudo-patch with all these changes:

#define DP_EDP_GENERAL_CAP_2 0x703

 # define DP_EDP_OVERDRIVE_ENGINE_ENABLED               (1 << 0)
+# define DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE (1<<7)
# define DP_EDP_DYNAMIC_BACKLIGHT_ENABLE               (1 << 4)
 # define DP_EDP_REGIONAL_BACKLIGHT_ENABLE              (1 << 5)
 # define DP_EDP_UPDATE_REGION_BRIGHTNESS               (1 << 6) /* eDP 1.4 */
+# define DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE (1<<7)

#define DP_EDP_DBC_MINIMUM_BRIGHTNESS_SET 0x732
#define DP_EDP_DBC_MAXIMUM_BRIGHTNESS_SET 0x733
+#define DP_EDP_PANEL_TARGET_LUMINANCE_VALUE 0x734

Thank you,
Felipe

-----Original Message-----
From: Wentland, Harry <[email protected]>
Sent: Wednesday, March 22, 2023 2:01 PM
To: Siqueira, Rodrigo <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Koo, Anthony <[email protected]>; Nagulendran, Iswara <[email protected]>; Clark, Felipe <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] drm/display: Add missing OLED Vesa brightnesses definitions

Quoted 5 lines · Rodrigo Siqueira
Cc Anthony Koo <[email protected]>
Cc Iswara Negulendran <[email protected]>
Cc Felipe Clark <[email protected]>
Cc Harry Wentland <[email protected]>

Harry

Quoted 17 lines
---
 include/drm/display/drm_dp.h | 2 ++
 1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/include/drm/display/drm_dp.h index 632376c291db..d30a9b2f450c 100644

include/drm/display/drm_dp.h +2 -0
@@ -977,6 +977,8 @@
 # define DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP           (1 << 5)
 # define DP_EDP_DYNAMIC_BACKLIGHT_CAP                        (1 << 6)
 # define DP_EDP_VBLANK_BACKLIGHT_UPDATE_CAP          (1 << 7)
+#define DP_EDP_OLED_VESA_BRIGHTNESS_ON      0x80
+# define DP_EDP_OLED_VESA_CAP                                (1 << 4)
 
 #define DP_EDP_GENERAL_CAP_2             0x703
 # define DP_EDP_OVERDRIVE_ENGINE_ENABLED             (1 << 0)
Reviewed-by Harry Wentland
#3 lore raw

[AMD Official Use Only - General]

Hi Rodrigo and Harry,
There was a typo in the third line of the pseudo-patch I wrote in the previous email. Here is the fixed version:

#define DP_EDP_GENERAL_CAP_2 0x703

 # define DP_EDP_OVERDRIVE_ENGINE_ENABLED       (1 << 0)
+# define DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE        (1<<4)
# define DP_EDP_DYNAMIC_BACKLIGHT_ENABLE        (1 << 4)
 # define DP_EDP_REGIONAL_BACKLIGHT_ENABLE      (1 << 5)
 # define DP_EDP_UPDATE_REGION_BRIGHTNESS       (1 << 6) /* eDP 1.4 */
+# define DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE (1<<7)
 #define DP_EDP_DBC_MINIMUM_BRIGHTNESS_SET      0x732
 #define DP_EDP_DBC_MAXIMUM_BRIGHTNESS_SET      0x733
+#define DP_EDP_PANEL_TARGET_LUMINANCE_VALUE    0x734

Thank you,
Felipe

-----Original Message-----
From: Clark, Felipe
Sent: Thursday, March 23, 2023 3:25 PM
To: Wentland, Harry <[email protected]>; Siqueira, Rodrigo <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Koo, Anthony <[email protected]>; Nagulendran, Iswara <[email protected]>; [email protected]; [email protected]
Subject: RE: [PATCH] drm/display: Add missing OLED Vesa brightnesses definitions

Hello Rodrigo and Harry,
I would like to propose some changes to keep this patch consistent with the naming scheme and general organization of the drm_dp.h file.

#define DP_EDP_OLED_VESA_BRIGHTNESS_ON 0x80
It would be better to use the (1<<7) representation for this bit to follow the pattern established by the other defines in the file. Also, a more generic name for this macro would be DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE.

# define DP_EDP_OLED_VESA_CAP   (1 << 4)
A more generic name for this macro would be DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE

In terms of the file structure, DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE should appear underneath the definition of DP_EDP_BACKLIGHT_MODE_SET_REGISTER. Similarly, DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE should appear underneath the definition of DP_EDP_GENERAL_CAP_2

For a complete definition of the millinit based brightness control specification the following should also be added:
#define DP_EDP_PANEL_TARGET_LUMINANCE_VALUE 0x734

Here is a suggested pseudo-patch with all these changes:

#define DP_EDP_GENERAL_CAP_2 0x703

 # define DP_EDP_OVERDRIVE_ENGINE_ENABLED               (1 << 0)
+# define DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE (1<<7)
# define DP_EDP_DYNAMIC_BACKLIGHT_ENABLE               (1 << 4)
 # define DP_EDP_REGIONAL_BACKLIGHT_ENABLE              (1 << 5)
 # define DP_EDP_UPDATE_REGION_BRIGHTNESS               (1 << 6) /* eDP 1.4 */
+# define DP_EDP_PANEL_LUMINANCE_CONTROL_ENABLE (1<<7)

#define DP_EDP_DBC_MINIMUM_BRIGHTNESS_SET 0x732
#define DP_EDP_DBC_MAXIMUM_BRIGHTNESS_SET 0x733
+#define DP_EDP_PANEL_TARGET_LUMINANCE_VALUE 0x734

Thank you,
Felipe

-----Original Message-----
From: Wentland, Harry <[email protected]>
Sent: Wednesday, March 22, 2023 2:01 PM
To: Siqueira, Rodrigo <[email protected]>; [email protected]; [email protected]
Cc: [email protected]; Koo, Anthony <[email protected]>; Nagulendran, Iswara <[email protected]>; Clark, Felipe <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] drm/display: Add missing OLED Vesa brightnesses definitions

Quoted 5 lines · Rodrigo Siqueira
Cc Anthony Koo <[email protected]>
Cc Iswara Negulendran <[email protected]>
Cc Felipe Clark <[email protected]>
Cc Harry Wentland <[email protected]>

Harry

Quoted 17 lines
---
 include/drm/display/drm_dp.h | 2 ++
 1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/include/drm/display/drm_dp.h index 632376c291db..d30a9b2f450c 100644

include/drm/display/drm_dp.h +2 -0
@@ -977,6 +977,8 @@
 # define DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP           (1 << 5)
 # define DP_EDP_DYNAMIC_BACKLIGHT_CAP                        (1 << 6)
 # define DP_EDP_VBLANK_BACKLIGHT_UPDATE_CAP          (1 << 7)
+#define DP_EDP_OLED_VESA_BRIGHTNESS_ON      0x80
+# define DP_EDP_OLED_VESA_CAP                                (1 << 4)
 
 #define DP_EDP_GENERAL_CAP_2             0x703
 # define DP_EDP_OVERDRIVE_ENGINE_ENABLED             (1 << 0)
#4 lore raw
In reply to Rodrigo Siqueira
Quoted 5 lines · Rodrigo Siqueira
Cc Anthony Koo <[email protected]>
Cc Iswara Negulendran <[email protected]>
Cc Felipe Clark <[email protected]>
Cc Harry Wentland <[email protected]>

Some changelog would be useful.

include/drm/display/drm_dp.h line 982

Quoted 8 lines

+++ b/include/drm/display/drm_dp.h

include/drm/display/drm_dp.h +2 -0
@@ -977,6 +977,8 @@
 # define DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP		(1 << 5)
 # define DP_EDP_DYNAMIC_BACKLIGHT_CAP			(1 << 6)
 # define DP_EDP_VBLANK_BACKLIGHT_UPDATE_CAP		(1 << 7)
+#define DP_EDP_OLED_VESA_BRIGHTNESS_ON      0x80
+# define DP_EDP_OLED_VESA_CAP				(1 << 4)
 

Are you fixing a compile problem? Otherwise this should go in with the user...

BR,
Pavel

Signature · 1 line
People of Russia, stop Putin before his war on Ukraine escalates.