aboutsummaryrefslogtreecommitdiffstats
path: root/include/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-13 07:30:56 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-12-13 07:30:56 -0500
commite7f5c9a16ea2648a3e85af8e34191026bf3dcb62 (patch)
treead79eb6b57058e69013408d8ae4267ea06536ca6 /include/video
parenta240af2eb24679f4d27d87281b25faee0a25df1a (diff)
parentbd0f5cc3641cb76ae8fa2cc4924c29da157f8b2d (diff)
Merge tag 'omapdss-for-3.8' of git://gitorious.org/linux-omap-dss2/linux into for-linus
OMAPDSS changes for 3.8, including: - use dynanic debug prints - OMAP platform dependency removals - Creation of compat-layer, helping us to improve omapdrm - Misc cleanups, aiming to make omadss more in line with the upcoming common display framework * tag 'omapdss-for-3.8' of git://gitorious.org/linux-omap-dss2/linux: (140 commits) OMAPDSS: fix TV-out issue with DSI PLL Revert "OMAPFB: simplify locking" OMAPFB: remove silly loop in fb2display() OMAPFB: fix error handling in omapfb_find_best_mode() OMAPFB: use devm_kzalloc to allocate omapfb2_device OMAPDSS: DISPC: remove dispc fck uses OMAPDSS: DISPC: get dss clock rate from dss driver OMAPDSS: use omapdss_compat_init() in other drivers OMAPDSS: export dispc functions OMAPDSS: export dss_feat functions OMAPDSS: export dss_mgr_ops functions OMAPDSS: separate compat files in the Makefile OMAPDSS: move display sysfs init to compat layer OMAPDSS: DPI: use dispc's check_timings OMAPDSS: DISPC: add dispc_ovl_check() OMAPDSS: move irq handling to dispc-compat OMAPDSS: move omap_dispc_wait_for_irq_interruptible_timeout to dispc-compat.c OMAPDSS: move blocking mgr enable/disable to compat layer OMAPDSS: manage framedone irq with mgr ops OMAPDSS: add manager ops ...
Diffstat (limited to 'include/video')
-rw-r--r--include/video/omapdss.h105
-rw-r--r--include/video/omapvrfb.h68
2 files changed, 163 insertions, 10 deletions
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 3729173b7fbc..caefa093337d 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -21,6 +21,7 @@
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/kobject.h> 22#include <linux/kobject.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/interrupt.h>
24 25
25#define DISPC_IRQ_FRAMEDONE (1 << 0) 26#define DISPC_IRQ_FRAMEDONE (1 << 0)
26#define DISPC_IRQ_VSYNC (1 << 1) 27#define DISPC_IRQ_VSYNC (1 << 1)
@@ -55,6 +56,7 @@
55 56
56struct omap_dss_device; 57struct omap_dss_device;
57struct omap_overlay_manager; 58struct omap_overlay_manager;
59struct dss_lcd_mgr_config;
58struct snd_aes_iec958; 60struct snd_aes_iec958;
59struct snd_cea_861_aud_if; 61struct snd_cea_861_aud_if;
60 62
@@ -158,7 +160,6 @@ enum omap_display_caps {
158enum omap_dss_display_state { 160enum omap_dss_display_state {
159 OMAP_DSS_DISPLAY_DISABLED = 0, 161 OMAP_DSS_DISPLAY_DISABLED = 0,
160 OMAP_DSS_DISPLAY_ACTIVE, 162 OMAP_DSS_DISPLAY_ACTIVE,
161 OMAP_DSS_DISPLAY_SUSPENDED,
162}; 163};
163 164
164enum omap_dss_audio_state { 165enum omap_dss_audio_state {
@@ -314,6 +315,19 @@ int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
314int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel); 315int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel);
315void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel); 316void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel);
316 317
318enum omapdss_version {
319 OMAPDSS_VER_UNKNOWN = 0,
320 OMAPDSS_VER_OMAP24xx,
321 OMAPDSS_VER_OMAP34xx_ES1, /* OMAP3430 ES1.0, 2.0 */
322 OMAPDSS_VER_OMAP34xx_ES3, /* OMAP3430 ES3.0+ */
323 OMAPDSS_VER_OMAP3630,
324 OMAPDSS_VER_AM35xx,
325 OMAPDSS_VER_OMAP4430_ES1, /* OMAP4430 ES1.0 */
326 OMAPDSS_VER_OMAP4430_ES2, /* OMAP4430 ES2.0, 2.1, 2.2 */
327 OMAPDSS_VER_OMAP4, /* All other OMAP4s */
328 OMAPDSS_VER_OMAP5,
329};
330
317/* Board specific data */ 331/* Board specific data */
318struct omap_dss_board_info { 332struct omap_dss_board_info {
319 int (*get_context_loss_count)(struct device *dev); 333 int (*get_context_loss_count)(struct device *dev);
@@ -323,6 +337,7 @@ struct omap_dss_board_info {
323 int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); 337 int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask);
324 void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); 338 void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask);
325 int (*set_min_bus_tput)(struct device *dev, unsigned long r); 339 int (*set_min_bus_tput)(struct device *dev, unsigned long r);
340 enum omapdss_version version;
326}; 341};
327 342
328/* Init with the board info */ 343/* Init with the board info */
@@ -607,10 +622,6 @@ struct omap_dss_device {
607 struct { 622 struct {
608 struct omap_video_timings timings; 623 struct omap_video_timings timings;
609 624
610 int acbi; /* ac-bias pin transitions per interrupt */
611 /* Unit: line clocks */
612 int acb; /* ac-bias pin frequency */
613
614 enum omap_dss_dsi_pixel_format dsi_pix_fmt; 625 enum omap_dss_dsi_pixel_format dsi_pix_fmt;
615 enum omap_dss_dsi_mode dsi_mode; 626 enum omap_dss_dsi_mode dsi_mode;
616 struct omap_dss_dsi_videomode_timings dsi_vm_timings; 627 struct omap_dss_dsi_videomode_timings dsi_vm_timings;
@@ -672,8 +683,6 @@ struct omap_dss_driver {
672 683
673 int (*enable)(struct omap_dss_device *display); 684 int (*enable)(struct omap_dss_device *display);
674 void (*disable)(struct omap_dss_device *display); 685 void (*disable)(struct omap_dss_device *display);
675 int (*suspend)(struct omap_dss_device *display);
676 int (*resume)(struct omap_dss_device *display);
677 int (*run_test)(struct omap_dss_device *display, int test); 686 int (*run_test)(struct omap_dss_device *display, int test);
678 687
679 int (*update)(struct omap_dss_device *dssdev, 688 int (*update)(struct omap_dss_device *dssdev,
@@ -731,6 +740,8 @@ struct omap_dss_driver {
731 740
732}; 741};
733 742
743enum omapdss_version omapdss_get_version(void);
744
734int omap_dss_register_driver(struct omap_dss_driver *); 745int omap_dss_register_driver(struct omap_dss_driver *);
735void omap_dss_unregister_driver(struct omap_dss_driver *); 746void omap_dss_unregister_driver(struct omap_dss_driver *);
736 747
@@ -740,10 +751,19 @@ void omap_dss_put_device(struct omap_dss_device *dssdev);
740struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from); 751struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from);
741struct omap_dss_device *omap_dss_find_device(void *data, 752struct omap_dss_device *omap_dss_find_device(void *data,
742 int (*match)(struct omap_dss_device *dssdev, void *data)); 753 int (*match)(struct omap_dss_device *dssdev, void *data));
754const char *omapdss_get_default_display_name(void);
743 755
744int omap_dss_start_device(struct omap_dss_device *dssdev); 756int omap_dss_start_device(struct omap_dss_device *dssdev);
745void omap_dss_stop_device(struct omap_dss_device *dssdev); 757void omap_dss_stop_device(struct omap_dss_device *dssdev);
746 758
759int dss_feat_get_num_mgrs(void);
760int dss_feat_get_num_ovls(void);
761enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel);
762enum omap_dss_output_id dss_feat_get_supported_outputs(enum omap_channel channel);
763enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane);
764
765
766
747int omap_dss_get_num_overlay_managers(void); 767int omap_dss_get_num_overlay_managers(void);
748struct omap_overlay_manager *omap_dss_get_overlay_manager(int num); 768struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
749 769
@@ -765,9 +785,43 @@ typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
765int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); 785int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
766int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask); 786int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
767 787
768int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout); 788u32 dispc_read_irqstatus(void);
769int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, 789void dispc_clear_irqstatus(u32 mask);
770 unsigned long timeout); 790u32 dispc_read_irqenable(void);
791void dispc_write_irqenable(u32 mask);
792
793int dispc_request_irq(irq_handler_t handler, void *dev_id);
794void dispc_free_irq(void *dev_id);
795
796int dispc_runtime_get(void);
797void dispc_runtime_put(void);
798
799void dispc_mgr_enable(enum omap_channel channel, bool enable);
800bool dispc_mgr_is_enabled(enum omap_channel channel);
801u32 dispc_mgr_get_vsync_irq(enum omap_channel channel);
802u32 dispc_mgr_get_framedone_irq(enum omap_channel channel);
803u32 dispc_mgr_get_sync_lost_irq(enum omap_channel channel);
804bool dispc_mgr_go_busy(enum omap_channel channel);
805void dispc_mgr_go(enum omap_channel channel);
806void dispc_mgr_set_lcd_config(enum omap_channel channel,
807 const struct dss_lcd_mgr_config *config);
808void dispc_mgr_set_timings(enum omap_channel channel,
809 const struct omap_video_timings *timings);
810void dispc_mgr_setup(enum omap_channel channel,
811 const struct omap_overlay_manager_info *info);
812
813int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel,
814 const struct omap_overlay_info *oi,
815 const struct omap_video_timings *timings,
816 int *x_predecim, int *y_predecim);
817
818int dispc_ovl_enable(enum omap_plane plane, bool enable);
819bool dispc_ovl_enabled(enum omap_plane plane);
820void dispc_ovl_set_channel_out(enum omap_plane plane,
821 enum omap_channel channel);
822int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
823 bool replication, const struct omap_video_timings *mgr_timings,
824 bool mem_to_mem);
771 825
772#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) 826#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
773#define to_dss_device(x) container_of((x), struct omap_dss_device, dev) 827#define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
@@ -826,4 +880,35 @@ void omapdss_rfbi_set_data_lines(struct omap_dss_device *dssdev,
826void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev, 880void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev,
827 struct rfbi_timings *timings); 881 struct rfbi_timings *timings);
828 882
883int omapdss_compat_init(void);
884void omapdss_compat_uninit(void);
885
886struct dss_mgr_ops {
887 void (*start_update)(struct omap_overlay_manager *mgr);
888 int (*enable)(struct omap_overlay_manager *mgr);
889 void (*disable)(struct omap_overlay_manager *mgr);
890 void (*set_timings)(struct omap_overlay_manager *mgr,
891 const struct omap_video_timings *timings);
892 void (*set_lcd_config)(struct omap_overlay_manager *mgr,
893 const struct dss_lcd_mgr_config *config);
894 int (*register_framedone_handler)(struct omap_overlay_manager *mgr,
895 void (*handler)(void *), void *data);
896 void (*unregister_framedone_handler)(struct omap_overlay_manager *mgr,
897 void (*handler)(void *), void *data);
898};
899
900int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
901void dss_uninstall_mgr_ops(void);
902
903void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
904 const struct omap_video_timings *timings);
905void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
906 const struct dss_lcd_mgr_config *config);
907int dss_mgr_enable(struct omap_overlay_manager *mgr);
908void dss_mgr_disable(struct omap_overlay_manager *mgr);
909void dss_mgr_start_update(struct omap_overlay_manager *mgr);
910int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
911 void (*handler)(void *), void *data);
912void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
913 void (*handler)(void *), void *data);
829#endif 914#endif
diff --git a/include/video/omapvrfb.h b/include/video/omapvrfb.h
new file mode 100644
index 000000000000..bb0bd89f8bc6
--- /dev/null
+++ b/include/video/omapvrfb.h
@@ -0,0 +1,68 @@
1/*
2 * VRFB Rotation Engine
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21#ifndef __OMAP_VRFB_H__
22#define __OMAP_VRFB_H__
23
24#define OMAP_VRFB_LINE_LEN 2048
25
26struct vrfb {
27 u8 context;
28 void __iomem *vaddr[4];
29 unsigned long paddr[4];
30 u16 xres;
31 u16 yres;
32 u16 xoffset;
33 u16 yoffset;
34 u8 bytespp;
35 bool yuv_mode;
36};
37
38#ifdef CONFIG_OMAP2_VRFB
39extern bool omap_vrfb_supported(void);
40extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
41extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
42extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
43 u8 bytespp);
44extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp);
45extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp);
46extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
47 u16 width, u16 height,
48 unsigned bytespp, bool yuv_mode);
49extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot);
50extern void omap_vrfb_restore_context(void);
51
52#else
53static inline bool omap_vrfb_supported(void) { return false; }
54static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; }
55static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {}
56static inline void omap_vrfb_adjust_size(u16 *width, u16 *height,
57 u8 bytespp) {}
58static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp)
59 { return 0; }
60static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp)
61 { return 0; }
62static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
63 u16 width, u16 height, unsigned bytespp, bool yuv_mode) {}
64static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot)
65 { return 0; }
66static inline void omap_vrfb_restore_context(void) {}
67#endif
68#endif /* __VRFB_H */