diff options
author | Jiri Kosina <jkosina@suse.cz> | 2015-09-01 09:35:24 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-09-01 09:35:24 -0400 |
commit | 067e2601d3c076abbf45db91261f9065eaa879b2 (patch) | |
tree | 86c8d4b913873dbd3b4ff23562a3a8597984b4df /drivers/gpu/drm/omapdrm/omap_drv.h | |
parent | 3e097d1271ecdff2f251a54ddfc5eaa1f9821e96 (diff) | |
parent | 931830aa5c251e0803523213428f777a48bde254 (diff) |
Merge branch 'for-4.3/gembird' into for-linus
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_drv.h')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_drv.h | 65 |
1 files changed, 19 insertions, 46 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h index b31c79f15aed..12081e61d45a 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.h +++ b/drivers/gpu/drm/omapdrm/omap_drv.h | |||
@@ -20,15 +20,16 @@ | |||
20 | #ifndef __OMAP_DRV_H__ | 20 | #ifndef __OMAP_DRV_H__ |
21 | #define __OMAP_DRV_H__ | 21 | #define __OMAP_DRV_H__ |
22 | 22 | ||
23 | #include <video/omapdss.h> | ||
24 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/platform_data/omap_drm.h> | ||
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | #include <linux/wait.h> | ||
27 | #include <video/omapdss.h> | ||
28 | |||
26 | #include <drm/drmP.h> | 29 | #include <drm/drmP.h> |
27 | #include <drm/drm_crtc_helper.h> | 30 | #include <drm/drm_crtc_helper.h> |
28 | #include <drm/omap_drm.h> | ||
29 | #include <drm/drm_gem.h> | 31 | #include <drm/drm_gem.h> |
30 | #include <linux/platform_data/omap_drm.h> | 32 | #include <drm/omap_drm.h> |
31 | |||
32 | 33 | ||
33 | #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) | 34 | #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__) |
34 | #define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */ | 35 | #define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */ |
@@ -50,21 +51,6 @@ struct omap_drm_window { | |||
50 | uint32_t src_w, src_h; | 51 | uint32_t src_w, src_h; |
51 | }; | 52 | }; |
52 | 53 | ||
53 | /* Once GO bit is set, we can't make further updates to shadowed registers | ||
54 | * until the GO bit is cleared. So various parts in the kms code that need | ||
55 | * to update shadowed registers queue up a pair of callbacks, pre_apply | ||
56 | * which is called before setting GO bit, and post_apply that is called | ||
57 | * after GO bit is cleared. The crtc manages the queuing, and everyone | ||
58 | * else goes thru omap_crtc_apply() using these callbacks so that the | ||
59 | * code which has to deal w/ GO bit state is centralized. | ||
60 | */ | ||
61 | struct omap_drm_apply { | ||
62 | struct list_head pending_node, queued_node; | ||
63 | bool queued; | ||
64 | void (*pre_apply)(struct omap_drm_apply *apply); | ||
65 | void (*post_apply)(struct omap_drm_apply *apply); | ||
66 | }; | ||
67 | |||
68 | /* For transiently registering for different DSS irqs that various parts | 54 | /* For transiently registering for different DSS irqs that various parts |
69 | * of the KMS code need during setup/configuration. We these are not | 55 | * of the KMS code need during setup/configuration. We these are not |
70 | * necessarily the same as what drm_vblank_get/put() are requesting, and | 56 | * necessarily the same as what drm_vblank_get/put() are requesting, and |
@@ -114,13 +100,20 @@ struct omap_drm_private { | |||
114 | bool has_dmm; | 100 | bool has_dmm; |
115 | 101 | ||
116 | /* properties: */ | 102 | /* properties: */ |
117 | struct drm_property *rotation_prop; | ||
118 | struct drm_property *zorder_prop; | 103 | struct drm_property *zorder_prop; |
119 | 104 | ||
120 | /* irq handling: */ | 105 | /* irq handling: */ |
121 | struct list_head irq_list; /* list of omap_drm_irq */ | 106 | struct list_head irq_list; /* list of omap_drm_irq */ |
122 | uint32_t vblank_mask; /* irq bits set for userspace vblank */ | 107 | uint32_t vblank_mask; /* irq bits set for userspace vblank */ |
123 | struct omap_drm_irq error_handler; | 108 | struct omap_drm_irq error_handler; |
109 | |||
110 | /* atomic commit */ | ||
111 | struct { | ||
112 | struct list_head events; | ||
113 | wait_queue_head_t wait; | ||
114 | u32 pending; | ||
115 | spinlock_t lock; /* Protects commit.pending */ | ||
116 | } commit; | ||
124 | }; | 117 | }; |
125 | 118 | ||
126 | 119 | ||
@@ -138,51 +131,31 @@ int omap_gem_resume(struct device *dev); | |||
138 | 131 | ||
139 | int omap_irq_enable_vblank(struct drm_device *dev, int crtc_id); | 132 | int omap_irq_enable_vblank(struct drm_device *dev, int crtc_id); |
140 | void omap_irq_disable_vblank(struct drm_device *dev, int crtc_id); | 133 | void omap_irq_disable_vblank(struct drm_device *dev, int crtc_id); |
141 | irqreturn_t omap_irq_handler(int irq, void *arg); | ||
142 | void omap_irq_preinstall(struct drm_device *dev); | ||
143 | int omap_irq_postinstall(struct drm_device *dev); | ||
144 | void omap_irq_uninstall(struct drm_device *dev); | ||
145 | void __omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq); | 134 | void __omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq); |
146 | void __omap_irq_unregister(struct drm_device *dev, struct omap_drm_irq *irq); | 135 | void __omap_irq_unregister(struct drm_device *dev, struct omap_drm_irq *irq); |
147 | void omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq); | 136 | void omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq); |
148 | void omap_irq_unregister(struct drm_device *dev, struct omap_drm_irq *irq); | 137 | void omap_irq_unregister(struct drm_device *dev, struct omap_drm_irq *irq); |
149 | int omap_drm_irq_uninstall(struct drm_device *dev); | 138 | void omap_drm_irq_uninstall(struct drm_device *dev); |
150 | int omap_drm_irq_install(struct drm_device *dev); | 139 | int omap_drm_irq_install(struct drm_device *dev); |
151 | 140 | ||
152 | struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev); | 141 | struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev); |
153 | void omap_fbdev_free(struct drm_device *dev); | 142 | void omap_fbdev_free(struct drm_device *dev); |
154 | 143 | ||
155 | const struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc); | 144 | struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc); |
156 | enum omap_channel omap_crtc_channel(struct drm_crtc *crtc); | 145 | enum omap_channel omap_crtc_channel(struct drm_crtc *crtc); |
157 | int omap_crtc_apply(struct drm_crtc *crtc, | ||
158 | struct omap_drm_apply *apply); | ||
159 | void omap_crtc_pre_init(void); | 146 | void omap_crtc_pre_init(void); |
160 | void omap_crtc_pre_uninit(void); | 147 | void omap_crtc_pre_uninit(void); |
161 | struct drm_crtc *omap_crtc_init(struct drm_device *dev, | 148 | struct drm_crtc *omap_crtc_init(struct drm_device *dev, |
162 | struct drm_plane *plane, enum omap_channel channel, int id); | 149 | struct drm_plane *plane, enum omap_channel channel, int id); |
163 | void omap_crtc_flush(struct drm_crtc *crtc); | 150 | int omap_crtc_wait_pending(struct drm_crtc *crtc); |
164 | 151 | ||
165 | struct drm_plane *omap_plane_init(struct drm_device *dev, | 152 | struct drm_plane *omap_plane_init(struct drm_device *dev, |
166 | int id, enum drm_plane_type type); | 153 | int id, enum drm_plane_type type); |
167 | int omap_plane_set_enable(struct drm_plane *plane, bool enable); | ||
168 | int omap_plane_mode_set(struct drm_plane *plane, | ||
169 | struct drm_crtc *crtc, struct drm_framebuffer *fb, | ||
170 | int crtc_x, int crtc_y, | ||
171 | unsigned int crtc_w, unsigned int crtc_h, | ||
172 | unsigned int src_x, unsigned int src_y, | ||
173 | unsigned int src_w, unsigned int src_h, | ||
174 | void (*fxn)(void *), void *arg); | ||
175 | void omap_plane_install_properties(struct drm_plane *plane, | 154 | void omap_plane_install_properties(struct drm_plane *plane, |
176 | struct drm_mode_object *obj); | 155 | struct drm_mode_object *obj); |
177 | int omap_plane_set_property(struct drm_plane *plane, | ||
178 | struct drm_property *property, uint64_t val); | ||
179 | 156 | ||
180 | struct drm_encoder *omap_encoder_init(struct drm_device *dev, | 157 | struct drm_encoder *omap_encoder_init(struct drm_device *dev, |
181 | struct omap_dss_device *dssdev); | 158 | struct omap_dss_device *dssdev); |
182 | int omap_encoder_set_enabled(struct drm_encoder *encoder, bool enabled); | ||
183 | int omap_encoder_update(struct drm_encoder *encoder, | ||
184 | struct omap_overlay_manager *mgr, | ||
185 | struct omap_video_timings *timings); | ||
186 | 159 | ||
187 | struct drm_connector *omap_connector_init(struct drm_device *dev, | 160 | struct drm_connector *omap_connector_init(struct drm_device *dev, |
188 | int connector_type, struct omap_dss_device *dssdev, | 161 | int connector_type, struct omap_dss_device *dssdev, |
@@ -204,7 +177,7 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev, | |||
204 | struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos); | 177 | struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object **bos); |
205 | struct drm_gem_object *omap_framebuffer_bo(struct drm_framebuffer *fb, int p); | 178 | struct drm_gem_object *omap_framebuffer_bo(struct drm_framebuffer *fb, int p); |
206 | int omap_framebuffer_pin(struct drm_framebuffer *fb); | 179 | int omap_framebuffer_pin(struct drm_framebuffer *fb); |
207 | int omap_framebuffer_unpin(struct drm_framebuffer *fb); | 180 | void omap_framebuffer_unpin(struct drm_framebuffer *fb); |
208 | void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, | 181 | void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, |
209 | struct omap_drm_window *win, struct omap_overlay_info *info); | 182 | struct omap_drm_window *win, struct omap_overlay_info *info); |
210 | struct drm_connector *omap_framebuffer_get_next_connector( | 183 | struct drm_connector *omap_framebuffer_get_next_connector( |
@@ -238,7 +211,7 @@ void omap_gem_dma_sync(struct drm_gem_object *obj, | |||
238 | enum dma_data_direction dir); | 211 | enum dma_data_direction dir); |
239 | int omap_gem_get_paddr(struct drm_gem_object *obj, | 212 | int omap_gem_get_paddr(struct drm_gem_object *obj, |
240 | dma_addr_t *paddr, bool remap); | 213 | dma_addr_t *paddr, bool remap); |
241 | int omap_gem_put_paddr(struct drm_gem_object *obj); | 214 | void omap_gem_put_paddr(struct drm_gem_object *obj); |
242 | int omap_gem_get_pages(struct drm_gem_object *obj, struct page ***pages, | 215 | int omap_gem_get_pages(struct drm_gem_object *obj, struct page ***pages, |
243 | bool remap); | 216 | bool remap); |
244 | int omap_gem_put_pages(struct drm_gem_object *obj); | 217 | int omap_gem_put_pages(struct drm_gem_object *obj); |
@@ -263,7 +236,7 @@ static inline int align_pitch(int pitch, int width, int bpp) | |||
263 | /* PVR needs alignment to 8 pixels.. right now that is the most | 236 | /* PVR needs alignment to 8 pixels.. right now that is the most |
264 | * restrictive stride requirement.. | 237 | * restrictive stride requirement.. |
265 | */ | 238 | */ |
266 | return ALIGN(pitch, 8 * bytespp); | 239 | return roundup(pitch, 8 * bytespp); |
267 | } | 240 | } |
268 | 241 | ||
269 | /* map crtc to vblank mask */ | 242 | /* map crtc to vblank mask */ |