diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-01-14 10:54:40 -0500 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-03-20 08:30:19 -0400 |
commit | 5a35876e2830511cb8110667fc426c6a6165a593 (patch) | |
tree | 10b8c91d6b6f6b57f2c5ef25c6f9b788a84d1777 | |
parent | 5dbe44336811a7e8ef4c958c6ac054772ee47637 (diff) |
drm: omapdrm: Remove manual update display support
All the manual update display code implements eventually ends up to just
calls to omap_connector_flush(), currently implemented as an empty TODO
stub. Remove it, the code can always be revived and implemented later if
interest in manual update displays becomes a reality.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_connector.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_drv.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_fb.c | 40 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_fbdev.c | 57 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_plane.c | 6 |
5 files changed, 4 insertions, 115 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c index a94b11f7859d..b41965c2888d 100644 --- a/drivers/gpu/drm/omapdrm/omap_connector.c +++ b/drivers/gpu/drm/omapdrm/omap_connector.c | |||
@@ -271,18 +271,6 @@ static const struct drm_connector_helper_funcs omap_connector_helper_funcs = { | |||
271 | .best_encoder = omap_connector_attached_encoder, | 271 | .best_encoder = omap_connector_attached_encoder, |
272 | }; | 272 | }; |
273 | 273 | ||
274 | /* flush an area of the framebuffer (in case of manual update display that | ||
275 | * is not automatically flushed) | ||
276 | */ | ||
277 | void omap_connector_flush(struct drm_connector *connector, | ||
278 | int x, int y, int w, int h) | ||
279 | { | ||
280 | struct omap_connector *omap_connector = to_omap_connector(connector); | ||
281 | |||
282 | /* TODO: enable when supported in dss */ | ||
283 | VERB("%s: %d,%d, %dx%d", omap_connector->dssdev->name, x, y, w, h); | ||
284 | } | ||
285 | |||
286 | /* initialize connector */ | 274 | /* initialize connector */ |
287 | struct drm_connector *omap_connector_init(struct drm_device *dev, | 275 | struct drm_connector *omap_connector_init(struct drm_device *dev, |
288 | int connector_type, struct omap_dss_device *dssdev, | 276 | int connector_type, struct omap_dss_device *dssdev, |
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h index fa6becc4d1be..1805edc0107d 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.h +++ b/drivers/gpu/drm/omapdrm/omap_drv.h | |||
@@ -186,8 +186,6 @@ struct drm_connector *omap_connector_init(struct drm_device *dev, | |||
186 | struct drm_encoder *encoder); | 186 | struct drm_encoder *encoder); |
187 | struct drm_encoder *omap_connector_attached_encoder( | 187 | struct drm_encoder *omap_connector_attached_encoder( |
188 | struct drm_connector *connector); | 188 | struct drm_connector *connector); |
189 | void omap_connector_flush(struct drm_connector *connector, | ||
190 | int x, int y, int w, int h); | ||
191 | bool omap_connector_get_hdmi_mode(struct drm_connector *connector); | 189 | bool omap_connector_get_hdmi_mode(struct drm_connector *connector); |
192 | 190 | ||
193 | void copy_timings_omap_to_drm(struct drm_display_mode *mode, | 191 | void copy_timings_omap_to_drm(struct drm_display_mode *mode, |
@@ -208,8 +206,6 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, | |||
208 | struct omap_drm_window *win, struct omap_overlay_info *info); | 206 | struct omap_drm_window *win, struct omap_overlay_info *info); |
209 | struct drm_connector *omap_framebuffer_get_next_connector( | 207 | struct drm_connector *omap_framebuffer_get_next_connector( |
210 | struct drm_framebuffer *fb, struct drm_connector *from); | 208 | struct drm_framebuffer *fb, struct drm_connector *from); |
211 | void omap_framebuffer_flush(struct drm_framebuffer *fb, | ||
212 | int x, int y, int w, int h); | ||
213 | 209 | ||
214 | void omap_gem_init(struct drm_device *dev); | 210 | void omap_gem_init(struct drm_device *dev); |
215 | void omap_gem_deinit(struct drm_device *dev); | 211 | void omap_gem_deinit(struct drm_device *dev); |
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index 2a5cacdc344b..45dd9eed9c57 100644 --- a/drivers/gpu/drm/omapdrm/omap_fb.c +++ b/drivers/gpu/drm/omapdrm/omap_fb.c | |||
@@ -121,18 +121,6 @@ static int omap_framebuffer_dirty(struct drm_framebuffer *fb, | |||
121 | struct drm_file *file_priv, unsigned flags, unsigned color, | 121 | struct drm_file *file_priv, unsigned flags, unsigned color, |
122 | struct drm_clip_rect *clips, unsigned num_clips) | 122 | struct drm_clip_rect *clips, unsigned num_clips) |
123 | { | 123 | { |
124 | int i; | ||
125 | |||
126 | drm_modeset_lock_all(fb->dev); | ||
127 | |||
128 | for (i = 0; i < num_clips; i++) { | ||
129 | omap_framebuffer_flush(fb, clips[i].x1, clips[i].y1, | ||
130 | clips[i].x2 - clips[i].x1, | ||
131 | clips[i].y2 - clips[i].y1); | ||
132 | } | ||
133 | |||
134 | drm_modeset_unlock_all(fb->dev); | ||
135 | |||
136 | return 0; | 124 | return 0; |
137 | } | 125 | } |
138 | 126 | ||
@@ -336,34 +324,6 @@ struct drm_connector *omap_framebuffer_get_next_connector( | |||
336 | return NULL; | 324 | return NULL; |
337 | } | 325 | } |
338 | 326 | ||
339 | /* flush an area of the framebuffer (in case of manual update display that | ||
340 | * is not automatically flushed) | ||
341 | */ | ||
342 | void omap_framebuffer_flush(struct drm_framebuffer *fb, | ||
343 | int x, int y, int w, int h) | ||
344 | { | ||
345 | struct drm_connector *connector = NULL; | ||
346 | |||
347 | VERB("flush: %d,%d %dx%d, fb=%p", x, y, w, h, fb); | ||
348 | |||
349 | /* FIXME: This is racy - no protection against modeset config changes. */ | ||
350 | while ((connector = omap_framebuffer_get_next_connector(fb, connector))) { | ||
351 | /* only consider connectors that are part of a chain */ | ||
352 | if (connector->encoder && connector->encoder->crtc) { | ||
353 | /* TODO: maybe this should propagate thru the crtc who | ||
354 | * could do the coordinate translation.. | ||
355 | */ | ||
356 | struct drm_crtc *crtc = connector->encoder->crtc; | ||
357 | int cx = max(0, x - crtc->x); | ||
358 | int cy = max(0, y - crtc->y); | ||
359 | int cw = w + (x - crtc->x) - cx; | ||
360 | int ch = h + (y - crtc->y) - cy; | ||
361 | |||
362 | omap_connector_flush(connector, cx, cy, cw, ch); | ||
363 | } | ||
364 | } | ||
365 | } | ||
366 | |||
367 | #ifdef CONFIG_DEBUG_FS | 327 | #ifdef CONFIG_DEBUG_FS |
368 | void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m) | 328 | void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m) |
369 | { | 329 | { |
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index d292d24b3a6e..950cd3389092 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c | |||
@@ -42,42 +42,8 @@ struct omap_fbdev { | |||
42 | struct work_struct work; | 42 | struct work_struct work; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | static void omap_fbdev_flush(struct fb_info *fbi, int x, int y, int w, int h); | ||
46 | static struct drm_fb_helper *get_fb(struct fb_info *fbi); | 45 | static struct drm_fb_helper *get_fb(struct fb_info *fbi); |
47 | 46 | ||
48 | static ssize_t omap_fbdev_write(struct fb_info *fbi, const char __user *buf, | ||
49 | size_t count, loff_t *ppos) | ||
50 | { | ||
51 | ssize_t res; | ||
52 | |||
53 | res = fb_sys_write(fbi, buf, count, ppos); | ||
54 | omap_fbdev_flush(fbi, 0, 0, fbi->var.xres, fbi->var.yres); | ||
55 | |||
56 | return res; | ||
57 | } | ||
58 | |||
59 | static void omap_fbdev_fillrect(struct fb_info *fbi, | ||
60 | const struct fb_fillrect *rect) | ||
61 | { | ||
62 | sys_fillrect(fbi, rect); | ||
63 | omap_fbdev_flush(fbi, rect->dx, rect->dy, rect->width, rect->height); | ||
64 | } | ||
65 | |||
66 | static void omap_fbdev_copyarea(struct fb_info *fbi, | ||
67 | const struct fb_copyarea *area) | ||
68 | { | ||
69 | sys_copyarea(fbi, area); | ||
70 | omap_fbdev_flush(fbi, area->dx, area->dy, area->width, area->height); | ||
71 | } | ||
72 | |||
73 | static void omap_fbdev_imageblit(struct fb_info *fbi, | ||
74 | const struct fb_image *image) | ||
75 | { | ||
76 | sys_imageblit(fbi, image); | ||
77 | omap_fbdev_flush(fbi, image->dx, image->dy, | ||
78 | image->width, image->height); | ||
79 | } | ||
80 | |||
81 | static void pan_worker(struct work_struct *work) | 47 | static void pan_worker(struct work_struct *work) |
82 | { | 48 | { |
83 | struct omap_fbdev *fbdev = container_of(work, struct omap_fbdev, work); | 49 | struct omap_fbdev *fbdev = container_of(work, struct omap_fbdev, work); |
@@ -121,10 +87,10 @@ static struct fb_ops omap_fb_ops = { | |||
121 | * basic fbdev ops which write to the framebuffer | 87 | * basic fbdev ops which write to the framebuffer |
122 | */ | 88 | */ |
123 | .fb_read = fb_sys_read, | 89 | .fb_read = fb_sys_read, |
124 | .fb_write = omap_fbdev_write, | 90 | .fb_write = fb_sys_write, |
125 | .fb_fillrect = omap_fbdev_fillrect, | 91 | .fb_fillrect = sys_fillrect, |
126 | .fb_copyarea = omap_fbdev_copyarea, | 92 | .fb_copyarea = sys_copyarea, |
127 | .fb_imageblit = omap_fbdev_imageblit, | 93 | .fb_imageblit = sys_imageblit, |
128 | 94 | ||
129 | .fb_check_var = drm_fb_helper_check_var, | 95 | .fb_check_var = drm_fb_helper_check_var, |
130 | .fb_set_par = drm_fb_helper_set_par, | 96 | .fb_set_par = drm_fb_helper_set_par, |
@@ -294,21 +260,6 @@ static struct drm_fb_helper *get_fb(struct fb_info *fbi) | |||
294 | return fbi->par; | 260 | return fbi->par; |
295 | } | 261 | } |
296 | 262 | ||
297 | /* flush an area of the framebuffer (in case of manual update display that | ||
298 | * is not automatically flushed) | ||
299 | */ | ||
300 | static void omap_fbdev_flush(struct fb_info *fbi, int x, int y, int w, int h) | ||
301 | { | ||
302 | struct drm_fb_helper *helper = get_fb(fbi); | ||
303 | |||
304 | if (!helper) | ||
305 | return; | ||
306 | |||
307 | VERB("flush fbdev: %d,%d %dx%d, fbi=%p", x, y, w, h, fbi); | ||
308 | |||
309 | omap_framebuffer_flush(helper->fb, x, y, w, h); | ||
310 | } | ||
311 | |||
312 | /* initialize fbdev helper */ | 263 | /* initialize fbdev helper */ |
313 | struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev) | 264 | struct drm_fb_helper *omap_fbdev_init(struct drm_device *dev) |
314 | { | 265 | { |
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index efec4265c2ae..2111d415da96 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c | |||
@@ -162,7 +162,6 @@ static void omap_plane_post_apply(struct omap_drm_apply *apply) | |||
162 | container_of(apply, struct omap_plane, apply); | 162 | container_of(apply, struct omap_plane, apply); |
163 | struct drm_plane *plane = &omap_plane->base; | 163 | struct drm_plane *plane = &omap_plane->base; |
164 | struct omap_drm_private *priv = plane->dev->dev_private; | 164 | struct omap_drm_private *priv = plane->dev->dev_private; |
165 | struct omap_overlay_info *info = &omap_plane->info; | ||
166 | struct callback cb; | 165 | struct callback cb; |
167 | 166 | ||
168 | cb = omap_plane->apply_done_cb; | 167 | cb = omap_plane->apply_done_cb; |
@@ -172,11 +171,6 @@ static void omap_plane_post_apply(struct omap_drm_apply *apply) | |||
172 | 171 | ||
173 | if (cb.fxn) | 172 | if (cb.fxn) |
174 | cb.fxn(cb.arg); | 173 | cb.fxn(cb.arg); |
175 | |||
176 | if (omap_plane->enabled) { | ||
177 | omap_framebuffer_flush(plane->fb, info->pos_x, info->pos_y, | ||
178 | info->out_width, info->out_height); | ||
179 | } | ||
180 | } | 174 | } |
181 | 175 | ||
182 | static int apply(struct drm_plane *plane) | 176 | static int apply(struct drm_plane *plane) |