From acd18af93ad3b99e6769b917fe5b549dc1bfc468 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Fri, 28 Sep 2012 12:42:28 +0300 Subject: OMAPDSS: add omapdss_version Add new enum, omapdss_version, that is used to tell which DSS hardware version the SoC has. This enum is initialized during platform init, and passed in the platform data to omapdss driver. Note that the versions are not "continuous", that is, you cannot check if the version is less or greater than something, but you need to check for exact version match. In other words, this is invalid: /* test if DSS is 3630 or earlier */ if (ver <= OMAPDSS_VER_OMAP3630) ... Signed-off-by: Tomi Valkeinen --- include/video/omapdss.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 3729173..88c8294 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -314,6 +314,19 @@ int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel); int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel); void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel); +enum omapdss_version { + OMAPDSS_VER_UNKNOWN = 0, + OMAPDSS_VER_OMAP24xx, + OMAPDSS_VER_OMAP34xx_ES1, /* OMAP3430 ES1.0, 2.0 */ + OMAPDSS_VER_OMAP34xx_ES3, /* OMAP3430 ES3.0+ */ + OMAPDSS_VER_OMAP3630, + OMAPDSS_VER_AM35xx, + OMAPDSS_VER_OMAP4430_ES1, /* OMAP4430 ES1.0 */ + OMAPDSS_VER_OMAP4430_ES2, /* OMAP4430 ES2.0, 2.1, 2.2 */ + OMAPDSS_VER_OMAP4, /* All other OMAP4s */ + OMAPDSS_VER_OMAP5, +}; + /* Board specific data */ struct omap_dss_board_info { int (*get_context_loss_count)(struct device *dev); @@ -323,6 +336,7 @@ struct omap_dss_board_info { int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); int (*set_min_bus_tput)(struct device *dev, unsigned long r); + enum omapdss_version version; }; /* Init with the board info */ -- cgit v1.1 From 6a1c9f6d19180cdbb603e5b77bd7b57d01260664 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 8 Oct 2012 14:52:24 +0300 Subject: OMAP: move arch/arm/plat-omap/include/plat/vrfb.h Now that vrfb driver is not omap dependent anymore, we can move vrfb.h from arch/arm/plat-omap/include/plat to include/video/omapvrfb.h. Signed-off-by: Tomi Valkeinen Cc: Tony Lindgren Cc: Vaibhav Hiremath --- include/video/omapvrfb.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 include/video/omapvrfb.h (limited to 'include/video') diff --git a/include/video/omapvrfb.h b/include/video/omapvrfb.h new file mode 100644 index 0000000..3792bde --- /dev/null +++ b/include/video/omapvrfb.h @@ -0,0 +1,66 @@ +/* + * VRFB Rotation Engine + * + * Copyright (C) 2009 Nokia Corporation + * Author: Tomi Valkeinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __OMAP_VRFB_H__ +#define __OMAP_VRFB_H__ + +#define OMAP_VRFB_LINE_LEN 2048 + +struct vrfb { + u8 context; + void __iomem *vaddr[4]; + unsigned long paddr[4]; + u16 xres; + u16 yres; + u16 xoffset; + u16 yoffset; + u8 bytespp; + bool yuv_mode; +}; + +#ifdef CONFIG_OMAP2_VRFB +extern int omap_vrfb_request_ctx(struct vrfb *vrfb); +extern void omap_vrfb_release_ctx(struct vrfb *vrfb); +extern void omap_vrfb_adjust_size(u16 *width, u16 *height, + u8 bytespp); +extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp); +extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp); +extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr, + u16 width, u16 height, + unsigned bytespp, bool yuv_mode); +extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot); +extern void omap_vrfb_restore_context(void); + +#else +static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; } +static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {} +static inline void omap_vrfb_adjust_size(u16 *width, u16 *height, + u8 bytespp) {} +static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp) + { return 0; } +static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp) + { return 0; } +static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr, + u16 width, u16 height, unsigned bytespp, bool yuv_mode) {} +static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot) + { return 0; } +static inline void omap_vrfb_restore_context(void) {} +#endif +#endif /* __VRFB_H */ -- cgit v1.1 From aa1e49a3752f09b3d2ab706f6d48916a04acf557 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 17 Oct 2012 12:15:31 +0300 Subject: OMAPDSS: VRFB: add omap_vrfb_supported() Add an exported function omap_vrfb_supported() which returns true if the vrfb driver has been loaded succesfully. This can be used to decide if VRFB can be used or not. Signed-off-by: Tomi Valkeinen --- include/video/omapvrfb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/video') diff --git a/include/video/omapvrfb.h b/include/video/omapvrfb.h index 3792bde..bb0bd89 100644 --- a/include/video/omapvrfb.h +++ b/include/video/omapvrfb.h @@ -36,6 +36,7 @@ struct vrfb { }; #ifdef CONFIG_OMAP2_VRFB +extern bool omap_vrfb_supported(void); extern int omap_vrfb_request_ctx(struct vrfb *vrfb); extern void omap_vrfb_release_ctx(struct vrfb *vrfb); extern void omap_vrfb_adjust_size(u16 *width, u16 *height, @@ -49,6 +50,7 @@ extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot); extern void omap_vrfb_restore_context(void); #else +static inline bool omap_vrfb_supported(void) { return false; } static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; } static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {} static inline void omap_vrfb_adjust_size(u16 *width, u16 *height, -- cgit v1.1 From 5028ea04c8a8a67fe73f18f5f34386730c9c1bf2 Mon Sep 17 00:00:00 2001 From: Archit Taneja Date: Thu, 18 Oct 2012 16:51:57 +0530 Subject: OMAPDSS: Remove acb and acbi fields from omap_dss_device acbi and acb fields were meant for passive matrix panels which omapdss doesn't support any longer. Remove these fields from omap_dss_device struct. Signed-off-by: Archit Taneja Signed-off-by: Tomi Valkeinen --- include/video/omapdss.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 88c8294..f39e6aa 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -621,10 +621,6 @@ struct omap_dss_device { struct { struct omap_video_timings timings; - int acbi; /* ac-bias pin transitions per interrupt */ - /* Unit: line clocks */ - int acb; /* ac-bias pin frequency */ - enum omap_dss_dsi_pixel_format dsi_pix_fmt; enum omap_dss_dsi_mode dsi_mode; struct omap_dss_dsi_videomode_timings dsi_vm_timings; -- cgit v1.1 From 998c336d4c7183301ed6a6ca93952f63e3cf694f Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 30 May 2012 13:26:00 +0300 Subject: OMAPDSS: remove omap_dss_device's suspend/resume The panel drivers contain enable, disable, suspend and resume calls. The suspend and resume are effectively identical to disable and enable. This patch removes panel suspend and enable code from omapdss and the panel drivers, and replaces their use with enable and disable. Signed-off-by: Tomi Valkeinen --- include/video/omapdss.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 88c8294..cdfb22e 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -158,7 +158,6 @@ enum omap_display_caps { enum omap_dss_display_state { OMAP_DSS_DISPLAY_DISABLED = 0, OMAP_DSS_DISPLAY_ACTIVE, - OMAP_DSS_DISPLAY_SUSPENDED, }; enum omap_dss_audio_state { @@ -686,8 +685,6 @@ struct omap_dss_driver { int (*enable)(struct omap_dss_device *display); void (*disable)(struct omap_dss_device *display); - int (*suspend)(struct omap_dss_device *display); - int (*resume)(struct omap_dss_device *display); int (*run_test)(struct omap_dss_device *display, int test); int (*update)(struct omap_dss_device *dssdev, -- cgit v1.1 From b2c7d54f72c1c588e8851c882f0465705f5e9e55 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 18 Oct 2012 13:46:29 +0300 Subject: OMAPDSS: get the dss version from core pdev The output drivers get the omapdss hw version from the platform data for their respective output device. This doesn't work with DT, as there's no platform data for them. Add a new function, omapdss_get_version(), which returns the dss version from the core device, which will have platform data on DT also. The function is exported so that users of omapdss can also use it. Signed-off-by: Tomi Valkeinen --- include/video/omapdss.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index cdfb22e..eac5f25 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -742,6 +742,8 @@ struct omap_dss_driver { }; +enum omapdss_version omapdss_get_version(void); + int omap_dss_register_driver(struct omap_dss_driver *); void omap_dss_unregister_driver(struct omap_dss_driver *); -- cgit v1.1 From 2bbcce5e0b47e0de83a1b799b9e164f8c5b9b634 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 29 Oct 2012 12:40:46 +0200 Subject: OMAPDSS: export dss_get_def_display_name() Export dss_get_def_display_name() with the name of omapdss_get_def_display_name() so that omapfb can use it after the next patch which moves default display handling to omapfb. Signed-off-by: Tomi Valkeinen --- include/video/omapdss.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index eac5f25..bf2c68a 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -753,6 +753,7 @@ void omap_dss_put_device(struct omap_dss_device *dssdev); struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from); struct omap_dss_device *omap_dss_find_device(void *data, int (*match)(struct omap_dss_device *dssdev, void *data)); +const char *omapdss_get_default_display_name(void); int omap_dss_start_device(struct omap_dss_device *dssdev); void omap_dss_stop_device(struct omap_dss_device *dssdev); -- cgit v1.1 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 --- include/video/omapdss.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index b1248c2d..a940236 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -836,4 +836,7 @@ void omapdss_rfbi_set_data_lines(struct omap_dss_device *dssdev, void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev, struct rfbi_timings *timings); +int omapdss_compat_init(void); +void omapdss_compat_uninit(void); + #endif -- cgit v1.1 From 549acbe7a3380dd3bd2ac71698549148ecc0d17e Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 10 Oct 2012 14:03:11 +0300 Subject: OMAPDSS: move omap_dispc_wait_for_irq_interruptible_timeout to dispc-compat.c We have two functions to wait for a dispc interrupt: int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout); int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, Of these, the former is not used at all, and can be removed. The latter is only used by the compat layer, and can be moved to the compat layer code. Signed-off-by: Tomi Valkeinen --- include/video/omapdss.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index a940236..823a07b 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -775,10 +775,6 @@ typedef void (*omap_dispc_isr_t) (void *arg, u32 mask); int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask); -int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout); -int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, - unsigned long timeout); - #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) #define to_dss_device(x) container_of((x), struct omap_dss_device, dev) -- cgit v1.1 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 --- include/video/omapdss.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 823a07b..d1bf3bc 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -55,6 +55,7 @@ struct omap_dss_device; struct omap_overlay_manager; +struct dss_lcd_mgr_config; struct snd_aes_iec958; struct snd_cea_861_aud_if; @@ -835,4 +836,32 @@ void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev, int omapdss_compat_init(void); void omapdss_compat_uninit(void); +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); + +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_enable(struct omap_overlay_manager *mgr); +void dss_mgr_disable(struct omap_overlay_manager *mgr); +void dss_mgr_start_update(struct omap_overlay_manager *mgr); +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); #endif -- cgit v1.1 From eda34273631a9c4bae65eb49394549f6007f2fb8 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 7 Nov 2012 16:26:11 +0200 Subject: OMAPDSS: export dss_feat functions Export dss_features related functions. Signed-off-by: Tomi Valkeinen --- include/video/omapdss.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index d1bf3bc..8c9df48 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -755,6 +755,14 @@ const char *omapdss_get_default_display_name(void); int omap_dss_start_device(struct omap_dss_device *dssdev); void omap_dss_stop_device(struct omap_dss_device *dssdev); +int dss_feat_get_num_mgrs(void); +int dss_feat_get_num_ovls(void); +enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel); +enum omap_dss_output_id dss_feat_get_supported_outputs(enum omap_channel channel); +enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane); + + + int omap_dss_get_num_overlay_managers(void); struct omap_overlay_manager *omap_dss_get_overlay_manager(int num); -- cgit v1.1 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 --- include/video/omapdss.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'include/video') diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 8c9df48..caefa09 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -21,6 +21,7 @@ #include #include #include +#include #define DISPC_IRQ_FRAMEDONE (1 << 0) #define DISPC_IRQ_VSYNC (1 << 1) @@ -784,6 +785,44 @@ typedef void (*omap_dispc_isr_t) (void *arg, u32 mask); int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask); +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_mgr_enable(enum omap_channel channel, bool enable); +bool dispc_mgr_is_enabled(enum omap_channel channel); +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_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); +void dispc_mgr_setup(enum omap_channel channel, + const struct omap_overlay_manager_info *info); + +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); + +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_setup(enum omap_plane plane, const struct omap_overlay_info *oi, + bool replication, const struct omap_video_timings *mgr_timings, + bool mem_to_mem); + #define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) #define to_dss_device(x) container_of((x), struct omap_dss_device, dev) -- cgit v1.1