Rev 5270 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5270 | Rev 6082 | ||
---|---|---|---|
Line 41... | Line 41... | ||
41 | * |
41 | * |
42 | * Helper functions to assist with creation and handling of CRTC primary |
42 | * Helper functions to assist with creation and handling of CRTC primary |
43 | * planes. |
43 | * planes. |
44 | */ |
44 | */ |
Line 45... | Line 45... | ||
45 | 45 | ||
46 | extern int drm_crtc_init(struct drm_device *dev, |
- | |
47 | struct drm_crtc *crtc, |
46 | int drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, |
Line 48... | Line 47... | ||
48 | const struct drm_crtc_funcs *funcs); |
47 | const struct drm_crtc_funcs *funcs); |
49 | 48 | ||
50 | /** |
49 | /** |
51 | * drm_plane_helper_funcs - helper operations for CRTCs |
50 | * drm_plane_helper_funcs - helper operations for CRTCs |
52 | * @prepare_fb: prepare a framebuffer for use by the plane |
51 | * @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 |
52 | * @cleanup_fb: cleanup a framebuffer when it's no longer used by the plane |
- | 53 | * @atomic_check: check that a given atomic state is valid and can be applied |
|
54 | * @atomic_check: check that a given atomic state is valid and can be applied |
54 | * @atomic_update: apply an atomic state to the plane (mandatory) |
55 | * @atomic_update: apply an atomic state to the plane |
55 | * @atomic_disable: disable the plane |
56 | * |
56 | * |
57 | * The helper operations are called by the mid-layer CRTC helper. |
57 | * The helper operations are called by the mid-layer CRTC helper. |
58 | */ |
58 | */ |
59 | struct drm_plane_helper_funcs { |
59 | struct drm_plane_helper_funcs { |
60 | int (*prepare_fb)(struct drm_plane *plane, |
60 | int (*prepare_fb)(struct drm_plane *plane, |
61 | struct drm_framebuffer *fb); |
61 | const struct drm_plane_state *new_state); |
Line 62... | Line 62... | ||
62 | void (*cleanup_fb)(struct drm_plane *plane, |
62 | void (*cleanup_fb)(struct drm_plane *plane, |
63 | struct drm_framebuffer *fb); |
63 | const struct drm_plane_state *old_state); |
64 | 64 | ||
65 | int (*atomic_check)(struct drm_plane *plane, |
65 | int (*atomic_check)(struct drm_plane *plane, |
- | 66 | struct drm_plane_state *state); |
|
- | 67 | void (*atomic_update)(struct drm_plane *plane, |
|
66 | struct drm_plane_state *state); |
68 | struct drm_plane_state *old_state); |
Line 67... | Line 69... | ||
67 | void (*atomic_update)(struct drm_plane *plane, |
69 | void (*atomic_disable)(struct drm_plane *plane, |
68 | struct drm_plane_state *old_state); |
70 | struct drm_plane_state *old_state); |
69 | }; |
71 | }; |
70 | 72 | ||
71 | static inline void drm_plane_helper_add(struct drm_plane *plane, |
73 | static inline void drm_plane_helper_add(struct drm_plane *plane, |
Line 72... | Line 74... | ||
72 | const struct drm_plane_helper_funcs *funcs) |
74 | const struct drm_plane_helper_funcs *funcs) |
73 | { |
75 | { |
74 | plane->helper_private = (void *)funcs; |
76 | plane->helper_private = funcs; |
75 | } |
77 | } |
76 | 78 | ||
77 | extern int drm_plane_helper_check_update(struct drm_plane *plane, |
79 | int drm_plane_helper_check_update(struct drm_plane *plane, |
78 | struct drm_crtc *crtc, |
80 | struct drm_crtc *crtc, |
79 | struct drm_framebuffer *fb, |
81 | struct drm_framebuffer *fb, |
80 | struct drm_rect *src, |
82 | struct drm_rect *src, |
81 | struct drm_rect *dest, |
83 | struct drm_rect *dest, |
82 | const struct drm_rect *clip, |
84 | const struct drm_rect *clip, |
83 | int min_scale, |
85 | int min_scale, |
84 | int max_scale, |
86 | int max_scale, |
85 | bool can_position, |
87 | bool can_position, |
86 | bool can_update_disabled, |
88 | bool can_update_disabled, |
87 | bool *visible); |
89 | bool *visible); |
88 | extern int drm_primary_helper_update(struct drm_plane *plane, |
90 | int drm_primary_helper_update(struct drm_plane *plane, |
89 | struct drm_crtc *crtc, |
91 | struct drm_crtc *crtc, |
90 | struct drm_framebuffer *fb, |
92 | struct drm_framebuffer *fb, |
91 | int crtc_x, int crtc_y, |
93 | int crtc_x, int crtc_y, |
92 | unsigned int crtc_w, unsigned int crtc_h, |
94 | unsigned int crtc_w, unsigned int crtc_h, |
93 | uint32_t src_x, uint32_t src_y, |
- | |
94 | uint32_t src_w, uint32_t src_h); |
- | |
95 | extern int drm_primary_helper_disable(struct drm_plane *plane); |
- | |
96 | extern void drm_primary_helper_destroy(struct drm_plane *plane); |
- | |
Line 97... | Line 95... | ||
97 | extern const struct drm_plane_funcs drm_primary_helper_funcs; |
95 | uint32_t src_x, uint32_t src_y, |
98 | extern struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, |
96 | uint32_t src_w, uint32_t src_h); |
99 | const uint32_t *formats, |
97 | int drm_primary_helper_disable(struct drm_plane *plane); |
100 | int num_formats); |
98 | void drm_primary_helper_destroy(struct drm_plane *plane); |