aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-07-12 14:08:18 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-07-25 12:23:46 -0400
commit66a9278eecbef1c746e7fac8f4bcb0485d7aa4d0 (patch)
treedf6a3a51e4ebe33384e532a3ccaae07be725ce37 /drivers/gpu/drm/i915/intel_display.c
parentebc0fd882b000b119e0684815db8c2245e61162f (diff)
drm/i915: simplify possible_clones computation
Intel hw only has one MUX for encoders, so outputs are either not cloneable or all in the same group of cloneable outputs. This neatly simplifies the code and allows us to ditch some ugly if cascades in the dp and hdmi init code (well, we need these if cascades for other stuff still, but that can be taken care of in follow-up patches). Note that this changes two things: - dvo can now be cloned with sdvo, but dvo is gen2 whereas sdvo is gen3+, so no problem. Note that the old code had a bug and didn't allow cloning crt with dvo (but only the other way round). - sdvo-lvds can now be cloned with sdvo-non-tv. Spec says this won't work, but the only reason I've found is that you can't use the panel-fitter (used for lvds upscaling) with anything else. But we don't use the panel fitter for sdvo-lvds. Imo this part of Bspec is a) rather confusing b) mostly as a guideline to implementors (i.e. explicitly stating what is already implicit from the spec, without always going into the details of why). So I think we can ignore this - worst case we'll get a bug report from a user with with sdvo-lvds and sdvo-tmds and have to add that special case back in. Because sdvo lvds is a bit special explain in comments why sdvo LVDS outputs can be cloned, but native LVDS and eDP can't be cloned - we use the panel fitter for the later, but not for sdvo. Note that this also uncoditionally initializes the panel_vdd work used by eDP. Trying to be clever doesn't buy us anything (but strange bugs) and this way we can kill the is_edp check. v2: Incorporate review from Paulo - Add in a missing space. - Pimp comment message to address his concerns. Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e9e476eca89f..5c0a72606225 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6707,15 +6707,23 @@ int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
6707 return 0; 6707 return 0;
6708} 6708}
6709 6709
6710static int intel_encoder_clones(struct drm_device *dev, int type_mask) 6710static int intel_encoder_clones(struct intel_encoder *encoder)
6711{ 6711{
6712 struct intel_encoder *encoder; 6712 struct drm_device *dev = encoder->base.dev;
6713 struct intel_encoder *source_encoder;
6713 int index_mask = 0; 6714 int index_mask = 0;
6714 int entry = 0; 6715 int entry = 0;
6715 6716
6716 list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head) { 6717 list_for_each_entry(source_encoder,
6717 if (type_mask & encoder->clone_mask) 6718 &dev->mode_config.encoder_list, base.head) {
6719
6720 if (encoder == source_encoder)
6718 index_mask |= (1 << entry); 6721 index_mask |= (1 << entry);
6722
6723 /* Intel hw has only one MUX where enocoders could be cloned. */
6724 if (encoder->cloneable && source_encoder->cloneable)
6725 index_mask |= (1 << entry);
6726
6719 entry++; 6727 entry++;
6720 } 6728 }
6721 6729
@@ -6874,7 +6882,7 @@ static void intel_setup_outputs(struct drm_device *dev)
6874 list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head) { 6882 list_for_each_entry(encoder, &dev->mode_config.encoder_list, base.head) {
6875 encoder->base.possible_crtcs = encoder->crtc_mask; 6883 encoder->base.possible_crtcs = encoder->crtc_mask;
6876 encoder->base.possible_clones = 6884 encoder->base.possible_clones =
6877 intel_encoder_clones(dev, encoder->clone_mask); 6885 intel_encoder_clones(encoder);
6878 } 6886 }
6879 6887
6880 /* disable all the possible outputs/crtcs before entering KMS mode */ 6888 /* disable all the possible outputs/crtcs before entering KMS mode */