From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaya Kumar Subject: [RFC 2.6.25] pxafb, am200epd, gumstix, metronomefb secondary framebuffer Date: Sat, 24 May 2008 03:35:43 -0400 Message-ID: <20080524073543.3156.77719.sendpatchset@apodmy1> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1JzpBU-0000UG-DW for linux-fbdev-devel@lists.sourceforge.net; Sat, 24 May 2008 01:33:01 -0700 Received: from rv-out-0708.google.com ([209.85.198.247]) by mail.sourceforge.net with esmtp (Exim 4.44) id 1JzpBU-0004E8-0H for linux-fbdev-devel@lists.sourceforge.net; Sat, 24 May 2008 01:33:00 -0700 Received: by rv-out-0708.google.com with SMTP id f25so987835rvb.22 for ; Sat, 24 May 2008 01:32:59 -0700 (PDT) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-fbdev-devel-bounces@lists.sourceforge.net Errors-To: linux-fbdev-devel-bounces@lists.sourceforge.net To: ymiao3@marvell.com Cc: linux-fbdev-devel@lists.sourceforge.net, Jaya Kumar Hi Eric, fbdev, Sorry for my slow progress on solving the pxafb/am200epd shared framebuffer issue. I've finally managed to get things working now and am feeling like this is a good point to stop and ask for your feedback. There is still some cleanup to be done but I'd like to find out if I'm heading in the right direction. My changes are as follows: - removed drivers/video/am200epd.c since it was not the right way to implement a board support driver. - added a new arch/arm/mach-pxa/am200epd.c driver that uses the generic GPIO API rather than manipulating GAFR/GPSR/etc. - changes to arch/arm/mach-pxa/gumstix.c to support MFP to allow am200epd to use generic GPIO. - changed metronomefb/am200epd/pxafb to allow for shared framebuffer rather than duplicate control of LCDC. - callbacks share_video_mem/unshare to allow am200epd to know when pxafb has allocated and will free the framebuffer. am200epd handles refcounting of pxafb so that it can't be unloaded underneath it. I was not able to implement an equivalent using registered_fb[] because there isn't a way to identify the fb_info and to get notification of the framebuffer state. - pxafb changes to use __devinit/exit for probe functions and __init for init/exit functions. This is needed so that it can work properly when built as a module. - exports pxa_device_fb so that am200epd can be modular. - cleanup am200epd board functions so that it doesn't refer to any pxa specific registers or descriptors. - cleanup to use dev_dbg instead of printk I would be grateful for your feedback and advice on this. Thanks, jaya --- b/arch/arm/mach-pxa/Kconfig | 14 + b/arch/arm/mach-pxa/Makefile | 1 b/arch/arm/mach-pxa/am200epd.c | 347 ++++++++++++++++++++++++++++++++ b/arch/arm/mach-pxa/devices.c | 3 b/arch/arm/mach-pxa/gumstix.c | 79 +++++-- b/arch/arm/mach-pxa/pxa25x.c | 32 ++ b/drivers/video/Kconfig | 20 - b/drivers/video/Makefile | 1 b/drivers/video/metronomefb.c | 270 +++++++++++++----------- b/drivers/video/pxafb.c | 110 ++++++++-- b/include/asm-arm/arch-pxa/mfp-pxa25x.h | 1 b/include/asm-arm/arch-pxa/pxafb.h | 9 b/include/video/metronomefb.h | 13 - drivers/video/am200epd.c | 295 --------------------------- 14 files changed, 721 insertions(+), 474 deletions(-) diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 5da7a68..423ae1e 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@ -179,6 +179,20 @@ endchoice endif +if MACH_GUMSTIX_F +choice + prompt "Select base board for Gumstix board" +config MACH_AM200EPD + tristate "Enable AM200EPD board support" + select FB_METRONOME + select FB_SYS_FILLRECT + select FB_SYS_COPYAREA + select FB_SYS_IMAGEBLIT + select FB_SYS_FOPS + select FB_DEFERRED_IO +endchoice +endif + if MACH_TRIZEPS4 diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index 6a83085..ba7f52e 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile @@ -52,6 +52,7 @@ obj-$(CONFIG_LEDS) += $(led-y) obj-$(CONFIG_PM) += pm.o sleep.o standby.o obj-$(CONFIG_CPU_FREQ) += cpu-pxa.o obj-$(CONFIG_PXA_SSP) += ssp.o +obj-$(CONFIG_MACH_AM200EPD) += am200epd.o ifeq ($(CONFIG_PCI),y) obj-$(CONFIG_MACH_ARMCORE) += cm-x270-pci.o diff --git a/arch/arm/mach-pxa/am200epd.c b/arch/arm/mach-pxa/am200epd.c new file mode 100644 index 0000000..96ee642 --- /dev/null +++ b/arch/arm/mach-pxa/am200epd.c @@ -0,0 +1,347 @@ +/* + * linux/drivers/video/am200epd.c -- Platform device for AM200 EPD kit + * + * Copyright (C) 2008, Jaya Kumar + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + * + * Layout is based on skeletonfb.c by James Simmons and Geert Uytterhoeven. + * + * This work was made possible by help and equipment support from E-Ink + * Corporation. http://support.eink.com/community + * + * This driver is written to be used with the Metronome display controller. + * on the AM200 EPD prototype kit/development kit with an E-Ink 800x600 + * Vizplex EPD on a Gumstix board using the Lyre interface board. + * + */ + +#define DEBUG 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include