From patchwork Fri Dec 16 03:05:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 5803 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 686D523E03 for ; Fri, 16 Dec 2011 03:05:14 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 59CB7A18276 for ; Fri, 16 Dec 2011 03:05:14 +0000 (UTC) Received: by eaak10 with SMTP id k10so3123076eaa.11 for ; Thu, 15 Dec 2011 19:05:14 -0800 (PST) Received: by 10.205.120.135 with SMTP id fy7mr2599300bkc.54.1324004714132; Thu, 15 Dec 2011 19:05:14 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.129.2 with SMTP id hg2cs59728bkc; Thu, 15 Dec 2011 19:05:13 -0800 (PST) Received: by 10.101.147.18 with SMTP id z18mr2616395ann.12.1324004712070; Thu, 15 Dec 2011 19:05:12 -0800 (PST) Received: from mail-gy0-f178.google.com (mail-gy0-f178.google.com [209.85.160.178]) by mx.google.com with ESMTPS id v4si2252274anf.173.2011.12.15.19.05.11 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Dec 2011 19:05:12 -0800 (PST) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.160.178 as permitted sender) client-ip=209.85.160.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.160.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by ghbg21 with SMTP id g21so2269449ghb.37 for ; Thu, 15 Dec 2011 19:05:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=BhFRGRqIYWBqqitol67yVtHPC0+iG51/5oR58AGiEyQ=; b=IIqydHG02Co7rPHjPaMha/LpUXYqppylwr4RMId6Ej748rit6tmTK+uwualtGa08Hw eRLU5H+9PjKNzzb75OpGfuw9Q4GR4EMN4tbpoMUYyF4nbcB8aVE0yqGhHYShnDsAjjjy JL8KayVhp/93HM2WMLWKau6B8C0ExbstoSbgI= Received: by 10.236.200.201 with SMTP id z49mr9743613yhn.20.1324004711586; Thu, 15 Dec 2011 19:05:11 -0800 (PST) Received: from localhost (ppp-70-253-156-7.dsl.rcsntx.swbell.net. [70.253.156.7]) by mx.google.com with ESMTPS id i32sm15728210anm.6.2011.12.15.19.05.10 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Dec 2011 19:05:11 -0800 (PST) Sender: Rob Clark From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: patches@linaro.org, Greg KH , Tomi Valkeinen , Rob Clark Subject: [PATCH 1/3] drm/omap: add ywrap module param Date: Thu, 15 Dec 2011 21:05:15 -0600 Message-Id: <1324004717-20595-1-git-send-email-rob.clark@linaro.org> X-Mailer: git-send-email 1.7.5.4 From: Rob Clark Can be set at boot or module load time to prevent YWRAP scrolling from being enabled. Signed-off-by: Rob Clark --- drivers/staging/omapdrm/omap_fbdev.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/staging/omapdrm/omap_fbdev.c b/drivers/staging/omapdrm/omap_fbdev.c index d8962e8..093ae2f 100644 --- a/drivers/staging/omapdrm/omap_fbdev.c +++ b/drivers/staging/omapdrm/omap_fbdev.c @@ -22,6 +22,10 @@ #include "drm_crtc.h" #include "drm_fb_helper.h" +MODULE_PARM_DESC(ywrap, "Enable ywrap scrolling (omap44xx and later, default 'y')"); +static bool ywrap_enabled = true; +module_param_named(ywrap, ywrap_enabled, bool, 0644); + /* * fbdev funcs, to implement legacy fbdev interface on top of drm driver */ @@ -32,6 +36,7 @@ struct omap_fbdev { struct drm_fb_helper base; struct drm_framebuffer *fb; struct drm_gem_object *bo; + bool ywrap_enabled; }; static 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, { struct drm_fb_helper *helper = get_fb(fbi); struct omap_fbdev *fbdev = to_omap_fbdev(helper); - struct omap_drm_private *priv; int npages; if (!helper) goto fallback; - priv = helper->dev->dev_private; - if (!priv->has_dmm) + if (!fbdev->ywrap_enabled) goto fallback; /* DMM roll shifts in 4K pages: */ @@ -152,7 +155,8 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, mode_cmd.width * ((mode_cmd.bpp + 7) / 8), mode_cmd.width, mode_cmd.bpp); - if (priv->has_dmm) { + fbdev->ywrap_enabled = priv->has_dmm && ywrap_enabled; + if (fbdev->ywrap_enabled) { /* need to align pitch to page size if using DMM scrolling */ mode_cmd.pitch = ALIGN(mode_cmd.pitch, PAGE_SIZE); } @@ -218,12 +222,13 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, /* if we have DMM, then we can use it for scrolling by just * shuffling pages around in DMM rather than doing sw blit. */ - if (priv->has_dmm) { + if (fbdev->ywrap_enabled) { DRM_INFO("Enabling DMM ywrap scrolling\n"); fbi->flags |= FBINFO_HWACCEL_YWRAP | FBINFO_READS_FAST; fbi->fix.ywrapstep = 1; } + DBG("par=%p, %dx%d", fbi->par, fbi->var.xres, fbi->var.yres); DBG("allocated %dx%d fb", fbdev->fb->width, fbdev->fb->height);