Skip to content

Commit 698236f

Browse files
committed
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: Dave Airlie <[email protected]> From: Joonas Lahtinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents d6a209d + 984318a commit 698236f

File tree

8 files changed

+50
-15
lines changed

8 files changed

+50
-15
lines changed

drivers/gpu/drm/i915/display/intel_display_power_well.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,14 @@ static enum phy icl_aux_pw_to_phy(struct drm_i915_private *i915,
246246
enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
247247
struct intel_digital_port *dig_port = aux_ch_to_digital_port(i915, aux_ch);
248248

249-
return intel_port_to_phy(i915, dig_port->base.port);
249+
/*
250+
* FIXME should we care about the (VBT defined) dig_port->aux_ch
251+
* relationship or should this be purely defined by the hardware layout?
252+
* Currently if the port doesn't appear in the VBT, or if it's declared
253+
* as HDMI-only and routed to a combo PHY, the encoder either won't be
254+
* present at all or it will not have an aux_ch assigned.
255+
*/
256+
return dig_port ? intel_port_to_phy(i915, dig_port->base.port) : PHY_NONE;
250257
}
251258

252259
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,
414421

415422
intel_de_rmw(dev_priv, regs->driver, 0, HSW_PWR_WELL_CTL_REQ(pw_idx));
416423

417-
if (DISPLAY_VER(dev_priv) < 12)
424+
/* FIXME this is a mess */
425+
if (phy != PHY_NONE)
418426
intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(phy),
419427
0, ICL_LANE_ENABLE_AUX);
420428

@@ -437,7 +445,10 @@ icl_combo_phy_aux_power_well_disable(struct drm_i915_private *dev_priv,
437445

438446
drm_WARN_ON(&dev_priv->drm, !IS_ICELAKE(dev_priv));
439447

440-
intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(phy), ICL_LANE_ENABLE_AUX, 0);
448+
/* FIXME this is a mess */
449+
if (phy != PHY_NONE)
450+
intel_de_rmw(dev_priv, ICL_PORT_CL_DW12(phy),
451+
ICL_LANE_ENABLE_AUX, 0);
441452

442453
intel_de_rmw(dev_priv, regs->driver, HSW_PWR_WELL_CTL_REQ(pw_idx), 0);
443454

drivers/gpu/drm/i915/display/intel_display_types.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,13 @@ struct intel_connector {
609609
* and active (i.e. dpms ON state). */
610610
bool (*get_hw_state)(struct intel_connector *);
611611

612+
/*
613+
* Optional hook called during init/resume to sync any state
614+
* stored in the connector (eg. DSC state) wrt. the HW state.
615+
*/
616+
void (*sync_state)(struct intel_connector *connector,
617+
const struct intel_crtc_state *crtc_state);
618+
612619
/* Panel info for eDP and LVDS */
613620
struct intel_panel panel;
614621

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5699,6 +5699,9 @@ intel_dp_detect(struct drm_connector *connector,
56995699
goto out;
57005700
}
57015701

5702+
if (!intel_dp_is_edp(intel_dp))
5703+
intel_psr_init_dpcd(intel_dp);
5704+
57025705
intel_dp_detect_dsc_caps(intel_dp, intel_connector);
57035706

57045707
intel_dp_configure_mst(intel_dp);
@@ -5859,6 +5862,19 @@ intel_dp_connector_unregister(struct drm_connector *connector)
58595862
intel_connector_unregister(connector);
58605863
}
58615864

5865+
void intel_dp_connector_sync_state(struct intel_connector *connector,
5866+
const struct intel_crtc_state *crtc_state)
5867+
{
5868+
struct drm_i915_private *i915 = to_i915(connector->base.dev);
5869+
5870+
if (crtc_state && crtc_state->dsc.compression_enable) {
5871+
drm_WARN_ON(&i915->drm, !connector->dp.dsc_decompression_aux);
5872+
connector->dp.dsc_decompression_enabled = true;
5873+
} else {
5874+
connector->dp.dsc_decompression_enabled = false;
5875+
}
5876+
}
5877+
58625878
void intel_dp_encoder_flush_work(struct drm_encoder *encoder)
58635879
{
58645880
struct intel_digital_port *dig_port = enc_to_dig_port(to_intel_encoder(encoder));

drivers/gpu/drm/i915/display/intel_dp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state,
4545
int intel_dp_min_bpp(enum intel_output_format output_format);
4646
bool intel_dp_init_connector(struct intel_digital_port *dig_port,
4747
struct intel_connector *intel_connector);
48+
void intel_dp_connector_sync_state(struct intel_connector *connector,
49+
const struct intel_crtc_state *crtc_state);
4850
void intel_dp_set_link_params(struct intel_dp *intel_dp,
4951
int link_rate, int lane_count);
5052
int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,

drivers/gpu/drm/i915/display/intel_dp_mst.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,7 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
15341534
return NULL;
15351535

15361536
intel_connector->get_hw_state = intel_dp_mst_get_hw_state;
1537+
intel_connector->sync_state = intel_dp_connector_sync_state;
15371538
intel_connector->mst_port = intel_dp;
15381539
intel_connector->port = port;
15391540
drm_dp_mst_get_port_malloc(port);

drivers/gpu/drm/i915/display/intel_modeset_setup.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,6 @@ static void intel_modeset_update_connector_atomic_state(struct drm_i915_private
318318
const struct intel_crtc_state *crtc_state =
319319
to_intel_crtc_state(crtc->base.state);
320320

321-
if (crtc_state->dsc.compression_enable) {
322-
drm_WARN_ON(&i915->drm, !connector->dp.dsc_decompression_aux);
323-
connector->dp.dsc_decompression_enabled = true;
324-
} else {
325-
connector->dp.dsc_decompression_enabled = false;
326-
}
327321
conn_state->max_bpc = (crtc_state->pipe_bpp ?: 24) / 3;
328322
}
329323
}
@@ -775,8 +769,9 @@ static void intel_modeset_readout_hw_state(struct drm_i915_private *i915)
775769

776770
drm_connector_list_iter_begin(&i915->drm, &conn_iter);
777771
for_each_intel_connector_iter(connector, &conn_iter) {
772+
struct intel_crtc_state *crtc_state = NULL;
773+
778774
if (connector->get_hw_state(connector)) {
779-
struct intel_crtc_state *crtc_state;
780775
struct intel_crtc *crtc;
781776

782777
connector->base.dpms = DRM_MODE_DPMS_ON;
@@ -802,6 +797,10 @@ static void intel_modeset_readout_hw_state(struct drm_i915_private *i915)
802797
connector->base.dpms = DRM_MODE_DPMS_OFF;
803798
connector->base.encoder = NULL;
804799
}
800+
801+
if (connector->sync_state)
802+
connector->sync_state(connector, crtc_state);
803+
805804
drm_dbg_kms(&i915->drm,
806805
"[CONNECTOR:%d:%s] hw state readout: %s\n",
807806
connector->base.base.id, connector->base.name,

drivers/gpu/drm/i915/display/intel_psr.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,9 +2776,6 @@ void intel_psr_init(struct intel_dp *intel_dp)
27762776
if (!(HAS_PSR(dev_priv) || HAS_DP20(dev_priv)))
27772777
return;
27782778

2779-
if (!intel_dp_is_edp(intel_dp))
2780-
intel_psr_init_dpcd(intel_dp);
2781-
27822779
/*
27832780
* HSW spec explicitly says PSR is tied to port A.
27842781
* BDW+ platforms have a instance of PSR registers per transcoder but

drivers/gpu/drm/i915/selftests/intel_scheduler_helpers.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © 2021 Intel Corporation
44
*/
55

6+
#include <linux/jiffies.h>
7+
68
//#include "gt/intel_engine_user.h"
79
#include "gt/intel_gt.h"
810
#include "i915_drv.h"
@@ -12,7 +14,7 @@
1214

1315
#define REDUCED_TIMESLICE 5
1416
#define REDUCED_PREEMPT 10
15-
#define WAIT_FOR_RESET_TIME 10000
17+
#define WAIT_FOR_RESET_TIME_MS 10000
1618

1719
struct intel_engine_cs *intel_selftest_find_any_engine(struct intel_gt *gt)
1820
{
@@ -91,7 +93,7 @@ int intel_selftest_wait_for_rq(struct i915_request *rq)
9193
{
9294
long ret;
9395

94-
ret = i915_request_wait(rq, 0, WAIT_FOR_RESET_TIME);
96+
ret = i915_request_wait(rq, 0, msecs_to_jiffies(WAIT_FOR_RESET_TIME_MS));
9597
if (ret < 0)
9698
return ret;
9799

0 commit comments

Comments
 (0)