aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2015-02-05 10:32:33 -0500
committerBoris Brezillon <boris.brezillon@free-electrons.com>2015-02-22 15:00:06 -0500
commit2389fc1305fc1e2cf8b310a75463fefd3058bf48 (patch)
tree2f85d867f87406bbb0256cdffb3f85478e133326 /drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h
parent45ee2dbc65cbf6910892c480e6f428be342fa733 (diff)
drm: atmel-hlcdc: Atomic mode-setting conversion
Convert the HLCDC driver to atomic mode-setting. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h')
-rw-r--r--drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h59
1 files changed, 3 insertions, 56 deletions
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h
index 7bc96af3397a..015c3f13b7f8 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h
@@ -26,11 +26,14 @@
26#include <linux/irqdomain.h> 26#include <linux/irqdomain.h>
27#include <linux/pwm.h> 27#include <linux/pwm.h>
28 28
29#include <drm/drm_atomic.h>
30#include <drm/drm_atomic_helper.h>
29#include <drm/drm_crtc.h> 31#include <drm/drm_crtc.h>
30#include <drm/drm_crtc_helper.h> 32#include <drm/drm_crtc_helper.h>
31#include <drm/drm_fb_cma_helper.h> 33#include <drm/drm_fb_cma_helper.h>
32#include <drm/drm_gem_cma_helper.h> 34#include <drm/drm_gem_cma_helper.h>
33#include <drm/drm_panel.h> 35#include <drm/drm_panel.h>
36#include <drm/drm_plane_helper.h>
34#include <drm/drmP.h> 37#include <drm/drmP.h>
35 38
36#include "atmel_hlcdc_layer.h" 39#include "atmel_hlcdc_layer.h"
@@ -69,7 +72,6 @@ struct atmel_hlcdc_dc_desc {
69 */ 72 */
70struct atmel_hlcdc_plane_properties { 73struct atmel_hlcdc_plane_properties {
71 struct drm_property *alpha; 74 struct drm_property *alpha;
72 struct drm_property *rotation;
73}; 75};
74 76
75/** 77/**
@@ -84,7 +86,6 @@ struct atmel_hlcdc_plane {
84 struct drm_plane base; 86 struct drm_plane base;
85 struct atmel_hlcdc_layer layer; 87 struct atmel_hlcdc_layer layer;
86 struct atmel_hlcdc_plane_properties *properties; 88 struct atmel_hlcdc_plane_properties *properties;
87 unsigned int rotation;
88}; 89};
89 90
90static inline struct atmel_hlcdc_plane * 91static inline struct atmel_hlcdc_plane *
@@ -100,43 +101,6 @@ atmel_hlcdc_layer_to_plane(struct atmel_hlcdc_layer *l)
100} 101}
101 102
102/** 103/**
103 * Atmel HLCDC Plane update request structure.
104 *
105 * @crtc_x: x position of the plane relative to the CRTC
106 * @crtc_y: y position of the plane relative to the CRTC
107 * @crtc_w: visible width of the plane
108 * @crtc_h: visible height of the plane
109 * @src_x: x buffer position
110 * @src_y: y buffer position
111 * @src_w: buffer width
112 * @src_h: buffer height
113 * @fb: framebuffer object object
114 * @bpp: bytes per pixel deduced from pixel_format
115 * @offsets: offsets to apply to the GEM buffers
116 * @xstride: value to add to the pixel pointer between each line
117 * @pstride: value to add to the pixel pointer between each pixel
118 * @nplanes: number of planes (deduced from pixel_format)
119 */
120struct atmel_hlcdc_plane_update_req {
121 int crtc_x;
122 int crtc_y;
123 unsigned int crtc_w;
124 unsigned int crtc_h;
125 uint32_t src_x;
126 uint32_t src_y;
127 uint32_t src_w;
128 uint32_t src_h;
129 struct drm_framebuffer *fb;
130
131 /* These fields are private and should not be touched */
132 int bpp[ATMEL_HLCDC_MAX_PLANES];
133 unsigned int offsets[ATMEL_HLCDC_MAX_PLANES];
134 int xstride[ATMEL_HLCDC_MAX_PLANES];
135 int pstride[ATMEL_HLCDC_MAX_PLANES];
136 int nplanes;
137};
138
139/**
140 * Atmel HLCDC Planes. 104 * Atmel HLCDC Planes.
141 * 105 *
142 * This structure stores the instantiated HLCDC Planes and can be accessed by 106 * This structure stores the instantiated HLCDC Planes and can be accessed by
@@ -184,23 +148,6 @@ int atmel_hlcdc_dc_mode_valid(struct atmel_hlcdc_dc *dc,
184struct atmel_hlcdc_planes * 148struct atmel_hlcdc_planes *
185atmel_hlcdc_create_planes(struct drm_device *dev); 149atmel_hlcdc_create_planes(struct drm_device *dev);
186 150
187int atmel_hlcdc_plane_prepare_update_req(struct drm_plane *p,
188 struct atmel_hlcdc_plane_update_req *req,
189 const struct drm_display_mode *mode);
190
191int atmel_hlcdc_plane_apply_update_req(struct drm_plane *p,
192 struct atmel_hlcdc_plane_update_req *req);
193
194int atmel_hlcdc_plane_update_with_mode(struct drm_plane *p,
195 struct drm_crtc *crtc,
196 struct drm_framebuffer *fb,
197 int crtc_x, int crtc_y,
198 unsigned int crtc_w,
199 unsigned int crtc_h,
200 uint32_t src_x, uint32_t src_y,
201 uint32_t src_w, uint32_t src_h,
202 const struct drm_display_mode *mode);
203
204void atmel_hlcdc_crtc_irq(struct drm_crtc *c); 151void atmel_hlcdc_crtc_irq(struct drm_crtc *c);
205 152
206void atmel_hlcdc_crtc_cancel_page_flip(struct drm_crtc *crtc, 153void atmel_hlcdc_crtc_cancel_page_flip(struct drm_crtc *crtc,