aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_crtc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 18:51:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 18:51:32 -0400
commit5f097cd249f00683442c3e265d6f27d80fc83563 (patch)
tree6b354913fcb2a099aa26e017895e1e6fdf6385e2 /drivers/gpu/drm/omapdrm/omap_crtc.c
parenta82a729f04232ccd0b59406574ba4cf20027a49d (diff)
parent1b6c79361ba5ce30b40f0f7d6fc2421dc5fcbe0c (diff)
Merge tag 'fbdev-for-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/plagnioj/linux-fbdev
Pull fbdev update from Jean-Christophe PLAGNIOL-VILLARD: "Various fbdev changes for 3.11 - xilinxfb updates - Small cleanups and fixes to multiple drivers - OMAP display subsystem bug updates - imxfb dt support" * tag 'fbdev-for-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/plagnioj/linux-fbdev: (95 commits) video: imxfb: Add DT support video: i740fb: Make i740fb_init static fb: make fp_get_options name argument const video: mmp: fix graphics/video layer enable/mask swap issue video: mmp: fix memcpy wrong size for mmp_addr issue radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM) aty128fb: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM) video: of_display_timing.h: Declare 'display_timing' fbdev: bfin-lq035q1-fb: Use dev_pm_ops fbmem: return -EFAULT on copy_to_user() failure OMAPDSS: DPI: Fix wrong pixel clock limit video: replace strict_strtoul() with kstrtoul() uvesafb: Correct/simplify warning message fb: fix atyfb unused data warnings fb: fix atyfb build warning video: imxfb: Make local symbols static video: udlfb: Make local symbol static video: udlfb: Use NULL instead of 0 video: smscufx: Use NULL instead of 0 video: remove unnecessary platform_set_drvdata() ...
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_crtc.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c46
1 files changed, 39 insertions, 7 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 79b200aee18a..4cec678dba94 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -40,7 +40,7 @@ struct omap_crtc {
40 * mgr->id.) Eventually this will be replaced w/ something 40 * mgr->id.) Eventually this will be replaced w/ something
41 * more common-panel-framework-y 41 * more common-panel-framework-y
42 */ 42 */
43 struct omap_overlay_manager mgr; 43 struct omap_overlay_manager *mgr;
44 44
45 struct omap_video_timings timings; 45 struct omap_video_timings timings;
46 bool enabled; 46 bool enabled;
@@ -90,7 +90,32 @@ uint32_t pipe2vbl(struct drm_crtc *crtc)
90 * job of sequencing the setup of the video pipe in the proper order 90 * job of sequencing the setup of the video pipe in the proper order
91 */ 91 */
92 92
93/* ovl-mgr-id -> crtc */
94static struct omap_crtc *omap_crtcs[8];
95
93/* we can probably ignore these until we support command-mode panels: */ 96/* we can probably ignore these until we support command-mode panels: */
97static int omap_crtc_connect(struct omap_overlay_manager *mgr,
98 struct omap_dss_device *dst)
99{
100 if (mgr->output)
101 return -EINVAL;
102
103 if ((mgr->supported_outputs & dst->id) == 0)
104 return -EINVAL;
105
106 dst->manager = mgr;
107 mgr->output = dst;
108
109 return 0;
110}
111
112static void omap_crtc_disconnect(struct omap_overlay_manager *mgr,
113 struct omap_dss_device *dst)
114{
115 mgr->output->manager = NULL;
116 mgr->output = NULL;
117}
118
94static void omap_crtc_start_update(struct omap_overlay_manager *mgr) 119static void omap_crtc_start_update(struct omap_overlay_manager *mgr)
95{ 120{
96} 121}
@@ -107,7 +132,7 @@ static void omap_crtc_disable(struct omap_overlay_manager *mgr)
107static void omap_crtc_set_timings(struct omap_overlay_manager *mgr, 132static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
108 const struct omap_video_timings *timings) 133 const struct omap_video_timings *timings)
109{ 134{
110 struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr); 135 struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
111 DBG("%s", omap_crtc->name); 136 DBG("%s", omap_crtc->name);
112 omap_crtc->timings = *timings; 137 omap_crtc->timings = *timings;
113 omap_crtc->full_update = true; 138 omap_crtc->full_update = true;
@@ -116,7 +141,7 @@ static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
116static void omap_crtc_set_lcd_config(struct omap_overlay_manager *mgr, 141static void omap_crtc_set_lcd_config(struct omap_overlay_manager *mgr,
117 const struct dss_lcd_mgr_config *config) 142 const struct dss_lcd_mgr_config *config)
118{ 143{
119 struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr); 144 struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
120 DBG("%s", omap_crtc->name); 145 DBG("%s", omap_crtc->name);
121 dispc_mgr_set_lcd_config(omap_crtc->channel, config); 146 dispc_mgr_set_lcd_config(omap_crtc->channel, config);
122} 147}
@@ -135,6 +160,8 @@ static void omap_crtc_unregister_framedone_handler(
135} 160}
136 161
137static const struct dss_mgr_ops mgr_ops = { 162static const struct dss_mgr_ops mgr_ops = {
163 .connect = omap_crtc_connect,
164 .disconnect = omap_crtc_disconnect,
138 .start_update = omap_crtc_start_update, 165 .start_update = omap_crtc_start_update,
139 .enable = omap_crtc_enable, 166 .enable = omap_crtc_enable,
140 .disable = omap_crtc_disable, 167 .disable = omap_crtc_disable,
@@ -569,7 +596,7 @@ static void omap_crtc_pre_apply(struct omap_drm_apply *apply)
569 } else { 596 } else {
570 if (encoder) { 597 if (encoder) {
571 omap_encoder_set_enabled(encoder, false); 598 omap_encoder_set_enabled(encoder, false);
572 omap_encoder_update(encoder, &omap_crtc->mgr, 599 omap_encoder_update(encoder, omap_crtc->mgr,
573 &omap_crtc->timings); 600 &omap_crtc->timings);
574 omap_encoder_set_enabled(encoder, true); 601 omap_encoder_set_enabled(encoder, true);
575 omap_crtc->full_update = false; 602 omap_crtc->full_update = false;
@@ -595,6 +622,11 @@ static const char *channel_names[] = {
595 [OMAP_DSS_CHANNEL_LCD2] = "lcd2", 622 [OMAP_DSS_CHANNEL_LCD2] = "lcd2",
596}; 623};
597 624
625void omap_crtc_pre_init(void)
626{
627 dss_install_mgr_ops(&mgr_ops);
628}
629
598/* initialize crtc */ 630/* initialize crtc */
599struct drm_crtc *omap_crtc_init(struct drm_device *dev, 631struct drm_crtc *omap_crtc_init(struct drm_device *dev,
600 struct drm_plane *plane, enum omap_channel channel, int id) 632 struct drm_plane *plane, enum omap_channel channel, int id)
@@ -635,9 +667,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
635 omap_irq_register(dev, &omap_crtc->error_irq); 667 omap_irq_register(dev, &omap_crtc->error_irq);
636 668
637 /* temporary: */ 669 /* temporary: */
638 omap_crtc->mgr.id = channel; 670 omap_crtc->mgr = omap_dss_get_overlay_manager(channel);
639
640 dss_install_mgr_ops(&mgr_ops);
641 671
642 /* TODO: fix hard-coded setup.. add properties! */ 672 /* TODO: fix hard-coded setup.. add properties! */
643 info = &omap_crtc->info; 673 info = &omap_crtc->info;
@@ -651,6 +681,8 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
651 681
652 omap_plane_install_properties(omap_crtc->plane, &crtc->base); 682 omap_plane_install_properties(omap_crtc->plane, &crtc->base);
653 683
684 omap_crtcs[channel] = omap_crtc;
685
654 return crtc; 686 return crtc;
655 687
656fail: 688fail: