Commit 698236f5 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-intel-fixes-2024-03-07' of...

Merge tag 'drm-intel-fixes-2024-03-07' of https://anongit.freedesktop.org/git/drm/drm-intel into drm-fixes

- Fix for #10184: Kernel crash on UHD Graphics 730 (Cc stable)
. Fix for #10284: Boot delay regresion with PSR
- Fix DP connector DSC HW state readout
- Selftest fix to convert msecs to jiffies
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Zel4jMpJ2Fay5VeJ@jlahtine-mobl.ger.corp.intel.com
parents d6a209dd 984318aa
...@@ -246,7 +246,14 @@ static enum phy icl_aux_pw_to_phy(struct drm_i915_private *i915, ...@@ -246,7 +246,14 @@ static enum phy icl_aux_pw_to_phy(struct drm_i915_private *i915,
enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well); enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
struct intel_digital_port *dig_port = aux_ch_to_digital_port(i915, aux_ch); struct intel_digital_port *dig_port = aux_ch_to_digital_port(i915, aux_ch);
return intel_port_to_phy(i915, dig_port->base.port); /*
* FIXME should we care about the (VBT defined) dig_port->aux_ch
* relationship or should this be purely defined by the hardware layout?
* Currently if the port doesn't appear in the VBT, or if it's declared
* as HDMI-only and routed to a combo PHY, the encoder either won't be
* present at all or it will not have an aux_ch assigned.
*/
return dig_port ? intel_port_to_phy(i915, dig_port->base.port) : PHY_NONE;
} }
static void hsw_wait_for_power_well_enable(struct drm_i915_private *dev_priv, static void hsw_wait_for_power_well_enable(struct drm_i915_private *dev_priv,
...@@ -414,7 +421,8 @@ icl_combo_phy_aux_power_well_enable(struct drm_i915_private *dev_priv, ...@@ -414,7 +421,8 @@ icl_combo_phy_aux_power_well_enable(struct drm_i915_private *dev_priv,
intel_de_rmw(dev_priv, regs->driver, 0, HSW_PWR_WELL_CTL_REQ(pw_idx)); intel_de_rmw(dev_priv, regs->driver, 0, HSW_PWR_WELL_CTL_REQ(pw_idx));
if (DISPLAY_VER(dev_priv) < 12) /* FIXME this is a mess */
if (phy != PHY_NONE)
intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(phy), intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(phy),
0, ICL_LANE_ENABLE_AUX); 0, ICL_LANE_ENABLE_AUX);
...@@ -437,7 +445,10 @@ icl_combo_phy_aux_power_well_disable(struct drm_i915_private *dev_priv, ...@@ -437,7 +445,10 @@ icl_combo_phy_aux_power_well_disable(struct drm_i915_private *dev_priv,
drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv)); drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(phy), ICL_LANE_ENABLE_AUX, 0); /* FIXME this is a mess */
if (phy != PHY_NONE)
intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(phy),
ICL_LANE_ENABLE_AUX, 0);
intel_de_rmw(dev_priv, regs->driver, HSW_PWR_WELL_CTL_REQ(pw_idx), 0); intel_de_rmw(dev_priv, regs->driver, HSW_PWR_WELL_CTL_REQ(pw_idx), 0);
......
...@@ -609,6 +609,13 @@ struct intel_connector { ...@@ -609,6 +609,13 @@ struct intel_connector {
* and active (i.e. dpms ON state). */ * and active (i.e. dpms ON state). */
bool (*get_hw_state)(struct intel_connector *); bool (*get_hw_state)(struct intel_connector *);
/*
* Optional hook called during init/resume to sync any state
* stored in the connector (eg. DSC state) wrt. the HW state.
*/
void (*sync_state)(struct intel_connector *connector,
const struct intel_crtc_state *crtc_state);
/* Panel info for eDP and LVDS */ /* Panel info for eDP and LVDS */
struct intel_panel panel; struct intel_panel panel;
......
...@@ -5699,6 +5699,9 @@ intel_dp_detect(struct drm_connector *connector, ...@@ -5699,6 +5699,9 @@ intel_dp_detect(struct drm_connector *connector,
goto out; goto out;
} }
if (!intel_dp_is_edp(intel_dp))
intel_psr_init_dpcd(intel_dp);
intel_dp_detect_dsc_caps(intel_dp, intel_connector); intel_dp_detect_dsc_caps(intel_dp, intel_connector);
intel_dp_configure_mst(intel_dp); intel_dp_configure_mst(intel_dp);
...@@ -5859,6 +5862,19 @@ intel_dp_connector_unregister(struct drm_connector *connector) ...@@ -5859,6 +5862,19 @@ intel_dp_connector_unregister(struct drm_connector *connector)
intel_connector_unregister(connector); intel_connector_unregister(connector);
} }
void intel_dp_connector_sync_state(struct intel_connector *connector,
const struct intel_crtc_state *crtc_state)
{
struct drm_i915_private *i915 = to_i915(connector->base.dev);
if (crtc_state && crtc_state->dsc.compression_enable) {
drm_WARN_ON(&i915->drm, !connector->dp.dsc_decompression_aux);
connector->dp.dsc_decompression_enabled = true;
} else {
connector->dp.dsc_decompression_enabled = false;
}
}
void intel_dp_encoder_flush_work(struct drm_encoder *encoder) void intel_dp_encoder_flush_work(struct drm_encoder *encoder)
{ {
struct intel_digital_port *dig_port = enc_to_dig_port(to_intel_encoder(encoder)); struct intel_digital_port *dig_port = enc_to_dig_port(to_intel_encoder(encoder));
......
...@@ -45,6 +45,8 @@ bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state, ...@@ -45,6 +45,8 @@ bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state,
int intel_dp_min_bpp(enum intel_output_format output_format); int intel_dp_min_bpp(enum intel_output_format output_format);
bool intel_dp_init_connector(struct intel_digital_port *dig_port, bool intel_dp_init_connector(struct intel_digital_port *dig_port,
struct intel_connector *intel_connector); struct intel_connector *intel_connector);
void intel_dp_connector_sync_state(struct intel_connector *connector,
const struct intel_crtc_state *crtc_state);
void intel_dp_set_link_params(struct intel_dp *intel_dp, void intel_dp_set_link_params(struct intel_dp *intel_dp,
int link_rate, int lane_count); int link_rate, int lane_count);
int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp, int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
......
...@@ -1534,6 +1534,7 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo ...@@ -1534,6 +1534,7 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
return NULL; return NULL;
intel_connector->get_hw_state = intel_dp_mst_get_hw_state; intel_connector->get_hw_state = intel_dp_mst_get_hw_state;
intel_connector->sync_state = intel_dp_connector_sync_state;
intel_connector->mst_port = intel_dp; intel_connector->mst_port = intel_dp;
intel_connector->port = port; intel_connector->port = port;
drm_dp_mst_get_port_malloc(port); drm_dp_mst_get_port_malloc(port);
......
...@@ -318,12 +318,6 @@ static void intel_modeset_update_connector_atomic_state(struct drm_i915_private ...@@ -318,12 +318,6 @@ static void intel_modeset_update_connector_atomic_state(struct drm_i915_private
const struct intel_crtc_state *crtc_state = const struct intel_crtc_state *crtc_state =
to_intel_crtc_state(crtc->base.state); to_intel_crtc_state(crtc->base.state);
if (crtc_state->dsc.compression_enable) {
drm_WARN_ON(&i915->drm, !connector->dp.dsc_decompression_aux);
connector->dp.dsc_decompression_enabled = true;
} else {
connector->dp.dsc_decompression_enabled = false;
}
conn_state->max_bpc = (crtc_state->pipe_bpp ?: 24) / 3; conn_state->max_bpc = (crtc_state->pipe_bpp ?: 24) / 3;
} }
} }
...@@ -775,8 +769,9 @@ static void intel_modeset_readout_hw_state(struct drm_i915_private *i915) ...@@ -775,8 +769,9 @@ static void intel_modeset_readout_hw_state(struct drm_i915_private *i915)
drm_connector_list_iter_begin(&i915->drm, &conn_iter); drm_connector_list_iter_begin(&i915->drm, &conn_iter);
for_each_intel_connector_iter(connector, &conn_iter) { for_each_intel_connector_iter(connector, &conn_iter) {
struct intel_crtc_state *crtc_state = NULL;
if (connector->get_hw_state(connector)) { if (connector->get_hw_state(connector)) {
struct intel_crtc_state *crtc_state;
struct intel_crtc *crtc; struct intel_crtc *crtc;
connector->base.dpms = DRM_MODE_DPMS_ON; connector->base.dpms = DRM_MODE_DPMS_ON;
...@@ -802,6 +797,10 @@ static void intel_modeset_readout_hw_state(struct drm_i915_private *i915) ...@@ -802,6 +797,10 @@ static void intel_modeset_readout_hw_state(struct drm_i915_private *i915)
connector->base.dpms = DRM_MODE_DPMS_OFF; connector->base.dpms = DRM_MODE_DPMS_OFF;
connector->base.encoder = NULL; connector->base.encoder = NULL;
} }
if (connector->sync_state)
connector->sync_state(connector, crtc_state);
drm_dbg_kms(&i915->drm, drm_dbg_kms(&i915->drm,
"[CONNECTOR:%d:%s] hw state readout: %s\n", "[CONNECTOR:%d:%s] hw state readout: %s\n",
connector->base.base.id, connector->base.name, connector->base.base.id, connector->base.name,
......
...@@ -2776,9 +2776,6 @@ void intel_psr_init(struct intel_dp *intel_dp) ...@@ -2776,9 +2776,6 @@ void intel_psr_init(struct intel_dp *intel_dp)
if (!(HAS_PSR(dev_priv) || HAS_DP20(dev_priv))) if (!(HAS_PSR(dev_priv) || HAS_DP20(dev_priv)))
return; return;
if (!intel_dp_is_edp(intel_dp))
intel_psr_init_dpcd(intel_dp);
/* /*
* HSW spec explicitly says PSR is tied to port A. * HSW spec explicitly says PSR is tied to port A.
* BDW+ platforms have a instance of PSR registers per transcoder but * BDW+ platforms have a instance of PSR registers per transcoder but
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
* Copyright © 2021 Intel Corporation * Copyright © 2021 Intel Corporation
*/ */
#include <linux/jiffies.h>
//#include "gt/intel_engine_user.h" //#include "gt/intel_engine_user.h"
#include "gt/intel_gt.h" #include "gt/intel_gt.h"
#include "i915_drv.h" #include "i915_drv.h"
...@@ -12,7 +14,7 @@ ...@@ -12,7 +14,7 @@
#define REDUCED_TIMESLICE 5 #define REDUCED_TIMESLICE 5
#define REDUCED_PREEMPT 10 #define REDUCED_PREEMPT 10
#define WAIT_FOR_RESET_TIME 10000 #define WAIT_FOR_RESET_TIME_MS 10000
struct intel_engine_cs *intel_selftest_find_any_engine(struct intel_gt *gt) struct intel_engine_cs *intel_selftest_find_any_engine(struct intel_gt *gt)
{ {
...@@ -91,7 +93,7 @@ int intel_selftest_wait_for_rq(struct i915_request *rq) ...@@ -91,7 +93,7 @@ int intel_selftest_wait_for_rq(struct i915_request *rq)
{ {
long ret; long ret;
ret = i915_request_wait(rq, 0, WAIT_FOR_RESET_TIME); ret = i915_request_wait(rq, 0, msecs_to_jiffies(WAIT_FOR_RESET_TIME_MS));
if (ret < 0) if (ret < 0)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment