All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Mike Rapoport <mike@compulab.co.il>
Cc: linux-fbdev-devel@lists.sourceforge.net
Subject: Re: [PATCH]: frame buffer driver for 2700G LCD controller
Date: Tue, 11 Jul 2006 20:53:45 +0800	[thread overview]
Message-ID: <44B39F59.9030605@gmail.com> (raw)
In-Reply-To: <44B3954D.4040302@compulab.co.il>

Mike Rapoport wrote:
> Antonino A. Daplas wrote:
> 
>> Mike Rapoport wrote:
>>  
>>
>>> Antonino A. Daplas wrote:
>>>
>>>   
>>>> Mike Rapoport wrote:
>>>>
>>>>
>>>>     
>>>>> This patch adds frame buffer driver for 2700G LCD controller
>>>>> present on
>>>>> CompuLab CM-X270 computer module.
>>>>> This pacth is versus current Linus git tree.
>>>>>
>>>>> Signed-off-by: Mike Rapoport <mike@compulab.co.il>       
>> It's because you don't have an info->pseudo_palette. And if you
>> accidentally
>> load the framebuffer console, your kernel will just crash because the
>> drawing functions (cfb_{fillrect,imageblit}) unconditionally refers to
>> that
>> array.
>>
>> So you have to do either one:
>>
>> 1. Create a properly filled up info->pseudo_palette; or
>>  
>>
> I think I've succeded to make it. At least I can see tux logo and getty
> output at startup.
> 
>> BTW, you will need to use generic accessors (readb|w|l, writeb|w|l or
>> __raw_readb|w|l, __raw_writeb|w|l, etc). This will entail a lot of
>> changes.
>> Otherwise, this driver won't get past Andrew Morton and Rusty.
>>
>> See include/asm/io.h.
>>  
>>
> Done.

Definitely much, much better. I'm attaching a clean-up patch. If you
approve, I'll send your patch + cleanup upstream.

Tony

mbxfb: Various fixes

From:  <>

- Add more informative help text to Kconfig
- Make DEBUG a Kconfig option as FB_MBX_DEBUG
- Remove #include mbxdebug.c, this is frowned upon
- Remove redundant casts
- Arrange #include's alphabetically
- Trivial whitespace changes

Signed-off-by: Antonino Daplas <adaplas@pol.net>
---

 drivers/video/Kconfig      |   12 +++++++++++-
 drivers/video/mbx/Makefile |    3 ++-
 drivers/video/mbx/mbxfb.c  |   24 +++++++++++-------------
 3 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 0f4af08..153e23e 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1547,8 +1547,18 @@ config FB_MBX
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
 	---help---
+	  Framebuffer driver for the Intel 2700G (Marathon) Graphics
+	  Accelerator
 
-	  If unsure, say N.
+config FB_MBX_DEBUG
+       bool "Enable debugging info via debugfs"
+       depends on FB_MBX && DEBUG_FS
+       default n
+       ---help---
+         Enable this if you want debugging information using the debug
+         filesystem (debugfs)
+
+         If unsure, say N.
 
 config FB_W100
 	tristate "W100 frame buffer support"
diff --git a/drivers/video/mbx/Makefile b/drivers/video/mbx/Makefile
index ad042f5..16c1165 100644
--- a/drivers/video/mbx/Makefile
+++ b/drivers/video/mbx/Makefile
@@ -1,3 +1,4 @@
 # Makefile for the 2700G controller driver.
 
-obj-$(CONFIG_FB_MBX)	+= mbxfb.o
+obj-$(CONFIG_FB_MBX)	   += mbxfb.o
+obj-$(CONFIG_FB_MBX_DEBUG) += mbxfbdebugfs.o
diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
index 7834586..a5836b5 100644
--- a/drivers/video/mbx/mbxfb.c
+++ b/drivers/video/mbx/mbxfb.c
@@ -14,22 +14,21 @@
  *
  */
 
-#include <linux/module.h>
-#include <linux/fb.h>
 #include <linux/delay.h>
+#include <linux/fb.h>
 #include <linux/init.h>
+#include <linux/module.h>
 #include <linux/platform_device.h>
 
-#include <video/mbxfb.h>
-
 #include <asm/io.h>
 
-#undef DEBUG
+#include <video/mbxfb.h>
 
-static unsigned long virt_base_2700;
 #include "regs.h"
 #include "reg_bits.h"
 
+static unsigned long virt_base_2700;
+
 #define MIN_XRES	16
 #define MIN_YRES	16
 #define MAX_XRES	2048
@@ -59,7 +58,7 @@ struct mbxfb_info {
 	int (*platform_probe) (struct fb_info * fb);
 	int (*platform_remove) (struct fb_info * fb);
 
-#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
+#ifdef CONFIG_FB_MBX_DEBUG
 	void *debugfs_data;
 #endif
 
@@ -145,7 +144,8 @@ static int mbxfb_setcolreg(u_int regno, 
 	if (regno < MAX_PALETTES) {
 		u32 *pal = info->pseudo_palette;
 
-		val = (red & 0xf800) | ((green & 0xfc00) >> 5) | ((blue & 0xf800) >> 11);
+		val = (red & 0xf800) | ((green & 0xfc00) >> 5) |
+			((blue & 0xf800) >> 11);
 		pal[regno] = val;
 		ret = 0;
 	}
@@ -477,7 +477,7 @@ static int mbxfb_suspend(struct platform
 
 static int mbxfb_resume(struct platform_device *dev)
 {
-	struct fb_info *fbi = (struct fb_info *)platform_get_drvdata(dev);
+	struct fb_info *fbi = platform_get_drvdata(dev);
 
 	enable_clocks(fbi);
 /* 	setup_graphics(fbi); */
@@ -492,9 +492,7 @@ #define mbxfb_resume	NULL
 #endif
 
 /* debugfs entries */
-#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
-#include "mbxdebugfs.c"
-#else
+#ifndef CONFIG_FB_MBX_DEBUG
 #define mbxfb_debugfs_init(x)	do {} while(0)
 #define mbxfb_debugfs_remove(x)	do {} while(0)
 #endif
@@ -632,7 +630,7 @@ err1:
 
 static int __devexit mbxfb_remove(struct platform_device *dev)
 {
-	struct fb_info *fbi = (struct fb_info *)platform_get_drvdata(dev);
+	struct fb_info *fbi = platform_get_drvdata(dev);
 
 	writel(SYSRST_RST, SYSRST);
 	udelay(1000);


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

  reply	other threads:[~2006-07-11 12:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-06 15:25 [PATCH]: frame buffer driver for 2700G LCD controller Mike Rapoport
2006-07-07  2:19 ` Antonino A. Daplas
2006-07-09 14:40   ` Mike Rapoport
2006-07-09 19:38     ` Geert Uytterhoeven
2006-07-09 23:21     ` Antonino A. Daplas
2006-07-11 10:08       ` Mike Rapoport
2006-07-11  9:33         ` Antonino A. Daplas
2006-07-11 12:10       ` Mike Rapoport
2006-07-11 12:53         ` Antonino A. Daplas [this message]
2006-07-11 14:14           ` Mike Rapoport
2006-07-11 13:24         ` Bernhard Fischer
2006-07-11 13:46           ` Antonino A. Daplas

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=44B39F59.9030605@gmail.com \
    --to=adaplas@gmail.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=mike@compulab.co.il \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.