Skip to contentSkip to conversation

drm/i915: Add Backlight Control using DPCD for eDP connectors (v3)

PATCH In review Yetunde Adebisi 2 participants 3 messages Nov 16, 2015 – Dec 10, 2015

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

PATCH 1/1 drm/i915: Add Backlight Control using DPCD for eDP connectors (v3)

This patch adds support for eDP backlight control using DPCD registers to backlight hooks in intel_panel.

It checks for backlight control over AUX channel capability and sets up function pointers to get and set the backlight brightness level if supported.

v2: Moved backlight functions from intel_dp.c into a new file intel_dp_aux_backlight.c. Also moved reading of eDP display control registers to intel_dp_get_dpcd

v3: Correct some formatting mistakes

This patch depends on http://patchwork.freedesktop.org/patch/64253/

---
 drivers/gpu/drm/i915/Makefile                 |   1 +
 drivers/gpu/drm/i915/intel_dp.c               |  16 ++-
 drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 177 ++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h              |   6 +
 drivers/gpu/drm/i915/intel_panel.c            |   4 +
 5 files changed, 198 insertions(+), 6 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_dp_aux_backlight.c
drivers/gpu/drm/i915/Makefile +1 -0
index 0851de07..7a1db3d 100644
@@ -77,6 +77,7 @@ i915-y += dvo_ch7017.o \
 	  dvo_tfp410.o \
 	  intel_crt.o \
 	  intel_ddi.o \
+	  intel_dp_aux_backlight.o\
 	  intel_dp_link_training.o \
 	  intel_dp_mst.o \
 	  intel_dp.o \
drivers/gpu/drm/i915/intel_dp.c +10 -6
index 8071247..22e0241 100644
@@ -3156,7 +3156,7 @@ static void chv_dp_post_pll_disable(struct intel_encoder *encoder)
  * Sinks are *supposed* to come up within 1ms from an off state, but we're also
  * supposed to retry 3 times per the spec.
  */
-static ssize_t
+ssize_t
 intel_dp_dpcd_read_wake(struct drm_dp_aux *aux, unsigned int offset,
 			void *buffer, size_t size)
 {
@@ -3823,7 +3823,6 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
 	struct drm_device *dev = dig_port->base.base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	uint8_t rev;
 
 	if (intel_dp_dpcd_read_wake(&intel_dp->aux, 0x000, intel_dp->dpcd,
 				    sizeof(intel_dp->dpcd)) < 0)
@@ -3859,6 +3858,14 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
 			DRM_DEBUG_KMS("PSR2 %s on sink",
 				dev_priv->psr.psr2_support ? "supported" : "not supported");
 		}
+
+		/* Read the eDP Display control capabilities registers */
+		if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP] & DP_DPCD_DISPLAY_CONTROL_CAPABLE) &&
+				(intel_dp_dpcd_read_wake(&intel_dp->aux, DP_EDP_DPCD_REV,
+						intel_dp->dpcd_edp, sizeof(intel_dp->dpcd_edp)) ==
+								sizeof(intel_dp->dpcd_edp)))
+			DRM_DEBUG_KMS("EDP DPCD : %*ph\n", (int) sizeof(intel_dp->dpcd_edp),
+					intel_dp->dpcd_edp);
 	}
 
 	DRM_DEBUG_KMS("Display Port TPS3 support: source %s, sink %s\n",
@@ -3866,10 +3873,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
 		      yesno(drm_dp_tps3_supported(intel_dp->dpcd)));
 
 	/* Intermediate frequency support */
-	if (is_edp(intel_dp) &&
-	    (intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP] &	DP_DPCD_DISPLAY_CONTROL_CAPABLE) &&
-	    (intel_dp_dpcd_read_wake(&intel_dp->aux, DP_EDP_DPCD_REV, &rev, 1) == 1) &&
-	    (rev >= 0x03)) { /* eDp v1.4 or higher */
+	if (is_edp(intel_dp) && (intel_dp->dpcd_edp[0] >= 0x03)) { /* eDp v1.4 or higher */
 		__le16 sink_rates[DP_MAX_SUPPORTED_RATES];
 		int i;
 
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +177 -0

177 lines not on this page · raw message

drivers/gpu/drm/i915/intel_drv.h +6 -0
index ad17288..095df8d 100644
@@ -758,6 +758,7 @@ struct intel_dp {
 	uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
 	uint8_t psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE];
 	uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
+	uint8_t dpcd_edp[EDP_DISPLAY_CTL_CAP_SIZE];
 	/* sink rates as reported by DP_SUPPORTED_LINK_RATES */
 	uint8_t num_sink_rates;
 	int sink_rates[DP_MAX_SUPPORTED_RATES];
@@ -1279,6 +1280,11 @@ void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
 bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);
 bool
 intel_dp_get_link_status(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE]);
+ssize_t intel_dp_dpcd_read_wake(struct drm_dp_aux *aux, unsigned int offset,
+		void *buffer, size_t size);
+
+/* intel_dp_aux_backlight.c */
+int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector);
 
 /* intel_dp_mst.c */
 int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id);
drivers/gpu/drm/i915/intel_panel.c +4 -0
index a24df35..7da49b5 100644
@@ -1744,6 +1744,10 @@ intel_panel_init_backlight_funcs(struct intel_panel *panel)
 	struct drm_device *dev = intel_connector->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (intel_connector->base.connector_type == DRM_MODE_CONNECTOR_eDP &&
+			intel_dp_aux_init_backlight_funcs(intel_connector) == 0)
+		return;
+
 	if (IS_BROXTON(dev)) {
 		panel->backlight.setup = bxt_setup_backlight;
 		panel->backlight.enable = bxt_enable_backlight;
Signature · 6 lines
1.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 33 lines · Yetunde Adebisi

This patch adds support for eDP backlight control using DPCD registers to backlight hooks in intel_panel.

It checks for backlight control over AUX channel capability and sets up function pointers to get and set the backlight brightness level if supported.

v2: Moved backlight functions from intel_dp.c into a new file intel_dp_aux_backlight.c. Also moved reading of eDP display control registers to intel_dp_get_dpcd

v3: Correct some formatting mistakes

This patch depends on http://patchwork.freedesktop.org/patch/64253/

---
 drivers/gpu/drm/i915/Makefile                 |   1 +
 drivers/gpu/drm/i915/intel_dp.c               |  16 ++-
 drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 177 ++++++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h              |   6 +
 drivers/gpu/drm/i915/intel_panel.c            |   4 +
 5 files changed, 198 insertions(+), 6 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_dp_aux_backlight.c
drivers/gpu/drm/i915/Makefile +0 -0
index 0851de07..7a1db3d 100644

drivers/gpu/drm/i915/Makefile i915-y += dvo_ch7017.o \ · line 80

Quoted 4 lines
drivers/gpu/drm/i915/Makefile +1 -0
@@ -77,6 +77,7 @@ i915-y += dvo_ch7017.o \
 	  dvo_tfp410.o \
 	  intel_crt.o \
 	  intel_ddi.o \
+	  intel_dp_aux_backlight.o\

Space before \ please.

Quoted 25 lines
drivers/gpu/drm/i915/Makefile +0 -0
 	  intel_dp_link_training.o \
 	  intel_dp_mst.o \
 	  intel_dp.o \
drivers/gpu/drm/i915/intel_dp.c +1 -2
index 8071247..22e0241 100644
@@ -3156,7 +3156,7 @@ static void chv_dp_post_pll_disable(struct intel_encoder *encoder)
  * Sinks are *supposed* to come up within 1ms from an off state, but we're also
  * supposed to retry 3 times per the spec.
  */
-static ssize_t
+ssize_t
 intel_dp_dpcd_read_wake(struct drm_dp_aux *aux, unsigned int offset,
 			void *buffer, size_t size)
 {
@@ -3823,7 +3823,6 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
 	struct drm_device *dev = dig_port->base.base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	uint8_t rev;
 
 	if (intel_dp_dpcd_read_wake(&intel_dp->aux, 0x000, intel_dp->dpcd,
 				    sizeof(intel_dp->dpcd)) < 0)

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp) · line 3862

Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c +2 -0
@@ -3859,6 +3858,14 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
 			DRM_DEBUG_KMS("PSR2 %s on sink",
 				dev_priv->psr.psr2_support ? "supported" : "not supported");
 		}
+
+		/* Read the eDP Display control capabilities registers */

You need to clear intel_dp->dpcd_edp here.

Quoted 113 lines
drivers/gpu/drm/i915/intel_dp.c +7 -4
+		if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP] & DP_DPCD_DISPLAY_CONTROL_CAPABLE) &&
+				(intel_dp_dpcd_read_wake(&intel_dp->aux, DP_EDP_DPCD_REV,
+						intel_dp->dpcd_edp, sizeof(intel_dp->dpcd_edp)) ==
+								sizeof(intel_dp->dpcd_edp)))
+			DRM_DEBUG_KMS("EDP DPCD : %*ph\n", (int) sizeof(intel_dp->dpcd_edp),
+					intel_dp->dpcd_edp);
 	}
 
 	DRM_DEBUG_KMS("Display Port TPS3 support: source %s, sink %s\n",
@@ -3866,10 +3873,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
 		      yesno(drm_dp_tps3_supported(intel_dp->dpcd)));
 
 	/* Intermediate frequency support */
-	if (is_edp(intel_dp) &&
-	    (intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP] &	DP_DPCD_DISPLAY_CONTROL_CAPABLE) &&
-	    (intel_dp_dpcd_read_wake(&intel_dp->aux, DP_EDP_DPCD_REV, &rev, 1) == 1) &&
-	    (rev >= 0x03)) { /* eDp v1.4 or higher */
+	if (is_edp(intel_dp) && (intel_dp->dpcd_edp[0] >= 0x03)) { /* eDp v1.4 or higher */
 		__le16 sink_rates[DP_MAX_SUPPORTED_RATES];
 		int i;
 
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +86 -0
new file mode 100644
index 0000000..190c5d9
@@ -0,0 +1,177 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include "intel_drv.h"
+
+static bool is_aux_backlight_enabled(struct drm_dp_aux *aux)
+{
+	uint8_t read_val = 0;
+
+	if (intel_dp_dpcd_read_wake(aux, DP_EDP_DISPLAY_CONTROL_REGISTER,
+			&read_val, sizeof(read_val)) < 0)
+		DRM_DEBUG_KMS("Failed to read DPCD register 0x%x\n",
+				DP_EDP_DISPLAY_CONTROL_REGISTER);
+
+	return read_val & DP_EDP_BACKLIGHT_ENABLE;
+}
+
+static void set_aux_backlight_enable(struct intel_dp *intel_dp, bool enable)
+{
+	uint8_t reg_val = 0;
+
+	if (intel_dp_dpcd_read_wake(&intel_dp->aux,
+				DP_EDP_DISPLAY_CONTROL_REGISTER,
+				&reg_val, sizeof(reg_val)) < 0) {
+		DRM_DEBUG_KMS("Failed to read DPCD register 0x%x\n",
+				DP_EDP_DISPLAY_CONTROL_REGISTER);
+		return;
+	}
+	if (enable)
+		reg_val |= DP_EDP_BACKLIGHT_ENABLE;
+	else
+		reg_val &= ~(DP_EDP_BACKLIGHT_ENABLE);
+
+	if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_EDP_DISPLAY_CONTROL_REGISTER,
+			reg_val) < 0) {
+		DRM_DEBUG_KMS("Failed to %s aux backlight\n",
+				enable ? "enable" : "disable");
+	}
+}
+
+/*
+ * Read the current backlight value from DPCD register(s) based
+ * on if 8-bit(MSB) or 16-bit(MSB and LSB) values are supported
+ */
+static uint32_t intel_dp_aux_get_backlight(struct intel_connector *connector)
+{
+	struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder->base);
+	uint8_t read_val[2] = { 0x0 };
+	uint16_t level = 0;
+
+	if (intel_dp_dpcd_read_wake(&intel_dp->aux,
+			DP_EDP_BACKLIGHT_BRIGHTNESS_MSB,
+			&read_val, sizeof(read_val)) < 0) {
+		DRM_DEBUG_KMS("Failed to read DPCD register 0x%x\n",
+				DP_EDP_BACKLIGHT_BRIGHTNESS_MSB);
+		return 0;
+	}
+	level = read_val[0];
+	if (intel_dp->dpcd_edp[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT)
+		level = (read_val[0] << 8 | read_val[1]);
+
+	return level;
+}
+
+/*

drivers/gpu/drm/i915/intel_dp_aux_backlight.c line 96

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +10 -0
+ * Sends the current backlight level over the aux channel, checking if its using
+ * 8-bit or 16 bit value (MSB and LSB)
+ */
+static void
+intel_dp_aux_set_backlight(struct intel_connector *connector, u32 level)
+{
+	struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder->base);
+	uint8_t vals[2] = { 0x0 };
+
+	DRM_DEBUG_KMS("Level 0x%x\n", level);

The caller of the hook does debug logging already.

Quoted 48 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +48 -0
+	vals[0] = level;
+
+	/* Write the MSB and/or LSB */
+	 if (intel_dp->dpcd_edp[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT) {
+		vals[0] = (level & 0xFF00) >> 8;
+		vals[1] = (level & 0xFF);
+	}
+	if (drm_dp_dpcd_write(&intel_dp->aux, DP_EDP_BACKLIGHT_BRIGHTNESS_MSB,
+			vals, sizeof(vals)) < 0) {
+		DRM_DEBUG_KMS("Failed to write aux backlight level\n");
+		return;
+	}
+}
+
+static void intel_dp_aux_enable_backlight(struct intel_connector *connector)
+{
+	set_aux_backlight_enable(enc_to_intel_dp(&connector->encoder->base), true);
+}
+
+static void intel_dp_aux_disable_backlight(struct intel_connector *connector)
+{
+	set_aux_backlight_enable(enc_to_intel_dp(&connector->encoder->base), false);
+}
+
+static int intel_dp_aux_setup_backlight(struct intel_connector *connector,
+			enum pipe pipe)
+{
+	struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder->base);
+	struct intel_panel *panel = &connector->panel;
+
+	if (intel_dp->dpcd_edp[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT)
+		panel->backlight.max = 0xFFFF;
+	else
+		panel->backlight.max = 0xFF;
+
+	panel->backlight.min = 0;
+
+	panel->backlight.level = intel_dp_aux_get_backlight(connector);
+	panel->backlight.enabled = is_aux_backlight_enabled(&intel_dp->aux);
+
+	return 0;
+}
+
+static bool intel_dp_aux_display_control_capable(struct intel_connector *connector)
+{
+	struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder->base);
+	uint8_t dpcd_buf = 0;
+

drivers/gpu/drm/i915/intel_dp_aux_backlight.c line 154

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +10 -0
+	/* Check the  eDP Display control capabilities registers to determine if
+	 * the panel can support backlight control over the aux channel*/
+
+	if (intel_dp->dpcd_edp[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP &&
+			(intel_dp->dpcd_edp[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) &&
+			(intel_dp->dpcd_edp[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP) &&
+			((intel_dp_dpcd_read_wake(&intel_dp->aux,
+					DP_EDP_BACKLIGHT_MODE_SET_REGISTER, &dpcd_buf, 1) == 1) &&
+					((dpcd_buf & DP_EDP_BACKLIGHT_CONTROL_MODE_MASK) ==
+							DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD))) {

The DP_EDP_BACKLIGHT_MODE_SET_REGISTER is a read/write register for configuration. You can also *set* the control method. Apparently this now trusts the BIOS to have written the right value here. I am not sure this is the right way to go.

How about checking that aux control is possible *and* pwm control is not possible, and then setting the mode accordingly?

Also, the power-on default for the mode is DP_EDP_BACKLIGHT_CONTROL_MODE_PRESET, which means a power cycle will fix the brightness to a preset level and the brightness adjustment will cease to work. Did you test this? I think you should write the mode in backlight enable.

Quoted 62 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +23 -0
+
+		DRM_DEBUG_KMS("AUX Backlight Control Supported!\n");
+
+		return true;
+	}
+	return false;
+}
+
+int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector)
+{
+	struct intel_panel *panel = &intel_connector->panel;
+
+	if (!intel_dp_aux_display_control_capable(intel_connector))
+		return -ENODEV;
+
+	panel->backlight.setup = intel_dp_aux_setup_backlight;
+	panel->backlight.enable = intel_dp_aux_enable_backlight;
+	panel->backlight.disable = intel_dp_aux_disable_backlight;
+	panel->backlight.set = intel_dp_aux_set_backlight;
+	panel->backlight.get = intel_dp_aux_get_backlight;
+
+	return 0;
+}
drivers/gpu/drm/i915/intel_drv.h +6 -0
index ad17288..095df8d 100644
@@ -758,6 +758,7 @@ struct intel_dp {
 	uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
 	uint8_t psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE];
 	uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
+	uint8_t dpcd_edp[EDP_DISPLAY_CTL_CAP_SIZE];
 	/* sink rates as reported by DP_SUPPORTED_LINK_RATES */
 	uint8_t num_sink_rates;
 	int sink_rates[DP_MAX_SUPPORTED_RATES];
@@ -1279,6 +1280,11 @@ void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,
 bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);
 bool
 intel_dp_get_link_status(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE]);
+ssize_t intel_dp_dpcd_read_wake(struct drm_dp_aux *aux, unsigned int offset,
+		void *buffer, size_t size);
+
+/* intel_dp_aux_backlight.c */
+int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector);
 
 /* intel_dp_mst.c */
 int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_id);
drivers/gpu/drm/i915/intel_panel.c +4 -0
index a24df35..7da49b5 100644
@@ -1744,6 +1744,10 @@ intel_panel_init_backlight_funcs(struct intel_panel *panel)
 	struct drm_device *dev = intel_connector->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (intel_connector->base.connector_type == DRM_MODE_CONNECTOR_eDP &&
+			intel_dp_aux_init_backlight_funcs(intel_connector) == 0)
+		return;
+
 	if (IS_BROXTON(dev)) {
 		panel->backlight.setup = bxt_setup_backlight;
 		panel->backlight.enable = bxt_enable_backlight;
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Hi Jani,

I have a question below.

Quoted 327 lines

-----Original Message-----
From: Nikula, Jani
Sent: Friday, November 20, 2015 3:04 PM
To: Adebisi, YetundeX; [email protected]
Cc: Adebisi, YetundeX; Paauwe, Bob J
Subject: Re: [PATCH] drm/i915: Add Backlight Control using DPCD for eDP connectors (v3)

Quoted 15 lines · Yetunde Adebisi

This patch adds support for eDP backlight control using DPCD registers to backlight hooks in intel_panel.

It checks for backlight control over AUX channel capability and sets up function pointers to get and set the backlight brightness level if supported.

v2: Moved backlight functions from intel_dp.c into a new file intel_dp_aux_backlight.c. Also moved reading of eDP display control registers to intel_dp_get_dpcd

v3: Correct some formatting mistakes

This patch depends on http://patchwork.freedesktop.org/patch/64253/

Quoted 8 lines
---
 drivers/gpu/drm/i915/Makefile                 |   1 +
 drivers/gpu/drm/i915/intel_dp.c               |  16 ++-
 drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 177

++++++++++++++++++++++++++

Review

Quoted 6 lines
 drivers/gpu/drm/i915/intel_drv.h              |   6 +
 drivers/gpu/drm/i915/intel_panel.c            |   4 +
 5 files changed, 198 insertions(+), 6 deletions(-)
 create mode 100644 drivers/gpu/drm/i915/intel_dp_aux_backlight.c
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/Makefile

drivers/gpu/drm/i915/Makefile i915-y += dvo_ch7017.o \ · line 80

Quoted 8 lines

index 0851de07..7a1db3d 100644

drivers/gpu/drm/i915/Makefile +1 -0
@@ -77,6 +77,7 @@ i915-y += dvo_ch7017.o \
 	  dvo_tfp410.o \
 	  intel_crt.o \
 	  intel_ddi.o \
+	  intel_dp_aux_backlight.o\

Space before \ please.

Review

Quoted 4 lines
drivers/gpu/drm/i915/Makefile +0 -0
 	  intel_dp_link_training.o \
 	  intel_dp_mst.o \
 	  intel_dp.o \
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_dp.c

drivers/gpu/drm/i915/intel_dp.c static void chv_dp_post_pll_disable(struct

Quoted 4 lines

index 8071247..22e0241 100644

drivers/gpu/drm/i915/intel_dp.c +0 -0
@@ -3156,7 +3156,7 @@ static void chv_dp_post_pll_disable(struct

intel_encoder *encoder)

drivers/gpu/drm/i915/intel_dp.c static void chv_dp_post_pll_disable(struct · line 3156

Quoted 1 line
drivers/gpu/drm/i915/intel_dp.c +0 -0
  * Sinks are *supposed* to come up within 1ms from an off state, but

we're also

Quoted 17 lines
drivers/gpu/drm/i915/intel_dp.c +1 -2
  * supposed to retry 3 times per the spec.
  */
-static ssize_t
+ssize_t
 intel_dp_dpcd_read_wake(struct drm_dp_aux *aux, unsigned int offset,
 			void *buffer, size_t size)
 {
@@ -3823,7 +3823,6 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
 	struct drm_device *dev = dig_port->base.base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	uint8_t rev;
 
 	if (intel_dp_dpcd_read_wake(&intel_dp->aux, 0x000, intel_dp-
 dpcd,
drivers/gpu/drm/i915/intel_dp.c +0 -0
 				    sizeof(intel_dp->dpcd)) < 0)

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp) · line 3859

Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +0 -0
@@ -3859,6 +3858,14 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
 			DRM_DEBUG_KMS("PSR2 %s on sink",
 				dev_priv->psr.psr2_support ? "supported" :

"not supported");

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp) · line 3862

Quoted 3 lines
drivers/gpu/drm/i915/intel_dp.c +2 -0
 		}
+
+		/* Read the eDP Display control capabilities registers */

You need to clear intel_dp->dpcd_edp here.

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp) · line 3863

Quoted 1 line
drivers/gpu/drm/i915/intel_dp.c +1 -0
+		if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP] &

DP_DPCD_DISPLAY_CONTROL_CAPABLE) &&

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp) · line 3864

Quoted 1 line
drivers/gpu/drm/i915/intel_dp.c +1 -0
+				(intel_dp_dpcd_read_wake(&intel_dp->aux,

DP_EDP_DPCD_REV,

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp) · line 3865

Quoted 1 line
drivers/gpu/drm/i915/intel_dp.c +1 -0
+						intel_dp->dpcd_edp,

sizeof(intel_dp->dpcd_edp)) ==

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp) · line 3866

Quoted 1 line
drivers/gpu/drm/i915/intel_dp.c +1 -0
+
	sizeof(intel_dp->dpcd_edp)))

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp) · line 3867

Quoted 1 line
drivers/gpu/drm/i915/intel_dp.c +1 -0
+			DRM_DEBUG_KMS("EDP DPCD : %*ph\n", (int)

sizeof(intel_dp->dpcd_edp),

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp)

Quoted 4 lines
drivers/gpu/drm/i915/intel_dp.c +1 -0
+					intel_dp->dpcd_edp);
 	}
 
 	DRM_DEBUG_KMS("Display Port TPS3 support: source %s, sink

%s\n",

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp) · line 3870

Quoted 6 lines
drivers/gpu/drm/i915/intel_dp.c +0 -2
@@ -3866,10 +3873,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
 		      yesno(drm_dp_tps3_supported(intel_dp->dpcd)));
 
 	/* Intermediate frequency support */
-	if (is_edp(intel_dp) &&
-	    (intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP] &
	DP_DPCD_DISPLAY_CONTROL_CAPABLE) &&

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp) · line 3871

Quoted 1 line
drivers/gpu/drm/i915/intel_dp.c +0 -1
-	    (intel_dp_dpcd_read_wake(&intel_dp->aux, DP_EDP_DPCD_REV,

&rev, 1) == 1) &&

drivers/gpu/drm/i915/intel_dp.c intel_dp_get_dpcd(struct intel_dp *intel_dp) · line 3876

Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +1 -1
-	    (rev >= 0x03)) { /* eDp v1.4 or higher */
+	if (is_edp(intel_dp) && (intel_dp->dpcd_edp[0] >= 0x03)) { /* eDp

v1.4 or higher */

Review

Quoted 4 lines
drivers/gpu/drm/i915/intel_dp.c +0 -0
 		__le16 sink_rates[DP_MAX_SUPPORTED_RATES];
 		int i;
 
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c

drivers/gpu/drm/i915/intel_dp_aux_backlight.c line 5

Quoted 10 lines

new file mode 100644
index 0000000..190c5d9

drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +5 -0
@@ -0,0 +1,177 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the

"Software"),

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 6 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +6 -0
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the

next

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 4 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +4 -0
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY

KIND, EXPRESS OR

drivers/gpu/drm/i915/intel_dp_aux_backlight.c line 16

Quoted 1 line
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +1 -0
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF

MERCHANTABILITY,

drivers/gpu/drm/i915/intel_dp_aux_backlight.c line 17

Quoted 1 line
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +1 -0
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN

NO EVENT SHALL

drivers/gpu/drm/i915/intel_dp_aux_backlight.c line 18

Quoted 1 line
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +1 -0
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,

DAMAGES OR OTHER

drivers/gpu/drm/i915/intel_dp_aux_backlight.c line 19

Quoted 1 line
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +1 -0
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR

OTHERWISE, ARISING

drivers/gpu/drm/i915/intel_dp_aux_backlight.c line 20

Quoted 1 line
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +1 -0
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE

OR OTHER DEALINGS

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 11 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +11 -0
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include "intel_drv.h"
+
+static bool is_aux_backlight_enabled(struct drm_dp_aux *aux)
+{
+	uint8_t read_val = 0;
+
+	if (intel_dp_dpcd_read_wake(aux,

DP_EDP_DISPLAY_CONTROL_REGISTER,

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 8 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +8 -0
+			&read_val, sizeof(read_val)) < 0)
+		DRM_DEBUG_KMS("Failed to read DPCD register 0x%x\n",
+				DP_EDP_DISPLAY_CONTROL_REGISTER);
+
+	return read_val & DP_EDP_BACKLIGHT_ENABLE;
+}
+
+static void set_aux_backlight_enable(struct intel_dp *intel_dp, bool

enable)

Quoted 6 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +6 -0
+{
+	uint8_t reg_val = 0;
+
+	if (intel_dp_dpcd_read_wake(&intel_dp->aux,
+				DP_EDP_DISPLAY_CONTROL_REGISTER,
+				&reg_val, sizeof(reg_val)) < 0) {

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +10 -0
+		DRM_DEBUG_KMS("Failed to read DPCD register 0x%x\n",
+				DP_EDP_DISPLAY_CONTROL_REGISTER);
+		return;
+	}
+	if (enable)
+		reg_val |= DP_EDP_BACKLIGHT_ENABLE;
+	else
+		reg_val &= ~(DP_EDP_BACKLIGHT_ENABLE);
+
+	if (drm_dp_dpcd_writeb(&intel_dp->aux,

DP_EDP_DISPLAY_CONTROL_REGISTER,

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 11 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +11 -0
+			reg_val) < 0) {
+		DRM_DEBUG_KMS("Failed to %s aux backlight\n",
+				enable ? "enable" : "disable");
+	}
+}
+
+/*
+ * Read the current backlight value from DPCD register(s) based
+ * on if 8-bit(MSB) or 16-bit(MSB and LSB) values are supported
+ */
+static uint32_t intel_dp_aux_get_backlight(struct intel_connector

*connector)

Quoted 5 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +2 -0
+{
+	struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder-

base);

drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +2 -0
+	uint8_t read_val[2] = { 0x0 };
+	uint16_t level = 0;

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +10 -0
+
+	if (intel_dp_dpcd_read_wake(&intel_dp->aux,
+			DP_EDP_BACKLIGHT_BRIGHTNESS_MSB,
+			&read_val, sizeof(read_val)) < 0) {
+		DRM_DEBUG_KMS("Failed to read DPCD register 0x%x\n",
+				DP_EDP_BACKLIGHT_BRIGHTNESS_MSB);
+		return 0;
+	}
+	level = read_val[0];
+	if (intel_dp->dpcd_edp[2] &

DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT)

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 7 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +7 -0
+		level = (read_val[0] << 8 | read_val[1]);
+
+	return level;
+}
+
+/*
+ * Sends the current backlight level over the aux channel, checking if its

using

drivers/gpu/drm/i915/intel_dp_aux_backlight.c line 96

Quoted 10 lines

+ * 8-bit or 16 bit value (MSB and LSB)
+ */

drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +4 -0
+static void
+intel_dp_aux_set_backlight(struct intel_connector *connector, u32 level)
+{
+	struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder-

base);

drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +3 -0
+	uint8_t vals[2] = { 0x0 };
+
+	DRM_DEBUG_KMS("Level 0x%x\n", level);

The caller of the hook does debug logging already.

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 4 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +4 -0
+	vals[0] = level;
+
+	/* Write the MSB and/or LSB */
+	 if (intel_dp->dpcd_edp[2] &

DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT) {

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 4 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +4 -0
+		vals[0] = (level & 0xFF00) >> 8;
+		vals[1] = (level & 0xFF);
+	}
+	if (drm_dp_dpcd_write(&intel_dp->aux,

DP_EDP_BACKLIGHT_BRIGHTNESS_MSB,

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 7 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +7 -0
+			vals, sizeof(vals)) < 0) {
+		DRM_DEBUG_KMS("Failed to write aux backlight level\n");
+		return;
+	}
+}
+
+static void intel_dp_aux_enable_backlight(struct intel_connector

*connector)

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 6 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +2 -0
+{
+	set_aux_backlight_enable(enc_to_intel_dp(&connector->encoder-

base), true);

drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +3 -0
+}
+
+static void intel_dp_aux_disable_backlight(struct intel_connector

*connector)

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 6 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +2 -0
+{
+	set_aux_backlight_enable(enc_to_intel_dp(&connector->encoder-

base), false);

drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +3 -0
+}
+
+static int intel_dp_aux_setup_backlight(struct intel_connector

*connector,

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 7 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +3 -0
+			enum pipe pipe)
+{
+	struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder-

base);

drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +3 -0
+	struct intel_panel *panel = &connector->panel;
+
+	if (intel_dp->dpcd_edp[2] &

DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT)

Quoted 9 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +8 -0
+		panel->backlight.max = 0xFFFF;
+	else
+		panel->backlight.max = 0xFF;
+
+	panel->backlight.min = 0;
+
+	panel->backlight.level = intel_dp_aux_get_backlight(connector);
+	panel->backlight.enabled = is_aux_backlight_enabled(&intel_dp-

aux);

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 5 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +5 -0
+
+	return 0;
+}
+
+static bool intel_dp_aux_display_control_capable(struct intel_connector

*connector)

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 9 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +2 -0
+{
+	struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder-

base);

drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +6 -0
+	uint8_t dpcd_buf = 0;
+
+	/* Check the  eDP Display control capabilities registers to determine if
+	 * the panel can support backlight control over the aux channel*/
+
+	if (intel_dp->dpcd_edp[1] &

DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP &&

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 1 line
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +1 -0
+			(intel_dp->dpcd_edp[1] &

DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) &&

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 1 line
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +1 -0
+			(intel_dp->dpcd_edp[2] &

DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP) &&

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 2 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +2 -0
+			((intel_dp_dpcd_read_wake(&intel_dp->aux,
+
	DP_EDP_BACKLIGHT_MODE_SET_REGISTER, &dpcd_buf, 1) == 1) &&

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 1 line
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +1 -0
+					((dpcd_buf &

DP_EDP_BACKLIGHT_CONTROL_MODE_MASK) ==

Quoted 1 line

+

	DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD))) {

The DP_EDP_BACKLIGHT_MODE_SET_REGISTER is a read/write register for configuration. You can also *set* the control method. Apparently this now trusts the BIOS to have written the right value here. I am not sure this is the right way to go.

How about checking that aux control is possible *and* pwm control is not possible, and then setting the mode accordingly?

Quoted 6 lines

Also, the power-on default for the mode is DP_EDP_BACKLIGHT_CONTROL_MODE_PRESET, which means a power cycle will fix
the brightness to a preset level and the brightness adjustment will cease to work. Did you test this? I think you should write the mode in backlight enable.

I am not sure what you mean by writing the mode in backlight enable.
The panel I am testing with doesn’t have the mode set to CONTROL_MODE_PRESET after a power cycle.

I have changed the code to look like this, is this what you mean?

static bool intel_dp_aux_display_control_capable(struct intel_connector *connector)

{
	struct intel_dp *intel_dp = enc_to_intel_dp(&connector->encoder->base);
	uint8_t dpcd_buf = 0;

	/* Check the  eDP Display control capabilities registers to determine if
	 * the panel can support backlight control over the aux channel*/

	if (intel_dp->edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP &&
			(intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) &&
			!(intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP) &&
			(intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP) ) {

		DRM_DEBUG_KMS("AUX Backlight Control Supported!\n");
		set_aux_backlight_enable(intel_dp, true);
		if ((intel_dp_dpcd_read_wake(&intel_dp->aux,
			DP_EDP_BACKLIGHT_MODE_SET_REGISTER, &dpcd_buf, 1) == 1) &&
			((dpcd_buf & DP_EDP_BACKLIGHT_CONTROL_MODE_MASK) ==
					DP_EDP_BACKLIGHT_CONTROL_MODE_PRESET))
		drm_dp_dpcd_writeb(&intel_dp->aux, DP_EDP_BACKLIGHT_MODE_SET_REGISTER,
				(dpcd_buf | DP_EDP_BACKLIGHT_CONTROL_MODE_DPCD));

		return true;
	}
	return false;
}
Quoted 69 lines

drivers/gpu/drm/i915/intel_dp_aux_backlight.c

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +9 -0
+
+		DRM_DEBUG_KMS("AUX Backlight Control Supported!\n");
+
+		return true;
+	}
+	return false;
+}
+
+int intel_dp_aux_init_backlight_funcs(struct intel_connector

*intel_connector)

Review

Quoted 15 lines
drivers/gpu/drm/i915/intel_dp_aux_backlight.c new file +14 -0
+{
+	struct intel_panel *panel = &intel_connector->panel;
+
+	if (!intel_dp_aux_display_control_capable(intel_connector))
+		return -ENODEV;
+
+	panel->backlight.setup = intel_dp_aux_setup_backlight;
+	panel->backlight.enable = intel_dp_aux_enable_backlight;
+	panel->backlight.disable = intel_dp_aux_disable_backlight;
+	panel->backlight.set = intel_dp_aux_set_backlight;
+	panel->backlight.get = intel_dp_aux_get_backlight;
+
+	return 0;
+}
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_drv.h

drivers/gpu/drm/i915/intel_drv.h void intel_dp_compute_rate(struct intel_dp

Quoted 12 lines

index ad17288..095df8d 100644

drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -758,6 +758,7 @@ struct intel_dp {
 	uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
 	uint8_t psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE];
 	uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
+	uint8_t dpcd_edp[EDP_DISPLAY_CTL_CAP_SIZE];
 	/* sink rates as reported by DP_SUPPORTED_LINK_RATES */
 	uint8_t num_sink_rates;
 	int sink_rates[DP_MAX_SUPPORTED_RATES];
@@ -1279,6 +1280,11 @@ void intel_dp_compute_rate(struct intel_dp

*intel_dp, int port_clock,

drivers/gpu/drm/i915/intel_drv.h void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,

Quoted 3 lines
drivers/gpu/drm/i915/intel_drv.h +0 -0
 bool intel_dp_source_supports_hbr2(struct intel_dp *intel_dp);
 bool
 intel_dp_get_link_status(struct intel_dp *intel_dp, uint8_t

link_status[DP_LINK_STATUS_SIZE]);

drivers/gpu/drm/i915/intel_drv.h void intel_dp_compute_rate(struct intel_dp · line 1283

Quoted 1 line
drivers/gpu/drm/i915/intel_drv.h +1 -0
+ssize_t intel_dp_dpcd_read_wake(struct drm_dp_aux *aux, unsigned int

offset,

drivers/gpu/drm/i915/intel_drv.h void intel_dp_compute_rate(struct intel_dp *intel_dp, int port_clock,

Quoted 4 lines
drivers/gpu/drm/i915/intel_drv.h +4 -0
+		void *buffer, size_t size);
+
+/* intel_dp_aux_backlight.c */
+int intel_dp_aux_init_backlight_funcs(struct intel_connector

*intel_connector);

drivers/gpu/drm/i915/intel_drv.h void intel_dp_compute_rate(struct intel_dp · line 1289

Quoted 3 lines
drivers/gpu/drm/i915/intel_drv.h +0 -0
 /* intel_dp_mst.c */
 int intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int

conn_id);

Review

Quoted 1 line
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_panel.c

drivers/gpu/drm/i915/intel_panel.c intel_panel_init_backlight_funcs(struct

Quoted 4 lines

index a24df35..7da49b5 100644

drivers/gpu/drm/i915/intel_panel.c +0 -0
@@ -1744,6 +1744,10 @@ intel_panel_init_backlight_funcs(struct

intel_panel *panel)

drivers/gpu/drm/i915/intel_panel.c intel_panel_init_backlight_funcs(struct intel_panel *panel)

Quoted 4 lines
drivers/gpu/drm/i915/intel_panel.c +1 -0
 	struct drm_device *dev = intel_connector->base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
+	if (intel_connector->base.connector_type ==

DRM_MODE_CONNECTOR_eDP &&

drivers/gpu/drm/i915/intel_panel.c intel_panel_init_backlight_funcs(struct · line 1748

Quoted 1 line
drivers/gpu/drm/i915/intel_panel.c +1 -0
+			intel_dp_aux_init_backlight_funcs(intel_connector)

== 0)

Quoted 8 lines

drivers/gpu/drm/i915/intel_panel.c intel_panel_init_backlight_funcs(struct intel_panel *panel) · line 1753

Quoted 5 lines
drivers/gpu/drm/i915/intel_panel.c +2 -0
+		return;
+
 	if (IS_BROXTON(dev)) {
 		panel->backlight.setup = bxt_setup_backlight;
 		panel->backlight.enable = bxt_enable_backlight;

--
Jani Nikula, Intel Open Source Technology Center

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