diff options
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/omapdrm/dss/omapdss.h | 41 | ||||
| -rw-r--r-- | drivers/gpu/drm/omapdrm/dss/output.c | 28 | ||||
| -rw-r--r-- | drivers/gpu/drm/omapdrm/omap_crtc.c | 31 | ||||
| -rw-r--r-- | drivers/gpu/drm/omapdrm/omap_crtc.h | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/omapdrm/omap_drv.c | 2 |
5 files changed, 64 insertions, 40 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index aeaa337b29c7..318641f5bc24 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h | |||
| @@ -59,6 +59,7 @@ | |||
| 59 | #define DISPC_IRQ_ACBIAS_COUNT_STAT3 (1 << 29) | 59 | #define DISPC_IRQ_ACBIAS_COUNT_STAT3 (1 << 29) |
| 60 | #define DISPC_IRQ_FRAMEDONE3 (1 << 30) | 60 | #define DISPC_IRQ_FRAMEDONE3 (1 << 30) |
| 61 | 61 | ||
| 62 | struct omap_drm_private; | ||
| 62 | struct omap_dss_device; | 63 | struct omap_dss_device; |
| 63 | struct dss_lcd_mgr_config; | 64 | struct dss_lcd_mgr_config; |
| 64 | struct snd_aes_iec958; | 65 | struct snd_aes_iec958; |
| @@ -635,25 +636,35 @@ struct device_node *dss_of_port_get_parent_device(struct device_node *port); | |||
| 635 | u32 dss_of_port_get_port_number(struct device_node *port); | 636 | u32 dss_of_port_get_port_number(struct device_node *port); |
| 636 | 637 | ||
| 637 | struct dss_mgr_ops { | 638 | struct dss_mgr_ops { |
| 638 | int (*connect)(enum omap_channel channel, | 639 | int (*connect)(struct omap_drm_private *priv, |
| 639 | struct omap_dss_device *dst); | 640 | enum omap_channel channel, |
| 640 | void (*disconnect)(enum omap_channel channel, | 641 | struct omap_dss_device *dst); |
| 641 | struct omap_dss_device *dst); | 642 | void (*disconnect)(struct omap_drm_private *priv, |
| 642 | 643 | enum omap_channel channel, | |
| 643 | void (*start_update)(enum omap_channel channel); | 644 | struct omap_dss_device *dst); |
| 644 | int (*enable)(enum omap_channel channel); | 645 | |
| 645 | void (*disable)(enum omap_channel channel); | 646 | void (*start_update)(struct omap_drm_private *priv, |
| 646 | void (*set_timings)(enum omap_channel channel, | 647 | enum omap_channel channel); |
| 647 | const struct videomode *vm); | 648 | int (*enable)(struct omap_drm_private *priv, |
| 648 | void (*set_lcd_config)(enum omap_channel channel, | 649 | enum omap_channel channel); |
| 649 | const struct dss_lcd_mgr_config *config); | 650 | void (*disable)(struct omap_drm_private *priv, |
| 650 | int (*register_framedone_handler)(enum omap_channel channel, | 651 | enum omap_channel channel); |
| 652 | void (*set_timings)(struct omap_drm_private *priv, | ||
| 653 | enum omap_channel channel, | ||
| 654 | const struct videomode *vm); | ||
| 655 | void (*set_lcd_config)(struct omap_drm_private *priv, | ||
| 656 | enum omap_channel channel, | ||
| 657 | const struct dss_lcd_mgr_config *config); | ||
| 658 | int (*register_framedone_handler)(struct omap_drm_private *priv, | ||
| 659 | enum omap_channel channel, | ||
| 651 | void (*handler)(void *), void *data); | 660 | void (*handler)(void *), void *data); |
| 652 | void (*unregister_framedone_handler)(enum omap_channel channel, | 661 | void (*unregister_framedone_handler)(struct omap_drm_private *priv, |
| 662 | enum omap_channel channel, | ||
| 653 | void (*handler)(void *), void *data); | 663 | void (*handler)(void *), void *data); |
| 654 | }; | 664 | }; |
| 655 | 665 | ||
| 656 | int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops); | 666 | int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops, |
| 667 | struct omap_drm_private *priv); | ||
| 657 | void dss_uninstall_mgr_ops(void); | 668 | void dss_uninstall_mgr_ops(void); |
| 658 | 669 | ||
| 659 | int dss_mgr_connect(struct omap_dss_device *dssdev, | 670 | int dss_mgr_connect(struct omap_dss_device *dssdev, |
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c index 9ff29dea28ce..96b9d4cd505f 100644 --- a/drivers/gpu/drm/omapdrm/dss/output.c +++ b/drivers/gpu/drm/omapdrm/dss/output.c | |||
| @@ -170,13 +170,16 @@ struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device | |||
| 170 | EXPORT_SYMBOL(omapdss_find_output_from_display); | 170 | EXPORT_SYMBOL(omapdss_find_output_from_display); |
| 171 | 171 | ||
| 172 | static const struct dss_mgr_ops *dss_mgr_ops; | 172 | static const struct dss_mgr_ops *dss_mgr_ops; |
| 173 | static struct omap_drm_private *dss_mgr_ops_priv; | ||
| 173 | 174 | ||
| 174 | int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops) | 175 | int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops, |
| 176 | struct omap_drm_private *priv) | ||
| 175 | { | 177 | { |
| 176 | if (dss_mgr_ops) | 178 | if (dss_mgr_ops) |
| 177 | return -EBUSY; | 179 | return -EBUSY; |
| 178 | 180 | ||
| 179 | dss_mgr_ops = mgr_ops; | 181 | dss_mgr_ops = mgr_ops; |
| 182 | dss_mgr_ops_priv = priv; | ||
| 180 | 183 | ||
| 181 | return 0; | 184 | return 0; |
| 182 | } | 185 | } |
| @@ -185,58 +188,62 @@ EXPORT_SYMBOL(dss_install_mgr_ops); | |||
| 185 | void dss_uninstall_mgr_ops(void) | 188 | void dss_uninstall_mgr_ops(void) |
| 186 | { | 189 | { |
| 187 | dss_mgr_ops = NULL; | 190 | dss_mgr_ops = NULL; |
| 191 | dss_mgr_ops_priv = NULL; | ||
| 188 | } | 192 | } |
| 189 | EXPORT_SYMBOL(dss_uninstall_mgr_ops); | 193 | EXPORT_SYMBOL(dss_uninstall_mgr_ops); |
| 190 | 194 | ||
| 191 | int dss_mgr_connect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) | 195 | int dss_mgr_connect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) |
| 192 | { | 196 | { |
| 193 | return dss_mgr_ops->connect(dssdev->dispc_channel, dst); | 197 | return dss_mgr_ops->connect(dss_mgr_ops_priv, |
| 198 | dssdev->dispc_channel, dst); | ||
| 194 | } | 199 | } |
| 195 | EXPORT_SYMBOL(dss_mgr_connect); | 200 | EXPORT_SYMBOL(dss_mgr_connect); |
| 196 | 201 | ||
| 197 | void dss_mgr_disconnect(struct omap_dss_device *dssdev, | 202 | void dss_mgr_disconnect(struct omap_dss_device *dssdev, |
| 198 | struct omap_dss_device *dst) | 203 | struct omap_dss_device *dst) |
| 199 | { | 204 | { |
| 200 | dss_mgr_ops->disconnect(dssdev->dispc_channel, dst); | 205 | dss_mgr_ops->disconnect(dss_mgr_ops_priv, dssdev->dispc_channel, dst); |
| 201 | } | 206 | } |
| 202 | EXPORT_SYMBOL(dss_mgr_disconnect); | 207 | EXPORT_SYMBOL(dss_mgr_disconnect); |
| 203 | 208 | ||
| 204 | void dss_mgr_set_timings(struct omap_dss_device *dssdev, | 209 | void dss_mgr_set_timings(struct omap_dss_device *dssdev, |
| 205 | const struct videomode *vm) | 210 | const struct videomode *vm) |
| 206 | { | 211 | { |
| 207 | dss_mgr_ops->set_timings(dssdev->dispc_channel, vm); | 212 | dss_mgr_ops->set_timings(dss_mgr_ops_priv, dssdev->dispc_channel, vm); |
| 208 | } | 213 | } |
| 209 | EXPORT_SYMBOL(dss_mgr_set_timings); | 214 | EXPORT_SYMBOL(dss_mgr_set_timings); |
| 210 | 215 | ||
| 211 | void dss_mgr_set_lcd_config(struct omap_dss_device *dssdev, | 216 | void dss_mgr_set_lcd_config(struct omap_dss_device *dssdev, |
| 212 | const struct dss_lcd_mgr_config *config) | 217 | const struct dss_lcd_mgr_config *config) |
| 213 | { | 218 | { |
| 214 | dss_mgr_ops->set_lcd_config(dssdev->dispc_channel, config); | 219 | dss_mgr_ops->set_lcd_config(dss_mgr_ops_priv, |
| 220 | dssdev->dispc_channel, config); | ||
| 215 | } | 221 | } |
| 216 | EXPORT_SYMBOL(dss_mgr_set_lcd_config); | 222 | EXPORT_SYMBOL(dss_mgr_set_lcd_config); |
| 217 | 223 | ||
| 218 | int dss_mgr_enable(struct omap_dss_device *dssdev) | 224 | int dss_mgr_enable(struct omap_dss_device *dssdev) |
| 219 | { | 225 | { |
| 220 | return dss_mgr_ops->enable(dssdev->dispc_channel); | 226 | return dss_mgr_ops->enable(dss_mgr_ops_priv, dssdev->dispc_channel); |
| 221 | } | 227 | } |
| 222 | EXPORT_SYMBOL(dss_mgr_enable); | 228 | EXPORT_SYMBOL(dss_mgr_enable); |
| 223 | 229 | ||
| 224 | void dss_mgr_disable(struct omap_dss_device *dssdev) | 230 | void dss_mgr_disable(struct omap_dss_device *dssdev) |
| 225 | { | 231 | { |
| 226 | dss_mgr_ops->disable(dssdev->dispc_channel); | 232 | dss_mgr_ops->disable(dss_mgr_ops_priv, dssdev->dispc_channel); |
| 227 | } | 233 | } |
| 228 | EXPORT_SYMBOL(dss_mgr_disable); | 234 | EXPORT_SYMBOL(dss_mgr_disable); |
| 229 | 235 | ||
| 230 | void dss_mgr_start_update(struct omap_dss_device *dssdev) | 236 | void dss_mgr_start_update(struct omap_dss_device *dssdev) |
| 231 | { | 237 | { |
| 232 | dss_mgr_ops->start_update(dssdev->dispc_channel); | 238 | dss_mgr_ops->start_update(dss_mgr_ops_priv, dssdev->dispc_channel); |
| 233 | } | 239 | } |
| 234 | EXPORT_SYMBOL(dss_mgr_start_update); | 240 | EXPORT_SYMBOL(dss_mgr_start_update); |
| 235 | 241 | ||
| 236 | int dss_mgr_register_framedone_handler(struct omap_dss_device *dssdev, | 242 | int dss_mgr_register_framedone_handler(struct omap_dss_device *dssdev, |
| 237 | void (*handler)(void *), void *data) | 243 | void (*handler)(void *), void *data) |
| 238 | { | 244 | { |
| 239 | return dss_mgr_ops->register_framedone_handler(dssdev->dispc_channel, | 245 | return dss_mgr_ops->register_framedone_handler(dss_mgr_ops_priv, |
| 246 | dssdev->dispc_channel, | ||
| 240 | handler, data); | 247 | handler, data); |
| 241 | } | 248 | } |
| 242 | EXPORT_SYMBOL(dss_mgr_register_framedone_handler); | 249 | EXPORT_SYMBOL(dss_mgr_register_framedone_handler); |
| @@ -244,7 +251,8 @@ EXPORT_SYMBOL(dss_mgr_register_framedone_handler); | |||
| 244 | void dss_mgr_unregister_framedone_handler(struct omap_dss_device *dssdev, | 251 | void dss_mgr_unregister_framedone_handler(struct omap_dss_device *dssdev, |
| 245 | void (*handler)(void *), void *data) | 252 | void (*handler)(void *), void *data) |
| 246 | { | 253 | { |
| 247 | dss_mgr_ops->unregister_framedone_handler(dssdev->dispc_channel, | 254 | dss_mgr_ops->unregister_framedone_handler(dss_mgr_ops_priv, |
| 255 | dssdev->dispc_channel, | ||
| 248 | handler, data); | 256 | handler, data); |
| 249 | } | 257 | } |
| 250 | EXPORT_SYMBOL(dss_mgr_unregister_framedone_handler); | 258 | EXPORT_SYMBOL(dss_mgr_unregister_framedone_handler); |
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index 95615a86e9f7..61d8d17a4243 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c | |||
| @@ -113,7 +113,8 @@ static struct omap_crtc *omap_crtcs[8]; | |||
| 113 | static struct omap_dss_device *omap_crtc_output[8]; | 113 | static struct omap_dss_device *omap_crtc_output[8]; |
| 114 | 114 | ||
| 115 | /* we can probably ignore these until we support command-mode panels: */ | 115 | /* we can probably ignore these until we support command-mode panels: */ |
| 116 | static int omap_crtc_dss_connect(enum omap_channel channel, | 116 | static int omap_crtc_dss_connect(struct omap_drm_private *priv, |
| 117 | enum omap_channel channel, | ||
| 117 | struct omap_dss_device *dst) | 118 | struct omap_dss_device *dst) |
| 118 | { | 119 | { |
| 119 | const struct dispc_ops *dispc_ops = dispc_get_ops(); | 120 | const struct dispc_ops *dispc_ops = dispc_get_ops(); |
| @@ -130,14 +131,16 @@ static int omap_crtc_dss_connect(enum omap_channel channel, | |||
| 130 | return 0; | 131 | return 0; |
| 131 | } | 132 | } |
| 132 | 133 | ||
| 133 | static void omap_crtc_dss_disconnect(enum omap_channel channel, | 134 | static void omap_crtc_dss_disconnect(struct omap_drm_private *priv, |
| 135 | enum omap_channel channel, | ||
| 134 | struct omap_dss_device *dst) | 136 | struct omap_dss_device *dst) |
| 135 | { | 137 | { |
| 136 | omap_crtc_output[channel] = NULL; | 138 | omap_crtc_output[channel] = NULL; |
| 137 | dst->dispc_channel_connected = false; | 139 | dst->dispc_channel_connected = false; |
| 138 | } | 140 | } |
| 139 | 141 | ||
| 140 | static void omap_crtc_dss_start_update(enum omap_channel channel) | 142 | static void omap_crtc_dss_start_update(struct omap_drm_private *priv, |
| 143 | enum omap_channel channel) | ||
| 141 | { | 144 | { |
| 142 | } | 145 | } |
| 143 | 146 | ||
| @@ -207,10 +210,10 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable) | |||
| 207 | } | 210 | } |
| 208 | 211 | ||
| 209 | 212 | ||
| 210 | static int omap_crtc_dss_enable(enum omap_channel channel) | 213 | static int omap_crtc_dss_enable(struct omap_drm_private *priv, |
| 214 | enum omap_channel channel) | ||
| 211 | { | 215 | { |
| 212 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; | 216 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; |
| 213 | struct omap_drm_private *priv = omap_crtc->base.dev->dev_private; | ||
| 214 | 217 | ||
| 215 | priv->dispc_ops->mgr_set_timings(omap_crtc->channel, &omap_crtc->vm); | 218 | priv->dispc_ops->mgr_set_timings(omap_crtc->channel, &omap_crtc->vm); |
| 216 | omap_crtc_set_enabled(&omap_crtc->base, true); | 219 | omap_crtc_set_enabled(&omap_crtc->base, true); |
| @@ -218,14 +221,16 @@ static int omap_crtc_dss_enable(enum omap_channel channel) | |||
| 218 | return 0; | 221 | return 0; |
| 219 | } | 222 | } |
| 220 | 223 | ||
| 221 | static void omap_crtc_dss_disable(enum omap_channel channel) | 224 | static void omap_crtc_dss_disable(struct omap_drm_private *priv, |
| 225 | enum omap_channel channel) | ||
| 222 | { | 226 | { |
| 223 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; | 227 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; |
| 224 | 228 | ||
| 225 | omap_crtc_set_enabled(&omap_crtc->base, false); | 229 | omap_crtc_set_enabled(&omap_crtc->base, false); |
| 226 | } | 230 | } |
| 227 | 231 | ||
| 228 | static void omap_crtc_dss_set_timings(enum omap_channel channel, | 232 | static void omap_crtc_dss_set_timings(struct omap_drm_private *priv, |
| 233 | enum omap_channel channel, | ||
| 229 | const struct videomode *vm) | 234 | const struct videomode *vm) |
| 230 | { | 235 | { |
| 231 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; | 236 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; |
| @@ -233,25 +238,25 @@ static void omap_crtc_dss_set_timings(enum omap_channel channel, | |||
| 233 | omap_crtc->vm = *vm; | 238 | omap_crtc->vm = *vm; |
| 234 | } | 239 | } |
| 235 | 240 | ||
| 236 | static void omap_crtc_dss_set_lcd_config(enum omap_channel channel, | 241 | static void omap_crtc_dss_set_lcd_config(struct omap_drm_private *priv, |
| 242 | enum omap_channel channel, | ||
| 237 | const struct dss_lcd_mgr_config *config) | 243 | const struct dss_lcd_mgr_config *config) |
| 238 | { | 244 | { |
| 239 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; | 245 | struct omap_crtc *omap_crtc = omap_crtcs[channel]; |
| 240 | struct omap_drm_private *priv = omap_crtc->base.dev->dev_private; | ||
| 241 | 246 | ||
| 242 | DBG("%s", omap_crtc->name); | 247 | DBG("%s", omap_crtc->name); |
| 243 | priv->dispc_ops->mgr_set_lcd_config(omap_crtc->channel, config); | 248 | priv->dispc_ops->mgr_set_lcd_config(omap_crtc->channel, config); |
| 244 | } | 249 | } |
| 245 | 250 | ||
| 246 | static int omap_crtc_dss_register_framedone( | 251 | static int omap_crtc_dss_register_framedone( |
| 247 | enum omap_channel channel, | 252 | struct omap_drm_private *priv, enum omap_channel channel, |
| 248 | void (*handler)(void *), void *data) | 253 | void (*handler)(void *), void *data) |
| 249 | { | 254 | { |
| 250 | return 0; | 255 | return 0; |
| 251 | } | 256 | } |
| 252 | 257 | ||
| 253 | static void omap_crtc_dss_unregister_framedone( | 258 | static void omap_crtc_dss_unregister_framedone( |
| 254 | enum omap_channel channel, | 259 | struct omap_drm_private *priv, enum omap_channel channel, |
| 255 | void (*handler)(void *), void *data) | 260 | void (*handler)(void *), void *data) |
| 256 | { | 261 | { |
| 257 | } | 262 | } |
| @@ -669,11 +674,11 @@ static const char *channel_names[] = { | |||
| 669 | [OMAP_DSS_CHANNEL_LCD3] = "lcd3", | 674 | [OMAP_DSS_CHANNEL_LCD3] = "lcd3", |
| 670 | }; | 675 | }; |
| 671 | 676 | ||
| 672 | void omap_crtc_pre_init(void) | 677 | void omap_crtc_pre_init(struct omap_drm_private *priv) |
| 673 | { | 678 | { |
| 674 | memset(omap_crtcs, 0, sizeof(omap_crtcs)); | 679 | memset(omap_crtcs, 0, sizeof(omap_crtcs)); |
| 675 | 680 | ||
| 676 | dss_install_mgr_ops(&mgr_ops); | 681 | dss_install_mgr_ops(&mgr_ops, priv); |
| 677 | } | 682 | } |
| 678 | 683 | ||
| 679 | void omap_crtc_pre_uninit(void) | 684 | void omap_crtc_pre_uninit(void) |
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.h b/drivers/gpu/drm/omapdrm/omap_crtc.h index 7f01e730a050..eaab2d7f0324 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.h +++ b/drivers/gpu/drm/omapdrm/omap_crtc.h | |||
| @@ -32,7 +32,7 @@ struct videomode; | |||
| 32 | 32 | ||
| 33 | struct videomode *omap_crtc_timings(struct drm_crtc *crtc); | 33 | struct videomode *omap_crtc_timings(struct drm_crtc *crtc); |
| 34 | enum omap_channel omap_crtc_channel(struct drm_crtc *crtc); | 34 | enum omap_channel omap_crtc_channel(struct drm_crtc *crtc); |
| 35 | void omap_crtc_pre_init(void); | 35 | void omap_crtc_pre_init(struct omap_drm_private *priv); |
| 36 | void omap_crtc_pre_uninit(void); | 36 | void omap_crtc_pre_uninit(void); |
| 37 | struct drm_crtc *omap_crtc_init(struct drm_device *dev, | 37 | struct drm_crtc *omap_crtc_init(struct drm_device *dev, |
| 38 | struct drm_plane *plane, struct omap_dss_device *dssdev); | 38 | struct drm_plane *plane, struct omap_dss_device *dssdev); |
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index b571cc04e08d..39e78f765f7e 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c | |||
| @@ -521,7 +521,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) | |||
| 521 | 521 | ||
| 522 | priv->dev = dev; | 522 | priv->dev = dev; |
| 523 | 523 | ||
| 524 | omap_crtc_pre_init(); | 524 | omap_crtc_pre_init(priv); |
| 525 | 525 | ||
| 526 | ret = omap_connect_dssdevs(); | 526 | ret = omap_connect_dssdevs(); |
| 527 | if (ret) | 527 | if (ret) |
