diff options
Diffstat (limited to 'drivers/gpu/pvr/display/omap_display.h')
-rw-r--r-- | drivers/gpu/pvr/display/omap_display.h | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/drivers/gpu/pvr/display/omap_display.h b/drivers/gpu/pvr/display/omap_display.h new file mode 100644 index 00000000000..13916a9461f --- /dev/null +++ b/drivers/gpu/pvr/display/omap_display.h | |||
@@ -0,0 +1,109 @@ | |||
1 | /* | ||
2 | * drivers/gpu/pvr/display/omap_display.h | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License version 2 as published by | ||
8 | * the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
13 | * more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License along with | ||
16 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #include <plat/vrfb.h> | ||
20 | #include <plat/display.h> | ||
21 | #include <linux/completion.h> | ||
22 | |||
23 | #ifndef __OMAP_DISPLAY_H_ | ||
24 | #define __OMAP_DISPLAY_H_ | ||
25 | |||
26 | /* Max overlay managers for virtual display */ | ||
27 | #define OMAP_DISP_MAX_MANAGERS 2 | ||
28 | /* 3 for triple buffering, 4 for virtual display */ | ||
29 | #define OMAP_DISP_MAX_FLIPCHAIN_BUFFERS 4 | ||
30 | #define OMAP_DISP_NUM_DISPLAYS 4 /* lcd, 2lcd, tv, virtual */ | ||
31 | |||
32 | struct omap_display_device; | ||
33 | |||
34 | /* On OMAP 4 we can only manage 3 displays at the same time + virtual */ | ||
35 | enum omap_display_id { | ||
36 | OMAP_DISPID_PRIMARY = 1 << 0, | ||
37 | OMAP_DISPID_SECONDARY = 1 << 1, | ||
38 | OMAP_DISPID_TERTIARY = 1 << 2, | ||
39 | OMAP_DISPID_VIRTUAL = 1 << 15, /* Multiple displays */ | ||
40 | OMAP_DISPID_BADSTATE = 1 << 30, /* Used to say a display is unusable*/ | ||
41 | }; | ||
42 | |||
43 | enum omap_display_pixel_format { | ||
44 | RGB_565 = 0, | ||
45 | ARGB_8888 = 1, | ||
46 | }; | ||
47 | |||
48 | /* Primary display location for virtual display */ | ||
49 | enum omap_display_feature { | ||
50 | ORIENTATION_VERTICAL = 1 << 0, | ||
51 | ORIENTATION_HORIZONTAL = 1 << 1, | ||
52 | ORIENTATION_INVERT = 1 << 2, | ||
53 | }; | ||
54 | |||
55 | struct omap_display_buffer { | ||
56 | unsigned long physical_addr; | ||
57 | unsigned long virtual_addr; | ||
58 | unsigned long size; | ||
59 | struct omap_display_device *display; | ||
60 | }; | ||
61 | |||
62 | struct omap_display_flip_chain { | ||
63 | int buffer_count; | ||
64 | struct omap_display_buffer *buffers[OMAP_DISP_MAX_FLIPCHAIN_BUFFERS]; | ||
65 | struct omap_display_device *display; | ||
66 | }; | ||
67 | |||
68 | struct omap_display_sync_item { | ||
69 | struct omap_display_buffer *buffer; | ||
70 | struct completion *task; | ||
71 | int invalidate; | ||
72 | }; | ||
73 | |||
74 | struct omap_display_device { | ||
75 | char *name; | ||
76 | enum omap_display_id id; | ||
77 | enum omap_display_pixel_format pixel_format; | ||
78 | enum omap_display_feature features; | ||
79 | unsigned int width; | ||
80 | unsigned int height; | ||
81 | unsigned int bits_per_pixel; | ||
82 | unsigned int bytes_per_pixel; | ||
83 | unsigned int byte_stride; | ||
84 | enum omap_dss_rotation_angle rotation; | ||
85 | unsigned int reference_count; | ||
86 | unsigned int buffers_available; | ||
87 | struct omap_display_buffer *main_buffer; | ||
88 | struct omap_display_flip_chain *flip_chain; | ||
89 | struct omap_overlay_manager *overlay_managers[OMAP_DISP_MAX_MANAGERS]; | ||
90 | unsigned int overlay_managers_count; | ||
91 | int (*open)(struct omap_display_device *display, | ||
92 | enum omap_display_feature features); | ||
93 | int (*close) (struct omap_display_device *display); | ||
94 | int (*create_flip_chain) (struct omap_display_device *display, | ||
95 | unsigned int buffer_count); | ||
96 | int (*destroy_flip_chain) (struct omap_display_device *display); | ||
97 | int (*rotate) (struct omap_display_device *display, | ||
98 | enum omap_dss_rotation_angle rotation); | ||
99 | int (*present_buffer) (struct omap_display_buffer *buffer); | ||
100 | int (*sync) (struct omap_display_device *display); | ||
101 | int (*present_buffer_sync) (struct omap_display_buffer *buffer); | ||
102 | }; | ||
103 | |||
104 | int omap_display_init(void); | ||
105 | int omap_display_deinit(void); | ||
106 | int omap_display_count(void); | ||
107 | struct omap_display_device *omap_display_get(enum omap_display_id id); | ||
108 | |||
109 | #endif | ||