Skip to content

Commit 151e3d6

Browse files
committed
Merge tag 'drm-intel-fixes-2019-02-07-1' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
drm/i915 fixes for v5.0-rc6: - SNB DPLL sanitize - ICL DDI clock selection - SLK srckey mask Signed-off-by: Dave Airlie <airlied@redhat.com> From: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/87lg2s6nur.fsf@intel.com
2 parents 78eb1ca + d028a64 commit 151e3d6

File tree

3 files changed

+46
-8
lines changed

3 files changed

+46
-8
lines changed

drivers/gpu/drm/i915/intel_ddi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ static uint32_t icl_pll_to_ddi_pll_sel(struct intel_encoder *encoder,
10861086
return DDI_CLK_SEL_TBT_810;
10871087
default:
10881088
MISSING_CASE(clock);
1089-
break;
1089+
return DDI_CLK_SEL_NONE;
10901090
}
10911091
case DPLL_ID_ICL_MGPLL1:
10921092
case DPLL_ID_ICL_MGPLL2:

drivers/gpu/drm/i915/intel_display.c

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15415,16 +15415,45 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc,
1541515415
}
1541615416
}
1541715417

15418+
static bool has_bogus_dpll_config(const struct intel_crtc_state *crtc_state)
15419+
{
15420+
struct drm_i915_private *dev_priv = to_i915(crtc_state->base.crtc->dev);
15421+
15422+
/*
15423+
* Some SNB BIOSen (eg. ASUS K53SV) are known to misprogram
15424+
* the hardware when a high res displays plugged in. DPLL P
15425+
* divider is zero, and the pipe timings are bonkers. We'll
15426+
* try to disable everything in that case.
15427+
*
15428+
* FIXME would be nice to be able to sanitize this state
15429+
* without several WARNs, but for now let's take the easy
15430+
* road.
15431+
*/
15432+
return IS_GEN6(dev_priv) &&
15433+
crtc_state->base.active &&
15434+
crtc_state->shared_dpll &&
15435+
crtc_state->port_clock == 0;
15436+
}
15437+
1541815438
static void intel_sanitize_encoder(struct intel_encoder *encoder)
1541915439
{
1542015440
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
1542115441
struct intel_connector *connector;
15442+
struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc);
15443+
struct intel_crtc_state *crtc_state = crtc ?
15444+
to_intel_crtc_state(crtc->base.state) : NULL;
1542215445

1542315446
/* We need to check both for a crtc link (meaning that the
1542415447
* encoder is active and trying to read from a pipe) and the
1542515448
* pipe itself being active. */
15426-
bool has_active_crtc = encoder->base.crtc &&
15427-
to_intel_crtc(encoder->base.crtc)->active;
15449+
bool has_active_crtc = crtc_state &&
15450+
crtc_state->base.active;
15451+
15452+
if (crtc_state && has_bogus_dpll_config(crtc_state)) {
15453+
DRM_DEBUG_KMS("BIOS has misprogrammed the hardware. Disabling pipe %c\n",
15454+
pipe_name(crtc->pipe));
15455+
has_active_crtc = false;
15456+
}
1542815457

1542915458
connector = intel_encoder_find_connector(encoder);
1543015459
if (connector && !has_active_crtc) {
@@ -15435,16 +15464,25 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
1543515464
/* Connector is active, but has no active pipe. This is
1543615465
* fallout from our resume register restoring. Disable
1543715466
* the encoder manually again. */
15438-
if (encoder->base.crtc) {
15439-
struct drm_crtc_state *crtc_state = encoder->base.crtc->state;
15467+
if (crtc_state) {
15468+
struct drm_encoder *best_encoder;
1544015469

1544115470
DRM_DEBUG_KMS("[ENCODER:%d:%s] manually disabled\n",
1544215471
encoder->base.base.id,
1544315472
encoder->base.name);
15473+
15474+
/* avoid oopsing in case the hooks consult best_encoder */
15475+
best_encoder = connector->base.state->best_encoder;
15476+
connector->base.state->best_encoder = &encoder->base;
15477+
1544415478
if (encoder->disable)
15445-
encoder->disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state);
15479+
encoder->disable(encoder, crtc_state,
15480+
connector->base.state);
1544615481
if (encoder->post_disable)
15447-
encoder->post_disable(encoder, to_intel_crtc_state(crtc_state), connector->base.state);
15482+
encoder->post_disable(encoder, crtc_state,
15483+
connector->base.state);
15484+
15485+
connector->base.state->best_encoder = best_encoder;
1544815486
}
1544915487
encoder->base.crtc = NULL;
1545015488

drivers/gpu/drm/i915/intel_sprite.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ skl_program_plane(struct intel_plane *plane,
494494

495495
keymax = (key->max_value & 0xffffff) | PLANE_KEYMAX_ALPHA(alpha);
496496

497-
keymsk = key->channel_mask & 0x3ffffff;
497+
keymsk = key->channel_mask & 0x7ffffff;
498498
if (alpha < 0xff)
499499
keymsk |= PLANE_KEYMSK_ALPHA_ENABLE;
500500

0 commit comments

Comments
 (0)