[PATCH 2/3] debug
José Roberto de Souza
jose.souza at intel.com
Wed Jul 21 05:19:05 UTC 2021
---
drivers/gpu/drm/i915/display/intel_bios.c | 22 ++++++++--
.../drm/i915/display/intel_dp_aux_backlight.c | 11 +++++
.../i915/display/intel_dsi_dcs_backlight.c | 5 +++
drivers/gpu/drm/i915/display/intel_dsi_vbt.c | 5 +++
drivers/gpu/drm/i915/display/intel_panel.c | 42 +++++++++++++++----
drivers/gpu/drm/i915/display/vlv_dsi.c | 35 +++++++++++++++-
6 files changed, 107 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 45d332b1b6f41..da4add5deb1a2 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -1879,17 +1879,29 @@ static void parse_lfp(struct drm_i915_private *i915,
{
const struct vbt_header *vbt = i915->opregion.vbt;
const struct bdb_header *bdb;
- int lfp_inst, panel_index;
+ int lfp_inst = 0, panel_index;
+ enum port port = dvo_port_to_port(i915, devdata->child.dvo_port);
+ int opregion_index;
if (devdata->child.handle == HANDLE_LFP_1)
lfp_inst = 1;
else if (devdata->child.handle == HANDLE_LFP_2)
lfp_inst = 2;
- else
+
+ drm_info(&i915->drm, "parse_lfp port%c lfp_inst=%i | zeh\n", port_name(port), lfp_inst);
+
+ if (lfp_inst == 0)
return;
bdb = get_bdb_header(vbt);
panel_index = get_lfp_panel_index(i915, bdb, lfp_inst);
+ drm_info(&i915->drm, "\tpanel_index=%i | zeh\n", panel_index);
+
+ opregion_index = intel_opregion_get_panel_type(i915);
+ drm_info(&i915->drm, "\tpanel_index using opregion method: %i (OpRegion) | zeh\n", opregion_index);
+ if (opregion_index >= 0 && DISPLAY_VER(i915) < 9)
+ panel_index = opregion_index;
+
if (panel_index == -1)
return;
@@ -1915,6 +1927,8 @@ static void parse_ddi_port(struct drm_i915_private *i915,
enum port port;
port = dvo_port_to_port(i915, child->dvo_port);
+ drm_info(&i915->drm, "parse_ddi_port child.type0x%x child.handle=0x%x port id=%i dvo_port=%i | zeh\n",
+ devdata->child.device_type, devdata->child.handle, port, child->dvo_port);
if (port == PORT_NONE)
return;
@@ -2128,8 +2142,8 @@ parse_general_definitions(struct drm_i915_private *i915,
continue;
drm_dbg_kms(&i915->drm,
- "Found VBT child device with type 0x%x\n",
- child->device_type);
+ "Found VBT child device with type 0x%x handle 0x%x | zeh\n",
+ child->device_type, child->handle);
devdata = kzalloc(sizeof(*devdata), GFP_KERNEL);
if (!devdata)
diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
index 996d24872ae8c..e3c9fc5c94f49 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -313,6 +313,12 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector,
u16 current_level;
u8 current_mode;
int ret;
+ struct drm_i915_private *i915 = dp_to_i915(intel_dp);
+
+ if (!panel->vbt_backlight_info) {
+ drm_info(&i915->drm, "intel_dp_aux_vesa_setup_backlight !panel->vbt_backlight_info | zeh\n");
+ return -1;
+ }
ret = drm_edp_backlight_init(&intel_dp->aux,
&panel->backlight.edp.vesa.info,
@@ -385,6 +391,11 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector)
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
bool try_intel_interface = false, try_vesa_interface = false;
+ if (!panel->vbt_backlight_info) {
+ drm_info(dev, "intel_dp_aux_init_backlight_funcs !vbt_backlight_info | zeh\n");
+ return -1;
+ }
+
/* Check the VBT and user's module parameters to figure out which
* interfaces to probe
*/
diff --git a/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c b/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c
index 018900255fef3..d2ee9929aec78 100644
--- a/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c
@@ -169,6 +169,11 @@ int intel_dsi_dcs_init_backlight_funcs(struct intel_connector *intel_connector)
struct intel_encoder *encoder = intel_attached_encoder(intel_connector);
struct intel_panel *panel = &intel_connector->panel;
+ if (!panel->vbt_backlight_info) {
+ drm_info(dev, "intel_dsi_dcs_init_backlight_funcs !vbt_backlight_info | zeh\n");
+ return -1;
+ }
+
if (panel->vbt_backlight_info->type != INTEL_BACKLIGHT_DSI_DCS)
return -ENODEV;
diff --git a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
index a2110361889c8..bbbdd16c8f35b 100644
--- a/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
+++ b/drivers/gpu/drm/i915/display/intel_dsi_vbt.c
@@ -733,6 +733,11 @@ bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
u16 burst_mode_ratio;
enum port port;
+ if (!mode) {
+ drm_info(dev, "intel_dsi_vbt_init\n !mode | zeh\n");
+ return false;
+ }
+
drm_dbg_kms(&dev_priv->drm, "\n");
intel_dsi->eotp_pkt = mipi_config->eot_pkt_disabled ? 0 : 1;
diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c
index 466a6adc594f3..6f1a1abf7f30f 100644
--- a/drivers/gpu/drm/i915/display/intel_panel.c
+++ b/drivers/gpu/drm/i915/display/intel_panel.c
@@ -1598,7 +1598,13 @@ static u32 vlv_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
static u16 get_vbt_pwm_freq(struct drm_i915_private *dev_priv,
struct intel_panel *panel)
{
- u16 pwm_freq_hz = panel->vbt_backlight_info->pwm_freq_hz;
+ u16 pwm_freq_hz = 0;
+
+ if (!panel->vbt_backlight_info) {
+ drm_info(&dev_priv->drm, "get_vbt_pwm_freq !vbt_backlight_info | zeh\n");
+ } else {
+ pwm_freq_hz = panel->vbt_backlight_info->pwm_freq_hz;
+ }
if (pwm_freq_hz) {
drm_dbg_kms(&dev_priv->drm,
@@ -1644,7 +1650,14 @@ static u32 get_backlight_min_vbt(struct intel_connector *connector)
{
struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
struct intel_panel *panel = &connector->panel;
- int min;
+ int min, vbt_min;
+
+ if (!panel->vbt_backlight_info) {
+ drm_info(&dev_priv->drm, "get_backlight_min_vbt !vbt_backlight_info | zeh\n");
+ vbt_min = 0;
+ } else {
+ vbt_min = panel->vbt_backlight_info->min_brightness;
+ }
drm_WARN_ON(&dev_priv->drm, panel->backlight.pwm_level_max == 0);
@@ -1655,11 +1668,11 @@ static u32 get_backlight_min_vbt(struct intel_connector *connector)
* against this by letting the minimum be at most (arbitrarily chosen)
* 25% of the max.
*/
- min = clamp_t(int, panel->vbt_backlight_info->min_brightness, 0, 64);
- if (min != panel->vbt_backlight_info->min_brightness) {
+ min = clamp_t(int, vbt_min, 0, 64);
+ if (min != vbt_min) {
drm_dbg_kms(&dev_priv->drm,
- "clamping VBT min backlight %d/255 to %d/255\n",
- panel->vbt_backlight_info->min_brightness, min);
+ "clamping VBT min backlight %d/255 to %d/255 | zeh\n",
+ vbt_min, min);
}
/* vbt value is a coefficient in range [0..255] */
@@ -1848,7 +1861,12 @@ bxt_setup_backlight(struct intel_connector *connector, enum pipe unused)
struct intel_panel *panel = &connector->panel;
u32 pwm_ctl, val;
- panel->backlight.controller = panel->vbt_backlight_info->controller;
+ if (!panel->vbt_backlight_info) {
+ drm_info(&dev_priv->drm, "bxt_setup_backlight !vbt_backlight_info | zeh");
+ panel->backlight.controller = 0;
+ } else {
+ panel->backlight.controller = panel->vbt_backlight_info->controller;
+ }
pwm_ctl = intel_de_read(dev_priv,
BXT_BLC_PWM_CTL(panel->backlight.controller));
@@ -2040,7 +2058,11 @@ int intel_panel_setup_backlight(struct drm_connector *connector, enum pipe pipe)
struct intel_panel *panel = &intel_connector->panel;
int ret;
- if (!panel->vbt_backlight_info->present) {
+ if (!panel->vbt_backlight_info) {
+ drm_info(&dev_priv->drm, "intel_panel_setup_backlight !vbt_backlight_info | zeh");
+ }
+
+ if (!panel->vbt_backlight_info || !panel->vbt_backlight_info->present) {
if (dev_priv->quirks & QUIRK_BACKLIGHT_PRESENT) {
drm_dbg_kms(&dev_priv->drm,
"no backlight present per VBT, but present per quirk\n");
@@ -2234,8 +2256,12 @@ int intel_panel_init(struct intel_connector *intel_connector,
struct drm_display_mode *downclock_mode)
{
struct intel_panel *panel = &intel_connector->panel;
+ struct drm_i915_private *dev_priv = to_i915(intel_connector->base.dev);
panel->vbt_backlight_info = intel_bios_backlight_info(intel_connector->encoder);
+ if (!panel->vbt_backlight_info) {
+ drm_info(&dev_priv->drm, "intel_panel_init !vbt_backlight_info | zeh");
+ }
intel_panel_init_backlight_funcs(panel);
panel->fixed_mode = fixed_mode;
diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c b/drivers/gpu/drm/i915/display/vlv_dsi.c
index ec61d09352718..0bf491cc1d0c2 100644
--- a/drivers/gpu/drm/i915/display/vlv_dsi.c
+++ b/drivers/gpu/drm/i915/display/vlv_dsi.c
@@ -1844,6 +1844,8 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
if (!intel_bios_is_dsi_present(dev_priv, &port))
return;
+ drm_dbg_kms(&dev_priv->drm, "0 | zeh\n");
+
if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv))
dev_priv->mipi_mmio_base = BXT_MIPI_BASE;
else
@@ -1865,8 +1867,11 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
connector = &intel_connector->base;
+ drm_dbg_kms(&dev_priv->drm, "1 | zeh\n");
+
drm_encoder_init(dev, encoder, &intel_dsi_funcs, DRM_MODE_ENCODER_DSI,
"DSI %c", port_name(port));
+ drm_dbg_kms(&dev_priv->drm, "1.1 port%c | zeh\n", port_name(port));
intel_encoder->compute_config = intel_dsi_compute_config;
intel_encoder->pre_enable = intel_dsi_pre_enable;
@@ -1878,6 +1883,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
intel_encoder->get_config = intel_dsi_get_config;
intel_encoder->update_pipe = intel_panel_update_backlight;
intel_encoder->shutdown = intel_dsi_shutdown;
+ drm_dbg_kms(&dev_priv->drm, "1.2 | zeh\n");
intel_connector->get_hw_state = intel_connector_get_hw_state;
@@ -1885,6 +1891,7 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
intel_encoder->type = INTEL_OUTPUT_DSI;
intel_encoder->power_domain = POWER_DOMAIN_PORT_DSI;
intel_encoder->cloneable = 0;
+ drm_dbg_kms(&dev_priv->drm, "1.3 | zeh\n");
/*
* On BYT/CHV, pipe A maps to MIPI DSI port A, pipe B maps to MIPI DSI
@@ -1897,9 +1904,10 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
else
intel_encoder->pipe_mask = BIT(PIPE_B);
+ drm_dbg_kms(&dev_priv->drm, "1.4 dev_priv->vbt.dsi.config=%px | zeh\n", dev_priv->vbt.dsi.config);
intel_dsi->panel_power_off_time = ktime_get_boottime();
- if (dev_priv->vbt.dsi.config->dual_link)
+ if (dev_priv->vbt.dsi.config && dev_priv->vbt.dsi.config->dual_link)
intel_dsi->ports = BIT(PORT_A) | BIT(PORT_C);
else
intel_dsi->ports = BIT(port);
@@ -1907,6 +1915,8 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
intel_dsi->dcs_backlight_ports = dev_priv->vbt.dsi.bl_ports;
intel_dsi->dcs_cabc_ports = dev_priv->vbt.dsi.cabc_ports;
+ drm_dbg_kms(&dev_priv->drm, "2 | zeh\n");
+
/* Create a DSI host (and a device) for each port. */
for_each_dsi_port(port, intel_dsi->ports) {
struct intel_dsi_host *host;
@@ -1919,11 +1929,15 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
intel_dsi->dsi_hosts[port] = host;
}
+ drm_dbg_kms(&dev_priv->drm, "3 | zeh\n");
+
if (!intel_dsi_vbt_init(intel_dsi, MIPI_DSI_GENERIC_PANEL_ID)) {
drm_dbg_kms(&dev_priv->drm, "no device found\n");
goto err;
}
+ drm_dbg_kms(&dev_priv->drm, "4 | zeh\n");
+
/* Use clock read-back from current hw-state for fastboot */
current_mode = intel_encoder_current_mode(intel_encoder);
if (current_mode) {
@@ -1938,35 +1952,54 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv)
kfree(current_mode);
}
+ drm_dbg_kms(&dev_priv->drm, "5 | zeh\n");
+
vlv_dphy_param_init(intel_dsi);
+ drm_dbg_kms(&dev_priv->drm, "6 | zeh\n");
+
intel_dsi_vbt_gpio_init(intel_dsi,
intel_dsi_get_hw_state(intel_encoder, &pipe));
+ drm_dbg_kms(&dev_priv->drm, "7 | zeh\n");
+
drm_connector_init(dev, connector, &intel_dsi_connector_funcs,
DRM_MODE_CONNECTOR_DSI);
+ drm_dbg_kms(&dev_priv->drm, "8 | zeh\n");
+
drm_connector_helper_add(connector, &intel_dsi_connector_helper_funcs);
+ drm_dbg_kms(&dev_priv->drm, "9 | zeh\n");
+
connector->display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/
connector->interlace_allowed = false;
connector->doublescan_allowed = false;
intel_connector_attach_encoder(intel_connector, intel_encoder);
+ drm_dbg_kms(&dev_priv->drm, "10 | zeh\n");
+
mutex_lock(&dev->mode_config.mutex);
fixed_mode = intel_panel_vbt_fixed_mode(intel_connector);
mutex_unlock(&dev->mode_config.mutex);
+ drm_dbg_kms(&dev_priv->drm, "11 | zeh\n");
+
if (!fixed_mode) {
drm_dbg_kms(&dev_priv->drm, "no fixed mode\n");
goto err_cleanup_connector;
}
+ drm_dbg_kms(&dev_priv->drm, "12 | zeh\n");
+
intel_panel_init(intel_connector, fixed_mode, NULL);
+ drm_dbg_kms(&dev_priv->drm, "13 | zeh\n");
intel_panel_setup_backlight(connector, INVALID_PIPE);
+ drm_dbg_kms(&dev_priv->drm, "14 | zeh\n");
vlv_dsi_add_properties(intel_connector);
+ drm_dbg_kms(&dev_priv->drm, "15 | zeh\n");
return;
--
2.32.0
More information about the Intel-gfx-trybot
mailing list