diff options
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_crtc.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_crtc.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index f5bdb8de98f4..9742d9f49a7c 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c | |||
@@ -109,7 +109,6 @@ int omap_crtc_wait_pending(struct drm_crtc *crtc) | |||
109 | */ | 109 | */ |
110 | 110 | ||
111 | /* ovl-mgr-id -> crtc */ | 111 | /* ovl-mgr-id -> crtc */ |
112 | static struct omap_crtc *omap_crtcs[8]; | ||
113 | static struct omap_dss_device *omap_crtc_output[8]; | 112 | static struct omap_dss_device *omap_crtc_output[8]; |
114 | 113 | ||
115 | /* we can probably ignore these until we support command-mode panels: */ | 114 | /* we can probably ignore these until we support command-mode panels: */ |
@@ -215,7 +214,8 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable) | |||
215 | static int omap_crtc_dss_enable(struct omap_drm_private *priv, | 214 | static int omap_crtc_dss_enable(struct omap_drm_private *priv, |
216 | enum omap_channel channel) | 215 | enum omap_channel channel) |
217 | { | 216 | { |
218 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; | 217 | struct drm_crtc *crtc = priv->channels[channel]->crtc; |
218 | struct omap_crtc *omap_crtc = to_omap_crtc(crtc); | ||
219 | 219 | ||
220 | priv->dispc_ops->mgr_set_timings(priv->dispc, omap_crtc->channel, | 220 | priv->dispc_ops->mgr_set_timings(priv->dispc, omap_crtc->channel, |
221 | &omap_crtc->vm); | 221 | &omap_crtc->vm); |
@@ -227,7 +227,8 @@ static int omap_crtc_dss_enable(struct omap_drm_private *priv, | |||
227 | static void omap_crtc_dss_disable(struct omap_drm_private *priv, | 227 | static void omap_crtc_dss_disable(struct omap_drm_private *priv, |
228 | enum omap_channel channel) | 228 | enum omap_channel channel) |
229 | { | 229 | { |
230 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; | 230 | struct drm_crtc *crtc = priv->channels[channel]->crtc; |
231 | struct omap_crtc *omap_crtc = to_omap_crtc(crtc); | ||
231 | 232 | ||
232 | omap_crtc_set_enabled(&omap_crtc->base, false); | 233 | omap_crtc_set_enabled(&omap_crtc->base, false); |
233 | } | 234 | } |
@@ -236,7 +237,9 @@ static void omap_crtc_dss_set_timings(struct omap_drm_private *priv, | |||
236 | enum omap_channel channel, | 237 | enum omap_channel channel, |
237 | const struct videomode *vm) | 238 | const struct videomode *vm) |
238 | { | 239 | { |
239 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; | 240 | struct drm_crtc *crtc = priv->channels[channel]->crtc; |
241 | struct omap_crtc *omap_crtc = to_omap_crtc(crtc); | ||
242 | |||
240 | DBG("%s", omap_crtc->name); | 243 | DBG("%s", omap_crtc->name); |
241 | omap_crtc->vm = *vm; | 244 | omap_crtc->vm = *vm; |
242 | } | 245 | } |
@@ -245,7 +248,8 @@ static void omap_crtc_dss_set_lcd_config(struct omap_drm_private *priv, | |||
245 | enum omap_channel channel, | 248 | enum omap_channel channel, |
246 | const struct dss_lcd_mgr_config *config) | 249 | const struct dss_lcd_mgr_config *config) |
247 | { | 250 | { |
248 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; | 251 | struct drm_crtc *crtc = priv->channels[channel]->crtc; |
252 | struct omap_crtc *omap_crtc = to_omap_crtc(crtc); | ||
249 | 253 | ||
250 | DBG("%s", omap_crtc->name); | 254 | DBG("%s", omap_crtc->name); |
251 | priv->dispc_ops->mgr_set_lcd_config(priv->dispc, omap_crtc->channel, | 255 | priv->dispc_ops->mgr_set_lcd_config(priv->dispc, omap_crtc->channel, |
@@ -681,8 +685,6 @@ static const char *channel_names[] = { | |||
681 | 685 | ||
682 | void omap_crtc_pre_init(struct omap_drm_private *priv) | 686 | void omap_crtc_pre_init(struct omap_drm_private *priv) |
683 | { | 687 | { |
684 | memset(omap_crtcs, 0, sizeof(omap_crtcs)); | ||
685 | |||
686 | dss_install_mgr_ops(priv->dss, &mgr_ops, priv); | 688 | dss_install_mgr_ops(priv->dss, &mgr_ops, priv); |
687 | } | 689 | } |
688 | 690 | ||
@@ -706,10 +708,6 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev, | |||
706 | 708 | ||
707 | DBG("%s", channel_names[channel]); | 709 | DBG("%s", channel_names[channel]); |
708 | 710 | ||
709 | /* Multiple displays on same channel is not allowed */ | ||
710 | if (WARN_ON(omap_crtcs[channel] != NULL)) | ||
711 | return ERR_PTR(-EINVAL); | ||
712 | |||
713 | omap_crtc = kzalloc(sizeof(*omap_crtc), GFP_KERNEL); | 711 | omap_crtc = kzalloc(sizeof(*omap_crtc), GFP_KERNEL); |
714 | if (!omap_crtc) | 712 | if (!omap_crtc) |
715 | return ERR_PTR(-ENOMEM); | 713 | return ERR_PTR(-ENOMEM); |
@@ -748,7 +746,5 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev, | |||
748 | 746 | ||
749 | omap_plane_install_properties(crtc->primary, &crtc->base); | 747 | omap_plane_install_properties(crtc->primary, &crtc->base); |
750 | 748 | ||
751 | omap_crtcs[channel] = omap_crtc; | ||
752 | |||
753 | return crtc; | 749 | return crtc; |
754 | } | 750 | } |