diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-11-10 18:59:50 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-03-01 02:18:18 -0500 |
commit | 7c00985109f95474a7fe31f03022126e23e355ff (patch) | |
tree | 8f8c98ca508bdc6c93c9b18492fea90535879907 | |
parent | 13bb1601c721f395d272d58438c9e747317f7c1a (diff) |
drm/omap: add writeback funcs to dispc_ops
Add writeback specific dispc functions to dispc_ops so that omapdrm can
use them. Also move 'enum dss_writeback_channel' to the public
omapdss.h for omapdrm.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dispc.c | 19 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dss.h | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/omapdss.h | 20 |
3 files changed, 35 insertions, 25 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 2aa72845f819..57960df1517a 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c | |||
@@ -715,7 +715,7 @@ static u32 dispc_mgr_get_sync_lost_irq(struct dispc_device *dispc, | |||
715 | return mgr_desc[channel].sync_lost_irq; | 715 | return mgr_desc[channel].sync_lost_irq; |
716 | } | 716 | } |
717 | 717 | ||
718 | u32 dispc_wb_get_framedone_irq(struct dispc_device *dispc) | 718 | static u32 dispc_wb_get_framedone_irq(struct dispc_device *dispc) |
719 | { | 719 | { |
720 | return DISPC_IRQ_FRAMEDONEWB; | 720 | return DISPC_IRQ_FRAMEDONEWB; |
721 | } | 721 | } |
@@ -750,12 +750,12 @@ static void dispc_mgr_go(struct dispc_device *dispc, enum omap_channel channel) | |||
750 | mgr_fld_write(dispc, channel, DISPC_MGR_FLD_GO, 1); | 750 | mgr_fld_write(dispc, channel, DISPC_MGR_FLD_GO, 1); |
751 | } | 751 | } |
752 | 752 | ||
753 | bool dispc_wb_go_busy(struct dispc_device *dispc) | 753 | static bool dispc_wb_go_busy(struct dispc_device *dispc) |
754 | { | 754 | { |
755 | return REG_GET(dispc, DISPC_CONTROL2, 6, 6) == 1; | 755 | return REG_GET(dispc, DISPC_CONTROL2, 6, 6) == 1; |
756 | } | 756 | } |
757 | 757 | ||
758 | void dispc_wb_go(struct dispc_device *dispc) | 758 | static void dispc_wb_go(struct dispc_device *dispc) |
759 | { | 759 | { |
760 | enum omap_plane_id plane = OMAP_DSS_WB; | 760 | enum omap_plane_id plane = OMAP_DSS_WB; |
761 | bool enable, go; | 761 | bool enable, go; |
@@ -2771,7 +2771,7 @@ static int dispc_ovl_setup(struct dispc_device *dispc, | |||
2771 | return r; | 2771 | return r; |
2772 | } | 2772 | } |
2773 | 2773 | ||
2774 | int dispc_wb_setup(struct dispc_device *dispc, | 2774 | static int dispc_wb_setup(struct dispc_device *dispc, |
2775 | const struct omap_dss_writeback_info *wi, | 2775 | const struct omap_dss_writeback_info *wi, |
2776 | bool mem_to_mem, const struct videomode *vm, | 2776 | bool mem_to_mem, const struct videomode *vm, |
2777 | enum dss_writeback_channel channel_in) | 2777 | enum dss_writeback_channel channel_in) |
@@ -2854,6 +2854,11 @@ int dispc_wb_setup(struct dispc_device *dispc, | |||
2854 | return 0; | 2854 | return 0; |
2855 | } | 2855 | } |
2856 | 2856 | ||
2857 | static bool dispc_has_writeback(struct dispc_device *dispc) | ||
2858 | { | ||
2859 | return dispc->feat->has_writeback; | ||
2860 | } | ||
2861 | |||
2857 | static int dispc_ovl_enable(struct dispc_device *dispc, | 2862 | static int dispc_ovl_enable(struct dispc_device *dispc, |
2858 | enum omap_plane_id plane, bool enable) | 2863 | enum omap_plane_id plane, bool enable) |
2859 | { | 2864 | { |
@@ -4709,6 +4714,12 @@ static const struct dispc_ops dispc_ops = { | |||
4709 | .ovl_enable = dispc_ovl_enable, | 4714 | .ovl_enable = dispc_ovl_enable, |
4710 | .ovl_setup = dispc_ovl_setup, | 4715 | .ovl_setup = dispc_ovl_setup, |
4711 | .ovl_get_color_modes = dispc_ovl_get_color_modes, | 4716 | .ovl_get_color_modes = dispc_ovl_get_color_modes, |
4717 | |||
4718 | .wb_get_framedone_irq = dispc_wb_get_framedone_irq, | ||
4719 | .wb_setup = dispc_wb_setup, | ||
4720 | .has_writeback = dispc_has_writeback, | ||
4721 | .wb_go_busy = dispc_wb_go_busy, | ||
4722 | .wb_go = dispc_wb_go, | ||
4712 | }; | 4723 | }; |
4713 | 4724 | ||
4714 | /* DISPC HW IP initialisation */ | 4725 | /* DISPC HW IP initialisation */ |
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h index c56c3c59bf18..c601ed9a09c2 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.h +++ b/drivers/gpu/drm/omapdrm/dss/dss.h | |||
@@ -102,17 +102,6 @@ enum dss_dsi_content_type { | |||
102 | DSS_DSI_CONTENT_GENERIC, | 102 | DSS_DSI_CONTENT_GENERIC, |
103 | }; | 103 | }; |
104 | 104 | ||
105 | enum dss_writeback_channel { | ||
106 | DSS_WB_LCD1_MGR = 0, | ||
107 | DSS_WB_LCD2_MGR = 1, | ||
108 | DSS_WB_TV_MGR = 2, | ||
109 | DSS_WB_OVL0 = 3, | ||
110 | DSS_WB_OVL1 = 4, | ||
111 | DSS_WB_OVL2 = 5, | ||
112 | DSS_WB_OVL3 = 6, | ||
113 | DSS_WB_LCD3_MGR = 7, | ||
114 | }; | ||
115 | |||
116 | enum dss_clk_source { | 105 | enum dss_clk_source { |
117 | DSS_CLK_SRC_FCK = 0, | 106 | DSS_CLK_SRC_FCK = 0, |
118 | 107 | ||
@@ -448,16 +437,6 @@ int dispc_mgr_get_clock_div(struct dispc_device *dispc, | |||
448 | struct dispc_clock_info *cinfo); | 437 | struct dispc_clock_info *cinfo); |
449 | void dispc_set_tv_pclk(struct dispc_device *dispc, unsigned long pclk); | 438 | void dispc_set_tv_pclk(struct dispc_device *dispc, unsigned long pclk); |
450 | 439 | ||
451 | u32 dispc_wb_get_framedone_irq(struct dispc_device *dispc); | ||
452 | bool dispc_wb_go_busy(struct dispc_device *dispc); | ||
453 | void dispc_wb_go(struct dispc_device *dispc); | ||
454 | void dispc_wb_set_channel_in(struct dispc_device *dispc, | ||
455 | enum dss_writeback_channel channel); | ||
456 | int dispc_wb_setup(struct dispc_device *dispc, | ||
457 | const struct omap_dss_writeback_info *wi, | ||
458 | bool mem_to_mem, const struct videomode *vm, | ||
459 | enum dss_writeback_channel channel_in); | ||
460 | |||
461 | #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS | 440 | #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS |
462 | static inline void dss_collect_irq_stats(u32 irqstatus, unsigned int *irq_arr) | 441 | static inline void dss_collect_irq_stats(u32 irqstatus, unsigned int *irq_arr) |
463 | { | 442 | { |
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 162f36fa3431..14d74adb13fb 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h | |||
@@ -626,6 +626,17 @@ omapdss_of_find_source_for_first_ep(struct device_node *node); | |||
626 | struct device_node *dss_of_port_get_parent_device(struct device_node *port); | 626 | struct device_node *dss_of_port_get_parent_device(struct device_node *port); |
627 | u32 dss_of_port_get_port_number(struct device_node *port); | 627 | u32 dss_of_port_get_port_number(struct device_node *port); |
628 | 628 | ||
629 | enum dss_writeback_channel { | ||
630 | DSS_WB_LCD1_MGR = 0, | ||
631 | DSS_WB_LCD2_MGR = 1, | ||
632 | DSS_WB_TV_MGR = 2, | ||
633 | DSS_WB_OVL0 = 3, | ||
634 | DSS_WB_OVL1 = 4, | ||
635 | DSS_WB_OVL2 = 5, | ||
636 | DSS_WB_OVL3 = 6, | ||
637 | DSS_WB_LCD3_MGR = 7, | ||
638 | }; | ||
639 | |||
629 | struct dss_mgr_ops { | 640 | struct dss_mgr_ops { |
630 | int (*connect)(struct omap_drm_private *priv, | 641 | int (*connect)(struct omap_drm_private *priv, |
631 | enum omap_channel channel, | 642 | enum omap_channel channel, |
@@ -732,6 +743,15 @@ struct dispc_ops { | |||
732 | 743 | ||
733 | const u32 *(*ovl_get_color_modes)(struct dispc_device *dispc, | 744 | const u32 *(*ovl_get_color_modes)(struct dispc_device *dispc, |
734 | enum omap_plane_id plane); | 745 | enum omap_plane_id plane); |
746 | |||
747 | u32 (*wb_get_framedone_irq)(struct dispc_device *dispc); | ||
748 | int (*wb_setup)(struct dispc_device *dispc, | ||
749 | const struct omap_dss_writeback_info *wi, | ||
750 | bool mem_to_mem, const struct videomode *vm, | ||
751 | enum dss_writeback_channel channel_in); | ||
752 | bool (*has_writeback)(struct dispc_device *dispc); | ||
753 | bool (*wb_go_busy)(struct dispc_device *dispc); | ||
754 | void (*wb_go)(struct dispc_device *dispc); | ||
735 | }; | 755 | }; |
736 | 756 | ||
737 | struct dispc_device *dispc_get_dispc(struct dss_device *dss); | 757 | struct dispc_device *dispc_get_dispc(struct dss_device *dss); |