2018-07-30 13:52:34 +03:00
# ifndef ARMADA_PLANE_H
# define ARMADA_PLANE_H
2019-01-25 13:56:54 +03:00
struct armada_plane_state {
struct drm_plane_state base ;
u32 src_hw ;
u32 dst_yx ;
u32 dst_hw ;
2019-01-25 14:14:21 +03:00
u32 addrs [ 2 ] [ 3 ] ;
u16 pitches [ 3 ] ;
bool interlace ;
2019-01-25 13:56:54 +03:00
} ;
# define to_armada_plane_state(st) \
container_of ( st , struct armada_plane_state , base )
# define armada_src_hw(state) to_armada_plane_state(state)->src_hw
# define armada_dst_yx(state) to_armada_plane_state(state)->dst_yx
# define armada_dst_hw(state) to_armada_plane_state(state)->dst_hw
2019-01-25 14:14:21 +03:00
# define armada_addr(state, f, p) to_armada_plane_state(state)->addrs[f][p]
# define armada_pitch(state, n) to_armada_plane_state(state)->pitches[n]
2019-01-25 13:28:20 +03:00
2018-07-30 13:52:34 +03:00
void armada_drm_plane_calc ( struct drm_plane_state * state , u32 addrs [ 2 ] [ 3 ] ,
u16 pitches [ 3 ] , bool interlaced ) ;
2018-07-30 13:52:34 +03:00
int armada_drm_plane_prepare_fb ( struct drm_plane * plane ,
struct drm_plane_state * state ) ;
void armada_drm_plane_cleanup_fb ( struct drm_plane * plane ,
struct drm_plane_state * old_state ) ;
int armada_drm_plane_atomic_check ( struct drm_plane * plane ,
struct drm_plane_state * state ) ;
2019-01-25 13:56:54 +03:00
void armada_plane_reset ( struct drm_plane * plane ) ;
struct drm_plane_state * armada_plane_duplicate_state ( struct drm_plane * plane ) ;
void armada_plane_destroy_state ( struct drm_plane * plane ,
struct drm_plane_state * state ) ;
2018-07-30 13:52:34 +03:00
int armada_drm_primary_plane_init ( struct drm_device * drm ,
2018-07-30 13:53:06 +03:00
struct drm_plane * primary ) ;
2018-07-30 13:52:34 +03:00
# endif