You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
(1) |
Apr
(104) |
May
(81) |
Jun
(248) |
Jul
(133) |
Aug
(33) |
Sep
(53) |
Oct
(82) |
Nov
(166) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(121) |
Feb
(42) |
Mar
(39) |
Apr
(84) |
May
(87) |
Jun
(58) |
Jul
(97) |
Aug
(130) |
Sep
(32) |
Oct
(139) |
Nov
(108) |
Dec
(216) |
2003 |
Jan
(299) |
Feb
(136) |
Mar
(392) |
Apr
(141) |
May
(137) |
Jun
(107) |
Jul
(94) |
Aug
(262) |
Sep
(300) |
Oct
(216) |
Nov
(72) |
Dec
(94) |
2004 |
Jan
(174) |
Feb
(192) |
Mar
(215) |
Apr
(314) |
May
(319) |
Jun
(293) |
Jul
(205) |
Aug
(161) |
Sep
(192) |
Oct
(226) |
Nov
(308) |
Dec
(89) |
2005 |
Jan
(127) |
Feb
(269) |
Mar
(588) |
Apr
(106) |
May
(77) |
Jun
(77) |
Jul
(161) |
Aug
(239) |
Sep
(86) |
Oct
(112) |
Nov
(153) |
Dec
(145) |
2006 |
Jan
(87) |
Feb
(57) |
Mar
(129) |
Apr
(109) |
May
(102) |
Jun
(232) |
Jul
(97) |
Aug
(69) |
Sep
(67) |
Oct
(69) |
Nov
(214) |
Dec
(82) |
2007 |
Jan
(133) |
Feb
(307) |
Mar
(121) |
Apr
(171) |
May
(229) |
Jun
(156) |
Jul
(185) |
Aug
(160) |
Sep
(122) |
Oct
(130) |
Nov
(78) |
Dec
(27) |
2008 |
Jan
(105) |
Feb
(137) |
Mar
(146) |
Apr
(148) |
May
(239) |
Jun
(208) |
Jul
(157) |
Aug
(244) |
Sep
(119) |
Oct
(125) |
Nov
(189) |
Dec
(225) |
2009 |
Jan
(157) |
Feb
(139) |
Mar
(106) |
Apr
(130) |
May
(246) |
Jun
(189) |
Jul
(128) |
Aug
(127) |
Sep
(88) |
Oct
(86) |
Nov
(216) |
Dec
(9) |
2010 |
Jan
(5) |
Feb
|
Mar
(11) |
Apr
(31) |
May
(3) |
Jun
|
Jul
(7) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Pawel O. <p.o...@sa...> - 2009-09-11 18:06:02
|
Hello, this patch series adds some new features to the driver, as well as fixes to the existing register handling (patch 4/7). It is rebased onto my previous patchset ([PATCH v2 0/3] v2: s3c-fb panning and vsync support). The series contains: [PATCH 1/7] [ARM] s3c-fb: Added colorkey support [PATCH 2/7] [ARM] s3c-fb: Added window source selection. [PATCH 3/7] [ARM] s3c-fb: Added support for alpha blending. [PATCH 4/7] [ARM] s3c-fb: Corrected and added new VIDOSD register macros. [PATCH 5/7] [ARM] s3c-fb: Added missing window enabled state updates. [PATCH 6/7] [ARM] s3c-fb: Added debugfs interface. [PATCH 7/7] [ARM] s3c-fb: Added color key blending. Best regards -- Pawel Osciak Linux Platform Group Samsung Poland R&D Center |
From: Eric M. <eri...@gm...> - 2009-09-11 16:13:23
|
> Ok, now remove 'cpu_is_pxa3xx() && ' above and you should be good to go:-) > What if tomorrow pxa4xx comes (ok, Eric will disagree, but wtill:-)) It is not likely to be pxa4xx, (chinese people don't like '4', and there are a lot chinese in Marvell, Shhh..... don't let them know I said this ;-) Still, I guess having a cpu_is_pxa3xx() should be OK here. > >> fbi->backlight_power = inf->pxafb_backlight_power; >> fbi->lcd_power = inf->pxafb_lcd_power; >> >> diff --git a/include/linux/fb.h b/include/linux/fb.h >> index f847df9..a34bdf5 100644 >> --- a/include/linux/fb.h >> +++ b/include/linux/fb.h >> @@ -133,6 +133,7 @@ struct dentry; >> #define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */ >> #define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */ >> #define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */ >> +#define FB_ACCEL_PXA3XX 99 /* PXA3xx */ >> >> #define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */ >> #define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */ >> -- >> 1.6.3.3 >> > > Thanks > Guennadi > --- > Guennadi Liakhovetski, Ph.D. > Freelance Open-Source Software Developer > http://www.open-technology.de/ > |
From: Daniel M. <da...@ca...> - 2009-09-11 15:20:36
|
On Thu, Sep 10, 2009 at 03:33:27PM +0200, Daniel Mack wrote: > On Thu, Sep 10, 2009 at 03:31:34PM +0200, Guennadi Liakhovetski wrote: > > > + if (cpu_is_pxa3xx() && inf->acceleration_enabled) > > > + fbi->fb.fix.accel = FB_ACCEL_PXA3XX; > > > + > > > > Ok, now remove 'cpu_is_pxa3xx() && ' above and you should be good to go:-) > > What if tomorrow pxa4xx comes (ok, Eric will disagree, but wtill:-)) > > Don't know. I left it in there intentionally, but I'm fine to remove it. > Or Eric does it when applying ;) Eric? What I was considering are cases where a kernel binary that works on both PXA3xx and other PXAs shares the same pxafb_mach_info struct across different board support code. The accel flag would then be set for wrong platforms. But this might be academic, that's why I don't have a strong opinion on that :) Daniel |
From: Daniel M. <da...@ca...> - 2009-09-10 14:10:44
|
On Thu, Sep 10, 2009 at 03:31:34PM +0200, Guennadi Liakhovetski wrote: > > + if (cpu_is_pxa3xx() && inf->acceleration_enabled) > > + fbi->fb.fix.accel = FB_ACCEL_PXA3XX; > > + > > Ok, now remove 'cpu_is_pxa3xx() && ' above and you should be good to go:-) > What if tomorrow pxa4xx comes (ok, Eric will disagree, but wtill:-)) Don't know. I left it in there intentionally, but I'm fine to remove it. Or Eric does it when applying ;) Eric? Daniel |
From: Guennadi L. <g.l...@gm...> - 2009-09-10 13:58:19
|
On Thu, 10 Sep 2009, Daniel Mack wrote: > Ok, here goes a new patch as just discussed. > Does that look good to everyone? > > Thanks, > Daniel > > >From 32b1fa824cd78f9ba6169b90c5d01870de05c86f Mon Sep 17 00:00:00 2001 > From: Daniel Mack <da...@ca...> > Date: Mon, 20 Jul 2009 11:18:43 +0200 > Subject: [PATCH] video: add PXA3xx accelerator ID > > Add ID 99 for PXA3xx frame buffers and report it in the pxa frame buffer > conditionally, depending on a new flag in struct pxafb_mach_info. > > Signed-off-by: Daniel Mack <da...@ca...> > Cc: Eric Miao <eri...@ma...> > Cc: lin...@li... > Cc: Dennis Oliver Kropp <do...@di...> > Cc: Sven Neumann <s.n...@ra...> > --- > arch/arm/mach-pxa/include/mach/pxafb.h | 3 ++- > drivers/video/pxafb.c | 3 +++ > include/linux/fb.h | 1 + > 3 files changed, 6 insertions(+), 1 deletions(-) > > diff --git a/arch/arm/mach-pxa/include/mach/pxafb.h b/arch/arm/mach-pxa/include/mach/pxafb.h > index 6932720..f73061c 100644 > --- a/arch/arm/mach-pxa/include/mach/pxafb.h > +++ b/arch/arm/mach-pxa/include/mach/pxafb.h > @@ -118,7 +118,8 @@ struct pxafb_mach_info { > u_int fixed_modes:1, > cmap_inverse:1, > cmap_static:1, > - unused:29; > + acceleration_enabled:1, > + unused:28; > > /* The following should be defined in LCCR0 > * LCCR0_Act or LCCR0_Pas Active or Passive > diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c > index 3951cc5..b65cc2d 100644 > --- a/drivers/video/pxafb.c > +++ b/drivers/video/pxafb.c > @@ -2083,6 +2083,9 @@ static int __devinit pxafb_probe(struct platform_device *dev) > goto failed; > } > > + if (cpu_is_pxa3xx() && inf->acceleration_enabled) > + fbi->fb.fix.accel = FB_ACCEL_PXA3XX; > + Ok, now remove 'cpu_is_pxa3xx() && ' above and you should be good to go:-) What if tomorrow pxa4xx comes (ok, Eric will disagree, but wtill:-)) > fbi->backlight_power = inf->pxafb_backlight_power; > fbi->lcd_power = inf->pxafb_lcd_power; > > diff --git a/include/linux/fb.h b/include/linux/fb.h > index f847df9..a34bdf5 100644 > --- a/include/linux/fb.h > +++ b/include/linux/fb.h > @@ -133,6 +133,7 @@ struct dentry; > #define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */ > #define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */ > #define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */ > +#define FB_ACCEL_PXA3XX 99 /* PXA3xx */ > > #define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */ > #define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */ > -- > 1.6.3.3 > Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ |
From: Daniel M. <da...@ca...> - 2009-09-10 13:26:52
|
Ok, here goes a new patch as just discussed. Does that look good to everyone? Thanks, Daniel >From 32b1fa824cd78f9ba6169b90c5d01870de05c86f Mon Sep 17 00:00:00 2001 From: Daniel Mack <da...@ca...> Date: Mon, 20 Jul 2009 11:18:43 +0200 Subject: [PATCH] video: add PXA3xx accelerator ID Add ID 99 for PXA3xx frame buffers and report it in the pxa frame buffer conditionally, depending on a new flag in struct pxafb_mach_info. Signed-off-by: Daniel Mack <da...@ca...> Cc: Eric Miao <eri...@ma...> Cc: lin...@li... Cc: Dennis Oliver Kropp <do...@di...> Cc: Sven Neumann <s.n...@ra...> --- arch/arm/mach-pxa/include/mach/pxafb.h | 3 ++- drivers/video/pxafb.c | 3 +++ include/linux/fb.h | 1 + 3 files changed, 6 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-pxa/include/mach/pxafb.h b/arch/arm/mach-pxa/include/mach/pxafb.h index 6932720..f73061c 100644 --- a/arch/arm/mach-pxa/include/mach/pxafb.h +++ b/arch/arm/mach-pxa/include/mach/pxafb.h @@ -118,7 +118,8 @@ struct pxafb_mach_info { u_int fixed_modes:1, cmap_inverse:1, cmap_static:1, - unused:29; + acceleration_enabled:1, + unused:28; /* The following should be defined in LCCR0 * LCCR0_Act or LCCR0_Pas Active or Passive diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 3951cc5..b65cc2d 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c @@ -2083,6 +2083,9 @@ static int __devinit pxafb_probe(struct platform_device *dev) goto failed; } + if (cpu_is_pxa3xx() && inf->acceleration_enabled) + fbi->fb.fix.accel = FB_ACCEL_PXA3XX; + fbi->backlight_power = inf->pxafb_backlight_power; fbi->lcd_power = inf->pxafb_lcd_power; diff --git a/include/linux/fb.h b/include/linux/fb.h index f847df9..a34bdf5 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -133,6 +133,7 @@ struct dentry; #define FB_ACCEL_NEOMAGIC_NM2230 96 /* NeoMagic NM2230 */ #define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */ #define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */ +#define FB_ACCEL_PXA3XX 99 /* PXA3xx */ #define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */ #define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */ -- 1.6.3.3 |
From: Sergey L. <sl...@os...> - 2009-09-07 14:51:53
|
Hi, all! I have special framebuffer device (128x128x2bpp display via external framebuffer interface on OMAP3), which works quite well, switching off backlight with fbcon on, and blanking. A problem is that I need to run graphics application on a framebuffer. But I also need blanking on inactivity. Application works perfectly until blanking occurs, then display is zeroed-out and application still redraws regions it changes. This is ok while not really clean, but also, when activity is recieved, backlight is on, but screen is not redrawn, since application is not aware of blanking, so I have to force it to readraw all screen. So, how this should be fixed? I want to keep fbcon auto-blanking functionality and tty, so removing fbcon is not an option. Thanks beforehand, S. |
From: Chris J. <cjn...@gm...> - 2009-09-07 03:52:04
|
On Mon, Aug 31, 2009 at 03:23:09PM EDT, Chris Jones wrote: > Hopefully, this is the correct place to ask such questions - I tried the > fbdev-users mailing list a couple of days ago, but is looks like it's > not currently very active. > > I would like my laptop's LCD panel to switch itself off automatically > after a few minutes of inactivity. > > The /etc/kbd/config file specifies: > > BLANK_DPMS=on > POWERDOWN_TIME=2 > > The /etc/init.d/console-screen.kbd.sh script appears to issue a setterm > command with the above options a boot time, yet nothing happens. > > I issued the corresponding "setterm" command manually also to no effect. > > Is there something that I need to configure in the linux kernel? > > Is this a limitation of the frambuffer console with the atyfb driver? > > Manually executing "vbetool dpms off" does the trick, so it doesn't look > like this is a hardware limitation per se. > > The video card is an ATI Technologies Rage Mobility P/M AGP 2x (rev 64). > > Relevant (?) software: > > linux-image : 2.6.26-1-686 > acpid : 1.0.8-1 > util-linux : 2.13.1.1-1 > kbd : 1.14.1-4 Hmm.. it looks like this is not the right place to request assistance regarding this issue. :-( Anyone could suggest where I might find help with this? Thanks, CJ |
From: Florian T. S. <Flo...@gm...> - 2009-09-07 02:51:30
|
Jonathan Corbet schrieb: >> Do you have a pointer to the OLPC tree? > > git://dev.laptop.org/olpc-2.6 > > They are working in the olpc-2.6.30 branch, currently. Thanks. After having a look at it seems concerning viafb to be mostly Haralds patches with 1 or 2 extra ones. >> I'd really like to see VX855/OLPC support in mainline as soon as >> possible as I consider it a good thing to support "new" hardware early. >> However even if I am capable to write such support based on Haralds work >> I don't want to see it in mainline as long as no one with that hardware >> tested it. > > I do have the hardware, and I've taken on the responsibility for making > pieces of it work. In my mind, that includes being responsible for > mainlining things too. I will start to work in that direction; 2.6.33 > should be a reasonable target for the bulk of it. > > My thinking, FWIW, is to turn the viafb code into something more like a > regular multi-function device driver. I've already integrated Harald's i2c > stuff with the OLPC code; I need to add proper GPIO support next. Then > there will be the V4L2 chunk for the video capture engine. Along the way, > I may try to introduce some foreign concepts like locking. Feel free to add the things you like. The main objective is probably to get things working and stable. I do not have an idea how good that will work out as I don't know how much code that requires. If you think that's the way to go, then we'll try it and see whether it leads to something usable and maintainable. > I have a tree on git.lwn.net now, but it's against the 2.6.30 base. I will > try to bring things forward to a more current tree sometime soon and put it > up as, at least, a place where we can see the various lines of development > going on. > > Sound good? Jep, that's fine with me. I'll try to rebase&integrate the patches I consider interesting from Harald's tree in -mm. I guess that's a good thing to do as that's the latest used common base. Any objections? Regards, Florian Tobias Schandinat |
From: Bruno P. <bo...@li...> - 2009-09-06 16:07:00
|
Hi Geert, On Sun, 06 September 2009 Geert Uytterhoeven wrote: > The linux-fbdev mailing lists (linux-fbdev-devel and > linux-fbdev-users) are being migrated from SourceForge.net to a > single mailing list at kernel.org > (Thanks David!). > I haven't arranged archives of the new mailing list yet. I also > haven't send a patch to Linus to update MAINTAINERS. I will do that > in the coming days. While subscribing the new list to archive services it might be a good opportunity to also "subscribe" the new list to patchwork. The question though is who shall manage it so as to have the patch listing match the actual patch state... (e.g. so it's not just an index of all patches submitted but with all patches marked "new" forever) Bruno |
From: Geert U. <ge...@li...> - 2009-09-06 15:07:25
|
Hi all, The linux-fbdev mailing lists (linux-fbdev-devel and linux-fbdev-users) are being migrated from SourceForge.net to a single mailing list at kernel.org (Thanks David!). Your subscriptions to the old mailing lists are not automatically transfered to the new mailing list.To subscribe to the new linux-fbdev mailing list, please send an email to maj...@vg... with the following command in the body of your email message: subscribe linux-fbdev In about a week from now, I'll setup auto-responders on the old mailing lists, to redirect people to the new mailing list. Sorry for any inconvenience this may cause. I haven't arranged archives of the new mailing list yet. I also haven't send a patch to Linus to update MAINTAINERS. I will do that in the coming days. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... 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 |
From: Jonathan C. <co...@lw...> - 2009-09-06 14:17:35
|
> Do you have a pointer to the OLPC tree? git://dev.laptop.org/olpc-2.6 They are working in the olpc-2.6.30 branch, currently. > I'd really like to see VX855/OLPC support in mainline as soon as > possible as I consider it a good thing to support "new" hardware early. > However even if I am capable to write such support based on Haralds work > I don't want to see it in mainline as long as no one with that hardware > tested it. I do have the hardware, and I've taken on the responsibility for making pieces of it work. In my mind, that includes being responsible for mainlining things too. I will start to work in that direction; 2.6.33 should be a reasonable target for the bulk of it. My thinking, FWIW, is to turn the viafb code into something more like a regular multi-function device driver. I've already integrated Harald's i2c stuff with the OLPC code; I need to add proper GPIO support next. Then there will be the V4L2 chunk for the video capture engine. Along the way, I may try to introduce some foreign concepts like locking. I have a tree on git.lwn.net now, but it's against the 2.6.30 base. I will try to bring things forward to a more current tree sometime soon and put it up as, at least, a place where we can see the various lines of development going on. Sound good? jon |
From: Andrew M. <ak...@li...> - 2009-09-06 03:02:58
|
On Sun, 06 Sep 2009 02:38:37 +0200 Florian Tobias Schandinat <Flo...@gm...> wrote: > >> I'm going to be doing some work here (writing a > >> driver for the video capture engine), and there's patches sitting in > >> Harald's tree and the OLPC tree. > > > > As far as the rest of the world is concerned, that stuff doesn't exist. > > I'll try to sort out the patches that still add anything to my stuff. I > know Harald's tree and I know that I probably broke every of his > patches. However, he seems to not have done anything for about 3 months > so I rebased/rewrote my patches on linux-2.6 and started sending. I > guess in the meantime I obsolated about half of his patches but there > are still some things I'd like to have (PCI rework, VX855/OLPC support). > Although I'm a bit unsure how to take these things, fix them to apply on > top of my changes and correctly give the original author credit for it. Sure, that works. Please coordinate with Harald of course, but we do that sort of thing regularly. > Do you have a pointer to the OLPC tree? I don't. > I'd really like to see VX855/OLPC support in mainline as soon as > possible as I consider it a good thing to support "new" hardware early. > However even if I am capable to write such support based on Haralds work > I don't want to see it in mainline as long as no one with that hardware > tested it. > > >> It seems like a central merge point > >> might be a nice thing to have. > >> > >> I'd be happy to run such a tree. I'm really *not* qualified to be > >> passing judgment on patches to the framebuffer driver at this point, > >> though, so I'm not sure that I'm the best person for the job. > > > > Send 'em over. I haven't heard anything from the original viafb > > submitters for a long time. Hopefully Florian has time to help out > > with some review-n-test. > > I do not object against a tree that collects all viafb patches, I even > could do it. But one should really send the patches to Andrew ASAP as > otherwise we may end up with a dead forest ;) > Actually it would be very nice to see some more activity around viafb. > It might be bad if I'm the only one who patches it and who knows how it > works. Discussion can be quite inspiring. > > I'll do the things I can. But in the next few weeks I'll be probably a > bit short on time. Okay I guess I won't do any big patches for a while > but wait until some patches advance or receive some comments. So I still > have some time to review-n-test but expect some delay. In the long run > my test platform might become better as I'll be able to 'revive' some > old VIA boards currently not available for testing. > Sounds good, thanks. Things appear to be going OK from where I sit (famous last words ;)) |
From: Florian T. S. <Flo...@gm...> - 2009-09-06 00:39:02
|
Andrew Morton schrieb: > On Sat, 5 Sep 2009 16:16:45 -0600 Jonathan Corbet <co...@lw...> wrote: > >> On Fri, 4 Sep 2009 20:43:52 +0000 >> Florian Tobias Schandinat <Flo...@gm...> wrote: >> >>> This patch is a completly rewritten 2D engine. The engine is no longer >>> in a default state but reinitialized every time to allow usage for both >>> framebuffers regardless of their settings. >>> The whole engine handling is concentrated in a big function which takes >>> 16 parameters. >> Ouch, that's a lot of parameters. Might it be better to create a >> structure to encapsulate all of those drawing parameters? > > I was wondering that. There's less advantage to that than usual > because the call graph is not at all deep. I thought about encapsulating the geometric surface parameter (base, pitch, x, y) for source and destination as they somehow belong together. That would reduce it to 10 parameters but I don't know whether it's worth the effort. The number of parameters simply resulted from the idea to have one central function which needs to be changed if the engine changes and that allows a 2D acceleration in a completely state independent manner to allow using it for for 2 or more framebuffers or whatever one wants to blit in the video memory. >> On a more general level: is anybody maintaining a tree for patches to >> the viafb driver? > > -mm. I just pushed all my patches (also in -mm) up there: http://github.com/schandinat/linux-2.6-viafb/commits/master But to get something included in the driver one should really send it to Andrew. >> I'm going to be doing some work here (writing a >> driver for the video capture engine), and there's patches sitting in >> Harald's tree and the OLPC tree. > > As far as the rest of the world is concerned, that stuff doesn't exist. I'll try to sort out the patches that still add anything to my stuff. I know Harald's tree and I know that I probably broke every of his patches. However, he seems to not have done anything for about 3 months so I rebased/rewrote my patches on linux-2.6 and started sending. I guess in the meantime I obsolated about half of his patches but there are still some things I'd like to have (PCI rework, VX855/OLPC support). Although I'm a bit unsure how to take these things, fix them to apply on top of my changes and correctly give the original author credit for it. Do you have a pointer to the OLPC tree? I'd really like to see VX855/OLPC support in mainline as soon as possible as I consider it a good thing to support "new" hardware early. However even if I am capable to write such support based on Haralds work I don't want to see it in mainline as long as no one with that hardware tested it. >> It seems like a central merge point >> might be a nice thing to have. >> >> I'd be happy to run such a tree. I'm really *not* qualified to be >> passing judgment on patches to the framebuffer driver at this point, >> though, so I'm not sure that I'm the best person for the job. > > Send 'em over. I haven't heard anything from the original viafb > submitters for a long time. Hopefully Florian has time to help out > with some review-n-test. I do not object against a tree that collects all viafb patches, I even could do it. But one should really send the patches to Andrew ASAP as otherwise we may end up with a dead forest ;) Actually it would be very nice to see some more activity around viafb. It might be bad if I'm the only one who patches it and who knows how it works. Discussion can be quite inspiring. I'll do the things I can. But in the next few weeks I'll be probably a bit short on time. Okay I guess I won't do any big patches for a while but wait until some patches advance or receive some comments. So I still have some time to review-n-test but expect some delay. In the long run my test platform might become better as I'll be able to 'revive' some old VIA boards currently not available for testing. Regards, Florian Tobias Schandinat |
From: Andrew M. <ak...@li...> - 2009-09-05 23:02:03
|
On Sat, 5 Sep 2009 16:16:45 -0600 Jonathan Corbet <co...@lw...> wrote: > On Fri, 4 Sep 2009 20:43:52 +0000 > Florian Tobias Schandinat <Flo...@gm...> wrote: > > > This patch is a completly rewritten 2D engine. The engine is no longer > > in a default state but reinitialized every time to allow usage for both > > framebuffers regardless of their settings. > > The whole engine handling is concentrated in a big function which takes > > 16 parameters. > > Ouch, that's a lot of parameters. Might it be better to create a > structure to encapsulate all of those drawing parameters? I was wondering that. There's less advantage to that than usual because the call graph is not at all deep. > On a more general level: is anybody maintaining a tree for patches to > the viafb driver? -mm. > I'm going to be doing some work here (writing a > driver for the video capture engine), and there's patches sitting in > Harald's tree and the OLPC tree. As far as the rest of the world is concerned, that stuff doesn't exist. > It seems like a central merge point > might be a nice thing to have. > > I'd be happy to run such a tree. I'm really *not* qualified to be > passing judgment on patches to the framebuffer driver at this point, > though, so I'm not sure that I'm the best person for the job. Send 'em over. I haven't heard anything from the original viafb submitters for a long time. Hopefully Florian has time to help out with some review-n-test. |
From: Jonathan C. <co...@lw...> - 2009-09-05 22:32:38
|
On Fri, 4 Sep 2009 20:43:52 +0000 Florian Tobias Schandinat <Flo...@gm...> wrote: > This patch is a completly rewritten 2D engine. The engine is no longer > in a default state but reinitialized every time to allow usage for both > framebuffers regardless of their settings. > The whole engine handling is concentrated in a big function which takes > 16 parameters. Ouch, that's a lot of parameters. Might it be better to create a structure to encapsulate all of those drawing parameters? On a more general level: is anybody maintaining a tree for patches to the viafb driver? I'm going to be doing some work here (writing a driver for the video capture engine), and there's patches sitting in Harald's tree and the OLPC tree. It seems like a central merge point might be a nice thing to have. I'd be happy to run such a tree. I'm really *not* qualified to be passing judgment on patches to the framebuffer driver at this point, though, so I'm not sure that I'm the best person for the job. jon |
From: Florian T. S. <Flo...@gm...> - 2009-09-05 19:54:36
|
viafb: hardware acceleration initialization cleanup The main motivation of this patch was to merge the three initialization functions in one and clean it up. However as some changes in other code areas where needed to do it right some small other changes were made. Changes to viafb_par: io_virt renamed as engine_mmio and moved to shared VQ_start renamed as vq_vram_addr and moved to shared VQ_end removed as it is easily recalculatable vq_vram_addr is not strictly needed but keep it to track where we allocated video memory. The memory allocated for the virtual queue was shrunk to VQ_SIZE as VQ_SIZE+CURSOR_SIZE looked like a bug to me. But to be honest I don't have the faintest idea what virtual queues are for in the graphic hardware and whether the driver needs them in any way. I only know that they aren't directly accessed by the driver and so the only potential current use would be as hardware internal buffers. For now keep them to avoid regressions and only remove the double cursor allocation. The most changes were caused by renames and the mentioned structure changes so the chance of regressions is pretty low. The meaning of viafb_accel changed slightly as previously it was changed back and forth in the code and allowed to enable the hardware acceleration by software if previously disabled. The new behaviour is that viafb_accel=0 always prevents hardware acceleration. With viafb_accel!=0 the acceleration can be freely choosen by set_var. This means viafb_accel is a diagnostic tool and if someone has to use viafb_accel=0 the driver needs to be fixed. As this is mostly a code cleanup no regressions beside the slightly change of viafb_accel is expected. Signed-off-by: Florian Tobias Schandinat <Flo...@gm...> --- accel.c | 268 ++++++++++++++++++++++++------------------------------------ accel.h | 8 +- global.c | 1 - hw.h | 1 - viafbdev.c | 80 ++++++++---------- viafbdev.h | 7 +- 6 files changed, 148 insertions(+), 217 deletions(-) diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c index 503f9d8..42ab4b4 100644 --- a/drivers/video/via/accel.c +++ b/drivers/video/via/accel.c @@ -308,9 +308,22 @@ static int hw_bitblt_2(void __iomem *engine, u8 op, u32 width, u32 height, return 0; } -void viafb_init_accel(struct viafb_shared *shared) +int viafb_init_engine(struct fb_info *info) { - switch (shared->chip_info.gfx_chip_name) { + struct viafb_par *viapar = info->par; + void __iomem *engine; + u32 vq_start_addr, vq_end_addr, vq_start_low, vq_end_low, vq_high, + vq_len, chip_name = viapar->shared->chip_info.gfx_chip_name; + + engine = ioremap_nocache(info->fix.mmio_start, info->fix.mmio_len); + viapar->shared->engine_mmio = engine; + if (!engine) { + printk(KERN_WARNING "viafb_init_accel: ioremap failed, " + "hardware acceleration disabled\n"); + return -ENOMEM; + } + + switch (chip_name) { case UNICHROME_CLE266: case UNICHROME_K400: case UNICHROME_K800: @@ -321,186 +334,115 @@ void viafb_init_accel(struct viafb_shared *shared) case UNICHROME_K8M890: case UNICHROME_P4M890: case UNICHROME_P4M900: - shared->hw_bitblt = hw_bitblt_1; + viapar->shared->hw_bitblt = hw_bitblt_1; break; case UNICHROME_VX800: - shared->hw_bitblt = hw_bitblt_2; + viapar->shared->hw_bitblt = hw_bitblt_2; break; default: - shared->hw_bitblt = NULL; + viapar->shared->hw_bitblt = NULL; } - viaparinfo->fbmem_free -= CURSOR_SIZE; - shared->cursor_vram_addr = viaparinfo->fbmem_free; - viaparinfo->fbmem_used += CURSOR_SIZE; + viapar->fbmem_free -= CURSOR_SIZE; + viapar->shared->cursor_vram_addr = viapar->fbmem_free; + viapar->fbmem_used += CURSOR_SIZE; - /* Reverse 8*1024 memory space for cursor image */ - viaparinfo->fbmem_free -= (CURSOR_SIZE + VQ_SIZE); - viaparinfo->VQ_start = viaparinfo->fbmem_free; - viaparinfo->VQ_end = viaparinfo->VQ_start + VQ_SIZE - 1; - viaparinfo->fbmem_used += (CURSOR_SIZE + VQ_SIZE); -} - -void viafb_init_2d_engine(void) -{ - u32 dwVQStartAddr, dwVQEndAddr; - u32 dwVQLen, dwVQStartL, dwVQEndL, dwVQStartEndH; + viapar->fbmem_free -= VQ_SIZE; + viapar->shared->vq_vram_addr = viapar->fbmem_free; + viapar->fbmem_used += VQ_SIZE; /* Init AGP and VQ regs */ - switch (viaparinfo->chip_info->gfx_chip_name) { + switch (chip_name) { case UNICHROME_K8M890: case UNICHROME_P4M900: - writel(0x00100000, viaparinfo->io_virt + VIA_REG_CR_TRANSET); - writel(0x680A0000, viaparinfo->io_virt + VIA_REG_CR_TRANSPACE); - writel(0x02000000, viaparinfo->io_virt + VIA_REG_CR_TRANSPACE); + writel(0x00100000, engine + VIA_REG_CR_TRANSET); + writel(0x680A0000, engine + VIA_REG_CR_TRANSPACE); + writel(0x02000000, engine + VIA_REG_CR_TRANSPACE); break; default: - writel(0x00100000, viaparinfo->io_virt + VIA_REG_TRANSET); - writel(0x00000000, viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x00333004, viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x60000000, viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x61000000, viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x62000000, viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x63000000, viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x64000000, viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x7D000000, viaparinfo->io_virt + VIA_REG_TRANSPACE); - - writel(0xFE020000, viaparinfo->io_virt + VIA_REG_TRANSET); - writel(0x00000000, viaparinfo->io_virt + VIA_REG_TRANSPACE); + writel(0x00100000, engine + VIA_REG_TRANSET); + writel(0x00000000, engine + VIA_REG_TRANSPACE); + writel(0x00333004, engine + VIA_REG_TRANSPACE); + writel(0x60000000, engine + VIA_REG_TRANSPACE); + writel(0x61000000, engine + VIA_REG_TRANSPACE); + writel(0x62000000, engine + VIA_REG_TRANSPACE); + writel(0x63000000, engine + VIA_REG_TRANSPACE); + writel(0x64000000, engine + VIA_REG_TRANSPACE); + writel(0x7D000000, engine + VIA_REG_TRANSPACE); + + writel(0xFE020000, engine + VIA_REG_TRANSET); + writel(0x00000000, engine + VIA_REG_TRANSPACE); break; } - if (viaparinfo->VQ_start != 0) { - /* Enable VQ */ - dwVQStartAddr = viaparinfo->VQ_start; - dwVQEndAddr = viaparinfo->VQ_end; - - dwVQStartL = 0x50000000 | (dwVQStartAddr & 0xFFFFFF); - dwVQEndL = 0x51000000 | (dwVQEndAddr & 0xFFFFFF); - dwVQStartEndH = 0x52000000 | - ((dwVQStartAddr & 0xFF000000) >> 24) | - ((dwVQEndAddr & 0xFF000000) >> 16); - dwVQLen = 0x53000000 | (VQ_SIZE >> 3); - switch (viaparinfo->chip_info->gfx_chip_name) { - case UNICHROME_K8M890: - case UNICHROME_P4M900: - dwVQStartL |= 0x20000000; - dwVQEndL |= 0x20000000; - dwVQStartEndH |= 0x20000000; - dwVQLen |= 0x20000000; - break; - default: - break; - } - switch (viaparinfo->chip_info->gfx_chip_name) { - case UNICHROME_K8M890: - case UNICHROME_P4M900: - writel(0x00100000, - viaparinfo->io_virt + VIA_REG_CR_TRANSET); - writel(dwVQStartEndH, - viaparinfo->io_virt + VIA_REG_CR_TRANSPACE); - writel(dwVQStartL, - viaparinfo->io_virt + VIA_REG_CR_TRANSPACE); - writel(dwVQEndL, - viaparinfo->io_virt + VIA_REG_CR_TRANSPACE); - writel(dwVQLen, - viaparinfo->io_virt + VIA_REG_CR_TRANSPACE); - writel(0x74301001, - viaparinfo->io_virt + VIA_REG_CR_TRANSPACE); - writel(0x00000000, - viaparinfo->io_virt + VIA_REG_CR_TRANSPACE); - break; - default: - writel(0x00FE0000, - viaparinfo->io_virt + VIA_REG_TRANSET); - writel(0x080003FE, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x0A00027C, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x0B000260, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x0C000274, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x0D000264, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x0E000000, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x0F000020, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x1000027E, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x110002FE, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x200F0060, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - - writel(0x00000006, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x40008C0F, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x44000000, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x45080C04, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x46800408, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - - writel(dwVQStartEndH, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(dwVQStartL, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(dwVQEndL, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(dwVQLen, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - break; - } - } else { - /* Disable VQ */ - switch (viaparinfo->chip_info->gfx_chip_name) { - case UNICHROME_K8M890: - case UNICHROME_P4M900: - writel(0x00100000, - viaparinfo->io_virt + VIA_REG_CR_TRANSET); - writel(0x74301000, - viaparinfo->io_virt + VIA_REG_CR_TRANSPACE); - break; - default: - writel(0x00FE0000, - viaparinfo->io_virt + VIA_REG_TRANSET); - writel(0x00000004, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x40008C0F, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x44000000, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x45080C04, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - writel(0x46800408, - viaparinfo->io_virt + VIA_REG_TRANSPACE); - break; - } + /* Enable VQ */ + vq_start_addr = viapar->shared->vq_vram_addr; + vq_end_addr = viapar->shared->vq_vram_addr + VQ_SIZE - 1; + + vq_start_low = 0x50000000 | (vq_start_addr & 0xFFFFFF); + vq_end_low = 0x51000000 | (vq_end_addr & 0xFFFFFF); + vq_high = 0x52000000 | ((vq_start_addr & 0xFF000000) >> 24) | + ((vq_end_addr & 0xFF000000) >> 16); + vq_len = 0x53000000 | (VQ_SIZE >> 3); + + switch (chip_name) { + case UNICHROME_K8M890: + case UNICHROME_P4M900: + vq_start_low |= 0x20000000; + vq_end_low |= 0x20000000; + vq_high |= 0x20000000; + vq_len |= 0x20000000; + + writel(0x00100000, engine + VIA_REG_CR_TRANSET); + writel(vq_high, engine + VIA_REG_CR_TRANSPACE); + writel(vq_start_low, engine + VIA_REG_CR_TRANSPACE); + writel(vq_end_low, engine + VIA_REG_CR_TRANSPACE); + writel(vq_len, engine + VIA_REG_CR_TRANSPACE); + writel(0x74301001, engine + VIA_REG_CR_TRANSPACE); + writel(0x00000000, engine + VIA_REG_CR_TRANSPACE); + break; + default: + writel(0x00FE0000, engine + VIA_REG_TRANSET); + writel(0x080003FE, engine + VIA_REG_TRANSPACE); + writel(0x0A00027C, engine + VIA_REG_TRANSPACE); + writel(0x0B000260, engine + VIA_REG_TRANSPACE); + writel(0x0C000274, engine + VIA_REG_TRANSPACE); + writel(0x0D000264, engine + VIA_REG_TRANSPACE); + writel(0x0E000000, engine + VIA_REG_TRANSPACE); + writel(0x0F000020, engine + VIA_REG_TRANSPACE); + writel(0x1000027E, engine + VIA_REG_TRANSPACE); + writel(0x110002FE, engine + VIA_REG_TRANSPACE); + writel(0x200F0060, engine + VIA_REG_TRANSPACE); + + writel(0x00000006, engine + VIA_REG_TRANSPACE); + writel(0x40008C0F, engine + VIA_REG_TRANSPACE); + writel(0x44000000, engine + VIA_REG_TRANSPACE); + writel(0x45080C04, engine + VIA_REG_TRANSPACE); + writel(0x46800408, engine + VIA_REG_TRANSPACE); + + writel(vq_high, engine + VIA_REG_TRANSPACE); + writel(vq_start_low, engine + VIA_REG_TRANSPACE); + writel(vq_end_low, engine + VIA_REG_TRANSPACE); + writel(vq_len, engine + VIA_REG_TRANSPACE); + break; } -} -void viafb_hw_cursor_init(void) -{ /* Set Cursor Image Base Address */ - writel(viaparinfo->shared->cursor_vram_addr, - viaparinfo->io_virt + VIA_REG_CURSOR_MODE); - writel(0x0, viaparinfo->io_virt + VIA_REG_CURSOR_POS); - writel(0x0, viaparinfo->io_virt + VIA_REG_CURSOR_ORG); - writel(0x0, viaparinfo->io_virt + VIA_REG_CURSOR_BG); - writel(0x0, viaparinfo->io_virt + VIA_REG_CURSOR_FG); + writel(viapar->shared->cursor_vram_addr, engine + VIA_REG_CURSOR_MODE); + writel(0x0, engine + VIA_REG_CURSOR_POS); + writel(0x0, engine + VIA_REG_CURSOR_ORG); + writel(0x0, engine + VIA_REG_CURSOR_BG); + writel(0x0, engine + VIA_REG_CURSOR_FG); + return 0; } void viafb_show_hw_cursor(struct fb_info *info, int Status) { - u32 temp; - u32 iga_path = ((struct viafb_par *)(info->par))->iga_path; + struct viafb_par *viapar = info->par; + u32 temp, iga_path = viapar->iga_path; - temp = readl(viaparinfo->io_virt + VIA_REG_CURSOR_MODE); + temp = readl(viapar->shared->engine_mmio + VIA_REG_CURSOR_MODE); switch (Status) { case HW_Cursor_ON: temp |= 0x1; @@ -517,25 +459,27 @@ void viafb_show_hw_cursor(struct fb_info *info, int Status) default: temp &= 0x7FFFFFFF; } - writel(temp, viaparinfo->io_virt + VIA_REG_CURSOR_MODE); + writel(temp, viapar->shared->engine_mmio + VIA_REG_CURSOR_MODE); } -int viafb_wait_engine_idle(void) +void viafb_wait_engine_idle(struct fb_info *info) { + struct viafb_par *viapar = info->par; int loop = 0; - while (!(readl(viaparinfo->io_virt + VIA_REG_STATUS) & + while (!(readl(viapar->shared->engine_mmio + VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY) && (loop < MAXLOOP)) { loop++; cpu_relax(); } - while ((readl(viaparinfo->io_virt + VIA_REG_STATUS) & + while ((readl(viapar->shared->engine_mmio + VIA_REG_STATUS) & (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY | VIA_3D_ENG_BUSY)) && (loop < MAXLOOP)) { loop++; cpu_relax(); } - return loop >= MAXLOOP; + if (loop >= MAXLOOP) + printk(KERN_ERR "viafb_wait_engine_idle: not syncing\n"); } diff --git a/drivers/video/via/accel.h b/drivers/video/via/accel.h index 4d93eba..615c84a 100644 --- a/drivers/video/via/accel.h +++ b/drivers/video/via/accel.h @@ -163,10 +163,8 @@ #define VIA_BITBLT_MONO 2 #define VIA_BITBLT_FILL 3 -void viafb_init_accel(struct viafb_shared *shared); -void viafb_init_2d_engine(void); -void viafb_hw_cursor_init(void); -void viafb_show_hw_cursor(struct fb_info *info, int Status); int -viafb_wait_engine_idle(void); void viafb_set_2d_color_depth(int bpp); +int viafb_init_engine(struct fb_info *info); +void viafb_show_hw_cursor(struct fb_info *info, int Status); +void viafb_wait_engine_idle(struct fb_info *info); #endif /* __ACCEL_H__ */ diff --git a/drivers/video/via/global.c b/drivers/video/via/global.c index 33e7c45..b675cdb 100644 --- a/drivers/video/via/global.c +++ b/drivers/video/via/global.c @@ -32,7 +32,6 @@ int viafb_lcd_dsp_method = LCD_EXPANDSION; int viafb_lcd_mode = LCD_OPENLDI; int viafb_bpp = 32; int viafb_bpp1 = 32; -int viafb_accel = 1; int viafb_CRT_ON = 1; int viafb_DVI_ON; int viafb_LCD_ON ; diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h index 817033d..7302b40 100644 --- a/drivers/video/via/hw.h +++ b/drivers/video/via/hw.h @@ -855,7 +855,6 @@ extern int viafb_dual_fb; extern int viafb_LCD2_ON; extern int viafb_LCD_ON; extern int viafb_DVI_ON; -extern int viafb_accel; extern int viafb_hotplug; void viafb_write_reg_mask(u8 index, int io_port, u8 data, u8 mask); diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 3d639df..34e49b8 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c @@ -32,6 +32,8 @@ static u32 pseudo_pal[17]; static char *viafb_mode = "640x480"; static char *viafb_mode1 = "640x480"; +static int viafb_accel = 1; + /* Added for specifying active devices.*/ char *viafb_active_dev = ""; @@ -139,6 +141,9 @@ static int viafb_check_var(struct fb_var_screeninfo *var, /* Adjust var according to our driver's own table */ viafb_fill_var_timing_info(var, viafb_refresh, vmode_index); + if (info->var.accel_flags & FB_ACCELF_TEXT && + !ppar->shared->engine_mmio) + info->var.accel_flags = 0; return 0; } @@ -176,8 +181,10 @@ static int viafb_set_par(struct fb_info *info) viafb_update_fix(info); viafb_bpp = info->var.bits_per_pixel; - /* Update viafb_accel, it is necessary to our 2D accelerate */ - viafb_accel = info->var.accel_flags; + if (info->var.accel_flags & FB_ACCELF_TEXT) + info->flags &= ~FBINFO_HWACCEL_DISABLED; + else + info->flags |= FBINFO_HWACCEL_DISABLED; } return 0; @@ -763,10 +770,11 @@ static void viafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { struct viafb_par *viapar = info->par; + struct viafb_shared *shared = viapar->shared; u32 fg_color; u8 rop; - if (!viapar->shared->hw_bitblt) { + if (info->flags & FBINFO_HWACCEL_DISABLED || !shared->hw_bitblt) { cfb_fillrect(info, rect); return; } @@ -785,7 +793,7 @@ static void viafb_fillrect(struct fb_info *info, rop = 0xF0; DEBUG_MSG(KERN_DEBUG "viafb 2D engine: fillrect\n"); - if (viapar->shared->hw_bitblt(viapar->io_virt, VIA_BITBLT_FILL, + if (shared->hw_bitblt(shared->engine_mmio, VIA_BITBLT_FILL, rect->width, rect->height, info->var.bits_per_pixel, viapar->vram_addr, info->fix.line_length, rect->dx, rect->dy, NULL, 0, 0, 0, 0, fg_color, 0, rop)) @@ -796,8 +804,9 @@ static void viafb_copyarea(struct fb_info *info, const struct fb_copyarea *area) { struct viafb_par *viapar = info->par; + struct viafb_shared *shared = viapar->shared; - if (!viapar->shared->hw_bitblt) { + if (info->flags & FBINFO_HWACCEL_DISABLED || !shared->hw_bitblt) { cfb_copyarea(info, area); return; } @@ -806,7 +815,7 @@ static void viafb_copyarea(struct fb_info *info, return; DEBUG_MSG(KERN_DEBUG "viafb 2D engine: copyarea\n"); - if (viapar->shared->hw_bitblt(viapar->io_virt, VIA_BITBLT_COLOR, + if (shared->hw_bitblt(shared->engine_mmio, VIA_BITBLT_COLOR, area->width, area->height, info->var.bits_per_pixel, viapar->vram_addr, info->fix.line_length, area->dx, area->dy, NULL, viapar->vram_addr, info->fix.line_length, @@ -818,10 +827,11 @@ static void viafb_imageblit(struct fb_info *info, const struct fb_image *image) { struct viafb_par *viapar = info->par; + struct viafb_shared *shared = viapar->shared; u32 fg_color = 0, bg_color = 0; u8 op; - if (!viapar->shared->hw_bitblt || + if (info->flags & FBINFO_HWACCEL_DISABLED || !shared->hw_bitblt || (image->depth != 1 && image->depth != viapar->depth)) { cfb_imageblit(info, image); return; @@ -842,7 +852,7 @@ static void viafb_imageblit(struct fb_info *info, op = VIA_BITBLT_COLOR; DEBUG_MSG(KERN_DEBUG "viafb 2D engine: imageblit\n"); - if (viapar->shared->hw_bitblt(viapar->io_virt, op, + if (shared->hw_bitblt(shared->engine_mmio, op, image->width, image->height, info->var.bits_per_pixel, viapar->vram_addr, info->fix.line_length, image->dx, image->dy, (u32 *)image->data, 0, 0, 0, 0, fg_color, bg_color, 0)) @@ -852,6 +862,7 @@ static void viafb_imageblit(struct fb_info *info, static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) { struct viafb_par *viapar = info->par; + void __iomem *engine = viapar->shared->engine_mmio; u32 temp, xx, yy, bg_color = 0, fg_color = 0, chip_name = viapar->shared->chip_info.gfx_chip_name; int i, j = 0, cur_size = 64; @@ -866,7 +877,7 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) if (cursor->set & FB_CUR_SETHOT) { temp = (cursor->hot.x << 16) + cursor->hot.y; - writel(temp, viapar->io_virt + VIA_REG_CURSOR_ORG); + writel(temp, engine + VIA_REG_CURSOR_ORG); } if (cursor->set & FB_CUR_SETPOS) { @@ -874,7 +885,7 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) xx = cursor->image.dx - info->var.xoffset; temp = yy & 0xFFFF; temp |= (xx << 16); - writel(temp, viapar->io_virt + VIA_REG_CURSOR_POS); + writel(temp, engine + VIA_REG_CURSOR_POS); } if (cursor->image.width <= 32 && cursor->image.height <= 32) @@ -888,13 +899,13 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) } if (cursor->set & FB_CUR_SETSIZE) { - temp = readl(viapar->io_virt + VIA_REG_CURSOR_MODE); + temp = readl(engine + VIA_REG_CURSOR_MODE); if (cur_size == 32) temp |= 0x2; else temp &= ~0x2; - writel(temp, viapar->io_virt + VIA_REG_CURSOR_MODE); + writel(temp, engine + VIA_REG_CURSOR_MODE); } if (cursor->set & FB_CUR_SETCMAP) { @@ -921,8 +932,8 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) ((info->cmap.blue[bg_color] & 0xFF00) >> 8); } - writel(bg_color, viapar->io_virt + VIA_REG_CURSOR_BG); - writel(fg_color, viapar->io_virt + VIA_REG_CURSOR_FG); + writel(bg_color, engine + VIA_REG_CURSOR_BG); + writel(fg_color, engine + VIA_REG_CURSOR_FG); } if (cursor->set & FB_CUR_SETSHAPE) { @@ -995,8 +1006,8 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) static int viafb_sync(struct fb_info *info) { - if (viafb_accel) - viafb_wait_engine_idle(); + if (!(info->flags & FBINFO_HWACCEL_DISABLED)) + viafb_wait_engine_idle(info); return 0; } @@ -1826,22 +1837,18 @@ static int __devinit via_pci_probe(void) viafb_get_mmio_info(&viafbinfo->fix.mmio_start, &viafbinfo->fix.mmio_len); - viaparinfo->io_virt = ioremap_nocache(viafbinfo->fix.mmio_start, - viafbinfo->fix.mmio_len); - if (!viaparinfo->io_virt) { - printk(KERN_WARNING "ioremap failed: hardware acceleration disabled\n"); - viafb_accel = 0; - } - viafbinfo->node = 0; viafbinfo->fbops = &viafb_ops; viafbinfo->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; viafbinfo->pseudo_palette = pseudo_pal; - if (viafb_accel) { - viafb_init_accel(viaparinfo->shared); - viafb_init_2d_engine(); - viafb_hw_cursor_init(); + if (viafb_accel && !viafb_init_engine(viafbinfo)) { + viafbinfo->flags |= FBINFO_HWACCEL_COPYAREA | + FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_IMAGEBLIT; + default_var.accel_flags = FB_ACCELF_TEXT; + } else { + viafbinfo->flags |= FBINFO_HWACCEL_DISABLED; + default_var.accel_flags = 0; } if (viafb_second_size && (viafb_second_size < 8)) { @@ -1922,15 +1929,6 @@ static int __devinit via_pci_probe(void) default_var.lower_margin = 4; default_var.hsync_len = default_var.left_margin; default_var.vsync_len = 4; - default_var.accel_flags = 0; - - if (viafb_accel) { - viafbinfo->flags |= - (FBINFO_HWACCEL_COPYAREA | FBINFO_HWACCEL_FILLRECT | - FBINFO_HWACCEL_IMAGEBLIT); - default_var.accel_flags |= FB_ACCELF_TEXT; - } else - viafbinfo->flags |= FBINFO_HWACCEL_DISABLED; if (viafb_dual_fb) { viafbinfo1 = framebuffer_alloc(viafb_par_length, NULL); @@ -1953,12 +1951,6 @@ static int __devinit via_pci_probe(void) viaparinfo1->fbmem_used; viaparinfo->fbmem_free = viaparinfo->memsize; viaparinfo->fbmem_used = 0; - if (viafb_accel) { - viaparinfo1->VQ_start = viaparinfo->VQ_start - - viafb_second_offset; - viaparinfo1->VQ_end = viaparinfo->VQ_end - - viafb_second_offset; - } viaparinfo->iga_path = IGA1; viaparinfo1->iga_path = IGA2; @@ -2032,7 +2024,7 @@ static void __devexit via_pci_remove(void) if (viafb_dual_fb) unregister_framebuffer(viafbinfo1); iounmap((void *)viafbinfo->screen_base); - iounmap(viaparinfo->io_virt); + iounmap(viaparinfo->shared->engine_mmio); viafb_delete_i2c_buss(viaparinfo); @@ -2194,7 +2186,7 @@ MODULE_PARM_DESC(viafb_SAMM_ON, module_param(viafb_accel, int, 0); MODULE_PARM_DESC(viafb_accel, - "Set 2D Hardware Acceleration.(Default = OFF)"); + "Set 2D Hardware Acceleration: 0 = OFF, 1 = ON (default)"); module_param(viafb_active_dev, charp, 0); MODULE_PARM_DESC(viafb_active_dev, "Specify active devices."); diff --git a/drivers/video/via/viafbdev.h b/drivers/video/via/viafbdev.h index 159619b..0c94d24 100644 --- a/drivers/video/via/viafbdev.h +++ b/drivers/video/via/viafbdev.h @@ -51,7 +51,9 @@ struct viafb_shared { struct chip_information chip_info; /* hardware acceleration stuff */ + void __iomem *engine_mmio; u32 cursor_vram_addr; + u32 vq_vram_addr; /* virtual queue address in video ram */ int (*hw_bitblt)(void __iomem *engine, u8 op, u32 width, u32 height, u8 dst_bpp, u32 dst_addr, u32 dst_pitch, u32 dst_x, u32 dst_y, u32 *src_mem, u32 src_addr, u32 src_pitch, u32 src_x, u32 src_y, @@ -61,13 +63,11 @@ struct viafb_shared { struct viafb_par { u8 depth; u32 vram_addr; - void __iomem *io_virt; /*iospace virtual memory address */ + unsigned int fbmem; /*framebuffer physical memory address */ unsigned int memsize; /*size of fbmem */ u32 fbmem_free; /* Free FB memory */ u32 fbmem_used; /* Use FB memory size */ - u32 VQ_start; /* Virtual Queue Start Address */ - u32 VQ_end; /* Virtual Queue End Address */ u32 iga_path; struct viafb_shared *shared; @@ -90,7 +90,6 @@ extern int viafb_dual_fb; extern int viafb_LCD2_ON; extern int viafb_LCD_ON; extern int viafb_DVI_ON; -extern int viafb_accel; extern int viafb_hotplug; extern int viafb_memsize; -- 1.6.3.2 |
From: Florian T. S. <Flo...@gm...> - 2009-09-05 19:54:34
|
viafb: improve pitch handling This patch splits the pitch handling up and replaces the calculation from virtual xres and bpp with fix.line_length which already contains the pitch and does not add any constrains for the virtual resolution. It also adds a bit to the second pitch which the documentation mentions but which was ignored by the driver. Although it is a bit unclear what the right pitch for some LCD modes is this patch should have no negative runtime impact. Signed-off-by: Florian Tobias Schandinat <Flo...@gm...> --- hw.c | 73 +++++++++++++++++++----------------------------------------- hw.h | 33 ++------------------------ lcd.c | 10 +------- viafbdev.c | 3 -- viafbdev.h | 1 - 5 files changed, 27 insertions(+), 93 deletions(-) diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c index 86050e7..4910561 100644 --- a/drivers/video/via/hw.c +++ b/drivers/video/via/hw.c @@ -36,13 +36,6 @@ static const struct pci_device_id_info pciidlist[] = { {0, 0, 0} }; -struct offset offset_reg = { - /* IGA1 Offset Register */ - {IGA1_OFFSET_REG_NUM, {{CR13, 0, 7}, {CR35, 5, 7} } }, - /* IGA2 Offset Register */ - {IGA2_OFFSET_REG_NUM, {{CR66, 0, 7}, {CR67, 0, 1} } } -}; - static struct pll_map pll_value[] = { {CLK_25_175M, CLE266_PLL_25_175M, K800_PLL_25_175M, CX700_25_175M}, {CLK_29_581M, CLE266_PLL_29_581M, K800_PLL_29_581M, CX700_29_581M}, @@ -648,6 +641,26 @@ void viafb_set_secondary_address(u32 addr) viafb_write_reg_mask(CRA3, VIACR, (addr >> 26) & 0x07, 0x07); } +void viafb_set_primary_pitch(u32 pitch) +{ + DEBUG_MSG(KERN_DEBUG "viafb_set_primary_pitch(0x%08X)\n", pitch); + /* spec does not say that first adapter skips 3 bits but old + * code did it and seems to be reasonable in analogy to 2nd adapter + */ + pitch = pitch >> 3; + viafb_write_reg(0x13, VIACR, pitch & 0xFF); + viafb_write_reg_mask(0x35, VIACR, (pitch >> (8 - 5)) & 0xE0, 0xE0); +} + +void viafb_set_secondary_pitch(u32 pitch) +{ + DEBUG_MSG(KERN_DEBUG "viafb_set_secondary_pitch(0x%08X)\n", pitch); + pitch = pitch >> 3; + viafb_write_reg(0x66, VIACR, pitch & 0xFF); + viafb_write_reg_mask(0x67, VIACR, (pitch >> 8) & 0x03, 0x03); + viafb_write_reg_mask(0x71, VIACR, (pitch >> (10 - 7)) & 0x80, 0x80); +} + void viafb_set_output_path(int device, int set_iga, int output_interface) { switch (device) { @@ -1076,30 +1089,6 @@ void viafb_write_regx(struct io_reg RegTable[], int ItemNum) } } -void viafb_load_offset_reg(int h_addr, int bpp_byte, int set_iga) -{ - int reg_value; - int viafb_load_reg_num; - struct io_register *reg; - - switch (set_iga) { - case IGA1_IGA2: - case IGA1: - reg_value = IGA1_OFFSET_FORMULA(h_addr, bpp_byte); - viafb_load_reg_num = offset_reg.iga1_offset_reg.reg_num; - reg = offset_reg.iga1_offset_reg.reg; - viafb_load_reg(reg_value, viafb_load_reg_num, reg, VIACR); - if (set_iga == IGA1) - break; - case IGA2: - reg_value = IGA2_OFFSET_FORMULA(h_addr, bpp_byte); - viafb_load_reg_num = offset_reg.iga2_offset_reg.reg_num; - reg = offset_reg.iga2_offset_reg.reg; - viafb_load_reg(reg_value, viafb_load_reg_num, reg, VIACR); - break; - } -} - void viafb_load_fetch_count_reg(int h_addr, int bpp_byte, int set_iga) { int reg_value; @@ -1869,7 +1858,6 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table, load_fix_bit_crtc_reg(); viafb_lock_crt(); viafb_write_reg_mask(CR17, VIACR, 0x80, BIT7); - viafb_load_offset_reg(h_addr, bpp_byte, set_iga); viafb_load_fetch_count_reg(h_addr, bpp_byte, set_iga); /* load FIFO */ @@ -2322,6 +2310,9 @@ int viafb_setmode(int vmode_index, int hor_res, int ver_res, int video_bpp, } } + viafb_set_primary_pitch(viafbinfo->fix.line_length); + viafb_set_secondary_pitch(viafb_dual_fb ? viafbinfo1->fix.line_length + : viafbinfo->fix.line_length); /* Update Refresh Rate Setting */ /* Clear On Screen */ @@ -2738,24 +2729,6 @@ void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\ } } -void viafb_memory_pitch_patch(struct fb_info *info) -{ - if (info->var.xres != info->var.xres_virtual) { - viafb_load_offset_reg(info->var.xres_virtual, - info->var.bits_per_pixel >> 3, IGA1); - - if (viafb_SAMM_ON) { - viafb_load_offset_reg(viafb_second_virtual_xres, - viafb_bpp1 >> 3, - IGA2); - } else { - viafb_load_offset_reg(info->var.xres_virtual, - info->var.bits_per_pixel >> 3, IGA2); - } - - } -} - /*According var's xres, yres fill var's other timing information*/ void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh, int mode_index) diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h index cf1dfd5..817033d 100644 --- a/drivers/video/via/hw.h +++ b/drivers/video/via/hw.h @@ -147,14 +147,8 @@ is reserved, so it may have problem to set 1600x1200 on IGA2. */ /* location: {CR5F,0,4} */ #define IGA2_VER_SYNC_END_REG_NUM 1 -/* Define Offset and Fetch Count Register*/ +/* Define Fetch Count Register*/ -/* location: {CR13,0,7},{CR35,5,7} */ -#define IGA1_OFFSET_REG_NUM 2 -/* 8 bytes alignment. */ -#define IGA1_OFFSER_ALIGN_BYTE 8 -/* x: H resolution, y: color depth */ -#define IGA1_OFFSET_FORMULA(x, y) ((x*y)/IGA1_OFFSER_ALIGN_BYTE) /* location: {SR1C,0,7},{SR1D,0,1} */ #define IGA1_FETCH_COUNT_REG_NUM 2 /* 16 bytes alignment. */ @@ -164,11 +158,6 @@ is reserved, so it may have problem to set 1600x1200 on IGA2. */ #define IGA1_FETCH_COUNT_FORMULA(x, y) \ (((x*y)/IGA1_FETCH_COUNT_ALIGN_BYTE) + IGA1_FETCH_COUNT_PATCH_VALUE) -/* location: {CR66,0,7},{CR67,0,1} */ -#define IGA2_OFFSET_REG_NUM 2 -#define IGA2_OFFSET_ALIGN_BYTE 8 -/* x: H resolution, y: color depth */ -#define IGA2_OFFSET_FORMULA(x, y) ((x*y)/IGA2_OFFSET_ALIGN_BYTE) /* location: {CR65,0,7},{CR67,2,3} */ #define IGA2_FETCH_COUNT_REG_NUM 2 #define IGA2_FETCH_COUNT_ALIGN_BYTE 16 @@ -617,23 +606,6 @@ struct iga2_ver_sync_end { struct io_register reg[IGA2_VER_SYNC_END_REG_NUM]; }; -/* IGA1 Offset Register */ -struct iga1_offset { - int reg_num; - struct io_register reg[IGA1_OFFSET_REG_NUM]; -}; - -/* IGA2 Offset Register */ -struct iga2_offset { - int reg_num; - struct io_register reg[IGA2_OFFSET_REG_NUM]; -}; - -struct offset { - struct iga1_offset iga1_offset_reg; - struct iga2_offset iga2_offset_reg; -}; - /* IGA1 Fetch Count Register */ struct iga1_fetch_count { int reg_num; @@ -904,7 +876,6 @@ void viafb_write_reg(u8 index, u16 io_port, u8 data); u8 viafb_read_reg(int io_port, u8 index); void viafb_lock_crt(void); void viafb_unlock_crt(void); -void viafb_load_offset_reg(int h_addr, int bpp_byte, int set_iga); void viafb_load_fetch_count_reg(int h_addr, int bpp_byte, int set_iga); void viafb_write_regx(struct io_reg RegTable[], int ItemNum); struct VideoModeTable *viafb_get_modetbl_pointer(int Index); @@ -928,6 +899,8 @@ void viafb_get_mmio_info(unsigned long *mmio_base, u32 *mmio_len); void viafb_set_iga_path(void); void viafb_set_primary_address(u32 addr); void viafb_set_secondary_address(u32 addr); +void viafb_set_primary_pitch(u32 pitch); +void viafb_set_secondary_pitch(u32 pitch); void viafb_get_fb_info(unsigned int *fb_base, unsigned int *fb_len); #endif /* __HW_H__ */ diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c index 144d34b..e3e597f 100644 --- a/drivers/video/via/lcd.c +++ b/drivers/video/via/lcd.c @@ -952,13 +952,10 @@ void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table, int video_index = plvds_setting_info->lcd_panel_size; int set_iga = plvds_setting_info->iga_path; int mode_bpp = plvds_setting_info->bpp; - int viafb_load_reg_num = 0; - int reg_value = 0; int set_hres, set_vres; int panel_hres, panel_vres; u32 pll_D_N; int offset; - struct io_register *reg = NULL; struct display_timing mode_crt_reg, panel_crt_reg; struct crt_mode_table *panel_crt_table = NULL; struct VideoModeTable *vmode_tbl = NULL; @@ -1038,16 +1035,11 @@ void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table, } /* Offset for simultaneous */ - reg_value = offset; - viafb_load_reg_num = offset_reg.iga2_offset_reg.reg_num; - reg = offset_reg.iga2_offset_reg.reg; - viafb_load_reg(reg_value, viafb_load_reg_num, reg, VIACR); + viafb_set_secondary_pitch(offset << 3); DEBUG_MSG(KERN_INFO "viafb_load_reg!!\n"); viafb_load_fetch_count_reg(set_hres, 4, IGA2); /* Fetch count for simultaneous */ } else { /* SAMM */ - /* Offset for IGA2 only */ - viafb_load_offset_reg(set_hres, mode_bpp / 8, set_iga); /* Fetch count for IGA2 only */ viafb_load_fetch_count_reg(set_hres, mode_bpp / 8, set_iga); diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 9a2d833..3d639df 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c @@ -174,9 +174,6 @@ static int viafb_set_par(struct fb_info *info) info->var.bits_per_pixel, vmode_index1, viafb_second_xres, viafb_second_yres, viafb_bpp1); - /*We should set memory offset according virtual_x */ - /*Fix me:put this function into viafb_setmode */ - viafb_memory_pitch_patch(info); viafb_update_fix(info); viafb_bpp = info->var.bits_per_pixel; /* Update viafb_accel, it is necessary to our 2D accelerate */ diff --git a/drivers/video/via/viafbdev.h b/drivers/video/via/viafbdev.h index ca39ec1..159619b 100644 --- a/drivers/video/via/viafbdev.h +++ b/drivers/video/via/viafbdev.h @@ -97,7 +97,6 @@ extern int viafb_memsize; extern int strict_strtoul(const char *cp, unsigned int base, unsigned long *res); -void viafb_memory_pitch_patch(struct fb_info *info); void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh, int mode_index); int viafb_get_mode_index(int hres, int vres); -- 1.6.3.2 |
From: Florian T. S. <Flo...@gm...> - 2009-09-05 19:54:30
|
viafb: cleanup viafb_cursor This patch cleans the hardware cursor handling up. The most notable change is that it no longer buffers the values in viacursor but uses the ones in cursor instead as they are guaranteed to be always valid. Furthermore it uses local instead global variables where possible, moves the cursor variable in shared as only one hardware cursor is supported and returns an error if memory allocation fails. Last but not least it fixes a too small buffer (as u32 has only 4 and not 32 bytes) but this did not produce any known problems. This is mostly a code cleanup, no negative runtime changes are expected. Signed-off-by: Florian Tobias Schandinat <Flo...@gm...> --- accel.c | 4 +- global.c | 1 - global.h | 1 - viafbdev.c | 186 +++++++++++++++++++++--------------------------------------- viafbdev.h | 2 +- 5 files changed, 68 insertions(+), 126 deletions(-) diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c index 8ac0251..503f9d8 100644 --- a/drivers/video/via/accel.c +++ b/drivers/video/via/accel.c @@ -331,7 +331,7 @@ void viafb_init_accel(struct viafb_shared *shared) } viaparinfo->fbmem_free -= CURSOR_SIZE; - viaparinfo->cursor_start = viaparinfo->fbmem_free; + shared->cursor_vram_addr = viaparinfo->fbmem_free; viaparinfo->fbmem_used += CURSOR_SIZE; /* Reverse 8*1024 memory space for cursor image */ @@ -487,7 +487,7 @@ void viafb_init_2d_engine(void) void viafb_hw_cursor_init(void) { /* Set Cursor Image Base Address */ - writel(viaparinfo->cursor_start, + writel(viaparinfo->shared->cursor_vram_addr, viaparinfo->io_virt + VIA_REG_CURSOR_MODE); writel(0x0, viaparinfo->io_virt + VIA_REG_CURSOR_POS); writel(0x0, viaparinfo->io_virt + VIA_REG_CURSOR_ORG); diff --git a/drivers/video/via/global.c b/drivers/video/via/global.c index 1096fd5..33e7c45 100644 --- a/drivers/video/via/global.c +++ b/drivers/video/via/global.c @@ -51,7 +51,6 @@ unsigned int viafb_second_yres = 480; unsigned int viafb_second_virtual_xres; unsigned int viafb_second_virtual_yres; int viafb_lcd_panel_id = LCD_PANEL_ID_MAXIMUM + 1; -struct fb_cursor viacursor; struct fb_info *viafbinfo; struct fb_info *viafbinfo1; struct viafb_par *viaparinfo; diff --git a/drivers/video/via/global.h b/drivers/video/via/global.h index 11382e5..d69d0ca 100644 --- a/drivers/video/via/global.h +++ b/drivers/video/via/global.h @@ -77,7 +77,6 @@ extern int viafb_hotplug_Yres; extern int viafb_hotplug_bpp; extern int viafb_hotplug_refresh; extern int viafb_primary_dev; -extern struct fb_cursor viacursor; extern unsigned int viafb_second_xres; extern unsigned int viafb_second_yres; diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 66921de..9a2d833 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c @@ -24,7 +24,6 @@ #include "global.h" -static int MAX_CURS = 32; static struct fb_var_screeninfo default_var; static char *viafb_name = "Via"; static u32 pseudo_pal[17]; @@ -855,150 +854,99 @@ static void viafb_imageblit(struct fb_info *info, static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) { - u32 temp, xx, yy, bg_col = 0, fg_col = 0; - int i, j = 0; - static int hw_cursor; - struct viafb_par *p_viafb_par; - - if (viafb_accel) - hw_cursor = 1; - - if (!viafb_accel) { - if (hw_cursor) { - viafb_show_hw_cursor(info, HW_Cursor_OFF); - hw_cursor = 0; - } - return -ENODEV; - } + struct viafb_par *viapar = info->par; + u32 temp, xx, yy, bg_color = 0, fg_color = 0, + chip_name = viapar->shared->chip_info.gfx_chip_name; + int i, j = 0, cur_size = 64; - if ((((struct viafb_par *)(info->par))->iga_path == IGA2) - && (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266)) + if (info->flags & FBINFO_HWACCEL_DISABLED || info != viafbinfo) return -ENODEV; - /* When duoview and using lcd , use soft cursor */ - if (viafb_LCD_ON || (!viafb_SAMM_ON && - viafb_LCD2_ON + viafb_DVI_ON + viafb_CRT_ON == 2)) + if (chip_name == UNICHROME_CLE266 && viapar->iga_path == IGA2) return -ENODEV; viafb_show_hw_cursor(info, HW_Cursor_OFF); - viacursor = *cursor; if (cursor->set & FB_CUR_SETHOT) { - viacursor.hot = cursor->hot; - temp = ((viacursor.hot.x) << 16) + viacursor.hot.y; - writel(temp, viaparinfo->io_virt + VIA_REG_CURSOR_ORG); + temp = (cursor->hot.x << 16) + cursor->hot.y; + writel(temp, viapar->io_virt + VIA_REG_CURSOR_ORG); } if (cursor->set & FB_CUR_SETPOS) { - viacursor.image.dx = cursor->image.dx; - viacursor.image.dy = cursor->image.dy; yy = cursor->image.dy - info->var.yoffset; xx = cursor->image.dx - info->var.xoffset; temp = yy & 0xFFFF; temp |= (xx << 16); - writel(temp, viaparinfo->io_virt + VIA_REG_CURSOR_POS); + writel(temp, viapar->io_virt + VIA_REG_CURSOR_POS); } - if (cursor->set & FB_CUR_SETSIZE) { - temp = readl(viaparinfo->io_virt + VIA_REG_CURSOR_MODE); + if (cursor->image.width <= 32 && cursor->image.height <= 32) + cur_size = 32; + else if (cursor->image.width <= 64 && cursor->image.height <= 64) + cur_size = 64; + else { + printk(KERN_WARNING "viafb_cursor: The cursor is too large " + "%dx%d", cursor->image.width, cursor->image.height); + return -ENXIO; + } - if ((cursor->image.width <= 32) - && (cursor->image.height <= 32)) { - MAX_CURS = 32; + if (cursor->set & FB_CUR_SETSIZE) { + temp = readl(viapar->io_virt + VIA_REG_CURSOR_MODE); + if (cur_size == 32) temp |= 0x2; - } else if ((cursor->image.width <= 64) - && (cursor->image.height <= 64)) { - MAX_CURS = 64; - temp &= 0xFFFFFFFD; - } else { - DEBUG_MSG(KERN_INFO - "The cursor image is biger than 64x64 bits...\n"); - return -ENXIO; - } - writel(temp, viaparinfo->io_virt + VIA_REG_CURSOR_MODE); + else + temp &= ~0x2; - viacursor.image.height = cursor->image.height; - viacursor.image.width = cursor->image.width; + writel(temp, viapar->io_virt + VIA_REG_CURSOR_MODE); } if (cursor->set & FB_CUR_SETCMAP) { - viacursor.image.fg_color = cursor->image.fg_color; - viacursor.image.bg_color = cursor->image.bg_color; - - switch (info->var.bits_per_pixel) { - case 8: - case 16: - case 32: - bg_col = - (0xFF << 24) | - (((info->cmap.red)[viacursor.image.bg_color] & - 0xFF00) << 8) | - ((info->cmap.green)[viacursor.image.bg_color] & - 0xFF00) | - (((info->cmap.blue)[viacursor.image.bg_color] & - 0xFF00) >> 8); - fg_col = - (0xFF << 24) | - (((info->cmap.red)[viacursor.image.fg_color] & - 0xFF00) << 8) | - ((info->cmap.green)[viacursor.image.fg_color] & - 0xFF00) | - (((info->cmap.blue)[viacursor.image.fg_color] & - 0xFF00) >> 8); - break; - default: - return 0; - } - - /* This is indeed a patch for VT3324/VT3353 */ - if (!info->par) - return 0; - p_viafb_par = (struct viafb_par *)info->par; - - if ((p_viafb_par->chip_info->gfx_chip_name == - UNICHROME_CX700) || - ((p_viafb_par->chip_info->gfx_chip_name == - UNICHROME_VX800))) { - bg_col = - (((info->cmap.red)[viacursor.image.bg_color] & - 0xFFC0) << 14) | - (((info->cmap.green)[viacursor.image.bg_color] & - 0xFFC0) << 4) | - (((info->cmap.blue)[viacursor.image.bg_color] & - 0xFFC0) >> 6); - fg_col = - (((info->cmap.red)[viacursor.image.fg_color] & - 0xFFC0) << 14) | - (((info->cmap.green)[viacursor.image.fg_color] & - 0xFFC0) << 4) | - (((info->cmap.blue)[viacursor.image.fg_color] & - 0xFFC0) >> 6); + fg_color = cursor->image.fg_color; + bg_color = cursor->image.bg_color; + if (chip_name == UNICHROME_CX700 || + chip_name == UNICHROME_VX800) { + fg_color = + ((info->cmap.red[fg_color] & 0xFFC0) << 14) | + ((info->cmap.green[fg_color] & 0xFFC0) << 4) | + ((info->cmap.blue[fg_color] & 0xFFC0) >> 6); + bg_color = + ((info->cmap.red[bg_color] & 0xFFC0) << 14) | + ((info->cmap.green[bg_color] & 0xFFC0) << 4) | + ((info->cmap.blue[bg_color] & 0xFFC0) >> 6); + } else { + fg_color = + ((info->cmap.red[fg_color] & 0xFF00) << 8) | + (info->cmap.green[fg_color] & 0xFF00) | + ((info->cmap.blue[fg_color] & 0xFF00) >> 8); + bg_color = + ((info->cmap.red[bg_color] & 0xFF00) << 8) | + (info->cmap.green[bg_color] & 0xFF00) | + ((info->cmap.blue[bg_color] & 0xFF00) >> 8); } - writel(bg_col, viaparinfo->io_virt + VIA_REG_CURSOR_BG); - writel(fg_col, viaparinfo->io_virt + VIA_REG_CURSOR_FG); + writel(bg_color, viapar->io_virt + VIA_REG_CURSOR_BG); + writel(fg_color, viapar->io_virt + VIA_REG_CURSOR_FG); } if (cursor->set & FB_CUR_SETSHAPE) { struct { - u8 data[CURSOR_SIZE / 8]; - u32 bak[CURSOR_SIZE / 32]; + u8 data[CURSOR_SIZE]; + u32 bak[CURSOR_SIZE / 4]; } *cr_data = kzalloc(sizeof(*cr_data), GFP_ATOMIC); - int size = - ((viacursor.image.width + 7) >> 3) * - viacursor.image.height; + int size = ((cursor->image.width + 7) >> 3) * + cursor->image.height; - if (cr_data == NULL) - goto out; + if (!cr_data) + return -ENOMEM; - if (MAX_CURS == 32) { - for (i = 0; i < (CURSOR_SIZE / 32); i++) { + if (cur_size == 32) { + for (i = 0; i < (CURSOR_SIZE / 4); i++) { cr_data->bak[i] = 0x0; cr_data->bak[i + 1] = 0xFFFFFFFF; i += 1; } - } else if (MAX_CURS == 64) { - for (i = 0; i < (CURSOR_SIZE / 32); i++) { + } else { + for (i = 0; i < (CURSOR_SIZE / 4); i++) { cr_data->bak[i] = 0x0; cr_data->bak[i + 1] = 0x0; cr_data->bak[i + 2] = 0xFFFFFFFF; @@ -1007,27 +955,27 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) } } - switch (viacursor.rop) { + switch (cursor->rop) { case ROP_XOR: for (i = 0; i < size; i++) - cr_data->data[i] = viacursor.mask[i]; + cr_data->data[i] = cursor->mask[i]; break; case ROP_COPY: for (i = 0; i < size; i++) - cr_data->data[i] = viacursor.mask[i]; + cr_data->data[i] = cursor->mask[i]; break; default: break; } - if (MAX_CURS == 32) { + if (cur_size == 32) { for (i = 0; i < size; i++) { cr_data->bak[j] = (u32) cr_data->data[i]; cr_data->bak[j + 1] = ~cr_data->bak[j]; j += 2; } - } else if (MAX_CURS == 64) { + } else { for (i = 0; i < size; i++) { cr_data->bak[j] = (u32) cr_data->data[i]; cr_data->bak[j + 1] = 0x0; @@ -1037,14 +985,12 @@ static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) } } - memcpy(viafbinfo->screen_base + - ((struct viafb_par *)(info->par))->cursor_start, - cr_data->bak, CURSOR_SIZE); -out: + memcpy_toio(viafbinfo->screen_base + viapar->shared-> + cursor_vram_addr, cr_data->bak, CURSOR_SIZE); kfree(cr_data); } - if (viacursor.enable) + if (cursor->enable) viafb_show_hw_cursor(info, HW_Cursor_ON); return 0; @@ -2011,8 +1957,6 @@ static int __devinit via_pci_probe(void) viaparinfo->fbmem_free = viaparinfo->memsize; viaparinfo->fbmem_used = 0; if (viafb_accel) { - viaparinfo1->cursor_start = - viaparinfo->cursor_start - viafb_second_offset; viaparinfo1->VQ_start = viaparinfo->VQ_start - viafb_second_offset; viaparinfo1->VQ_end = viaparinfo->VQ_end - diff --git a/drivers/video/via/viafbdev.h b/drivers/video/via/viafbdev.h index beb4703..ca39ec1 100644 --- a/drivers/video/via/viafbdev.h +++ b/drivers/video/via/viafbdev.h @@ -51,6 +51,7 @@ struct viafb_shared { struct chip_information chip_info; /* hardware acceleration stuff */ + u32 cursor_vram_addr; int (*hw_bitblt)(void __iomem *engine, u8 op, u32 width, u32 height, u8 dst_bpp, u32 dst_addr, u32 dst_pitch, u32 dst_x, u32 dst_y, u32 *src_mem, u32 src_addr, u32 src_pitch, u32 src_x, u32 src_y, @@ -65,7 +66,6 @@ struct viafb_par { unsigned int memsize; /*size of fbmem */ u32 fbmem_free; /* Free FB memory */ u32 fbmem_used; /* Use FB memory size */ - u32 cursor_start; /* Cursor Start Address */ u32 VQ_start; /* Virtual Queue Start Address */ u32 VQ_end; /* Virtual Queue End Address */ u32 iga_path; -- 1.6.3.2 |
From: Florian T. S. <Flo...@gm...> - 2009-09-05 14:21:11
|
ak...@li... schrieb: > The patch titled > viafb: switch to seq_file > has been added to the -mm tree. Its filename is > viafb-switch-to-seq_file.patch > ------------------------------------------------------ > Subject: viafb: switch to seq_file > From: Alexey Dobriyan <ado...@gm...> > > Signed-off-by: Alexey Dobriyan <ado...@gm...> > Cc: Florian Tobias Schandinat <Flo...@gm...> > Cc: Scott Fang <Sco...@vi...> > Cc: Joseph Chan <Jos...@vi...> > Signed-off-by: Andrew Morton <ak...@li...> Acked-by: Florian Tobias Schandinat <Flo...@gm...> This patch doesn't change anything viafb specific and as far as I can say it does all proc and seq_file things right. Also it does not conflict with or depend on any of my patches. Thanks, Florian Tobias Schandinat > --- > > drivers/video/via/viafbdev.c | 179 ++++++++++++++++++++------------- > 1 file changed, 110 insertions(+), 69 deletions(-) > > diff -puN drivers/video/via/viafbdev.c~viafb-switch-to-seq_file drivers/video/via/viafbdev.c > --- a/drivers/video/via/viafbdev.c~viafb-switch-to-seq_file > +++ a/drivers/video/via/viafbdev.c > @@ -20,6 +20,7 @@ > */ > > #include <linux/module.h> > +#include <linux/seq_file.h> > #define _MASTER_FILE > > #include "global.h" > @@ -1479,10 +1480,8 @@ static void parse_dvi_port(void) > * DVP1Driving, DFPHigh, DFPLow CR96, SR2A[5], SR1B[1], SR2A[4], SR1E[2], > * CR9B, SR65, CR97, CR99 > */ > -static int viafb_dvp0_proc_read(char *buf, char **start, off_t offset, > -int count, int *eof, void *data) > +static int viafb_dvp0_proc_show(struct seq_file *m, void *v) > { > - int len = 0; > u8 dvp0_data_dri = 0, dvp0_clk_dri = 0, dvp0 = 0; > dvp0_data_dri = > (viafb_read_reg(VIASR, SR2A) & BIT5) >> 4 | > @@ -1491,13 +1490,17 @@ int count, int *eof, void *data) > (viafb_read_reg(VIASR, SR2A) & BIT4) >> 3 | > (viafb_read_reg(VIASR, SR1E) & BIT2) >> 2; > dvp0 = viafb_read_reg(VIACR, CR96) & 0x0f; > - len += > - sprintf(buf + len, "%x %x %x\n", dvp0, dvp0_data_dri, dvp0_clk_dri); > - *eof = 1; /*Inform kernel end of data */ > - return len; > + seq_printf(m, "%x %x %x\n", dvp0, dvp0_data_dri, dvp0_clk_dri); > + return 0; > } > -static int viafb_dvp0_proc_write(struct file *file, > - const char __user *buffer, unsigned long count, void *data) > + > +static int viafb_dvp0_proc_open(struct inode *inode, struct file *file) > +{ > + return single_open(file, viafb_dvp0_proc_show, NULL); > +} > + > +static ssize_t viafb_dvp0_proc_write(struct file *file, > + const char __user *buffer, size_t count, loff_t *pos) > { > char buf[20], *value, *pbuf; > u8 reg_val = 0; > @@ -1541,21 +1544,33 @@ static int viafb_dvp0_proc_write(struct > } > return count; > } > -static int viafb_dvp1_proc_read(char *buf, char **start, off_t offset, > - int count, int *eof, void *data) > + > +static const struct file_operations viafb_dvp0_proc_fops = { > + .owner = THIS_MODULE, > + .open = viafb_dvp0_proc_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release = single_release, > + .write = viafb_dvp0_proc_write, > +}; > + > +static int viafb_dvp1_proc_show(struct seq_file *m, void *v) > { > - int len = 0; > u8 dvp1 = 0, dvp1_data_dri = 0, dvp1_clk_dri = 0; > dvp1 = viafb_read_reg(VIACR, CR9B) & 0x0f; > dvp1_data_dri = (viafb_read_reg(VIASR, SR65) & 0x0c) >> 2; > dvp1_clk_dri = viafb_read_reg(VIASR, SR65) & 0x03; > - len += > - sprintf(buf + len, "%x %x %x\n", dvp1, dvp1_data_dri, dvp1_clk_dri); > - *eof = 1; /*Inform kernel end of data */ > - return len; > + seq_printf(m, "%x %x %x\n", dvp1, dvp1_data_dri, dvp1_clk_dri); > + return 0; > +} > + > +static int viafb_dvp1_proc_open(struct inode *inode, struct file *file) > +{ > + return single_open(file, viafb_dvp1_proc_show, NULL); > } > -static int viafb_dvp1_proc_write(struct file *file, > - const char __user *buffer, unsigned long count, void *data) > + > +static ssize_t viafb_dvp1_proc_write(struct file *file, > + const char __user *buffer, size_t count, loff_t *pos) > { > char buf[20], *value, *pbuf; > u8 reg_val = 0; > @@ -1594,18 +1609,30 @@ static int viafb_dvp1_proc_write(struct > return count; > } > > -static int viafb_dfph_proc_read(char *buf, char **start, off_t offset, > - int count, int *eof, void *data) > +static const struct file_operations viafb_dvp1_proc_fops = { > + .owner = THIS_MODULE, > + .open = viafb_dvp1_proc_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release = single_release, > + .write = viafb_dvp1_proc_write, > +}; > + > +static int viafb_dfph_proc_show(struct seq_file *m, void *v) > { > - int len = 0; > u8 dfp_high = 0; > dfp_high = viafb_read_reg(VIACR, CR97) & 0x0f; > - len += sprintf(buf + len, "%x\n", dfp_high); > - *eof = 1; /*Inform kernel end of data */ > - return len; > + seq_printf(m, "%x\n", dfp_high); > + return 0; > } > -static int viafb_dfph_proc_write(struct file *file, > - const char __user *buffer, unsigned long count, void *data) > + > +static int viafb_dfph_proc_open(struct inode *inode, struct file *file) > +{ > + return single_open(file, viafb_dfph_proc_show, NULL); > +} > + > +static ssize_t viafb_dfph_proc_write(struct file *file, > + const char __user *buffer, size_t count, loff_t *pos) > { > char buf[20]; > u8 reg_val = 0; > @@ -1620,18 +1647,31 @@ static int viafb_dfph_proc_write(struct > viafb_write_reg_mask(CR97, VIACR, reg_val, 0x0f); > return count; > } > -static int viafb_dfpl_proc_read(char *buf, char **start, off_t offset, > - int count, int *eof, void *data) > + > +static const struct file_operations viafb_dfph_proc_fops = { > + .owner = THIS_MODULE, > + .open = viafb_dfph_proc_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release = single_release, > + .write = viafb_dfph_proc_write, > +}; > + > +static int viafb_dfpl_proc_show(struct seq_file *m, void *v) > { > - int len = 0; > u8 dfp_low = 0; > dfp_low = viafb_read_reg(VIACR, CR99) & 0x0f; > - len += sprintf(buf + len, "%x\n", dfp_low); > - *eof = 1; /*Inform kernel end of data */ > - return len; > + seq_printf(m, "%x\n", dfp_low); > + return 0; > +} > + > +static int viafb_dfpl_proc_open(struct inode *inode, struct file *file) > +{ > + return single_open(file, viafb_dfpl_proc_show, NULL); > } > -static int viafb_dfpl_proc_write(struct file *file, > - const char __user *buffer, unsigned long count, void *data) > + > +static ssize_t viafb_dfpl_proc_write(struct file *file, > + const char __user *buffer, size_t count, loff_t *pos) > { > char buf[20]; > u8 reg_val = 0; > @@ -1646,10 +1686,18 @@ static int viafb_dfpl_proc_write(struct > viafb_write_reg_mask(CR99, VIACR, reg_val, 0x0f); > return count; > } > -static int viafb_vt1636_proc_read(char *buf, char **start, > - off_t offset, int count, int *eof, void *data) > + > +static const struct file_operations viafb_dfpl_proc_fops = { > + .owner = THIS_MODULE, > + .open = viafb_dfpl_proc_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release = single_release, > + .write = viafb_dfpl_proc_write, > +}; > + > +static int viafb_vt1636_proc_show(struct seq_file *m, void *v) > { > - int len = 0; > u8 vt1636_08 = 0, vt1636_09 = 0; > switch (viaparinfo->chip_info->lvds_chip_info.lvds_chip_name) { > case VT1636_LVDS: > @@ -1659,7 +1707,7 @@ static int viafb_vt1636_proc_read(char * > vt1636_09 = > viafb_gpio_i2c_read_lvds(viaparinfo->lvds_setting_info, > &viaparinfo->chip_info->lvds_chip_info, 0x09) & 0x1f; > - len += sprintf(buf + len, "%x %x\n", vt1636_08, vt1636_09); > + seq_printf(m, "%x %x\n", vt1636_08, vt1636_09); > break; > default: > break; > @@ -1672,16 +1720,21 @@ static int viafb_vt1636_proc_read(char * > vt1636_09 = > viafb_gpio_i2c_read_lvds(viaparinfo->lvds_setting_info2, > &viaparinfo->chip_info->lvds_chip_info2, 0x09) & 0x1f; > - len += sprintf(buf + len, " %x %x\n", vt1636_08, vt1636_09); > + seq_printf(m, " %x %x\n", vt1636_08, vt1636_09); > break; > default: > break; > } > - *eof = 1; /*Inform kernel end of data */ > - return len; > + return 0; > +} > + > +static int viafb_vt1636_proc_open(struct inode *inode, struct file *file) > +{ > + return single_open(file, viafb_vt1636_proc_show, NULL); > } > -static int viafb_vt1636_proc_write(struct file *file, > - const char __user *buffer, unsigned long count, void *data) > + > +static ssize_t viafb_vt1636_proc_write(struct file *file, > + const char __user *buffer, size_t count, loff_t *pos) > { > char buf[30], *value, *pbuf; > struct IODATA reg_val; > @@ -1770,39 +1823,27 @@ static int viafb_vt1636_proc_write(struc > return count; > } > > +static const struct file_operations viafb_vt1636_proc_fops = { > + .owner = THIS_MODULE, > + .open = viafb_vt1636_proc_open, > + .read = seq_read, > + .llseek = seq_lseek, > + .release = single_release, > + .write = viafb_vt1636_proc_write, > +}; > + > static void viafb_init_proc(struct proc_dir_entry **viafb_entry) > { > - struct proc_dir_entry *entry; > *viafb_entry = proc_mkdir("viafb", NULL); > if (viafb_entry) { > - entry = create_proc_entry("dvp0", 0, *viafb_entry); > - if (entry) { > - entry->read_proc = viafb_dvp0_proc_read; > - entry->write_proc = viafb_dvp0_proc_write; > - } > - entry = create_proc_entry("dvp1", 0, *viafb_entry); > - if (entry) { > - entry->read_proc = viafb_dvp1_proc_read; > - entry->write_proc = viafb_dvp1_proc_write; > - } > - entry = create_proc_entry("dfph", 0, *viafb_entry); > - if (entry) { > - entry->read_proc = viafb_dfph_proc_read; > - entry->write_proc = viafb_dfph_proc_write; > - } > - entry = create_proc_entry("dfpl", 0, *viafb_entry); > - if (entry) { > - entry->read_proc = viafb_dfpl_proc_read; > - entry->write_proc = viafb_dfpl_proc_write; > - } > + proc_create("dvp0", 0, *viafb_entry, &viafb_dvp0_proc_fops); > + proc_create("dvp1", 0, *viafb_entry, &viafb_dvp1_proc_fops); > + proc_create("dfph", 0, *viafb_entry, &viafb_dfph_proc_fops); > + proc_create("dfpl", 0, *viafb_entry, &viafb_dfpl_proc_fops); > if (VT1636_LVDS == viaparinfo->chip_info->lvds_chip_info. > lvds_chip_name || VT1636_LVDS == > viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name) { > - entry = create_proc_entry("vt1636", 0, *viafb_entry); > - if (entry) { > - entry->read_proc = viafb_vt1636_proc_read; > - entry->write_proc = viafb_vt1636_proc_write; > - } > + proc_create("vt1636", 0, *viafb_entry, &viafb_vt1636_proc_fops); > } > > } |
From: Geert U. <ge...@li...> - 2009-09-05 06:42:21
|
On 2009-09-03, Randy Dunlap <rd...@xe...> wrote: > On Thu, 3 Sep 2009 08:06:00 +0200 Geert Uytterhoeven wrote: > >> On 2009-08-31, Randy Dunlap <rd...@xe...> wrote: >> > On Mon, 31 Aug 2009 21:52:03 +0200 Florian Tobias Schandinat wrote: >> >> Randy Dunlap schrieb: >> >> > On Mon, 31 Aug 2009 21:26:44 +0200 Florian Tobias Schandinat wrote: >> >> >> Randy Dunlap schrieb: >> >> >>> On Mon, 31 Aug 2009 13:55:22 -0400 Chris Jones wrote: >> >> >>>> I posted on linux-fbdev-users list re: an issued with dpms a >> >> >>>> couple >> >> >>>> of >> >> >>>> days ago and I was wondering if anyone is still subscribed to this >> >> >>>> list >> >> >>>> apart from myself. >> >> >>> Hi, >> >> >>> The -users mailing list has had 12 postings in 2009. >> >> >>> I'd say it's mostly dead. Just use this (fbdev-devel) list. >> >> >> After having a look at the archive I agree. >> >> >> If this is the consensus wouldn't it be a good idea to shut the >> >> >> users >> >> >> list down and point to the devel mailing list to avoid misleading >> >> >> anyone? (perhaps -announce too?) >> >> > >> >> > Yes, that's a good idea. Is it possible? >> >> > It used to be nearly impossible to kill off a mailing list at >> >> > sourceforge.net... >> >> >> >> I think it is. >> >> I was subscribed to a mailing list of this project: >> >> http://sourceforge.net/projects/rt2400/ >> >> until they decided to move away from sourceforge and in this process >> >> shut the mailing lists they had there down. So it seems possible >> >> although I don't know the technical details how to do this. >> > >> > OK, thanks. >> > >> > Hi Otto, >> > Do you still maintain linux-fbdev.sf.net ? >> > >> > If so: the fbdev-users mailing list is no longer being used. >> > Please try to shut it down and don't mention it on the FBDEV project web >> > pages. >> > Also, the fbdev-devel mailing list should be added to the project web >> > pages >> > (lin...@li...). >> >> My plan was to merge both lists and move them to vger. That would also >> relieve me from >> having to moderate postings from non-subscribers. >> >> Unfortunately that hasn't happened yet due to my lack of time... > > Other than asking davem for a new vger mailing list, what do you > plan to do? Did you plan to auto-subscribe people to the new list? No auto-subscribe. But setting up an auto-responder on sf.net. > I would just announce on the old lists that they will be dead > in one week's time -- don't try to subscribe people to the new list, > let them do that. OK, I'll ask davem. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... 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 |
From: Eric W. <ewi...@mi...> - 2009-09-05 02:09:52
|
On Sep 4, 2009, at 9:34 AM, Peter Barada wrote: > On Fri, 2009-09-04 at 12:14 +0530, Gadiyar, Anand wrote: >>> From: Sergio Aguirre <saa...@ti...> >>> >>> This fixes the issue in which mm_lock mutex was attempted to be >>> used without initializing previously. >>> >>> Signed-off-by: Sergio Aguirre <saa...@ti...> >> >> Tested-by: Anand Gadiyar <ga...@ti...> >> >> This patch on top of current linux-omap kernel allows me to >> boot with the default SDP defconfig on a 3430 SDP. > > Tested-by: Peter Barada <pe...@lo...> > > This patch on top of current linux-omap kernel allows me to boot with > the LCD enabled on LogicPD's OMAP boards. > Tested-by: Eric Witcher <ewi...@mi...> Ditto for omap3_beagle_defconfig on Beagle Rev. C2 >>> --- >>> drivers/video/omap/omapfb_main.c | 20 +++++++++++--------- >>> 1 files changed, 11 insertions(+), 9 deletions(-) >>> >>> diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/ >>> omapfb_main.c >>> index 125e605..60f9482 100644 >>> --- a/drivers/video/omap/omapfb_main.c >>> +++ b/drivers/video/omap/omapfb_main.c >>> @@ -1503,12 +1503,21 @@ static int fbinfo_init(struct >>> omapfb_device *fbdev, struct fb_info *info) >>> var->rotate = def_rotate; >>> var->bits_per_pixel = fbdev->panel->bpp; >>> >>> + r = register_framebuffer(info); >>> + if (r != 0) { >>> + dev_err(fbdev->dev, >>> + "registering framebuffer failed\n"); >>> + return r; >>> + } >>> + >>> set_fb_var(info, var); >>> set_fb_fix(info); >>> >>> r = fb_alloc_cmap(&info->cmap, 16, 0); >>> - if (r != 0) >>> + if (r != 0) { >>> dev_err(fbdev->dev, "unable to allocate color map memory\n"); >>> + unregister_framebuffer(info); >>> + } >>> >>> return r; >>> } >>> @@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct >>> platform_device *pdev, >>> init_state++; >>> >>> vram = 0; >>> - for (i = 0; i < fbdev->mem_desc.region_cnt; i++) { >>> - r = register_framebuffer(fbdev->fb_info[i]); >>> - if (r != 0) { >>> - dev_err(fbdev->dev, >>> - "registering framebuffer %d failed\n", i); >>> - goto cleanup; >>> - } >>> + for (i = 0; i < fbdev->mem_desc.region_cnt; i++) >>> vram += fbdev->mem_desc.region[i].size; >>> - } >>> >>> fbdev->state = OMAPFB_ACTIVE; >>> >>> -- >>> 1.6.3.2 >>> >>> -- >> To unsubscribe from this list: send the line "unsubscribe linux- >> omap" in >> the body of a message to maj...@vg... >> More majordomo info at http://vger.kernel.org/majordomo-info.html > -- > Peter Barada <pe...@lo...> > Logic Product Development, Inc. > -- > To unsubscribe from this list: send the line "unsubscribe linux- > omap" in > the body of a message to maj...@vg... > More majordomo info at http://vger.kernel.org/majordomo-info.html |
From: Florian T. S. <Flo...@gm...> - 2009-09-04 20:41:29
|
viafb: 2D engine rewrite This patch is a completly rewritten 2D engine. The engine is no longer in a default state but reinitialized every time to allow usage for both framebuffers regardless of their settings. The whole engine handling is concentrated in a big function which takes 16 parameters. Although the number of parameters is worryingly it is good to have a single funtion to deal with this stuff as it allows to easily support different engines and avoids some code duplication. On the way support for the new 2D engine in VX800 was added. As the difference is only in the register addresses it could be done in a way with less code duplication but it is probably better to duplicate the code as this way is easier to walk if VIA ever decides to release a new engine which changes anything the driver touches. The engine support for VX800 gives a notable boost in speed. There are no known regressions but as this patch changes paths I do neither have the hardware nor documentation to check and has the possibility to put the system in a critical state heavy testing is appreciated. Signed-off-by: Florian Tobias Schandinat <Flo...@gm...> --- v2: - fix copyarea with overlapping areas - add raster operation code conversion and checking --- accel.c | 363 +++++++++++++++++++++++++++++++++++++++++++++++++++--------- accel.h | 7 +- viafbdev.c | 226 ++++++++++--------------------------- viafbdev.h | 8 ++ 4 files changed, 385 insertions(+), 219 deletions(-) diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c index b3e7e82..8ac0251 100644 --- a/drivers/video/via/accel.c +++ b/drivers/video/via/accel.c @@ -20,8 +20,316 @@ */ #include "global.h" -void viafb_init_accel(void) +static int hw_bitblt_1(void __iomem *engine, u8 op, u32 width, u32 height, + u8 dst_bpp, u32 dst_addr, u32 dst_pitch, u32 dst_x, u32 dst_y, + u32 *src_mem, u32 src_addr, u32 src_pitch, u32 src_x, u32 src_y, + u32 fg_color, u32 bg_color, u8 fill_rop) { + u32 ge_cmd = 0, tmp, i; + + if (!op || op > 3) { + printk(KERN_WARNING "hw_bitblt_1: Invalid operation: %d\n", op); + return -EINVAL; + } + + if (op != VIA_BITBLT_FILL && !src_mem && src_addr == dst_addr) { + if (src_x < dst_x) { + ge_cmd |= 0x00008000; + src_x += width - 1; + dst_x += width - 1; + } + if (src_y < dst_y) { + ge_cmd |= 0x00004000; + src_y += height - 1; + dst_y += height - 1; + } + } + + if (op == VIA_BITBLT_FILL) { + switch (fill_rop) { + case 0x00: /* blackness */ + case 0x5A: /* pattern inversion */ + case 0xF0: /* pattern copy */ + case 0xFF: /* whiteness */ + break; + default: + printk(KERN_WARNING "hw_bitblt_1: Invalid fill rop: " + "%u\n", fill_rop); + return -EINVAL; + } + } + + switch (dst_bpp) { + case 8: + tmp = 0x00000000; + break; + case 16: + tmp = 0x00000100; + break; + case 32: + tmp = 0x00000300; + break; + default: + printk(KERN_WARNING "hw_bitblt_1: Unsupported bpp %d\n", + dst_bpp); + return -EINVAL; + } + writel(tmp, engine + 0x04); + + if (op != VIA_BITBLT_FILL) { + if (src_x & (op == VIA_BITBLT_MONO ? 0xFFFF8000 : 0xFFFFF000) + || src_y & 0xFFFFF000) { + printk(KERN_WARNING "hw_bitblt_1: Unsupported source " + "x/y %d %d\n", src_x, src_y); + return -EINVAL; + } + tmp = src_x | (src_y << 16); + writel(tmp, engine + 0x08); + } + + if (dst_x & 0xFFFFF000 || dst_y & 0xFFFFF000) { + printk(KERN_WARNING "hw_bitblt_1: Unsupported destination x/y " + "%d %d\n", dst_x, dst_y); + return -EINVAL; + } + tmp = dst_x | (dst_y << 16); + writel(tmp, engine + 0x0C); + + if ((width - 1) & 0xFFFFF000 || (height - 1) & 0xFFFFF000) { + printk(KERN_WARNING "hw_bitblt_1: Unsupported width/height " + "%d %d\n", width, height); + return -EINVAL; + } + tmp = (width - 1) | ((height - 1) << 16); + writel(tmp, engine + 0x10); + + if (op != VIA_BITBLT_COLOR) + writel(fg_color, engine + 0x18); + + if (op == VIA_BITBLT_MONO) + writel(bg_color, engine + 0x1C); + + if (op != VIA_BITBLT_FILL) { + tmp = src_mem ? 0 : src_addr; + if (dst_addr & 0xE0000007) { + printk(KERN_WARNING "hw_bitblt_1: Unsupported source " + "address %X\n", tmp); + return -EINVAL; + } + tmp >>= 3; + writel(tmp, engine + 0x30); + } + + if (dst_addr & 0xE0000007) { + printk(KERN_WARNING "hw_bitblt_1: Unsupported destination " + "address %X\n", dst_addr); + return -EINVAL; + } + tmp = dst_addr >> 3; + writel(tmp, engine + 0x34); + + if (op == VIA_BITBLT_FILL) + tmp = 0; + else + tmp = src_pitch; + if (tmp & 0xFFFFC007 || dst_pitch & 0xFFFFC007) { + printk(KERN_WARNING "hw_bitblt_1: Unsupported pitch %X %X\n", + tmp, dst_pitch); + return -EINVAL; + } + tmp = (tmp >> 3) | (dst_pitch << (16 - 3)); + writel(tmp, engine + 0x38); + + if (op == VIA_BITBLT_FILL) + ge_cmd |= fill_rop << 24 | 0x00002000 | 0x00000001; + else { + ge_cmd |= 0xCC000000; /* ROP=SRCCOPY */ + if (src_mem) + ge_cmd |= 0x00000040; + if (op == VIA_BITBLT_MONO) + ge_cmd |= 0x00000002 | 0x00000100 | 0x00020000; + else + ge_cmd |= 0x00000001; + } + writel(ge_cmd, engine); + + if (op == VIA_BITBLT_FILL || !src_mem) + return 0; + + tmp = (width * height * (op == VIA_BITBLT_MONO ? 1 : (dst_bpp >> 3)) + + 3) >> 2; + + for (i = 0; i < tmp; i++) + writel(src_mem[i], engine + VIA_MMIO_BLTBASE); + + return 0; +} + +static int hw_bitblt_2(void __iomem *engine, u8 op, u32 width, u32 height, + u8 dst_bpp, u32 dst_addr, u32 dst_pitch, u32 dst_x, u32 dst_y, + u32 *src_mem, u32 src_addr, u32 src_pitch, u32 src_x, u32 src_y, + u32 fg_color, u32 bg_color, u8 fill_rop) +{ + u32 ge_cmd = 0, tmp, i; + + if (!op || op > 3) { + printk(KERN_WARNING "hw_bitblt_2: Invalid operation: %d\n", op); + return -EINVAL; + } + + if (op != VIA_BITBLT_FILL && !src_mem && src_addr == dst_addr) { + if (src_x < dst_x) { + ge_cmd |= 0x00008000; + src_x += width - 1; + dst_x += width - 1; + } + if (src_y < dst_y) { + ge_cmd |= 0x00004000; + src_y += height - 1; + dst_y += height - 1; + } + } + + if (op == VIA_BITBLT_FILL) { + switch (fill_rop) { + case 0x00: /* blackness */ + case 0x5A: /* pattern inversion */ + case 0xF0: /* pattern copy */ + case 0xFF: /* whiteness */ + break; + default: + printk(KERN_WARNING "hw_bitblt_2: Invalid fill rop: " + "%u\n", fill_rop); + return -EINVAL; + } + } + + switch (dst_bpp) { + case 8: + tmp = 0x00000000; + break; + case 16: + tmp = 0x00000100; + break; + case 32: + tmp = 0x00000300; + break; + default: + printk(KERN_WARNING "hw_bitblt_2: Unsupported bpp %d\n", + dst_bpp); + return -EINVAL; + } + writel(tmp, engine + 0x04); + + if (op == VIA_BITBLT_FILL) + tmp = 0; + else + tmp = src_pitch; + if (tmp & 0xFFFFC007 || dst_pitch & 0xFFFFC007) { + printk(KERN_WARNING "hw_bitblt_2: Unsupported pitch %X %X\n", + tmp, dst_pitch); + return -EINVAL; + } + tmp = (tmp >> 3) | (dst_pitch << (16 - 3)); + writel(tmp, engine + 0x08); + + if ((width - 1) & 0xFFFFF000 || (height - 1) & 0xFFFFF000) { + printk(KERN_WARNING "hw_bitblt_2: Unsupported width/height " + "%d %d\n", width, height); + return -EINVAL; + } + tmp = (width - 1) | ((height - 1) << 16); + writel(tmp, engine + 0x0C); + + if (dst_x & 0xFFFFF000 || dst_y & 0xFFFFF000) { + printk(KERN_WARNING "hw_bitblt_2: Unsupported destination x/y " + "%d %d\n", dst_x, dst_y); + return -EINVAL; + } + tmp = dst_x | (dst_y << 16); + writel(tmp, engine + 0x10); + + if (dst_addr & 0xE0000007) { + printk(KERN_WARNING "hw_bitblt_2: Unsupported destination " + "address %X\n", dst_addr); + return -EINVAL; + } + tmp = dst_addr >> 3; + writel(tmp, engine + 0x14); + + if (op != VIA_BITBLT_FILL) { + if (src_x & (op == VIA_BITBLT_MONO ? 0xFFFF8000 : 0xFFFFF000) + || src_y & 0xFFFFF000) { + printk(KERN_WARNING "hw_bitblt_2: Unsupported source " + "x/y %d %d\n", src_x, src_y); + return -EINVAL; + } + tmp = src_x | (src_y << 16); + writel(tmp, engine + 0x18); + + tmp = src_mem ? 0 : src_addr; + if (dst_addr & 0xE0000007) { + printk(KERN_WARNING "hw_bitblt_2: Unsupported source " + "address %X\n", tmp); + return -EINVAL; + } + tmp >>= 3; + writel(tmp, engine + 0x1C); + } + + if (op != VIA_BITBLT_COLOR) + writel(fg_color, engine + 0x4C); + + if (op == VIA_BITBLT_MONO) + writel(bg_color, engine + 0x50); + + if (op == VIA_BITBLT_FILL) + ge_cmd |= fill_rop << 24 | 0x00002000 | 0x00000001; + else { + ge_cmd |= 0xCC000000; /* ROP=SRCCOPY */ + if (src_mem) + ge_cmd |= 0x00000040; + if (op == VIA_BITBLT_MONO) + ge_cmd |= 0x00000002 | 0x00000100 | 0x00020000; + else + ge_cmd |= 0x00000001; + } + writel(ge_cmd, engine); + + if (op == VIA_BITBLT_FILL || !src_mem) + return 0; + + tmp = (width * height * (op == VIA_BITBLT_MONO ? 1 : (dst_bpp >> 3)) + + 3) >> 2; + + for (i = 0; i < tmp; i++) + writel(src_mem[i], engine + VIA_MMIO_BLTBASE); + + return 0; +} + +void viafb_init_accel(struct viafb_shared *shared) +{ + switch (shared->chip_info.gfx_chip_name) { + case UNICHROME_CLE266: + case UNICHROME_K400: + case UNICHROME_K800: + case UNICHROME_PM800: + case UNICHROME_CN700: + case UNICHROME_CX700: + case UNICHROME_CN750: + case UNICHROME_K8M890: + case UNICHROME_P4M890: + case UNICHROME_P4M900: + shared->hw_bitblt = hw_bitblt_1; + break; + case UNICHROME_VX800: + shared->hw_bitblt = hw_bitblt_2; + break; + default: + shared->hw_bitblt = NULL; + } + viaparinfo->fbmem_free -= CURSOR_SIZE; viaparinfo->cursor_start = viaparinfo->fbmem_free; viaparinfo->fbmem_used += CURSOR_SIZE; @@ -30,30 +338,14 @@ void viafb_init_accel(void) viaparinfo->fbmem_free -= (CURSOR_SIZE + VQ_SIZE); viaparinfo->VQ_start = viaparinfo->fbmem_free; viaparinfo->VQ_end = viaparinfo->VQ_start + VQ_SIZE - 1; - viaparinfo->fbmem_used += (CURSOR_SIZE + VQ_SIZE); } + viaparinfo->fbmem_used += (CURSOR_SIZE + VQ_SIZE); +} void viafb_init_2d_engine(void) { - u32 dwVQStartAddr, dwVQEndAddr, linesize; + u32 dwVQStartAddr, dwVQEndAddr; u32 dwVQLen, dwVQStartL, dwVQEndL, dwVQStartEndH; - /* init 2D engine regs to reset 2D engine */ - writel(0x0, viaparinfo->io_virt + VIA_REG_GEMODE); - writel(0x0, viaparinfo->io_virt + VIA_REG_SRCPOS); - writel(0x0, viaparinfo->io_virt + VIA_REG_DSTPOS); - writel(0x0, viaparinfo->io_virt + VIA_REG_DIMENSION); - writel(0x0, viaparinfo->io_virt + VIA_REG_PATADDR); - writel(0x0, viaparinfo->io_virt + VIA_REG_FGCOLOR); - writel(0x0, viaparinfo->io_virt + VIA_REG_BGCOLOR); - writel(0x0, viaparinfo->io_virt + VIA_REG_CLIPTL); - writel(0x0, viaparinfo->io_virt + VIA_REG_CLIPBR); - writel(0x0, viaparinfo->io_virt + VIA_REG_OFFSET); - writel(0x0, viaparinfo->io_virt + VIA_REG_KEYCONTROL); - writel(0x0, viaparinfo->io_virt + VIA_REG_SRCBASE); - writel(0x0, viaparinfo->io_virt + VIA_REG_DSTBASE); - writel(0x0, viaparinfo->io_virt + VIA_REG_PITCH); - writel(0x0, viaparinfo->io_virt + VIA_REG_MONOPAT1); - /* Init AGP and VQ regs */ switch (viaparinfo->chip_info->gfx_chip_name) { case UNICHROME_K8M890: @@ -190,37 +482,6 @@ void viafb_init_2d_engine(void) break; } } - - viafb_set_2d_color_depth(viafbinfo->var.bits_per_pixel); - - writel(0x0, viaparinfo->io_virt + VIA_REG_SRCBASE); - writel(0x0, viaparinfo->io_virt + VIA_REG_DSTBASE); - - linesize = viafbinfo->var.xres * viafbinfo->var.bits_per_pixel >> 3; - writel(VIA_PITCH_ENABLE | (linesize >> 3) | ((linesize >> 3) << 16), - viaparinfo->io_virt + VIA_REG_PITCH); -} - -void viafb_set_2d_color_depth(int bpp) -{ - u32 dwGEMode; - - dwGEMode = readl(viaparinfo->io_virt + 0x04) & 0xFFFFFCFF; - - switch (bpp) { - case 16: - dwGEMode |= VIA_GEM_16bpp; - break; - case 32: - dwGEMode |= VIA_GEM_32bpp; - break; - default: - dwGEMode |= VIA_GEM_8bpp; - break; - } - - /* Set BPP and Pitch */ - writel(dwGEMode, viaparinfo->io_virt + VIA_REG_GEMODE); } void viafb_hw_cursor_init(void) diff --git a/drivers/video/via/accel.h b/drivers/video/via/accel.h index 29bf854..4d93eba 100644 --- a/drivers/video/via/accel.h +++ b/drivers/video/via/accel.h @@ -159,9 +159,12 @@ #define MAXLOOP 0xFFFFFF -void viafb_init_accel(void); +#define VIA_BITBLT_COLOR 1 +#define VIA_BITBLT_MONO 2 +#define VIA_BITBLT_FILL 3 + +void viafb_init_accel(struct viafb_shared *shared); void viafb_init_2d_engine(void); -void set_2d_color_depth(int); void viafb_hw_cursor_init(void); void viafb_show_hw_cursor(struct fb_info *info, int Status); int viafb_wait_engine_idle(void); void viafb_set_2d_color_depth(int bpp); diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index 4a8853a..66921de 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c @@ -95,11 +95,8 @@ static int viafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { int vmode_index, htotal, vtotal; - struct viafb_par *ppar; + struct viafb_par *ppar = info->par; u32 long_refresh; - struct viafb_par *p_viafb_par; - ppar = info->par; - DEBUG_MSG(KERN_INFO "viafb_check_var!\n"); /* Sanity check */ @@ -144,22 +141,17 @@ static int viafb_check_var(struct fb_var_screeninfo *var, /* Adjust var according to our driver's own table */ viafb_fill_var_timing_info(var, viafb_refresh, vmode_index); - /* This is indeed a patch for VT3353 */ - if (!info->par) - return -1; - p_viafb_par = (struct viafb_par *)info->par; - if (p_viafb_par->chip_info->gfx_chip_name == UNICHROME_VX800) - var->accel_flags = 0; - return 0; } static int viafb_set_par(struct fb_info *info) { + struct viafb_par *viapar = info->par; int vmode_index; int vmode_index1 = 0; DEBUG_MSG(KERN_INFO "viafb_set_par!\n"); + viapar->depth = fb_get_color_depth(&info->var, &info->fix); viafb_update_device_setting(info->var.xres, info->var.yres, info->var.bits_per_pixel, viafb_refresh, 0); @@ -190,9 +182,6 @@ static int viafb_set_par(struct fb_info *info) viafb_bpp = info->var.bits_per_pixel; /* Update viafb_accel, it is necessary to our 2D accelerate */ viafb_accel = info->var.accel_flags; - - if (viafb_accel) - viafb_set_2d_color_depth(info->var.bits_per_pixel); } return 0; @@ -777,10 +766,11 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg) static void viafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { - u32 col = 0, rop = 0; - int pitch; + struct viafb_par *viapar = info->par; + u32 fg_color; + u8 rop; - if (!viafb_accel) { + if (!viapar->shared->hw_bitblt) { cfb_fillrect(info, rect); return; } @@ -788,67 +778,30 @@ static void viafb_fillrect(struct fb_info *info, if (!rect->width || !rect->height) return; - switch (rect->rop) { - case ROP_XOR: + if (info->fix.visual == FB_VISUAL_TRUECOLOR) + fg_color = ((u32 *)info->pseudo_palette)[rect->color]; + else + fg_color = rect->color; + + if (rect->rop == ROP_XOR) rop = 0x5A; - break; - case ROP_COPY: - default: + else rop = 0xF0; - break; - } - - switch (info->var.bits_per_pixel) { - case 8: - col = rect->color; - break; - case 16: - col = ((u32 *) (info->pseudo_palette))[rect->color]; - break; - case 32: - col = ((u32 *) (info->pseudo_palette))[rect->color]; - break; - } - - /* BitBlt Source Address */ - writel(0x0, viaparinfo->io_virt + VIA_REG_SRCPOS); - /* Source Base Address */ - writel(0x0, viaparinfo->io_virt + VIA_REG_SRCBASE); - /* Destination Base Address */ - writel((info->fix.smem_start - viafbinfo->fix.smem_start) >> 3, - viaparinfo->io_virt + VIA_REG_DSTBASE); - /* Pitch */ - pitch = (info->var.xres_virtual + 7) & ~7; - writel(VIA_PITCH_ENABLE | - (((pitch * - info->var.bits_per_pixel >> 3) >> 3) | - (((pitch * info-> - var.bits_per_pixel >> 3) >> 3) << 16)), - viaparinfo->io_virt + VIA_REG_PITCH); - /* BitBlt Destination Address */ - writel(((rect->dy << 16) | rect->dx), - viaparinfo->io_virt + VIA_REG_DSTPOS); - /* Dimension: width & height */ - writel((((rect->height - 1) << 16) | (rect->width - 1)), - viaparinfo->io_virt + VIA_REG_DIMENSION); - /* Forground color or Destination color */ - writel(col, viaparinfo->io_virt + VIA_REG_FGCOLOR); - /* GE Command */ - writel((0x01 | 0x2000 | (rop << 24)), - viaparinfo->io_virt + VIA_REG_GECMD); + DEBUG_MSG(KERN_DEBUG "viafb 2D engine: fillrect\n"); + if (viapar->shared->hw_bitblt(viapar->io_virt, VIA_BITBLT_FILL, + rect->width, rect->height, info->var.bits_per_pixel, + viapar->vram_addr, info->fix.line_length, rect->dx, rect->dy, + NULL, 0, 0, 0, 0, fg_color, 0, rop)) + cfb_fillrect(info, rect); } static void viafb_copyarea(struct fb_info *info, const struct fb_copyarea *area) { - u32 dy = area->dy, sy = area->sy, direction = 0x0; - u32 sx = area->sx, dx = area->dx, width = area->width; - int pitch; + struct viafb_par *viapar = info->par; - DEBUG_MSG(KERN_INFO "viafb_copyarea!!\n"); - - if (!viafb_accel) { + if (!viapar->shared->hw_bitblt) { cfb_copyarea(info, area); return; } @@ -856,113 +809,48 @@ static void viafb_copyarea(struct fb_info *info, if (!area->width || !area->height) return; - if (sy < dy) { - dy += area->height - 1; - sy += area->height - 1; - direction |= 0x4000; - } - - if (sx < dx) { - dx += width - 1; - sx += width - 1; - direction |= 0x8000; - } - - /* Source Base Address */ - writel((info->fix.smem_start - viafbinfo->fix.smem_start) >> 3, - viaparinfo->io_virt + VIA_REG_SRCBASE); - /* Destination Base Address */ - writel((info->fix.smem_start - viafbinfo->fix.smem_start) >> 3, - viaparinfo->io_virt + VIA_REG_DSTBASE); - /* Pitch */ - pitch = (info->var.xres_virtual + 7) & ~7; - /* VIA_PITCH_ENABLE can be omitted now. */ - writel(VIA_PITCH_ENABLE | - (((pitch * - info->var.bits_per_pixel >> 3) >> 3) | (((pitch * - info->var. - bits_per_pixel - >> 3) >> 3) - << 16)), - viaparinfo->io_virt + VIA_REG_PITCH); - /* BitBlt Source Address */ - writel(((sy << 16) | sx), viaparinfo->io_virt + VIA_REG_SRCPOS); - /* BitBlt Destination Address */ - writel(((dy << 16) | dx), viaparinfo->io_virt + VIA_REG_DSTPOS); - /* Dimension: width & height */ - writel((((area->height - 1) << 16) | (area->width - 1)), - viaparinfo->io_virt + VIA_REG_DIMENSION); - /* GE Command */ - writel((0x01 | direction | (0xCC << 24)), - viaparinfo->io_virt + VIA_REG_GECMD); - + DEBUG_MSG(KERN_DEBUG "viafb 2D engine: copyarea\n"); + if (viapar->shared->hw_bitblt(viapar->io_virt, VIA_BITBLT_COLOR, + area->width, area->height, info->var.bits_per_pixel, + viapar->vram_addr, info->fix.line_length, area->dx, area->dy, + NULL, viapar->vram_addr, info->fix.line_length, + area->sx, area->sy, 0, 0, 0)) + cfb_copyarea(info, area); } static void viafb_imageblit(struct fb_info *info, const struct fb_image *image) { - u32 size, bg_col = 0, fg_col = 0, *udata; - int i; - int pitch; + struct viafb_par *viapar = info->par; + u32 fg_color = 0, bg_color = 0; + u8 op; - if (!viafb_accel) { + if (!viapar->shared->hw_bitblt || + (image->depth != 1 && image->depth != viapar->depth)) { cfb_imageblit(info, image); return; } - udata = (u32 *) image->data; - - switch (info->var.bits_per_pixel) { - case 8: - bg_col = image->bg_color; - fg_col = image->fg_color; - break; - case 16: - bg_col = ((u32 *) (info->pseudo_palette))[image->bg_color]; - fg_col = ((u32 *) (info->pseudo_palette))[image->fg_color]; - break; - case 32: - bg_col = ((u32 *) (info->pseudo_palette))[image->bg_color]; - fg_col = ((u32 *) (info->pseudo_palette))[image->fg_color]; - break; - } - size = image->width * image->height; - - /* Source Base Address */ - writel(0x0, viaparinfo->io_virt + VIA_REG_SRCBASE); - /* Destination Base Address */ - writel((info->fix.smem_start - viafbinfo->fix.smem_start) >> 3, - viaparinfo->io_virt + VIA_REG_DSTBASE); - /* Pitch */ - pitch = (info->var.xres_virtual + 7) & ~7; - writel(VIA_PITCH_ENABLE | - (((pitch * - info->var.bits_per_pixel >> 3) >> 3) | (((pitch * - info->var. - bits_per_pixel - >> 3) >> 3) - << 16)), - viaparinfo->io_virt + VIA_REG_PITCH); - /* BitBlt Source Address */ - writel(0x0, viaparinfo->io_virt + VIA_REG_SRCPOS); - /* BitBlt Destination Address */ - writel(((image->dy << 16) | image->dx), - viaparinfo->io_virt + VIA_REG_DSTPOS); - /* Dimension: width & height */ - writel((((image->height - 1) << 16) | (image->width - 1)), - viaparinfo->io_virt + VIA_REG_DIMENSION); - /* fb color */ - writel(fg_col, viaparinfo->io_virt + VIA_REG_FGCOLOR); - /* bg color */ - writel(bg_col, viaparinfo->io_virt + VIA_REG_BGCOLOR); - /* GE Command */ - writel(0xCC020142, viaparinfo->io_virt + VIA_REG_GECMD); - - for (i = 0; i < size / 4; i++) { - writel(*udata, viaparinfo->io_virt + VIA_MMIO_BLTBASE); - udata++; - } + if (image->depth == 1) { + op = VIA_BITBLT_MONO; + if (info->fix.visual == FB_VISUAL_TRUECOLOR) { + fg_color = + ((u32 *)info->pseudo_palette)[image->fg_color]; + bg_color = + ((u32 *)info->pseudo_palette)[image->bg_color]; + } else { + fg_color = image->fg_color; + bg_color = image->bg_color; + } + } else + op = VIA_BITBLT_COLOR; + DEBUG_MSG(KERN_DEBUG "viafb 2D engine: imageblit\n"); + if (viapar->shared->hw_bitblt(viapar->io_virt, op, + image->width, image->height, info->var.bits_per_pixel, + viapar->vram_addr, info->fix.line_length, image->dx, image->dy, + (u32 *)image->data, 0, 0, 0, 0, fg_color, bg_color, 0)) + cfb_imageblit(info, image); } static int viafb_cursor(struct fb_info *info, struct fb_cursor *cursor) @@ -1961,6 +1849,7 @@ static int __devinit via_pci_probe(void) viaparinfo = (struct viafb_par *)viafbinfo->par; viaparinfo->shared = viafbinfo->par + viafb_par_length; + viaparinfo->vram_addr = 0; viaparinfo->tmds_setting_info = &viaparinfo->shared->tmds_setting_info; viaparinfo->lvds_setting_info = &viaparinfo->shared->lvds_setting_info; viaparinfo->lvds_setting_info2 = @@ -2007,7 +1896,7 @@ static int __devinit via_pci_probe(void) viafbinfo->pseudo_palette = pseudo_pal; if (viafb_accel) { - viafb_init_accel(); + viafb_init_accel(viaparinfo->shared); viafb_init_2d_engine(); viafb_hw_cursor_init(); } @@ -2110,6 +1999,7 @@ static int __devinit via_pci_probe(void) } viaparinfo1 = viafbinfo1->par; memcpy(viaparinfo1, viaparinfo, viafb_par_length); + viaparinfo1->vram_addr = viafb_second_offset; viaparinfo1->memsize = viaparinfo->memsize - viafb_second_offset; viaparinfo->memsize = viafb_second_offset; @@ -2157,12 +2047,16 @@ static int __devinit via_pci_probe(void) viafb_check_var(&default_var, viafbinfo1); viafbinfo1->var = default_var; viafb_update_fix(viafbinfo1); + viaparinfo1->depth = fb_get_color_depth(&viafbinfo1->var, + &viafbinfo1->fix); } viafb_setup_fixinfo(&viafbinfo->fix, viaparinfo); viafb_check_var(&default_var, viafbinfo); viafbinfo->var = default_var; viafb_update_fix(viafbinfo); + viaparinfo->depth = fb_get_color_depth(&viafbinfo->var, + &viafbinfo->fix); default_var.activate = FB_ACTIVATE_NOW; fb_alloc_cmap(&viafbinfo->cmap, 256, 0); diff --git a/drivers/video/via/viafbdev.h b/drivers/video/via/viafbdev.h index 1d1fe35..beb4703 100644 --- a/drivers/video/via/viafbdev.h +++ b/drivers/video/via/viafbdev.h @@ -49,9 +49,17 @@ struct viafb_shared { struct lvds_setting_information lvds_setting_info; struct lvds_setting_information lvds_setting_info2; struct chip_information chip_info; + + /* hardware acceleration stuff */ + int (*hw_bitblt)(void __iomem *engine, u8 op, u32 width, u32 height, + u8 dst_bpp, u32 dst_addr, u32 dst_pitch, u32 dst_x, u32 dst_y, + u32 *src_mem, u32 src_addr, u32 src_pitch, u32 src_x, u32 src_y, + u32 fg_color, u32 bg_color, u8 fill_rop); }; struct viafb_par { + u8 depth; + u32 vram_addr; void __iomem *io_virt; /*iospace virtual memory address */ unsigned int fbmem; /*framebuffer physical memory address */ unsigned int memsize; /*size of fbmem */ -- 1.6.3.2 |
From: Peter B. <pet...@lo...> - 2009-09-04 13:56:58
|
On Fri, 2009-09-04 at 12:14 +0530, Gadiyar, Anand wrote: > > From: Sergio Aguirre <saa...@ti...> > > > > This fixes the issue in which mm_lock mutex was attempted to be > > used without initializing previously. > > > > Signed-off-by: Sergio Aguirre <saa...@ti...> > > Tested-by: Anand Gadiyar <ga...@ti...> > > This patch on top of current linux-omap kernel allows me to > boot with the default SDP defconfig on a 3430 SDP. Tested-by: Peter Barada <pe...@lo...> This patch on top of current linux-omap kernel allows me to boot with the LCD enabled on LogicPD's OMAP boards. > > --- > > drivers/video/omap/omapfb_main.c | 20 +++++++++++--------- > > 1 files changed, 11 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c > > index 125e605..60f9482 100644 > > --- a/drivers/video/omap/omapfb_main.c > > +++ b/drivers/video/omap/omapfb_main.c > > @@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info) > > var->rotate = def_rotate; > > var->bits_per_pixel = fbdev->panel->bpp; > > > > + r = register_framebuffer(info); > > + if (r != 0) { > > + dev_err(fbdev->dev, > > + "registering framebuffer failed\n"); > > + return r; > > + } > > + > > set_fb_var(info, var); > > set_fb_fix(info); > > > > r = fb_alloc_cmap(&info->cmap, 16, 0); > > - if (r != 0) > > + if (r != 0) { > > dev_err(fbdev->dev, "unable to allocate color map memory\n"); > > + unregister_framebuffer(info); > > + } > > > > return r; > > } > > @@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device *pdev, > > init_state++; > > > > vram = 0; > > - for (i = 0; i < fbdev->mem_desc.region_cnt; i++) { > > - r = register_framebuffer(fbdev->fb_info[i]); > > - if (r != 0) { > > - dev_err(fbdev->dev, > > - "registering framebuffer %d failed\n", i); > > - goto cleanup; > > - } > > + for (i = 0; i < fbdev->mem_desc.region_cnt; i++) > > vram += fbdev->mem_desc.region[i].size; > > - } > > > > fbdev->state = OMAPFB_ACTIVE; > > > > -- > > 1.6.3.2 > > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to maj...@vg... > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Peter Barada <pe...@lo...> Logic Product Development, Inc. |
From: Rui S. <rs...@gr...> - 2009-09-04 10:07:06
|
Add new resolutions to udlfb driver: 800x600, 1360x768, 1366x768, 1600x1200 and 1920x1080. Signed-off-by: Rui Santos <rs...@gr...> |