From patchwork Wed Feb 25 21:01:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Ramamurthy X-Patchwork-Id: 443655 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 088F1140111 for ; Thu, 26 Feb 2015 08:02:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753072AbbBYVCl (ORCPT ); Wed, 25 Feb 2015 16:02:41 -0500 Received: from mail-gw2-out.broadcom.com ([216.31.210.63]:25377 "EHLO mail-gw2-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753021AbbBYVCj (ORCPT ); Wed, 25 Feb 2015 16:02:39 -0500 X-IronPort-AV: E=Sophos;i="5.09,647,1418112000"; d="scan'208";a="58025612" Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw2-out.broadcom.com with ESMTP; 25 Feb 2015 13:44:42 -0800 Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.174.1; Wed, 25 Feb 2015 13:02:38 -0800 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.3.174.1; Wed, 25 Feb 2015 13:02:37 -0800 Received: from lbrmn-lnxub64.broadcom.com (unknown [10.136.8.214]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 20E3A41460; Wed, 25 Feb 2015 12:58:43 -0800 (PST) From: Arun Ramamurthy To: Rob Herring , Pawel Moll , "Mark Rutland" , Ian Campbell , Kumar Gala , "Russell King" , Jean-Christophe Plagniol-Villard , Tomi Valkeinen CC: , , , Dmitry Torokhov , "Anatol Pomazau" , Jonathan Richardson , Scott Branden , Ray Jui , , Arun Ramamurthy Subject: [PATCH] video: ARM CLCD: Added support for FBIOPAN_DISPLAY and virtual y resolution Date: Wed, 25 Feb 2015 13:01:20 -0800 Message-ID: <1424898082-1522-2-git-send-email-arun.ramamurthy@broadcom.com> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1424898082-1522-1-git-send-email-arun.ramamurthy@broadcom.com> References: <1424898082-1522-1-git-send-email-arun.ramamurthy@broadcom.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Added code to support FBIOPAN_DISPLAY. Also added yres_virtual parameter to device tree to set the virtual y resolution Reviewed-by: Ray Jui Reviewed-by: Scott Branden Signed-off-by: Arun Ramamurthy --- .../devicetree/bindings/video/arm,pl11x.txt | 4 +++ drivers/video/fbdev/amba-clcd.c | 31 +++++++++++++++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/video/arm,pl11x.txt b/Documentation/devicetree/bindings/video/arm,pl11x.txt index 14d6f87..2262cdb 100644 --- a/Documentation/devicetree/bindings/video/arm,pl11x.txt +++ b/Documentation/devicetree/bindings/video/arm,pl11x.txt @@ -50,6 +50,10 @@ Optional properties: display mode, data is driven onto the LCD data lines at the programmed edge of CLCP when CLAC is in its active state. +- yres_virtual: Virtual Y resolution, + It can be used to configure a virtual y resolution. It + must be a value larger than the actual y resolution. + Required sub-nodes: - port: describes LCD panel signals, following the common binding diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c index 4e4e50f..3bc09ad 100644 --- a/drivers/video/fbdev/amba-clcd.c +++ b/drivers/video/fbdev/amba-clcd.c @@ -454,6 +454,18 @@ static int clcdfb_mmap(struct fb_info *info, return ret; } +static int clcdfb_pan_display(struct fb_var_screeninfo *var, + struct fb_info *info) +{ + struct clcd_fb *fb; + + info->var = *var; + fb = to_clcd(info); + clcdfb_set_start(fb); + + return 0; +} + static struct fb_ops clcdfb_ops = { .owner = THIS_MODULE, .fb_check_var = clcdfb_check_var, @@ -464,6 +476,7 @@ static struct fb_ops clcdfb_ops = { .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, .fb_mmap = clcdfb_mmap, + .fb_pan_display = clcdfb_pan_display, }; static int clcdfb_register(struct clcd_fb *fb) @@ -517,14 +530,16 @@ static int clcdfb_register(struct clcd_fb *fb) fb->fb.fix.type = FB_TYPE_PACKED_PIXELS; fb->fb.fix.type_aux = 0; fb->fb.fix.xpanstep = 0; - fb->fb.fix.ypanstep = 0; + if (fb->fb.var.yres_virtual > fb->panel->mode.yres) + fb->fb.fix.ypanstep = 1; + else + fb->fb.fix.ypanstep = 0; fb->fb.fix.ywrapstep = 0; fb->fb.fix.accel = FB_ACCEL_NONE; fb->fb.var.xres = fb->panel->mode.xres; fb->fb.var.yres = fb->panel->mode.yres; fb->fb.var.xres_virtual = fb->panel->mode.xres; - fb->fb.var.yres_virtual = fb->panel->mode.yres; fb->fb.var.bits_per_pixel = fb->panel->bpp; fb->fb.var.grayscale = fb->panel->grayscale; fb->fb.var.pixclock = fb->panel->mode.pixclock; @@ -690,7 +705,7 @@ static int clcdfb_of_init_display(struct clcd_fb *fb) struct device_node *endpoint; int err; unsigned int bpp; - u32 max_bandwidth; + u32 max_bandwidth, yres_virtual; u32 tft_r0b0g0[3]; fb->panel = devm_kzalloc(&fb->dev->dev, sizeof(*fb->panel), GFP_KERNEL); @@ -730,6 +745,14 @@ static int clcdfb_of_init_display(struct clcd_fb *fb) fb->panel->width = -1; fb->panel->height = -1; + /* if yres_virtual property is not specified in device tree, + * set it as the actual y resolution */ + if (of_property_read_u32(fb->dev->dev.of_node, + "yres_virtual", &yres_virtual)) + fb->fb.var.yres_virtual = fb->panel->mode.yres; + else + fb->fb.var.yres_virtual = yres_virtual; + if (of_property_read_u32_array(endpoint, "arm,pl11x,tft-r0g0b0-pads", tft_r0b0g0, ARRAY_SIZE(tft_r0b0g0)) == 0) @@ -797,7 +820,7 @@ static int clcdfb_of_dma_setup(struct clcd_fb *fb) if (err) return err; - framesize = fb->panel->mode.xres * fb->panel->mode.yres * + framesize = fb->panel->mode.xres * fb->fb.var.yres_virtual * fb->panel->bpp / 8; fb->fb.screen_base = dma_alloc_coherent(&fb->dev->dev, framesize, &dma, GFP_KERNEL);