From 8dd2491a4216778a81668581041ba1c06453ed6c Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 10 Oct 2012 10:26:45 +0300 Subject: OMAPDSS: add omapdss_compat_init() Add two new exported functions, omapdss_compat_init and omapdss_compat_uninit, which are to be used by omapfb, omap_vout to enable compatibility mode for omapdss. The functions are called by omapdss internally for now, and moved to other drivers later. The compatibility mode is implemented fully in the following patches. For now, enabling compat mode only sets up the private data in apply.c. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/video/omap2/dss/dss.h') diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index bdf843135661..9da3d61b8a56 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -178,7 +178,6 @@ void dss_copy_device_pdata(struct omap_dss_device *dst, const struct omap_dss_device *src); /* apply */ -void dss_apply_init(void); int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr); int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl); void dss_mgr_start_update(struct omap_overlay_manager *mgr); -- cgit v1.2.3 From 0c49ff747a4656e24b8990764f5ee4cd047ee982 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 23 Oct 2012 13:44:12 +0300 Subject: OMAPDSS: move ovl-mgr function setup to apply.c Most of the functions that are assigned to the fields in ovl-mgr struct are in apply.c. By moving the function pointer setup into apply.c we can make these functions static. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'drivers/video/omap2/dss/dss.h') diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 9da3d61b8a56..9e093bc81b5f 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -178,20 +178,10 @@ void dss_copy_device_pdata(struct omap_dss_device *dst, const struct omap_dss_device *src); /* apply */ -int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr); int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl); void dss_mgr_start_update(struct omap_overlay_manager *mgr); -int omap_dss_mgr_apply(struct omap_overlay_manager *mgr); - int dss_mgr_enable(struct omap_overlay_manager *mgr); void dss_mgr_disable(struct omap_overlay_manager *mgr); -int dss_mgr_set_info(struct omap_overlay_manager *mgr, - struct omap_overlay_manager_info *info); -void dss_mgr_get_info(struct omap_overlay_manager *mgr, - struct omap_overlay_manager_info *info); -int dss_mgr_set_output(struct omap_overlay_manager *mgr, - struct omap_dss_output *output); -int dss_mgr_unset_output(struct omap_overlay_manager *mgr); void dss_mgr_set_timings(struct omap_overlay_manager *mgr, const struct omap_video_timings *timings); void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, -- cgit v1.2.3 From 6abae7a18a8c9dbec96915eb924dc06288a47b02 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 23 Oct 2012 13:45:07 +0300 Subject: OMAPDSS: move ovl function setup to apply.c Most of the functions that are assigned to the fields in ovl struct are in apply.c. By moving the function pointer setup into apply.c we can make these functions static. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'drivers/video/omap2/dss/dss.h') diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 9e093bc81b5f..9ce798645b2d 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -178,7 +178,6 @@ void dss_copy_device_pdata(struct omap_dss_device *dst, const struct omap_dss_device *src); /* apply */ -int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl); void dss_mgr_start_update(struct omap_overlay_manager *mgr); int dss_mgr_enable(struct omap_overlay_manager *mgr); void dss_mgr_disable(struct omap_overlay_manager *mgr); @@ -187,17 +186,6 @@ void dss_mgr_set_timings(struct omap_overlay_manager *mgr, void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, const struct dss_lcd_mgr_config *config); -bool dss_ovl_is_enabled(struct omap_overlay *ovl); -int dss_ovl_enable(struct omap_overlay *ovl); -int dss_ovl_disable(struct omap_overlay *ovl); -int dss_ovl_set_info(struct omap_overlay *ovl, - struct omap_overlay_info *info); -void dss_ovl_get_info(struct omap_overlay *ovl, - struct omap_overlay_info *info); -int dss_ovl_set_manager(struct omap_overlay *ovl, - struct omap_overlay_manager *mgr); -int dss_ovl_unset_manager(struct omap_overlay *ovl); - /* output */ void dss_register_output(struct omap_dss_output *out); void dss_unregister_output(struct omap_dss_output *out); -- cgit v1.2.3 From 74b65ec24560ab0df0e7b789fa91cde4a442f169 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 10 Oct 2012 10:56:05 +0300 Subject: OMAPDSS: add manager ops The output drivers need some operations from the overlay managers, like enable and set_timings. These will affect the dispc registers, and need to be synchronized with the composition-side changes with overlays and overlay managers. We want to handle these calls in the apply.c in the compatibility mode, but when in non-compat mode, the calls need to be handled by some other component (e.g. omapdrm). To make this possible, this patch creates a set of function pointers in a dss_mgr_ops struct, that is used to redirect the calls into the correct destination. The non-compat users can install their mgr ops with dss_install_mgr_ops() function. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/video/omap2/dss/dss.h') diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 9ce798645b2d..5cc13ea2b5a7 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -523,4 +523,17 @@ static inline void dss_collect_irq_stats(u32 irqstatus, unsigned *irq_arr) } #endif +struct dss_mgr_ops { + void (*start_update)(struct omap_overlay_manager *mgr); + int (*enable)(struct omap_overlay_manager *mgr); + void (*disable)(struct omap_overlay_manager *mgr); + void (*set_timings)(struct omap_overlay_manager *mgr, + const struct omap_video_timings *timings); + void (*set_lcd_config)(struct omap_overlay_manager *mgr, + const struct dss_lcd_mgr_config *config); +}; + +int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops); +void dss_uninstall_mgr_ops(void); + #endif -- cgit v1.2.3 From 1550202d4a7593655a2aca99e39a58751073c92a Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 10 Oct 2012 13:59:07 +0300 Subject: OMAPDSS: manage framedone irq with mgr ops Some of the output drivers need to handle FRAMEDONE interrupt from DISPC. This creates a direct dependency to dispc code, and we need to avoid this to make the compat code to work. Instead of the output drivers registering for dispc interrupts, we create new mgr-ops that are used to register a framedone handler. The code implementing the mgr-ops is responsible for calling the handler when DISPC FRAMEDONE interrupt happens. The compat layer is improved accordingly to do the call to the framedone handler. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/video/omap2/dss/dss.h') diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 5cc13ea2b5a7..8ae73670aa37 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -185,6 +185,10 @@ void dss_mgr_set_timings(struct omap_overlay_manager *mgr, const struct omap_video_timings *timings); void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, const struct dss_lcd_mgr_config *config); +int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr, + void (*handler)(void *), void *data); +void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr, + void (*handler)(void *), void *data); /* output */ void dss_register_output(struct omap_dss_output *out); @@ -531,6 +535,10 @@ struct dss_mgr_ops { const struct omap_video_timings *timings); void (*set_lcd_config)(struct omap_overlay_manager *mgr, const struct dss_lcd_mgr_config *config); + int (*register_framedone_handler)(struct omap_overlay_manager *mgr, + void (*handler)(void *), void *data); + void (*unregister_framedone_handler)(struct omap_overlay_manager *mgr, + void (*handler)(void *), void *data); }; int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops); -- cgit v1.2.3 From bb39813413db782cc77b94d55cb5d044f42079df Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 24 Oct 2012 12:39:53 +0300 Subject: OMAPDSS: move blocking mgr enable/disable to compat layer dispc_mgr_enable_sync and dispc_mgr_disable_sync are only used with the compat mode. Non-compat will use the simpler enable and disable functions. This patch moves the synchronous enable/disable code to the compat layer. A new file is created, dispc-compat.c, which contains low level dispc compat code (versus apply.c, which contains slightly higher level compat code). Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers/video/omap2/dss/dss.h') diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 8ae73670aa37..9faaa63d3089 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -426,8 +426,6 @@ bool dispc_mgr_go_busy(enum omap_channel channel); void dispc_mgr_go(enum omap_channel channel); void dispc_mgr_enable(enum omap_channel channel, bool enable); bool dispc_mgr_is_enabled(enum omap_channel channel); -void dispc_mgr_enable_sync(enum omap_channel channel); -void dispc_mgr_disable_sync(enum omap_channel channel); void dispc_mgr_set_lcd_config(enum omap_channel channel, const struct dss_lcd_mgr_config *config); void dispc_mgr_set_timings(enum omap_channel channel, -- cgit v1.2.3 From 96e2e6374385d2219b9011f6bfd0de7221a591d4 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 10 Oct 2012 15:55:19 +0300 Subject: OMAPDSS: move irq handling to dispc-compat The whole dispc irq handling system we currently have is only needed for compat layer, and thus can be moved from dispc.c to the compat layer. This is quite straigtforward, but we need to add new dispc functions to request and free the actual hardware irq: dispc_request_irq() and dispc_free_irq(). Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/video/omap2/dss/dss.h') diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 9faaa63d3089..2754bcb231d6 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -23,6 +23,8 @@ #ifndef __OMAP2_DSS_H #define __OMAP2_DSS_H +#include + #ifdef pr_fmt #undef pr_fmt #endif @@ -386,6 +388,9 @@ void dispc_clear_irqstatus(u32 mask); u32 dispc_read_irqenable(void); void dispc_write_irqenable(u32 mask); +int dispc_request_irq(irq_handler_t handler, void *dev_id); +void dispc_free_irq(void *dev_id); + int dispc_runtime_get(void); void dispc_runtime_put(void); -- cgit v1.2.3 From f9b719b6c25c0609c528ccc1e881b42373ba1ba3 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 19 Oct 2012 15:57:11 +0300 Subject: OMAPDSS: DISPC: add dispc_ovl_check() This patch adds a new function, dispc_ovl_check(), which can be used to verify scaling configuration for an overlay. The function gets both the overlay and overlay manager as parameters, so that the caller does not need to configure the hardware before using this function. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/video/omap2/dss/dss.h') diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 2754bcb231d6..180b381fd120 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -423,6 +423,10 @@ int dispc_ovl_enable(enum omap_plane plane, bool enable); bool dispc_ovl_enabled(enum omap_plane plane); void dispc_ovl_set_channel_out(enum omap_plane plane, enum omap_channel channel); +int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel, + const struct omap_overlay_info *oi, + const struct omap_video_timings *timings, + int *x_predecim, int *y_predecim); u32 dispc_mgr_get_vsync_irq(enum omap_channel channel); u32 dispc_mgr_get_framedone_irq(enum omap_channel channel); -- cgit v1.2.3 From 09e82ba7011d6e94bf1eeb3f1cd0b7d441263132 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 8 Nov 2012 14:11:29 +0200 Subject: OMAPDSS: move display sysfs init to compat layer Move creation of the sysfs files for displays to the compat layer. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/video/omap2/dss/dss.h') diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 180b381fd120..8c89cdda96dd 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -201,11 +201,6 @@ int dss_suspend_all_devices(void); int dss_resume_all_devices(void); void dss_disable_all_devices(void); -int dss_init_device(struct platform_device *pdev, - struct omap_dss_device *dssdev); -void dss_uninit_device(struct platform_device *pdev, - struct omap_dss_device *dssdev); - int display_init_sysfs(struct platform_device *pdev, struct omap_dss_device *dssdev); void display_uninit_sysfs(struct platform_device *pdev, -- cgit v1.2.3 From a97a96347598201ae39b5aee67638dae2cebe454 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 24 Oct 2012 13:52:40 +0300 Subject: OMAPDSS: export dss_mgr_ops functions Export dss_mgr_ops related functions. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'drivers/video/omap2/dss/dss.h') diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 8c89cdda96dd..1d8483cbe395 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -179,19 +179,6 @@ void dss_put_device(struct omap_dss_device *dssdev); void dss_copy_device_pdata(struct omap_dss_device *dst, const struct omap_dss_device *src); -/* apply */ -void dss_mgr_start_update(struct omap_overlay_manager *mgr); -int dss_mgr_enable(struct omap_overlay_manager *mgr); -void dss_mgr_disable(struct omap_overlay_manager *mgr); -void dss_mgr_set_timings(struct omap_overlay_manager *mgr, - const struct omap_video_timings *timings); -void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, - const struct dss_lcd_mgr_config *config); -int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr, - void (*handler)(void *), void *data); -void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr, - void (*handler)(void *), void *data); - /* output */ void dss_register_output(struct omap_dss_output *out); void dss_unregister_output(struct omap_dss_output *out); @@ -529,21 +516,4 @@ static inline void dss_collect_irq_stats(u32 irqstatus, unsigned *irq_arr) } #endif -struct dss_mgr_ops { - void (*start_update)(struct omap_overlay_manager *mgr); - int (*enable)(struct omap_overlay_manager *mgr); - void (*disable)(struct omap_overlay_manager *mgr); - void (*set_timings)(struct omap_overlay_manager *mgr, - const struct omap_video_timings *timings); - void (*set_lcd_config)(struct omap_overlay_manager *mgr, - const struct dss_lcd_mgr_config *config); - int (*register_framedone_handler)(struct omap_overlay_manager *mgr, - void (*handler)(void *), void *data); - void (*unregister_framedone_handler)(struct omap_overlay_manager *mgr, - void (*handler)(void *), void *data); -}; - -int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops); -void dss_uninstall_mgr_ops(void); - #endif -- cgit v1.2.3 From 348be69d306260c9bcb62662c4cf04196a2b9f53 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 7 Nov 2012 18:17:35 +0200 Subject: OMAPDSS: export dispc functions Export DISPC functions. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/dss.h | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) (limited to 'drivers/video/omap2/dss/dss.h') diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 1d8483cbe395..ebe9e08b2a91 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -365,16 +365,6 @@ void dpi_uninit_platform_driver(void) __exit; int dispc_init_platform_driver(void) __init; void dispc_uninit_platform_driver(void) __exit; void dispc_dump_clocks(struct seq_file *s); -u32 dispc_read_irqstatus(void); -void dispc_clear_irqstatus(u32 mask); -u32 dispc_read_irqenable(void); -void dispc_write_irqenable(u32 mask); - -int dispc_request_irq(irq_handler_t handler, void *dev_id); -void dispc_free_irq(void *dev_id); - -int dispc_runtime_get(void); -void dispc_runtime_put(void); void dispc_enable_sidle(void); void dispc_disable_sidle(void); @@ -398,29 +388,7 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high); void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane, u32 *fifo_low, u32 *fifo_high, bool use_fifomerge, bool manual_update); -int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi, - bool replication, const struct omap_video_timings *mgr_timings, - bool mem_to_mem); -int dispc_ovl_enable(enum omap_plane plane, bool enable); -bool dispc_ovl_enabled(enum omap_plane plane); -void dispc_ovl_set_channel_out(enum omap_plane plane, - enum omap_channel channel); -int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel, - const struct omap_overlay_info *oi, - const struct omap_video_timings *timings, - int *x_predecim, int *y_predecim); - -u32 dispc_mgr_get_vsync_irq(enum omap_channel channel); -u32 dispc_mgr_get_framedone_irq(enum omap_channel channel); -u32 dispc_mgr_get_sync_lost_irq(enum omap_channel channel); -bool dispc_mgr_go_busy(enum omap_channel channel); -void dispc_mgr_go(enum omap_channel channel); -void dispc_mgr_enable(enum omap_channel channel, bool enable); -bool dispc_mgr_is_enabled(enum omap_channel channel); -void dispc_mgr_set_lcd_config(enum omap_channel channel, - const struct dss_lcd_mgr_config *config); -void dispc_mgr_set_timings(enum omap_channel channel, - const struct omap_video_timings *timings); + unsigned long dispc_mgr_lclk_rate(enum omap_channel channel); unsigned long dispc_mgr_pclk_rate(enum omap_channel channel); unsigned long dispc_core_clk_rate(void); @@ -428,8 +396,6 @@ void dispc_mgr_set_clock_div(enum omap_channel channel, const struct dispc_clock_info *cinfo); int dispc_mgr_get_clock_div(enum omap_channel channel, struct dispc_clock_info *cinfo); -void dispc_mgr_setup(enum omap_channel channel, - const struct omap_overlay_manager_info *info); u32 dispc_wb_get_framedone_irq(void); bool dispc_wb_go_busy(void); -- cgit v1.2.3