25 MODULE_PARM_DESC(ywrap,
"Enable ywrap scrolling (omap44xx and later, default 'y')");
26 static bool ywrap_enabled =
true;
33 #define to_omap_fbdev(x) container_of(x, struct omap_fbdev, base)
38 struct drm_gem_object *
bo;
45 static void omap_fbdev_flush(
struct fb_info *fbi,
int x,
int y,
int w,
int h);
49 size_t count, loff_t *ppos)
54 omap_fbdev_flush(fbi, 0, 0, fbi->
var.xres, fbi->
var.yres);
59 static void omap_fbdev_fillrect(
struct fb_info *fbi,
66 static void omap_fbdev_copyarea(
struct fb_info *fbi,
73 static void omap_fbdev_imageblit(
struct fb_info *fbi,
77 omap_fbdev_flush(fbi, image->
dx, image->
dy,
104 if (drm_can_sleep()) {
105 pan_worker(&fbdev->
work);
117 static struct fb_ops omap_fb_ops = {
124 .fb_write = omap_fbdev_write,
125 .fb_fillrect = omap_fbdev_fillrect,
126 .fb_copyarea = omap_fbdev_copyarea,
127 .fb_imageblit = omap_fbdev_imageblit,
131 .fb_pan_display = omap_fbdev_pan_display,
168 mode_cmd.
pitches[0] = align_pitch(
182 DBG(
"allocating %d bytes for fb %d", gsize.bytes, dev->primary->index);
185 dev_err(dev->dev,
"failed to allocate buffer object\n");
192 dev_err(dev->dev,
"failed to allocate fb\n");
196 drm_gem_object_unreference(fbdev->
bo);
212 "could not map (paddr)! Skipping framebuffer alloc\n");
221 dev_err(dev->dev,
"failed to allocate fb info\n");
226 DBG(
"fbi=%p, dev=%p", fbi, dev);
234 fbi->
fbops = &omap_fb_ops;
247 dev->mode_config.fb_base =
paddr;
252 fbi->
fix.smem_len = fbdev->
bo->size;
258 DRM_INFO(
"Enabling DMM ywrap scrolling\n");
260 fbi->
fix.ywrapstep = 1;
264 DBG(
"par=%p, %dx%d", fbi->
par, fbi->
var.xres, fbi->
var.yres);
265 DBG(
"allocated %dx%d fb", fbdev->
fb->width, fbdev->
fb->height);
285 static void omap_crtc_fb_gamma_set(
struct drm_crtc *
crtc,
288 DBG(
"fbdev: set gamma");
291 static void omap_crtc_fb_gamma_get(
struct drm_crtc *
crtc,
294 DBG(
"fbdev: get gamma");
304 ret = omap_fbdev_create(helper, sizes);
313 .gamma_set = omap_crtc_fb_gamma_set,
314 .gamma_get = omap_crtc_fb_gamma_get,
315 .fb_probe = omap_fbdev_probe,
330 static void omap_fbdev_flush(
struct fb_info *fbi,
int x,
int y,
int w,
int h)
337 VERB(
"flush fbdev: %d,%d %dx%d, fbi=%p", x, y, w, h, fbi);
352 dev_err(dev->dev,
"could not allocate fbdev\n");
358 helper = &fbdev->
base;
360 helper->
funcs = &omap_fb_helper_funcs;
365 dev_err(dev->dev,
"could not init fbdev: ret=%d\n", ret);
372 priv->
fbdev = helper;