diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2013-06-28 05:59:10 -0400 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2013-06-28 05:59:10 -0400 |
commit | 8e9804557ca1188f3a9d9129180f46c2c73ba942 (patch) | |
tree | ce7acdbc7af509b5d863106c99b7c654418648cd /include/video | |
parent | a66e62ae56307e587e93d7ed4d83ea34c71d2eb9 (diff) | |
parent | 595470a7853848cb971d5ee3fed443b1e3aa0d1b (diff) |
Merge tag 'omapdss-for-3.11-1' of git://gitorious.org/linux-omap-dss2/linux into fbdev/for-next
OMAP display subsystem changes for 3.11 (part 1/2)
This is the first part of OMAP DSS changes for 3.11. This part contains fixes,
cleanups and reorganizations that are not directly related to the new DSS
device model that is added in part 2, although many of the reorganizations are
made to make the part 2 possible.
There should not be any functional changes visible to the user except the few
bug fixes.
The main new internal features:
- Display (dis)connect support, which allows us to explicitly (dis)connect a
whole display pipeline
- Panel list, which allows us to operate without the specific DSS bus
- Combine omap_dss_output to omap_dss_device, so that we have one generic
"entity" for display pipeline blocks
Diffstat (limited to 'include/video')
-rw-r--r-- | include/video/omapdss.h | 113 |
1 files changed, 70 insertions, 43 deletions
diff --git a/include/video/omapdss.h b/include/video/omapdss.h index aeb4e9a0c5d1..ef9db241b4a1 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <linux/device.h> | 23 | #include <linux/device.h> |
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | 25 | ||
26 | #include <video/videomode.h> | ||
27 | |||
26 | #define DISPC_IRQ_FRAMEDONE (1 << 0) | 28 | #define DISPC_IRQ_FRAMEDONE (1 << 0) |
27 | #define DISPC_IRQ_VSYNC (1 << 1) | 29 | #define DISPC_IRQ_VSYNC (1 << 1) |
28 | #define DISPC_IRQ_EVSYNC_EVEN (1 << 2) | 30 | #define DISPC_IRQ_EVSYNC_EVEN (1 << 2) |
@@ -365,6 +367,7 @@ struct omap_dss_board_info { | |||
365 | int num_devices; | 367 | int num_devices; |
366 | struct omap_dss_device **devices; | 368 | struct omap_dss_device **devices; |
367 | struct omap_dss_device *default_device; | 369 | struct omap_dss_device *default_device; |
370 | const char *default_display_name; | ||
368 | int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); | 371 | int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); |
369 | void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); | 372 | void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); |
370 | int (*set_min_bus_tput)(struct device *dev, unsigned long r); | 373 | int (*set_min_bus_tput)(struct device *dev, unsigned long r); |
@@ -512,7 +515,7 @@ struct omap_overlay_manager { | |||
512 | enum omap_dss_output_id supported_outputs; | 515 | enum omap_dss_output_id supported_outputs; |
513 | 516 | ||
514 | /* dynamic fields */ | 517 | /* dynamic fields */ |
515 | struct omap_dss_output *output; | 518 | struct omap_dss_device *output; |
516 | 519 | ||
517 | /* | 520 | /* |
518 | * The following functions do not block: | 521 | * The following functions do not block: |
@@ -526,7 +529,7 @@ struct omap_overlay_manager { | |||
526 | */ | 529 | */ |
527 | 530 | ||
528 | int (*set_output)(struct omap_overlay_manager *mgr, | 531 | int (*set_output)(struct omap_overlay_manager *mgr, |
529 | struct omap_dss_output *output); | 532 | struct omap_dss_device *output); |
530 | int (*unset_output)(struct omap_overlay_manager *mgr); | 533 | int (*unset_output)(struct omap_overlay_manager *mgr); |
531 | 534 | ||
532 | int (*set_manager_info)(struct omap_overlay_manager *mgr, | 535 | int (*set_manager_info)(struct omap_overlay_manager *mgr, |
@@ -569,33 +572,22 @@ struct omap_dss_writeback_info { | |||
569 | u8 pre_mult_alpha; | 572 | u8 pre_mult_alpha; |
570 | }; | 573 | }; |
571 | 574 | ||
572 | struct omap_dss_output { | 575 | struct omap_dss_device { |
573 | struct list_head list; | 576 | /* old device, to be removed */ |
574 | 577 | struct device old_dev; | |
575 | const char *name; | ||
576 | |||
577 | /* display type supported by the output */ | ||
578 | enum omap_display_type type; | ||
579 | |||
580 | /* DISPC channel for this output */ | ||
581 | enum omap_channel dispc_channel; | ||
582 | |||
583 | /* output instance */ | ||
584 | enum omap_dss_output_id id; | ||
585 | 578 | ||
586 | /* output's platform device pointer */ | 579 | /* new device, pointer to panel device */ |
587 | struct platform_device *pdev; | 580 | struct device *dev; |
588 | 581 | ||
589 | /* dynamic fields */ | 582 | struct module *owner; |
590 | struct omap_overlay_manager *manager; | ||
591 | 583 | ||
592 | struct omap_dss_device *device; | 584 | struct list_head panel_list; |
593 | }; | ||
594 | 585 | ||
595 | struct omap_dss_device { | 586 | /* alias in the form of "display%d" */ |
596 | struct device dev; | 587 | char alias[16]; |
597 | 588 | ||
598 | enum omap_display_type type; | 589 | enum omap_display_type type; |
590 | enum omap_display_type output_type; | ||
599 | 591 | ||
600 | /* obsolete, to be removed */ | 592 | /* obsolete, to be removed */ |
601 | enum omap_channel channel; | 593 | enum omap_channel channel; |
@@ -616,9 +608,6 @@ struct omap_dss_device { | |||
616 | 608 | ||
617 | struct { | 609 | struct { |
618 | int module; | 610 | int module; |
619 | |||
620 | bool ext_te; | ||
621 | u8 ext_te_gpio; | ||
622 | } dsi; | 611 | } dsi; |
623 | 612 | ||
624 | struct { | 613 | struct { |
@@ -639,10 +628,6 @@ struct omap_dss_device { | |||
639 | struct rfbi_timings rfbi_timings; | 628 | struct rfbi_timings rfbi_timings; |
640 | } ctrl; | 629 | } ctrl; |
641 | 630 | ||
642 | int reset_gpio; | ||
643 | |||
644 | int max_backlight_level; | ||
645 | |||
646 | const char *name; | 631 | const char *name; |
647 | 632 | ||
648 | /* used to match device to driver */ | 633 | /* used to match device to driver */ |
@@ -657,17 +642,26 @@ struct omap_dss_device { | |||
657 | 642 | ||
658 | enum omap_display_caps caps; | 643 | enum omap_display_caps caps; |
659 | 644 | ||
660 | struct omap_dss_output *output; | 645 | struct omap_dss_device *output; |
661 | 646 | ||
662 | enum omap_dss_display_state state; | 647 | enum omap_dss_display_state state; |
663 | 648 | ||
664 | enum omap_dss_audio_state audio_state; | 649 | enum omap_dss_audio_state audio_state; |
665 | 650 | ||
666 | /* platform specific */ | 651 | /* OMAP DSS output specific fields */ |
667 | int (*platform_enable)(struct omap_dss_device *dssdev); | 652 | |
668 | void (*platform_disable)(struct omap_dss_device *dssdev); | 653 | struct list_head list; |
669 | int (*set_backlight)(struct omap_dss_device *dssdev, int level); | 654 | |
670 | int (*get_backlight)(struct omap_dss_device *dssdev); | 655 | /* DISPC channel for this output */ |
656 | enum omap_channel dispc_channel; | ||
657 | |||
658 | /* output instance */ | ||
659 | enum omap_dss_output_id id; | ||
660 | |||
661 | /* dynamic fields */ | ||
662 | struct omap_overlay_manager *manager; | ||
663 | |||
664 | struct omap_dss_device *device; | ||
671 | }; | 665 | }; |
672 | 666 | ||
673 | struct omap_dss_hdmi_data | 667 | struct omap_dss_hdmi_data |
@@ -688,6 +682,9 @@ struct omap_dss_driver { | |||
688 | int (*probe)(struct omap_dss_device *); | 682 | int (*probe)(struct omap_dss_device *); |
689 | void (*remove)(struct omap_dss_device *); | 683 | void (*remove)(struct omap_dss_device *); |
690 | 684 | ||
685 | int (*connect)(struct omap_dss_device *dssdev); | ||
686 | void (*disconnect)(struct omap_dss_device *dssdev); | ||
687 | |||
691 | int (*enable)(struct omap_dss_device *display); | 688 | int (*enable)(struct omap_dss_device *display); |
692 | void (*disable)(struct omap_dss_device *display); | 689 | void (*disable)(struct omap_dss_device *display); |
693 | int (*run_test)(struct omap_dss_device *display, int test); | 690 | int (*run_test)(struct omap_dss_device *display, int test); |
@@ -753,7 +750,10 @@ bool omapdss_is_initialized(void); | |||
753 | int omap_dss_register_driver(struct omap_dss_driver *); | 750 | int omap_dss_register_driver(struct omap_dss_driver *); |
754 | void omap_dss_unregister_driver(struct omap_dss_driver *); | 751 | void omap_dss_unregister_driver(struct omap_dss_driver *); |
755 | 752 | ||
756 | void omap_dss_get_device(struct omap_dss_device *dssdev); | 753 | int omapdss_register_display(struct omap_dss_device *dssdev); |
754 | void omapdss_unregister_display(struct omap_dss_device *dssdev); | ||
755 | |||
756 | struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev); | ||
757 | void omap_dss_put_device(struct omap_dss_device *dssdev); | 757 | void omap_dss_put_device(struct omap_dss_device *dssdev); |
758 | #define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL) | 758 | #define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL) |
759 | struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from); | 759 | struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from); |
@@ -761,8 +761,10 @@ struct omap_dss_device *omap_dss_find_device(void *data, | |||
761 | int (*match)(struct omap_dss_device *dssdev, void *data)); | 761 | int (*match)(struct omap_dss_device *dssdev, void *data)); |
762 | const char *omapdss_get_default_display_name(void); | 762 | const char *omapdss_get_default_display_name(void); |
763 | 763 | ||
764 | int omap_dss_start_device(struct omap_dss_device *dssdev); | 764 | void videomode_to_omap_video_timings(const struct videomode *vm, |
765 | void omap_dss_stop_device(struct omap_dss_device *dssdev); | 765 | struct omap_video_timings *ovt); |
766 | void omap_video_timings_to_videomode(const struct omap_video_timings *ovt, | ||
767 | struct videomode *vm); | ||
766 | 768 | ||
767 | int dss_feat_get_num_mgrs(void); | 769 | int dss_feat_get_num_mgrs(void); |
768 | int dss_feat_get_num_ovls(void); | 770 | int dss_feat_get_num_ovls(void); |
@@ -778,10 +780,15 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num); | |||
778 | int omap_dss_get_num_overlays(void); | 780 | int omap_dss_get_num_overlays(void); |
779 | struct omap_overlay *omap_dss_get_overlay(int num); | 781 | struct omap_overlay *omap_dss_get_overlay(int num); |
780 | 782 | ||
781 | struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id); | 783 | struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id); |
782 | int omapdss_output_set_device(struct omap_dss_output *out, | 784 | struct omap_dss_device *omap_dss_find_output(const char *name); |
785 | struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node); | ||
786 | int omapdss_output_set_device(struct omap_dss_device *out, | ||
783 | struct omap_dss_device *dssdev); | 787 | struct omap_dss_device *dssdev); |
784 | int omapdss_output_unset_device(struct omap_dss_output *out); | 788 | int omapdss_output_unset_device(struct omap_dss_device *out); |
789 | |||
790 | struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev); | ||
791 | struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev); | ||
785 | 792 | ||
786 | void omapdss_default_get_resolution(struct omap_dss_device *dssdev, | 793 | void omapdss_default_get_resolution(struct omap_dss_device *dssdev, |
787 | u16 *xres, u16 *yres); | 794 | u16 *xres, u16 *yres); |
@@ -832,7 +839,7 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, | |||
832 | bool mem_to_mem); | 839 | bool mem_to_mem); |
833 | 840 | ||
834 | #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) | 841 | #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) |
835 | #define to_dss_device(x) container_of((x), struct omap_dss_device, dev) | 842 | #define to_dss_device(x) container_of((x), struct omap_dss_device, old_dev) |
836 | 843 | ||
837 | void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, | 844 | void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, |
838 | bool enable); | 845 | bool enable); |
@@ -883,6 +890,11 @@ int omapdss_compat_init(void); | |||
883 | void omapdss_compat_uninit(void); | 890 | void omapdss_compat_uninit(void); |
884 | 891 | ||
885 | struct dss_mgr_ops { | 892 | struct dss_mgr_ops { |
893 | int (*connect)(struct omap_overlay_manager *mgr, | ||
894 | struct omap_dss_device *dst); | ||
895 | void (*disconnect)(struct omap_overlay_manager *mgr, | ||
896 | struct omap_dss_device *dst); | ||
897 | |||
886 | void (*start_update)(struct omap_overlay_manager *mgr); | 898 | void (*start_update)(struct omap_overlay_manager *mgr); |
887 | int (*enable)(struct omap_overlay_manager *mgr); | 899 | int (*enable)(struct omap_overlay_manager *mgr); |
888 | void (*disable)(struct omap_overlay_manager *mgr); | 900 | void (*disable)(struct omap_overlay_manager *mgr); |
@@ -899,6 +911,10 @@ struct dss_mgr_ops { | |||
899 | int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops); | 911 | int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops); |
900 | void dss_uninstall_mgr_ops(void); | 912 | void dss_uninstall_mgr_ops(void); |
901 | 913 | ||
914 | int dss_mgr_connect(struct omap_overlay_manager *mgr, | ||
915 | struct omap_dss_device *dst); | ||
916 | void dss_mgr_disconnect(struct omap_overlay_manager *mgr, | ||
917 | struct omap_dss_device *dst); | ||
902 | void dss_mgr_set_timings(struct omap_overlay_manager *mgr, | 918 | void dss_mgr_set_timings(struct omap_overlay_manager *mgr, |
903 | const struct omap_video_timings *timings); | 919 | const struct omap_video_timings *timings); |
904 | void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, | 920 | void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, |
@@ -910,4 +926,15 @@ int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr, | |||
910 | void (*handler)(void *), void *data); | 926 | void (*handler)(void *), void *data); |
911 | void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr, | 927 | void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr, |
912 | void (*handler)(void *), void *data); | 928 | void (*handler)(void *), void *data); |
929 | |||
930 | static inline bool omapdss_device_is_connected(struct omap_dss_device *dssdev) | ||
931 | { | ||
932 | return dssdev->output; | ||
933 | } | ||
934 | |||
935 | static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev) | ||
936 | { | ||
937 | return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE; | ||
938 | } | ||
939 | |||
913 | #endif | 940 | #endif |