Rev 5056 | Rev 6082 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5056 | Rev 5270 | ||
---|---|---|---|
Line 23... | Line 23... | ||
23 | 23 | ||
24 | #ifndef DRM_PLANE_HELPER_H |
24 | #ifndef DRM_PLANE_HELPER_H |
Line 25... | Line 25... | ||
25 | #define DRM_PLANE_HELPER_H |
25 | #define DRM_PLANE_HELPER_H |
- | 26 | ||
Line 26... | Line 27... | ||
26 | 27 | #include |
|
27 | #include |
28 | #include |
28 | 29 | ||
29 | /* |
30 | /* |
Line 40... | Line 41... | ||
40 | * |
41 | * |
41 | * Helper functions to assist with creation and handling of CRTC primary |
42 | * Helper functions to assist with creation and handling of CRTC primary |
42 | * planes. |
43 | * planes. |
43 | */ |
44 | */ |
Line -... | Line 45... | ||
- | 45 | ||
- | 46 | extern int drm_crtc_init(struct drm_device *dev, |
|
- | 47 | struct drm_crtc *crtc, |
|
- | 48 | const struct drm_crtc_funcs *funcs); |
|
- | 49 | ||
- | 50 | /** |
|
- | 51 | * drm_plane_helper_funcs - helper operations for CRTCs |
|
- | 52 | * @prepare_fb: prepare a framebuffer for use by the plane |
|
- | 53 | * @cleanup_fb: cleanup a framebuffer when it's no longer used by the plane |
|
- | 54 | * @atomic_check: check that a given atomic state is valid and can be applied |
|
- | 55 | * @atomic_update: apply an atomic state to the plane |
|
- | 56 | * |
|
- | 57 | * The helper operations are called by the mid-layer CRTC helper. |
|
- | 58 | */ |
|
- | 59 | struct drm_plane_helper_funcs { |
|
- | 60 | int (*prepare_fb)(struct drm_plane *plane, |
|
- | 61 | struct drm_framebuffer *fb); |
|
- | 62 | void (*cleanup_fb)(struct drm_plane *plane, |
|
- | 63 | struct drm_framebuffer *fb); |
|
- | 64 | ||
- | 65 | int (*atomic_check)(struct drm_plane *plane, |
|
- | 66 | struct drm_plane_state *state); |
|
- | 67 | void (*atomic_update)(struct drm_plane *plane, |
|
- | 68 | struct drm_plane_state *old_state); |
|
- | 69 | }; |
|
- | 70 | ||
- | 71 | static inline void drm_plane_helper_add(struct drm_plane *plane, |
|
- | 72 | const struct drm_plane_helper_funcs *funcs) |
|
- | 73 | { |
|
- | 74 | plane->helper_private = (void *)funcs; |
|
- | 75 | } |
|
44 | 76 | ||
45 | extern int drm_plane_helper_check_update(struct drm_plane *plane, |
77 | extern int drm_plane_helper_check_update(struct drm_plane *plane, |
46 | struct drm_crtc *crtc, |
78 | struct drm_crtc *crtc, |
47 | struct drm_framebuffer *fb, |
79 | struct drm_framebuffer *fb, |
48 | struct drm_rect *src, |
80 | struct drm_rect *src, |
Line 66... | Line 98... | ||
66 | extern struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, |
98 | extern struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, |
67 | const uint32_t *formats, |
99 | const uint32_t *formats, |
68 | int num_formats); |
100 | int num_formats); |
Line -... | Line 101... | ||
- | 101 | ||
- | 102 | ||
- | 103 | int drm_plane_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, |
|
- | 104 | struct drm_framebuffer *fb, |
|
- | 105 | int crtc_x, int crtc_y, |
|
- | 106 | unsigned int crtc_w, unsigned int crtc_h, |
|
- | 107 | uint32_t src_x, uint32_t src_y, |
|
- | 108 | uint32_t src_w, uint32_t src_h); |
|
- | 109 | int drm_plane_helper_disable(struct drm_plane *plane); |
|
- | 110 | ||
- | 111 | /* For use by drm_crtc_helper.c */ |
|
- | 112 | int drm_plane_helper_commit(struct drm_plane *plane, |
|
69 | 113 | struct drm_plane_state *plane_state, |