Skip to contentSkip to conversation

drm/i915/dpcd_bl: Skip testing control capability with force DPCD quirk

PATCH In review Kai-Heng Feng 3 participants 7 messages Oct 7, 2020 – Oct 8, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/i915/dpcd_bl: Skip testing control capability with force DPCD quirk

HP DreamColor panel needs to be controlled via AUX interface. However, it has both DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP and DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP set, so it fails to pass intel_dp_aux_display_control_capable() test.

Skip the test if the panel has force DPCD quirk.

---
 drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +6 -4
index acbd7eb66cbe..acf2e1c65290 100644
@@ -347,9 +347,13 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector)
 	struct intel_panel *panel = &intel_connector->panel;
 	struct intel_dp *intel_dp = enc_to_intel_dp(intel_connector->encoder);
 	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
+	bool force_dpcd;
+
+	force_dpcd = drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
+				      DP_QUIRK_FORCE_DPCD_BACKLIGHT);
 
 	if (i915->params.enable_dpcd_backlight == 0 ||
-	    !intel_dp_aux_display_control_capable(intel_connector))
+	    (!force_dpcd && !intel_dp_aux_display_control_capable(intel_connector)))
 		return -ENODEV;
 
 	/*
@@ -358,9 +362,7 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector)
 	 */
 	if (i915->vbt.backlight.type !=
 	    INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE &&
-	    i915->params.enable_dpcd_backlight != 1 &&
-	    !drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
-			      DP_QUIRK_FORCE_DPCD_BACKLIGHT)) {
+	    i915->params.enable_dpcd_backlight != 1 && !force_dpcd) {
 		drm_info(&i915->drm,
 			 "Panel advertises DPCD backlight support, but "
 			 "VBT disagrees. If your backlight controls "
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/2 drm/dp: HP DreamColor panel brigntness fix

HP DreamColor panel, which is used by new HP ZBook Studio, needs to use DPCD to control brightness.

---
 drivers/gpu/drm/drm_dp_helper.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_dp_helper.c +1 -0
index 092c8c985911..b3d0ea1b082b 100644
@@ -1321,6 +1321,7 @@ static const struct edid_quirk edid_quirk_list[] = {
 	 */
 	{ MFG(0x06, 0xaf), PROD_ID(0x9b, 0x32), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) },
 	{ MFG(0x06, 0xaf), PROD_ID(0xeb, 0x41), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) },
+	{ MFG(0x30, 0xe4), PROD_ID(0x61, 0x06), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) },
 	{ MFG(0x4d, 0x10), PROD_ID(0xc7, 0x14), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) },
 	{ MFG(0x4d, 0x10), PROD_ID(0xe6, 0x14), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) },
 	{ MFG(0x4c, 0x83), PROD_ID(0x47, 0x41), BIT(DP_QUIRK_FORCE_DPCD_BACKLIGHT) },
Signature · 1 line
2.17.1
#2 lore raw
In reply to Kai-Heng Feng

Hi! I thought this patch rang a bell, we actually already had some discussion about this since there's a couple of other systems this was causing issues for. Unfortunately it never seems like that patch got sent out. Satadru?

(if I don't hear back from them soon, I'll just send out a patch for this myself)

JFYI - the proper fix here is to just drop the DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP check from the code entirely. As long as the backlight supports AUX_SET_CAP, that should be enough for us to control it.

Quoted 46 lines · Kai-Heng Feng

HP DreamColor panel needs to be controlled via AUX interface. However, it has both DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP and DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP set, so it fails to pass intel_dp_aux_display_control_capable() test.

Skip the test if the panel has force DPCD quirk.

---
 drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +5 -1
index acbd7eb66cbe..acf2e1c65290 100644
@@ -347,9 +347,13 @@ int intel_dp_aux_init_backlight_funcs(struct
 intel_connector *intel_connector)
 	struct intel_panel *panel = &intel_connector->panel;
 	struct intel_dp *intel_dp = enc_to_intel_dp(intel_connector->encoder);
 	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
+	bool force_dpcd;
+
+	force_dpcd = drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
+				      DP_QUIRK_FORCE_DPCD_BACKLIGHT);
 
 	if (i915->params.enable_dpcd_backlight == 0 ||
-	    !intel_dp_aux_display_control_capable(intel_connector))
+	    (!force_dpcd &&
 !intel_dp_aux_display_control_capable(intel_connector)))
 		return -ENODEV;
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +1 -3
 	/*
@@ -358,9 +362,7 @@ int intel_dp_aux_init_backlight_funcs(struct
 intel_connector *intel_connector)
 	 */
 	if (i915->vbt.backlight.type !=
 	    INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE &&
-	    i915->params.enable_dpcd_backlight != 1 &&
-	    !drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
-			      DP_QUIRK_FORCE_DPCD_BACKLIGHT)) {
+	    i915->params.enable_dpcd_backlight != 1 && !force_dpcd) {
 		drm_info(&i915->drm,
 			 "Panel advertises DPCD backlight support, but "

"VBT disagrees. If your backlight controls "

Signature · 8 lines
Sincerely,
      Lyude Paul (she/her)
      Software Engineer at Red Hat

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Hi Lyude,

Quoted 6 lines · Lyude Paul

Hi! I thought this patch rang a bell, we actually already had some discussion about this since there's a couple of other systems this was causing issues for. Unfortunately it never seems like that patch got sent out. Satadru?

Quoted 6 lines

(if I don't hear back from them soon, I'll just send out a patch for this myself)

JFYI - the proper fix here is to just drop the DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP check from the code entirely. As long as the backlight supports AUX_SET_CAP, that should be enough for us to control it.

Does the proper fix include dropping DP_QUIRK_FORCE_DPCD_BACKLIGHT entirely?

Kai-Heng

Quoted 36 lines · Kai-Heng Feng
Quoted 33 lines

HP DreamColor panel needs to be controlled via AUX interface. However, it has both DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP and DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP set, so it fails to pass intel_dp_aux_display_control_capable() test.

Skip the test if the panel has force DPCD quirk.

---
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 10 ++++++----

1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +5 -1
index acbd7eb66cbe..acf2e1c65290 100644
@@ -347,9 +347,13 @@ int intel_dp_aux_init_backlight_funcs(struct
 intel_connector *intel_connector)
 	struct intel_panel *panel = &intel_connector->panel;
 	struct intel_dp *intel_dp = enc_to_intel_dp(intel_connector->encoder);
 	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
+	bool force_dpcd;
+
+	force_dpcd = drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
+				      DP_QUIRK_FORCE_DPCD_BACKLIGHT);
 
 	if (i915->params.enable_dpcd_backlight == 0 ||
-	    !intel_dp_aux_display_control_capable(intel_connector))
+	    (!force_dpcd &&
 !intel_dp_aux_display_control_capable(intel_connector)))
 		return -ENODEV;
Quoted 17 lines
Quoted 13 lines
	/*
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +1 -3
@@ -358,9 +362,7 @@ int intel_dp_aux_init_backlight_funcs(struct
 intel_connector *intel_connector)
 	 */
 	if (i915->vbt.backlight.type !=
 	    INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE &&
-	    i915->params.enable_dpcd_backlight != 1 &&
-	    !drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
-			      DP_QUIRK_FORCE_DPCD_BACKLIGHT)) {
+	    i915->params.enable_dpcd_backlight != 1 && !force_dpcd) {
 		drm_info(&i915->drm,
 			 "Panel advertises DPCD backlight support, but "

"VBT disagrees. If your backlight controls "

Signature · 3 lines
Sincerely,
     Lyude Paul (she/her)
     Software Engineer at Red Hat

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 13 lines · Kai-Heng Feng

Hi Lyude,

Quoted 11 lines · Lyude Paul

Hi! I thought this patch rang a bell, we actually already had some discussion
about this since there's a couple of other systems this was causing issues for.
Unfortunately it never seems like that patch got sent out. Satadru?

(if I don't hear back from them soon, I'll just send out a patch for this myself)

Quoted 7 lines
Quoted 5 lines

JFYI - the proper fix here is to just drop the DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP check from the code entirely. As long as
the backlight supports AUX_SET_CAP, that should be enough for us to control it.

Does the proper fix include dropping DP_QUIRK_FORCE_DPCD_BACKLIGHT entirely?\

Not yet - we need someone to help with reviewing my Intel HDR backlight interface patches before we can drop that. I was just talking about dropping the check where we don't enable the DPCD backlight if it claims to support DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP

Quoted 55 lines

Kai-Heng

Quoted 52 lines · Kai-Heng Feng
Quoted 46 lines

HP DreamColor panel needs to be controlled via AUX interface. However, it has both DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP and DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP set, so it fails to pass intel_dp_aux_display_control_capable() test.

Skip the test if the panel has force DPCD quirk.

---
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 10 ++++++----

1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +5 -1
index acbd7eb66cbe..acf2e1c65290 100644
@@ -347,9 +347,13 @@ int intel_dp_aux_init_backlight_funcs(struct
 intel_connector *intel_connector)
 	struct intel_panel *panel = &intel_connector->panel;
 	struct intel_dp *intel_dp = enc_to_intel_dp(intel_connector->encoder);
 	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
+	bool force_dpcd;
+
+	force_dpcd = drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
+				      DP_QUIRK_FORCE_DPCD_BACKLIGHT);
 
 	if (i915->params.enable_dpcd_backlight == 0 ||
-	    !intel_dp_aux_display_control_capable(intel_connector))
+	    (!force_dpcd &&
 !intel_dp_aux_display_control_capable(intel_connector)))
 		return -ENODEV;
	/*
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +1 -3
@@ -358,9 +362,7 @@ int intel_dp_aux_init_backlight_funcs(struct
 intel_connector *intel_connector)
 	 */
 	if (i915->vbt.backlight.type !=
 	    INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE &&
-	    i915->params.enable_dpcd_backlight != 1 &&
-	    !drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
-			      DP_QUIRK_FORCE_DPCD_BACKLIGHT)) {
+	    i915->params.enable_dpcd_backlight != 1 && !force_dpcd) {
 		drm_info(&i915->drm,
 			 "Panel advertises DPCD backlight support, but "

"VBT disagrees. If your backlight controls "

Signature · 3 lines
Sincerely,
     Lyude Paul (she/her)
     Software Engineer at Red Hat
Signature · 3 lines
Sincerely,
      Lyude Paul (she/her)
      Software Engineer at Red Hat
#5 lore raw
In reply to Kai-Heng Feng

oh hold on, I misspoke. Here's the patch I was thinking of:

https://patchwork.freedesktop.org/series/82041/

Quoted 75 lines · Kai-Heng Feng

Hi Lyude,

Quoted 8 lines · Lyude Paul

Hi! I thought this patch rang a bell, we actually already had some discussion
about this since there's a couple of other systems this was causing issues for.
Unfortunately it never seems like that patch got sent out. Satadru?

Quoted 8 lines

(if I don't hear back from them soon, I'll just send out a patch for this myself)

JFYI - the proper fix here is to just drop the DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP check from the code entirely. As long as
the backlight supports AUX_SET_CAP, that should be enough for us to control it.

Does the proper fix include dropping DP_QUIRK_FORCE_DPCD_BACKLIGHT entirely?

Kai-Heng

Quoted 52 lines · Kai-Heng Feng
Quoted 46 lines

HP DreamColor panel needs to be controlled via AUX interface. However, it has both DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP and DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP set, so it fails to pass intel_dp_aux_display_control_capable() test.

Skip the test if the panel has force DPCD quirk.

---
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 10 ++++++----

1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +5 -1
index acbd7eb66cbe..acf2e1c65290 100644
@@ -347,9 +347,13 @@ int intel_dp_aux_init_backlight_funcs(struct
 intel_connector *intel_connector)
 	struct intel_panel *panel = &intel_connector->panel;
 	struct intel_dp *intel_dp = enc_to_intel_dp(intel_connector->encoder);
 	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
+	bool force_dpcd;
+
+	force_dpcd = drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
+				      DP_QUIRK_FORCE_DPCD_BACKLIGHT);
 
 	if (i915->params.enable_dpcd_backlight == 0 ||
-	    !intel_dp_aux_display_control_capable(intel_connector))
+	    (!force_dpcd &&
 !intel_dp_aux_display_control_capable(intel_connector)))
 		return -ENODEV;
	/*
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +1 -3
@@ -358,9 +362,7 @@ int intel_dp_aux_init_backlight_funcs(struct
 intel_connector *intel_connector)
 	 */
 	if (i915->vbt.backlight.type !=
 	    INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE &&
-	    i915->params.enable_dpcd_backlight != 1 &&
-	    !drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
-			      DP_QUIRK_FORCE_DPCD_BACKLIGHT)) {
+	    i915->params.enable_dpcd_backlight != 1 && !force_dpcd) {
 		drm_info(&i915->drm,
 			 "Panel advertises DPCD backlight support, but "

"VBT disagrees. If your backlight controls "

Signature · 3 lines
Sincerely,
     Lyude Paul (she/her)
     Software Engineer at Red Hat
Signature · 8 lines
Sincerely,
      Lyude Paul (she/her)
      Software Engineer at Red Hat

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

Kevin Chowski said he would be geting to working on upstreaming a version of that which was in the ChromeOS tree here:

https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2344844
when I last spoke to hi

(This was two weeks ago.)

Kevin - do you have any input on this?

Satadru

Quoted 88 lines · Lyude Paul

oh hold on, I misspoke. Here's the patch I was thinking of:

https://patchwork.freedesktop.org/series/82041/

Quoted 7 lines · Kai-Heng Feng

Hi Lyude,

Quoted 5 lines · Lyude Paul

Hi! I thought this patch rang a bell, we actually already had some discussion
about this since there's a couple of other systems this was causing

issues

Quoted 4 lines
Quoted 4 lines

for.
Unfortunately it never seems like that patch got sent out. Satadru?

(if I don't hear back from them soon, I'll just send out a patch for

this

Quoted 4 lines
Quoted 4 lines

myself)

JFYI - the proper fix here is to just drop the DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP check from the code entirely.

As

Quoted 2 lines
Quoted 2 lines

long as
the backlight supports AUX_SET_CAP, that should be enough for us to

control

Quoted 3 lines
Quoted 1 line

it.

Does the proper fix include dropping DP_QUIRK_FORCE_DPCD_BACKLIGHT

entirely?

Quoted 6 lines

Kai-Heng

Quoted 3 lines · Kai-Heng Feng
Quoted 1 line

HP DreamColor panel needs to be controlled via AUX interface.

However,

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

it has both DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP and DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP set, so it fails to pass intel_dp_aux_display_control_capable() test.

Skip the test if the panel has force DPCD quirk.

---
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 10 ++++++----

1 file changed, 6 insertions(+), 4 deletions(-)
Quoted 9 lines
Quoted 9 lines

drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c int intel_dp_aux_init_backlight_funcs(struct · line 349

Quoted 9 lines
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +0 -0
index acbd7eb66cbe..acf2e1c65290 100644
@@ -347,9 +347,13 @@ int intel_dp_aux_init_backlight_funcs(struct
 intel_connector *intel_connector)
  struct intel_panel *panel = &intel_connector->panel;
  struct intel_dp *intel_dp =

enc_to_intel_dp(intel_connector->encoder);

Quoted 4 lines
Quoted 4 lines

drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector)

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +3 -0
  struct drm_i915_private *i915 = dp_to_i915(intel_dp);
+ bool force_dpcd;
+
+ force_dpcd = drm_dp_has_quirk(&intel_dp->desc,

intel_dp->edid_quirks,

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +2 -1
+                               DP_QUIRK_FORCE_DPCD_BACKLIGHT);
 
  if (i915->params.enable_dpcd_backlight == 0 ||
-     !intel_dp_aux_display_control_capable(intel_connector))
+     (!force_dpcd &&
 !intel_dp_aux_display_control_capable(intel_connector)))
          return -ENODEV;

/*

drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +0 -3
@@ -358,9 +362,7 @@ int intel_dp_aux_init_backlight_funcs(struct
 intel_connector *intel_connector)
   */
  if (i915->vbt.backlight.type !=
      INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE &&
-     i915->params.enable_dpcd_backlight != 1 &&
-     !drm_dp_has_quirk(&intel_dp->desc, intel_dp->edid_quirks,
-                       DP_QUIRK_FORCE_DPCD_BACKLIGHT)) {
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c +1 -0
+     i915->params.enable_dpcd_backlight != 1 && !force_dpcd) {
          drm_info(&i915->drm,
                   "Panel advertises DPCD backlight support, but "

"VBT disagrees. If your backlight controls "

--
Sincerely,
Lyude Paul (she/her)
Software Engineer at Red Hat

Quoted 6 lines

--
Sincerely,
Lyude Paul (she/her)
Software Engineer at Red Hat

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx