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
*,
40 struct armada_plane
*,
41 struct armada_plane_work
*);
45 struct drm_plane base
;
46 wait_queue_head_t frame_wait
;
47 struct armada_plane_work
*work
;
49 #define drm_to_armada_plane(p) container_of(p, struct armada_plane, base)
51 int armada_drm_plane_init(struct armada_plane
*plane
);
52 int armada_drm_plane_work_queue(struct armada_crtc
*dcrtc
,
53 struct armada_plane
*plane
, struct armada_plane_work
*work
);
54 int armada_drm_plane_work_wait(struct armada_plane
*plane
, long timeout
);
55 struct armada_plane_work
*armada_drm_plane_work_cancel(
56 struct armada_crtc
*dcrtc
, struct armada_plane
*plane
);
60 const struct armada_variant
*variant
;
64 struct clk
*extclk
[2];
66 uint32_t spu_v_h_total
;
75 struct drm_plane
*plane
;
77 struct armada_gem_object
*cursor_obj
;
80 uint32_t cursor_hw_pos
;
81 uint32_t cursor_hw_sz
;
86 uint32_t cfg_dumb_ctrl
;
88 uint32_t spu_iopad_ctrl
;
93 #define drm_to_armada_crtc(c) container_of(c, struct armada_crtc, crtc)
95 void armada_drm_crtc_gamma_set(struct drm_crtc
*, u16
, u16
, u16
, int);
96 void armada_drm_crtc_gamma_get(struct drm_crtc
*, u16
*, u16
*, u16
*, int);
97 void armada_drm_crtc_disable_irq(struct armada_crtc
*, u32
);
98 void armada_drm_crtc_enable_irq(struct armada_crtc
*, u32
);
99 void armada_drm_crtc_update_regs(struct armada_crtc
*, struct armada_regs
*);
101 void armada_drm_crtc_plane_disable(struct armada_crtc
*dcrtc
,
102 struct drm_plane
*plane
);
104 extern struct platform_driver armada_lcd_platform_driver
;