diff options
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_fbdev.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_fbdev.c | 65 |
1 files changed, 8 insertions, 57 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c index d292d24b3a6e..720d16bce7e8 100644 --- a/drivers/gpu/drm/omapdrm/omap_fbdev.c +++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c | |||
@@ -17,10 +17,10 @@ | |||
17 | * this program. If not, see <http://www.gnu.org/licenses/>. | 17 | * this program. If not, see <http://www.gnu.org/licenses/>. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "omap_drv.h" | 20 | #include <drm/drm_crtc.h> |
21 | #include <drm/drm_fb_helper.h> | ||
21 | 22 | ||
22 | #include "drm_crtc.h" | 23 | #include "omap_drv.h" |
23 | #include "drm_fb_helper.h" | ||
24 | 24 | ||
25 | MODULE_PARM_DESC(ywrap, "Enable ywrap scrolling (omap44xx and later, default 'y')"); | 25 | MODULE_PARM_DESC(ywrap, "Enable ywrap scrolling (omap44xx and later, default 'y')"); |
26 | static bool ywrap_enabled = true; | 26 | static bool ywrap_enabled = true; |
@@ -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, |
@@ -169,7 +135,7 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, | |||
169 | fbdev->ywrap_enabled = priv->has_dmm && ywrap_enabled; | 135 | fbdev->ywrap_enabled = priv->has_dmm && ywrap_enabled; |
170 | if (fbdev->ywrap_enabled) { | 136 | if (fbdev->ywrap_enabled) { |
171 | /* need to align pitch to page size if using DMM scrolling */ | 137 | /* need to align pitch to page size if using DMM scrolling */ |
172 | mode_cmd.pitches[0] = ALIGN(mode_cmd.pitches[0], PAGE_SIZE); | 138 | mode_cmd.pitches[0] = PAGE_ALIGN(mode_cmd.pitches[0]); |
173 | } | 139 | } |
174 | 140 | ||
175 | /* allocate backing bo */ | 141 | /* allocate backing bo */ |
@@ -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 | { |