add framebuffer and display update module support for pnx4008
PATCH 1/1 add framebuffer and display update module support for pnx4008
Hi folks,
inlined is the patch that adds support for Display Update Module and RGB framebuffer device on Philips PNX4008 ARM board.
Kconfig | 15 Makefile | 2 pnx4008/Makefile | 7 pnx4008/dum.h | 243 ++++++++++++++ pnx4008/fbcommon.h | 43 ++ pnx4008/rgbfb.c | 223 +++++++++++++ pnx4008/sdum.c | 866 +++++++++++++++++++++++++++++++++++++++++++++++++++++ pnx4008/sdum.h | 139 ++++++++ 8 files changed, 1538 insertions(+)
drivers/video/pnx4008/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Makefile for the new PNX4008 framebuffer device driver +# + +obj-$(CONFIG_FB_PNX4008_DUM) += sdum.o +obj-$(CONFIG_FB_PNX4008_DUM_RGB) += rgbfb.o +
drivers/video/pnx4008/dum.h new file +243 -0
243 lines not on this page · raw message
drivers/video/pnx4008/fbcommon.h new file +43 -0
43 lines not on this page · raw message
drivers/video/pnx4008/rgbfb.c new file +223 -0
223 lines not on this page · raw message
drivers/video/Kconfig +15 -0
@@ -1560,6 +1560,21 @@ config FB_S3C2410_DEBUG Turn on debugging messages. Note that you can set/unset at run time through sysfs +config FB_PNX4008_DUM + tristate "Display Update Module support on Philips PNX4008 board" + depends on FB && ARCH_PNX4008 + ---help--- + Say Y here to enable support for PNX4008 Display Update Module (DUM) + +config FB_PNX4008_DUM_RGB + tristate "RGB Framebuffer support on Philips PNX4008 board" + depends on FB_PNX4008_DUM + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + ---help--- + Say Y here to enable support for PNX4008 RGB Framebuffer + config FB_VIRTUAL tristate "Virtual Frame Buffer support (ONLY FOR TESTING!)" depends on FB
drivers/video/Makefile +2 -0
@@ -94,6 +94,8 @@ obj-$(CONFIG_FB_TX3912) += tx3912fb.o obj-$(CONFIG_FB_S1D13XXX) += s1d13xxxfb.o obj-$(CONFIG_FB_IMX) += imxfb.o obj-$(CONFIG_FB_S3C2410) += s3c2410fb.o +obj-$(CONFIG_FB_PNX4008_DUM) += pnx4008/ +obj-$(CONFIG_FB_PNX4008_DUM_RGB) += pnx4008/ # Platform or fallback drivers go here obj-$(CONFIG_FB_VESA) += vesafb.o
drivers/video/pnx4008/sdum.c new file +866 -0
866 lines not on this page · raw message
drivers/video/pnx4008/sdum.h new file +139 -0
139 lines not on this page · raw message
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
Quoted 22 lines · Vitaly Wool
Hi folks,
inlined is the patch that adds support for Display Update Module and RGB framebuffer device on Philips PNX4008 ARM board.
Kconfig | 15 Makefile | 2 pnx4008/Makefile | 7 pnx4008/dum.h | 243 ++++++++++++++ pnx4008/fbcommon.h | 43 ++ pnx4008/rgbfb.c | 223 +++++++++++++ pnx4008/sdum.c | 866 +++++++++++++++++++++++++++++++++++++++++++++++++++++ pnx4008/sdum.h | 139 ++++++++ 8 files changed, 1538 insertions(+)Signed-off-by Grigory Tolstolytkin <[email protected]>Signed-off-by Vitaly Wool <[email protected]>Index: linux-2.6.git/drivers/video/pnx4008/Makefile
===================================================================
drivers/video/pnx4008/Makefile line 6
Quoted 6 lines
drivers/video/pnx4008/Makefile new file +6
-0@@ -0,0 +1,7 @@ +# +# Makefile for the new PNX4008 framebuffer device driver +# + +obj-$(CONFIG_FB_PNX4008_DUM) += sdum.o +obj-$(CONFIG_FB_PNX4008_DUM_RGB) += rgbfb.o
rgbfb? Can the name be more descriptive of the chipset?
drivers/video/pnx4008/Makefile
Quoted 6 lines
drivers/video/pnx4008/Makefile new file +6
-0+ +static int no_cursor(struct fb_info *info, struct fb_cursor *cursor) +{ + return 0; +} +
Hmm, this driver is not going to be used as a console at all?
drivers/video/pnx4008/Makefile
Quoted 11 lines
drivers/video/pnx4008/Makefile new file +11
-0+ +static int rgbfb_open(struct fb_info *info, int user) +{ + return 0; +} + +static int rgbfb_release(struct fb_info *info, int user) +{ + return 0; +} +
Just remove fb_open() nad fb_release().
drivers/video/pnx4008/Makefile
Quoted 7 lines
drivers/video/pnx4008/Makefile new file +7
-0+static int __devinit rgbfb_probe(struct platform_device *pdev) +{ + struct fb_info *info; + struct dumchannel_uf chan_uf; + int ret; + + info = framebuffer_alloc(sizeof(u32) * 256, &pdev->dev);
256 is too much. You can use 16.
drivers/video/pnx4008/Makefile
Quoted 8 lines
drivers/video/pnx4008/Makefile new file +8
-0+ return 0; + +err2: + fb_dealloc_cmap(&info->cmap); +err1: + framebuffer_release(info); +err: + pnx4008_free_dum_channel(channel_owned, pdev->id);
Check the error path. This driver may leak resources.
Quoted 6 lines
drivers/video/pnx4008/Makefile new file +5
-0+config FB_PNX4008_DUM + tristate "Display Update Module support on Philips PNX4008 board" + depends on FB && ARCH_PNX4008 + ---help--- + Say Y here to enable support for PNX4008 Display Update Module (DUM)
drivers/video/pnx4008/Makefile
Quoted 10 lines
drivers/video/pnx4008/Makefile new file +10
-0+ +config FB_PNX4008_DUM_RGB + tristate "RGB Framebuffer support on Philips PNX4008 board" + depends on FB_PNX4008_DUM + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + ---help--- + Say Y here to enable support for PNX4008 RGB Framebuffer +
Are there other uses of the "Display Update Module" other than the framebuffer? IOW, is CONFIG_PNX4008_DUM=y, CONFIG_PNX4008_DUM_RGB=n a usable configuration?
Quoted 11 lines
drivers/video/pnx4008/Makefile new file +11
-0+int pnx4008_get_dum_channel_uf(struct dumchannel_uf *p_chan_uf, int dev_id) +{ + int i = p_chan_uf->channelnr; + + if (i < 0 || i > MAX_DUM_CHANNELS) + return -EINVAL; + else if (dum_data.fb_owning_channel[i] != dev_id) + return -EFBNOTOWNER; + else { + p_chan_uf->dirty = dum_data.chan_uf_store[i].dirty; + p_chan_uf->source = dum_data.chan_uf_store[i].source;
drivers/video/pnx4008/Makefile
Quoted 10 lines
drivers/video/pnx4008/Makefile new file +10
-0+ p_chan_uf->x_offset = dum_data.chan_uf_store[i].x_offset; + p_chan_uf->y_offset = dum_data.chan_uf_store[i].y_offset; + p_chan_uf->width = dum_data.chan_uf_store[i].width; + p_chan_uf->height = dum_data.chan_uf_store[i].height; + } + + return 0; +} + +EXPORT_SYMBOL(pnx4008_get_dum_channel_uf);
Unused?
Quoted 10 lines
drivers/video/pnx4008/Makefile new file +10
-0+ +int pnx4008_get_dum_channel_config(int channr, int dev_id) +{ + int ret; + struct dumchannel chan; + + if (channr < 0 || channr > MAX_DUM_CHANNELS) + return -EINVAL; + else if (dum_data.fb_owning_channel[channr] != dev_id) + return -EFBNOTOWNER;
drivers/video/pnx4008/Makefile
Quoted 10 lines
drivers/video/pnx4008/Makefile new file +10
-0+ else { + chan.channelnr = channr; + if ((ret = get_channel(&chan)) != 0) + return ret; + } + + return (chan.dum_ch_conf & DUM_CHANNEL_CFG_MASK); +} + +EXPORT_SYMBOL(pnx4008_get_dum_channel_config);
Unused?
Quoted 9 lines
drivers/video/pnx4008/Makefile new file +9
-0+int pnx4008_set_dum_chanel_dirty_detect(int channr, int val, int dev_id) +{ + if (channr < 0 || channr > MAX_DUM_CHANNELS) + return -EINVAL; + else if (dum_data.fb_owning_channel[channr] != dev_id) + return -EFBNOTOWNER; + else { + if (val == CONF_DIRTYDETECTION_ON) + DUM_CH_CONF(channr) |= CONF_DIRTYENABLE;
drivers/video/pnx4008/Makefile
Quoted 10 lines
drivers/video/pnx4008/Makefile new file +10
-0+ else if (val == CONF_DIRTYDETECTION_OFF) + DUM_CH_CONF(channr) &= ~CONF_DIRTYENABLE; + else + return -EINVAL; + } + + return 0; +} + +EXPORT_SYMBOL(pnx4008_set_dum_chanel_dirty_detect);
^^^^^^
channel?
Quoted 5 lines
drivers/video/pnx4008/Makefile new file +5
-0+ +int pnx4008_force_update_dum_channel(int channr, int dev_id) +{ + if (channr < 0 || channr > MAX_DUM_CHANNELS) + return -EINVAL;
drivers/video/pnx4008/Makefile
Quoted 10 lines
drivers/video/pnx4008/Makefile new file +10
-0+ + else if (dum_data.fb_owning_channel[channr] != dev_id) + return -EFBNOTOWNER; + else + DUM_CH_CTRL(channr) = CTRL_SETDIRTY; + + return 0; +} + +EXPORT_SYMBOL(pnx4008_force_update_dum_channel);
Unused?
Tony
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
Quoted 5 lines · On Wed, 28 Jun 2006 05:27:02 +0800 "Antonino A. Daplas" <[email protected]>…
Quoted 5 lines
Index: linux-2.6.git/drivers/video/pnx4008/Makefile
===================================================================drivers/video/pnx4008/Makefile new file +0
-0@@ -0,0 +1,7 @@
Quoted 8 lines
drivers/video/pnx4008/Makefile line 6
Quoted 6 lines
drivers/video/pnx4008/Makefile new file +6
-0+# +# Makefile for the new PNX4008 framebuffer device driver +# + +obj-$(CONFIG_FB_PNX4008_DUM) += sdum.o +obj-$(CONFIG_FB_PNX4008_DUM_RGB) += rgbfb.orgbfb? Can the name be more descriptive of the chipset?
Hmmm, the thing is that the frambuffer can actually be anyone of a kind.
Display Update Module provides interface to the actual device and the only difference it makes is whether it's a RGB or YUV framebuffer.
Quoted 8 lines
drivers/video/pnx4008/Makefile
Quoted 6 lines
drivers/video/pnx4008/Makefile new file +6
-0+ +static int no_cursor(struct fb_info *info, struct fb_cursor *cursor) +{ + return 0; +} +Hmm, this driver is not going to be used as a console at all?
No, it was never planned to be.
Quoted 10 lines
Quoted 10 lines
drivers/video/pnx4008/Makefile new file +10
-0+config FB_PNX4008_DUM + tristate "Display Update Module support on Philips PNX4008 board" + depends on FB && ARCH_PNX4008 + ---help--- + Say Y here to enable support for PNX4008 Display Update Module (DUM) + +config FB_PNX4008_DUM_RGB + tristate "RGB Framebuffer support on Philips PNX4008 board" + depends on FB_PNX4008_DUM + select FB_CFB_FILLRECT
Quoted 8 lines
drivers/video/pnx4008/Makefile
Quoted 5 lines
drivers/video/pnx4008/Makefile new file +5
-0+ select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + ---help--- + Say Y here to enable support for PNX4008 RGB Framebuffer +Are there other uses of the "Display Update Module" other than the framebuffer? IOW, is
CONFIG_PNX4008_DUM=y,CONFIG_PNX4008_DUM_RGB=na usable configuration?
It is, but currently it will result in nothing shown on the LCD.
However, it's planned to add YUV framebuffer driver which also requires DUM and is an alternative to RGB one.
Quoted 15 lines
Quoted 15 lines
drivers/video/pnx4008/Makefile new file +15
-0+int pnx4008_get_dum_channel_uf(struct dumchannel_uf *p_chan_uf, int dev_id) +{ + int i = p_chan_uf->channelnr; + + if (i < 0 || i > MAX_DUM_CHANNELS) + return -EINVAL; + else if (dum_data.fb_owning_channel[i] != dev_id) + return -EFBNOTOWNER; + else { + p_chan_uf->dirty = dum_data.chan_uf_store[i].dirty; + p_chan_uf->source = dum_data.chan_uf_store[i].source; + p_chan_uf->x_offset = dum_data.chan_uf_store[i].x_offset; + p_chan_uf->y_offset = dum_data.chan_uf_store[i].y_offset; + p_chan_uf->width = dum_data.chan_uf_store[i].width; + p_chan_uf->height = dum_data.chan_uf_store[i].height;
Quoted 8 lines
drivers/video/pnx4008/Makefile
Quoted 6 lines
drivers/video/pnx4008/Makefile new file +6
-0+ } + + return 0; +} + +EXPORT_SYMBOL(pnx4008_get_dum_channel_uf);Unused?
For this one and followers, they might be used in YUV framebuffer driver. However, if you consider it's reasonable to remove those for now, I don't mind.
Quoted 21 lines
Quoted 10 lines
drivers/video/pnx4008/Makefile new file +9
-0+int pnx4008_set_dum_chanel_dirty_detect(int channr, int val, int dev_id) +{ + if (channr < 0 || channr > MAX_DUM_CHANNELS) + return -EINVAL; + else if (dum_data.fb_owning_channel[channr] != dev_id) + return -EFBNOTOWNER; + else { + if (val == CONF_DIRTYDETECTION_ON) + DUM_CH_CONF(channr) |= CONF_DIRTYENABLE;drivers/video/pnx4008/Makefile
Quoted 10 lines
drivers/video/pnx4008/Makefile new file +10
-0+ else if (val == CONF_DIRTYDETECTION_OFF) + DUM_CH_CONF(channr) &= ~CONF_DIRTYENABLE; + else + return -EINVAL; + } + + return 0; +} + +EXPORT_SYMBOL(pnx4008_set_dum_chanel_dirty_detect);^^^^^^
Quoted 1 line
channel?
Yes, thanks.
Vitaly
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
Quoted 16 lines · Vitaly Wool
Quoted 4 lines · On Wed, 28 Jun 2006 05:27:02 +0800 "Antonino A. Daplas" <[email protected]>…
Quoted 4 lines
Index: linux-2.6.git/drivers/video/pnx4008/Makefile
===================================================================drivers/video/pnx4008/Makefile new file +0
-0Quoted 8 lines
drivers/video/pnx4008/Makefile line 6
Quoted 7 lines
drivers/video/pnx4008/Makefile new file +6
-0@@ -0,0 +1,7 @@ +# +# Makefile for the new PNX4008 framebuffer device driver +# + +obj-$(CONFIG_FB_PNX4008_DUM) += sdum.o +obj-$(CONFIG_FB_PNX4008_DUM_RGB) += rgbfb.orgbfb? Can the name be more descriptive of the chipset?
Quoted 3 lines
Hmmm, the thing is that the frambuffer can actually be anyone of a kind.
Display Update Module provides interface to the actual device and the only difference it makes is whether it's a RGB or YUV framebuffer.
Well, something like pnxrgbfb, pnxyuvfb? But it's your driver, so your call.
Quoted 9 lines
Quoted 7 lines
drivers/video/pnx4008/Makefile
Quoted 6 lines
drivers/video/pnx4008/Makefile new file +6
-0+ +static int no_cursor(struct fb_info *info, struct fb_cursor *cursor) +{ + return 0; +} +Hmm, this driver is not going to be used as a console at all?
No, it was never planned to be.
Okay, but you can always give the user an option to turn it on, say, with video=rgbfb:cursor boot/module parameter.
Quoted 19 lines
Quoted 10 lines
Quoted 10 lines
drivers/video/pnx4008/Makefile new file +9
-0+config FB_PNX4008_DUM + tristate "Display Update Module support on Philips PNX4008 board" + depends on FB && ARCH_PNX4008 + ---help--- + Say Y here to enable support for PNX4008 Display Update Module (DUM) + +config FB_PNX4008_DUM_RGB + tristate "RGB Framebuffer support on Philips PNX4008 board" + depends on FB_PNX4008_DUMQuoted 8 lines
drivers/video/pnx4008/Makefile
Quoted 6 lines
drivers/video/pnx4008/Makefile new file +6
-0+ select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + ---help--- + Say Y here to enable support for PNX4008 RGB Framebuffer +Are there other uses of the "Display Update Module" other than the framebuffer? IOW, is
CONFIG_PNX4008_DUM=y,CONFIG_PNX4008_DUM_RGB=na usable configuration?
Quoted 2 lines
It is, but currently it will result in nothing shown on the LCD.
However, it's planned to add YUV framebuffer driver which also requires DUM and is an alternative to RGB one.
Okay.
Quoted 24 lines
Quoted 15 lines
Quoted 15 lines
drivers/video/pnx4008/Makefile new file +14
-0+int pnx4008_get_dum_channel_uf(struct dumchannel_uf *p_chan_uf, int dev_id) +{ + int i = p_chan_uf->channelnr; + + if (i < 0 || i > MAX_DUM_CHANNELS) + return -EINVAL; + else if (dum_data.fb_owning_channel[i] != dev_id) + return -EFBNOTOWNER; + else { + p_chan_uf->dirty = dum_data.chan_uf_store[i].dirty; + p_chan_uf->source = dum_data.chan_uf_store[i].source; + p_chan_uf->x_offset = dum_data.chan_uf_store[i].x_offset; + p_chan_uf->y_offset = dum_data.chan_uf_store[i].y_offset; + p_chan_uf->width = dum_data.chan_uf_store[i].width;Quoted 8 lines
drivers/video/pnx4008/Makefile
Quoted 7 lines
drivers/video/pnx4008/Makefile new file +7
-0+ p_chan_uf->height = dum_data.chan_uf_store[i].height; + } + + return 0; +} + +EXPORT_SYMBOL(pnx4008_get_dum_channel_uf);Unused?
Quoted 1 line
For this one and followers, they might be used in YUV framebuffer driver. However, if you consider it's reasonable to remove those for now, I don't mind.
You can just enclose then with an #if 0/#endif
Tony
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
Quoted 6 lines · On Wed, 28 Jun 2006 17:07:45 +0800 "Antonino A. Daplas" <[email protected]>…
Quoted 3 lines
Hmmm, the thing is that the frambuffer can actually be anyone of a kind.
Display Update Module provides interface to the actual device and the only difference it makes is whether it's a RGB or YUV framebuffer.Well, something like pnxrgbfb, pnxyuvfb? But it's your driver, so your call.
It's in pnx4008/ subdir, is it really reasonable to prefix the FB driver name with pnx?
Vitaly
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
Quoted 11 lines · Vitaly Wool
Quoted 6 lines · On Wed, 28 Jun 2006 17:07:45 +0800 "Antonino A. Daplas" <[email protected]>…
Quoted 3 lines
Hmmm, the thing is that the frambuffer can actually be anyone of a kind.
Display Update Module provides interface to the actual device and the only difference it makes is whether it's a RGB or YUV framebuffer.Well, something like pnxrgbfb, pnxyuvfb? But it's your driver, so your call.
It's in pnx4008/ subdir, is it really reasonable to prefix the FB driver name with pnx?
If it's a loadable module, the name must be unique.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
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