Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/gma500: Sanitize possible_clones

I doubt the DP+DP and SDVO+SDVO cloning works for this driver.
i915 at least doesn't do those. Truthfully there could be some very
specific circumstances where some of them would do doable, but
genereally it's too much pain to deal with so we've chose not to
bother. Let's use the same approach for gma500.

Also the LVDS+LVDS and DSI+DSI cases probably don't really exist as
there is one of each at most.

This does mean we'll now leave possible_clones at 0 for these encoder
types whereas previosuly we included the encoder itself in the bitmask.
But that's fine as the core now treaks 0 as a special case and adds
the encoder itself into the final bitmask reported to userspace.

Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200211162208.16224-3-ville.syrjala@linux.intel.com

+10 -10
+8 -8
drivers/gpu/drm/gma500/framebuffer.c
··· 577 577 break; 578 578 case INTEL_OUTPUT_SDVO: 579 579 crtc_mask = dev_priv->ops->sdvo_mask; 580 - clone_mask = (1 << INTEL_OUTPUT_SDVO); 580 + clone_mask = 0; 581 581 break; 582 582 case INTEL_OUTPUT_LVDS: 583 - crtc_mask = dev_priv->ops->lvds_mask; 584 - clone_mask = (1 << INTEL_OUTPUT_LVDS); 583 + crtc_mask = dev_priv->ops->lvds_mask; 584 + clone_mask = 0; 585 585 break; 586 586 case INTEL_OUTPUT_MIPI: 587 587 crtc_mask = (1 << 0); 588 - clone_mask = (1 << INTEL_OUTPUT_MIPI); 588 + clone_mask = 0; 589 589 break; 590 590 case INTEL_OUTPUT_MIPI2: 591 591 crtc_mask = (1 << 2); 592 - clone_mask = (1 << INTEL_OUTPUT_MIPI2); 592 + clone_mask = 0; 593 593 break; 594 594 case INTEL_OUTPUT_HDMI: 595 - crtc_mask = dev_priv->ops->hdmi_mask; 595 + crtc_mask = dev_priv->ops->hdmi_mask; 596 596 clone_mask = (1 << INTEL_OUTPUT_HDMI); 597 597 break; 598 598 case INTEL_OUTPUT_DISPLAYPORT: 599 599 crtc_mask = (1 << 0) | (1 << 1); 600 - clone_mask = (1 << INTEL_OUTPUT_DISPLAYPORT); 600 + clone_mask = 0; 601 601 break; 602 602 case INTEL_OUTPUT_EDP: 603 603 crtc_mask = (1 << 1); 604 - clone_mask = (1 << INTEL_OUTPUT_EDP); 604 + clone_mask = 0; 605 605 } 606 606 encoder->possible_crtcs = crtc_mask; 607 607 encoder->possible_clones =
+2 -2
drivers/gpu/drm/gma500/mdfld_dsi_dpi.c
··· 1006 1006 /*set possible crtcs and clones*/ 1007 1007 if (dsi_connector->pipe) { 1008 1008 encoder->possible_crtcs = (1 << 2); 1009 - encoder->possible_clones = (1 << 1); 1009 + encoder->possible_clones = 0; 1010 1010 } else { 1011 1011 encoder->possible_crtcs = (1 << 0); 1012 - encoder->possible_clones = (1 << 0); 1012 + encoder->possible_clones = 0; 1013 1013 } 1014 1014 1015 1015 dsi_connector->base.encoder = &dpi_output->base.base;