diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2016-08-23 10:18:07 -0400 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2016-08-24 03:49:10 -0400 |
commit | 496b0fc370caaf4072c19ac9120bf5c58f057d59 (patch) | |
tree | d6add863f9928701b1590c20ad0aee845d8c95c4 /drivers/gpu/drm/i915/intel_display.c | |
parent | 80c33624e4723c4e22d9917cd676067ebf652dc2 (diff) |
drm/i915: Create a intel_encoder_find_connector helper function.
This makes the code in intel_sanitize_encoder slightly more readable.
This was meant to be addressed in fd6bbda9c7a4, but I missed that
review comment.
Fixes: fd6bbda9c7a4 ("drm/i915: Pass crtc_state and connector_state to encoder functions")
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471961888-10771-1-git-send-email-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[mlankhorst: Fix unused variable reported by kbuild.]
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2dd2c0e9ae32..b747402ab310 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -16423,6 +16423,17 @@ static bool intel_crtc_has_encoders(struct intel_crtc *crtc) | |||
16423 | return false; | 16423 | return false; |
16424 | } | 16424 | } |
16425 | 16425 | ||
16426 | static struct intel_connector *intel_encoder_find_connector(struct intel_encoder *encoder) | ||
16427 | { | ||
16428 | struct drm_device *dev = encoder->base.dev; | ||
16429 | struct intel_connector *connector; | ||
16430 | |||
16431 | for_each_connector_on_encoder(dev, &encoder->base, connector) | ||
16432 | return connector; | ||
16433 | |||
16434 | return NULL; | ||
16435 | } | ||
16436 | |||
16426 | static bool has_pch_trancoder(struct drm_i915_private *dev_priv, | 16437 | static bool has_pch_trancoder(struct drm_i915_private *dev_priv, |
16427 | enum transcoder pch_transcoder) | 16438 | enum transcoder pch_transcoder) |
16428 | { | 16439 | { |
@@ -16525,8 +16536,6 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc) | |||
16525 | static void intel_sanitize_encoder(struct intel_encoder *encoder) | 16536 | static void intel_sanitize_encoder(struct intel_encoder *encoder) |
16526 | { | 16537 | { |
16527 | struct intel_connector *connector; | 16538 | struct intel_connector *connector; |
16528 | struct drm_device *dev = encoder->base.dev; | ||
16529 | bool found_connector = false; | ||
16530 | 16539 | ||
16531 | /* We need to check both for a crtc link (meaning that the | 16540 | /* We need to check both for a crtc link (meaning that the |
16532 | * encoder is active and trying to read from a pipe) and the | 16541 | * encoder is active and trying to read from a pipe) and the |
@@ -16534,12 +16543,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder) | |||
16534 | bool has_active_crtc = encoder->base.crtc && | 16543 | bool has_active_crtc = encoder->base.crtc && |
16535 | to_intel_crtc(encoder->base.crtc)->active; | 16544 | to_intel_crtc(encoder->base.crtc)->active; |
16536 | 16545 | ||
16537 | for_each_connector_on_encoder(dev, &encoder->base, connector) { | 16546 | connector = intel_encoder_find_connector(encoder); |
16538 | found_connector = true; | 16547 | if (connector && !has_active_crtc) { |
16539 | break; | ||
16540 | } | ||
16541 | |||
16542 | if (found_connector && !has_active_crtc) { | ||
16543 | DRM_DEBUG_KMS("[ENCODER:%d:%s] has active connectors but no active pipe!\n", | 16548 | DRM_DEBUG_KMS("[ENCODER:%d:%s] has active connectors but no active pipe!\n", |
16544 | encoder->base.base.id, | 16549 | encoder->base.base.id, |
16545 | encoder->base.name); | 16550 | encoder->base.name); |