aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_drv.h
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2015-09-01 09:35:24 -0400
committerJiri Kosina <jkosina@suse.cz>2015-09-01 09:35:24 -0400
commit067e2601d3c076abbf45db91261f9065eaa879b2 (patch)
tree86c8d4b913873dbd3b4ff23562a3a8597984b4df /drivers/gpu/drm/omapdrm/omap_drv.h
parent3e097d1271ecdff2f251a54ddfc5eaa1f9821e96 (diff)
parent931830aa5c251e0803523213428f777a48bde254 (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.h65
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 */
61struct 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
139int omap_irq_enable_vblank(struct drm_device *dev, int crtc_id); 132int omap_irq_enable_vblank(struct drm_device *dev, int crtc_id);
140void omap_irq_disable_vblank(struct drm_device *dev, int crtc_id); 133void omap_irq_disable_vblank(struct drm_device *dev, int crtc_id);
141irqreturn_t omap_irq_handler(int irq, void *arg);
142void omap_irq_preinstall(struct drm_device *dev);
143int omap_irq_postinstall(struct drm_device *dev);
144void omap_irq_uninstall(struct drm_device *dev);
145void __omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq); 134void __omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq);
146void __omap_irq_unregister(struct drm_device *dev, struct omap_drm_irq *irq); 135void __omap_irq_unregister(struct drm_device *dev, struct omap_drm_irq *irq);
147void omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq); 136void omap_irq_register(struct drm_device *dev, struct omap_drm_irq *irq);
148void omap_irq_unregister(struct drm_device *dev, struct omap_drm_irq *irq); 137void omap_irq_unregister(struct drm_device *dev, struct omap_drm_irq *irq);
149int omap_drm_irq_uninstall(struct drm_device *dev); 138void omap_drm_irq_uninstall(struct drm_device *dev);
150int omap_drm_irq_install(struct drm_device *dev); 139int omap_drm_irq_install(struct drm_device *dev);
151 140
152struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev); 141struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev);
153void omap_fbdev_free(struct drm_device *dev); 142void omap_fbdev_free(struct drm_device *dev);
154 143
155const struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc); 144struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc);
156enum omap_channel omap_crtc_channel(struct drm_crtc *crtc); 145enum omap_channel omap_crtc_channel(struct drm_crtc *crtc);
157int omap_crtc_apply(struct drm_crtc *crtc,
158 struct omap_drm_apply *apply);
159void omap_crtc_pre_init(void); 146void omap_crtc_pre_init(void);
160void omap_crtc_pre_uninit(void); 147void omap_crtc_pre_uninit(void);
161struct drm_crtc *omap_crtc_init(struct drm_device *dev, 148struct 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);
163void omap_crtc_flush(struct drm_crtc *crtc); 150int omap_crtc_wait_pending(struct drm_crtc *crtc);
164 151
165struct drm_plane *omap_plane_init(struct drm_device *dev, 152struct 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);
167int omap_plane_set_enable(struct drm_plane *plane, bool enable);
168int 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);
175void omap_plane_install_properties(struct drm_plane *plane, 154void omap_plane_install_properties(struct drm_plane *plane,
176 struct drm_mode_object *obj); 155 struct drm_mode_object *obj);
177int omap_plane_set_property(struct drm_plane *plane,
178 struct drm_property *property, uint64_t val);
179 156
180struct drm_encoder *omap_encoder_init(struct drm_device *dev, 157struct drm_encoder *omap_encoder_init(struct drm_device *dev,
181 struct omap_dss_device *dssdev); 158 struct omap_dss_device *dssdev);
182int omap_encoder_set_enabled(struct drm_encoder *encoder, bool enabled);
183int omap_encoder_update(struct drm_encoder *encoder,
184 struct omap_overlay_manager *mgr,
185 struct omap_video_timings *timings);
186 159
187struct drm_connector *omap_connector_init(struct drm_device *dev, 160struct 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);
205struct drm_gem_object *omap_framebuffer_bo(struct drm_framebuffer *fb, int p); 178struct drm_gem_object *omap_framebuffer_bo(struct drm_framebuffer *fb, int p);
206int omap_framebuffer_pin(struct drm_framebuffer *fb); 179int omap_framebuffer_pin(struct drm_framebuffer *fb);
207int omap_framebuffer_unpin(struct drm_framebuffer *fb); 180void omap_framebuffer_unpin(struct drm_framebuffer *fb);
208void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, 181void 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);
210struct drm_connector *omap_framebuffer_get_next_connector( 183struct 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);
239int omap_gem_get_paddr(struct drm_gem_object *obj, 212int omap_gem_get_paddr(struct drm_gem_object *obj,
240 dma_addr_t *paddr, bool remap); 213 dma_addr_t *paddr, bool remap);
241int omap_gem_put_paddr(struct drm_gem_object *obj); 214void omap_gem_put_paddr(struct drm_gem_object *obj);
242int omap_gem_get_pages(struct drm_gem_object *obj, struct page ***pages, 215int omap_gem_get_pages(struct drm_gem_object *obj, struct page ***pages,
243 bool remap); 216 bool remap);
244int omap_gem_put_pages(struct drm_gem_object *obj); 217int 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 */