2 * Copyright (C) 2012 Russell King
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
11 struct armada_gem_object
;
19 #define armada_reg_queue_mod(_r, _i, _v, _m, _o) \
21 struct armada_regs *__reg = _r; \
22 __reg[_i].offset = _o; \
23 __reg[_i].mask = ~(_m); \
28 #define armada_reg_queue_set(_r, _i, _v, _o) \
29 armada_reg_queue_mod(_r, _i, _v, ~0, _o)
31 #define armada_reg_queue_end(_r, _i) \
32 armada_reg_queue_mod(_r, _i, 0, 0, ~0)
36 struct armada_variant
;
38 struct armada_plane_work
{
39 void (*fn
)(struct armada_crtc
*, struct armada_plane_work
*);
40 void (*cancel
)(struct armada_crtc
*, struct armada_plane_work
*);
42 struct drm_plane
*plane
;
43 struct drm_framebuffer
*old_fb
;
44 struct drm_pending_vblank_event
*event
;
45 struct armada_regs regs
[14];
48 struct armada_plane_state
{
60 struct drm_plane base
;
61 wait_queue_head_t frame_wait
;
63 struct armada_plane_work works
[2];
64 struct armada_plane_work
*work
;
65 struct armada_plane_state state
;
67 #define drm_to_armada_plane(p) container_of(p, struct armada_plane, base)
69 int armada_drm_plane_init(struct armada_plane
*plane
);
70 int armada_drm_plane_work_queue(struct armada_crtc
*dcrtc
,
71 struct armada_plane_work
*work
);
72 int armada_drm_plane_work_wait(struct armada_plane
*plane
, long timeout
);
73 void armada_drm_plane_work_cancel(struct armada_crtc
*dcrtc
,
74 struct armada_plane
*plane
);
75 void armada_drm_plane_calc_addrs(u32
*addrs
, struct drm_framebuffer
*fb
,
80 const struct armada_variant
*variant
;
84 struct clk
*extclk
[2];
86 uint32_t spu_v_h_total
;
95 struct drm_plane
*plane
;
97 struct armada_gem_object
*cursor_obj
;
100 uint32_t cursor_hw_pos
;
101 uint32_t cursor_hw_sz
;
106 uint32_t cfg_dumb_ctrl
;
108 uint32_t spu_iopad_ctrl
;
113 #define drm_to_armada_crtc(c) container_of(c, struct armada_crtc, crtc)
115 void armada_drm_crtc_update_regs(struct armada_crtc
*, struct armada_regs
*);
117 int armada_drm_plane_disable(struct drm_plane
*plane
,
118 struct drm_modeset_acquire_ctx
*ctx
);
120 extern struct platform_driver armada_lcd_platform_driver
;