From: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
To: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Ian Campbell
<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
Jean-Christophe Plagniol-Villard
<plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>,
Tomi Valkeinen <tomi.valkeinen-l0cyMroinI0@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Dmitry Torokhov <dtor-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Anatol Pomazau <anatol-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Jonathan Richardson
<jonathar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Scott Branden <sbranden-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
Ray Jui <rjui-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org,
Arun Ramamurthy
<arun.ramamurthy-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Subject: [PATCH] video: ARM CLCD: Added support for FBIOPAN_DISPLAY and virtual y resolution
Date: Wed, 25 Feb 2015 21:01:20 +0000 [thread overview]
Message-ID: <1424898082-1522-2-git-send-email-arun.ramamurthy@broadcom.com> (raw)
In-Reply-To: <1424898082-1522-1-git-send-email-arun.ramamurthy-dY08KVG/lbpWk0Htik3J/w@public.gmane.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 <rjui@broadcom.com>
Reviewed-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Arun Ramamurthy <arun.ramamurthy@broadcom.com>
---
.../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);
--
2.3.0
next prev parent reply other threads:[~2015-02-25 21:01 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-25 21:01 [PATCH] video: ARM CLCD: Added dt support to set tim2 register Arun Ramamurthy
[not found] ` <1424898082-1522-1-git-send-email-arun.ramamurthy-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-02-25 21:01 ` Arun Ramamurthy [this message]
2015-03-02 16:08 ` [PATCH] video: ARM CLCD: Added support for FBIOPAN_DISPLAY and virtual y resolution Pawel Moll
2015-03-02 16:11 ` Russell King - ARM Linux
2015-03-02 19:09 ` Arun Ramamurthy
2015-03-02 19:12 ` Russell King - ARM Linux
[not found] ` <54F4B57F.3030306-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-03-02 23:22 ` Rob Herring
[not found] ` <CAL_JsqKMP4JxQ-Q5V1skcaKPdhC4v-joOrNyn++tMfat8arMKA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-04 0:31 ` Arun Ramamurthy
2015-03-02 16:11 ` [PATCH] video: ARM CLCD: Added dt support to set tim2 register Pawel Moll
2015-03-02 19:09 ` Arun Ramamurthy
2015-03-03 10:02 ` Pawel Moll
[not found] ` <1425376977.3092.26.camel-5wv7dgnIgG8@public.gmane.org>
2015-03-03 10:22 ` Pawel Moll
[not found] ` <1425378127.3092.38.camel-5wv7dgnIgG8@public.gmane.org>
2015-03-04 0:37 ` Arun Ramamurthy
2015-03-05 10:59 ` Pawel Moll
2015-03-09 16:16 ` Russell King - ARM Linux
2015-02-25 21:01 ` [PATCH] video: ARM CLCD: Added support for FBIO_WAITFORVSYNC Arun Ramamurthy
[not found] ` <1424898082-1522-3-git-send-email-arun.ramamurthy-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-03-02 16:00 ` Pawel Moll
2015-03-02 19:09 ` Arun Ramamurthy
2015-03-03 10:01 ` Pawel Moll
2015-03-04 0:35 ` Arun Ramamurthy
[not found] ` <1425312029.3092.1.camel-5wv7dgnIgG8@public.gmane.org>
2015-03-02 23:27 ` Rob Herring
2015-03-04 0:31 ` Arun Ramamurthy
2015-03-02 23:29 ` Rob Herring
[not found] ` <CAL_JsqJfA3Pxvdux-Um9nFoaZpRh30S9d1TQid_TchDH_qo7Ow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-04 0:33 ` Arun Ramamurthy
2015-02-25 21:01 ` [PATCH] video: ARM CLCD: Correcting timing checks for STN and TFT dispalys Arun Ramamurthy
2016-02-10 13:58 ` [PATCH] video: ARM CLCD: Added dt support to set tim2 register Linus Walleij
2016-02-10 17:48 ` Ray Jui
[not found] ` <a005c107-0b15-65ec-eede-a713ee1a8bd9-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2016-02-15 13:25 ` Linus Walleij
[not found] ` <CAE_wzQ-s4-T8wDJjwtLkr73_1j8JpRVxBaBJRfskMeACdUxPig@mail.gmail.com>
2016-02-17 17:42 ` Ray Jui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1424898082-1522-2-git-send-email-arun.ramamurthy@broadcom.com \
--to=arun.ramamurthy@broadcom.com \
--cc=anatol-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=arun.ramamurthy-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dtor-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
--cc=jonathar-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
--cc=plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org \
--cc=rjui-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sbranden-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=tomi.valkeinen-l0cyMroinI0@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).