aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2011-12-15 22:05:15 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-16 13:59:25 -0500
commit510d4d32f25f49dedd7da88c29fdb4d0aada5815 (patch)
tree683a72055295de058e3e8d56eec10feb22353a94 /drivers
parent0156bb3ea7fa2664b4934806fa40a9b80750d1c5 (diff)
staging: drm/omap: add ywrap module param
Can be set at boot or module load time to prevent YWRAP scrolling from being enabled. Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/omapdrm/omap_fbdev.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/staging/omapdrm/omap_fbdev.c b/drivers/staging/omapdrm/omap_fbdev.c
index d8962e81e4cb..093ae2f87b20 100644
--- a/drivers/staging/omapdrm/omap_fbdev.c
+++ b/drivers/staging/omapdrm/omap_fbdev.c
@@ -22,6 +22,10 @@
22#include "drm_crtc.h" 22#include "drm_crtc.h"
23#include "drm_fb_helper.h" 23#include "drm_fb_helper.h"
24 24
25MODULE_PARM_DESC(ywrap, "Enable ywrap scrolling (omap44xx and later, default 'y')");
26static bool ywrap_enabled = true;
27module_param_named(ywrap, ywrap_enabled, bool, 0644);
28
25/* 29/*
26 * fbdev funcs, to implement legacy fbdev interface on top of drm driver 30 * fbdev funcs, to implement legacy fbdev interface on top of drm driver
27 */ 31 */
@@ -32,6 +36,7 @@ struct omap_fbdev {
32 struct drm_fb_helper base; 36 struct drm_fb_helper base;
33 struct drm_framebuffer *fb; 37 struct drm_framebuffer *fb;
34 struct drm_gem_object *bo; 38 struct drm_gem_object *bo;
39 bool ywrap_enabled;
35}; 40};
36 41
37static void omap_fbdev_flush(struct fb_info *fbi, int x, int y, int w, int h); 42static void omap_fbdev_flush(struct fb_info *fbi, int x, int y, int w, int h);
@@ -75,14 +80,12 @@ static int omap_fbdev_pan_display(struct fb_var_screeninfo *var,
75{ 80{
76 struct drm_fb_helper *helper = get_fb(fbi); 81 struct drm_fb_helper *helper = get_fb(fbi);
77 struct omap_fbdev *fbdev = to_omap_fbdev(helper); 82 struct omap_fbdev *fbdev = to_omap_fbdev(helper);
78 struct omap_drm_private *priv;
79 int npages; 83 int npages;
80 84
81 if (!helper) 85 if (!helper)
82 goto fallback; 86 goto fallback;
83 87
84 priv = helper->dev->dev_private; 88 if (!fbdev->ywrap_enabled)
85 if (!priv->has_dmm)
86 goto fallback; 89 goto fallback;
87 90
88 /* DMM roll shifts in 4K pages: */ 91 /* DMM roll shifts in 4K pages: */
@@ -152,7 +155,8 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
152 mode_cmd.width * ((mode_cmd.bpp + 7) / 8), 155 mode_cmd.width * ((mode_cmd.bpp + 7) / 8),
153 mode_cmd.width, mode_cmd.bpp); 156 mode_cmd.width, mode_cmd.bpp);
154 157
155 if (priv->has_dmm) { 158 fbdev->ywrap_enabled = priv->has_dmm && ywrap_enabled;
159 if (fbdev->ywrap_enabled) {
156 /* need to align pitch to page size if using DMM scrolling */ 160 /* need to align pitch to page size if using DMM scrolling */
157 mode_cmd.pitch = ALIGN(mode_cmd.pitch, PAGE_SIZE); 161 mode_cmd.pitch = ALIGN(mode_cmd.pitch, PAGE_SIZE);
158 } 162 }
@@ -218,12 +222,13 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
218 /* if we have DMM, then we can use it for scrolling by just 222 /* if we have DMM, then we can use it for scrolling by just
219 * shuffling pages around in DMM rather than doing sw blit. 223 * shuffling pages around in DMM rather than doing sw blit.
220 */ 224 */
221 if (priv->has_dmm) { 225 if (fbdev->ywrap_enabled) {
222 DRM_INFO("Enabling DMM ywrap scrolling\n"); 226 DRM_INFO("Enabling DMM ywrap scrolling\n");
223 fbi->flags |= FBINFO_HWACCEL_YWRAP | FBINFO_READS_FAST; 227 fbi->flags |= FBINFO_HWACCEL_YWRAP | FBINFO_READS_FAST;
224 fbi->fix.ywrapstep = 1; 228 fbi->fix.ywrapstep = 1;
225 } 229 }
226 230
231
227 DBG("par=%p, %dx%d", fbi->par, fbi->var.xres, fbi->var.yres); 232 DBG("par=%p, %dx%d", fbi->par, fbi->var.xres, fbi->var.yres);
228 DBG("allocated %dx%d fb", fbdev->fb->width, fbdev->fb->height); 233 DBG("allocated %dx%d fb", fbdev->fb->width, fbdev->fb->height);
229 234