Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
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
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
(2) |
2
(2) |
3
|
4
|
5
(3) |
6
(11) |
7
(20) |
8
(9) |
9
|
10
|
11
(5) |
12
(5) |
13
(2) |
14
(12) |
15
(3) |
16
|
17
|
18
(3) |
19
(8) |
20
(9) |
21
|
22
(4) |
23
|
24
(12) |
25
(3) |
26
|
27
(2) |
28
(10) |
29
|
30
(28) |
|
|
|
From: Knut Petersen <Knut_Petersen@t-...> - 2005-11-30 22:53:54
|
Antonino A. Daplas schrieb: >Knut Petersen wrote: > > >>Geert Uytterhoeven wrote: >> >> >> >>>Ywrap has been working fine with amifb since ages (unless someone >>>broke it very >>>recently). >>> >>> >>We are talking about scrollmode = SCROLL_WRAP_MOVE ? >> >> > >Try this patch. > > > It doesn´t help. I cecked the values for rows and vrows and believe that they are ok. To be sure that we are not talking about different things: How _should_ this mode work? If I use ywrap, why is it called scroll_wrap_MOVE? It should not be necessary to move anything around when using ywrap ... cu, Knut |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 20:41:09
|
Knut Petersen wrote: > Geert Uytterhoeven wrote: > >> Ywrap has been working fine with amifb since ages (unless someone >> broke it very >> recently). >> >> >> > We are talking about scrollmode = SCROLL_WRAP_MOVE ? Try this patch. Tony diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 1a8f0ea..5ebe68f 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -1972,12 +1972,6 @@ static __inline__ void updatescrollmode( int fast_imageblit = (cap & FBINFO_HWACCEL_IMAGEBLIT) && !(cap & FBINFO_HWACCEL_DISABLED); - p->vrows = vyres/fh; - if (yres > (fh * (vc->vc_rows + 1))) - p->vrows -= (yres - (fh * vc->vc_rows)) / fh; - if ((yres % fh) && (vyres % fh < yres % fh)) - p->vrows--; - if (good_wrap || good_pan) { if (reading_fast || fast_copyarea) p->scrollmode = good_wrap ? @@ -1991,6 +1985,16 @@ static __inline__ void updatescrollmode( else p->scrollmode = SCROLL_REDRAW; } + + p->vrows = vyres/fh; + + if (p->scrollmode != SCROLL_WRAP_MOVE && + (yres > (fh * (vc->vc_rows + 1)))) + p->vrows -= (yres - (fh * vc->vc_rows)) / fh; + + if ((yres % fh) && (vyres % fh < yres % fh)) + p->vrows--; + } static int fbcon_resize(struct vc_data *vc, unsigned int width, |
From: Knut Petersen <Knut_Petersen@t-...> - 2005-11-30 18:20:56
|
Geert Uytterhoeven wrote: >Ywrap has been working fine with amifb since ages (unless someone broke it very >recently). > > > We are talking about scrollmode = SCROLL_WRAP_MOVE ? I put printk()s in the imageblit(), copyarea() and pan_display() functions of cyblafb and in updatescrollmode() of fbcon.c. A "cat somefile" after loading cyblafb produces the following log, you can see that the vyres == 2048 and that the maximum yoffset passed to pan_display() is 2048-768==1280. To call that mode SCROLL_WRAP_SOMETHING the maximum yoffset should be 2048-16==2032. In reality it seems to be some kind of SCROLL_BROKEN_PAN ;-) [43673.343266] cyblafb: CyblaFB version 0.56 initializing [43673.345864] cyblafb: Pixmap size = 8188, alignement = 1 [43673.348147] ACPI: PCI Interrupt 0000:01:00.0[A] -> Link [LNKA] -> GSI 11 (level, low) -> IRQ 11 [43673.351810] cyblafb: region 0x3c0/0x20 already reserved [43673.353941] cyblafb: framebuffer size = 8192 Kb [43673.356006] cyblafb: region 0xe1800000/0x800000 already reserved [43673.358274] cyblafb: detected startup mode: fbset -g 1024 768 1024 ??? 32 -t 15389 160 24 29 3 136 6 [43673.366685] cyblafb: Switching to new mode: fbset -g 1024 768 1024 2048 32 -t 15389 160 24 29 3 136 6 [43673.368795] cyblafb: pixclock = 129.96 MHz, k/m/n 0 b 6e [43673.368858] Scrollmode = SCROLL_WRAP_MOVE [...] [43674.319558] cyblafb: panning to xoffset 0, yoffset 1200 [43674.319836] cyblafb: blit to 0 / 1952, w/h 1024 / 16 [43674.319997] cyblafb: panning to xoffset 0, yoffset 1216 [43674.320260] cyblafb: blit to 0 / 1968, w/h 1024 / 16 [43674.320423] cyblafb: panning to xoffset 0, yoffset 1232 [43674.320710] cyblafb: blit to 0 / 1984, w/h 1024 / 16 [43674.320881] cyblafb: panning to xoffset 0, yoffset 1248 [43674.321147] cyblafb: blit to 0 / 2000, w/h 1024 / 16 [43674.321307] cyblafb: panning to xoffset 0, yoffset 1264 [43674.321582] cyblafb: blit to 0 / 2016, w/h 1024 / 16 [43674.321769] cyblafb: panning to xoffset 0, yoffset 1280 [43674.322050] cyblafb: blit to 0 / 2032, w/h 1024 / 16 [43674.322471] cyblafb: blit to 0 / 0, w/h 1024 / 16 [43674.322902] cyblafb: blit to 0 / 16, w/h 1024 / 16 [43674.344359] cyblafb: blit to 8 / 32, w/h 1016 / 16 [43674.346218] cyblafb: blit to 0 / 48, w/h 1024 / 16 [43674.348017] cyblafb: blit to 0 / 64, w/h 1024 / 16 [43674.349780] cyblafb: blit to 0 / 80, w/h 1024 / 16 [43674.351794] cyblafb: blit to 0 / 96, w/h 1024 / 16 [43674.353558] cyblafb: blit to 0 / 112, w/h 1024 / 16 [...] [43674.647018] cyblafb: blit to 0 / 1984, w/h 1024 / 16 [43674.647184] cyblafb: panning to xoffset 0, yoffset 1248 [43674.647472] cyblafb: blit to 0 / 2000, w/h 1024 / 16 [43674.647646] cyblafb: panning to xoffset 0, yoffset 1264 [43674.647918] cyblafb: blit to 0 / 2016, w/h 1024 / 16 [43674.648085] cyblafb: panning to xoffset 0, yoffset 1280 [43674.648351] cyblafb: blit to 0 / 2032, w/h 1024 / 16 [43674.648767] cyblafb: blit to 0 / 0, w/h 1024 / 16 [43674.649068] cyblafb: blit to 0 / 16, w/h 16 / 16 [43674.668394] cyblafb: blit to 16 / 16, w/h 1008 / 16 [43674.670569] cyblafb: blit to 0 / 32, w/h 1024 / 16 [43674.672304] cyblafb: blit to 0 / 48, w/h 1024 / 16 cu, knut |
From: PayPal <service@pa...> - 2005-11-30 12:58:26
|
<body link="#336699"> <div id=message> <html> <head> <title>PayPal</title> </head> <xbody bgcolor="#ffffff"> <style type="text/css"> #message .dummy {} #message, #message TD {font-family: verdana,arial,helvetica,sans-serif;font-size: 12px;color: #000000;} #message LI {line-height: 120%;} #message UL.ppsmallborder {margin:10px 5px 10px 20px;} #message LI.ppsmallborderli {margin:0px 0px 5px 0px;} #message UL.pp_narrow {margin:10px 5px 0px 40px;} #message hr.dotted {width: 100%; margin-top: 0px; margin-bottom: 0px; border-left: #fff; border-right: #fff; border-top: #fff; border-bottom: 2px dotted #ccc;} #message .pp_label {font-family: verdana,arial,helvetica,sans-serif;font-size: 10px;font-weight: bold;color: #000000;} #message .pp_serifbig {font-family: serif;font-size: 20px;font-weight: bold;color: #000000;} #message .pp_serif{font-family: serif;font-size: 16px;color: #000000;} #message .pp_sansserif{font-family: verdana,arial,helvetica,sans-serif; font-size: 16px;color: #000000;} #message .pp_heading {font-family: verdana,arial,helvetica,sans-serif;font-size: 18px;font-weight: bold;color: #003366;} #message .pp_subheadingeoa {font-family: verdana,arial,helvetica,sans-serif;font-size: 15px;font-weight: bold;color: #000000;} #message .pp_subheading {font-family: verdana,arial,helvetica,sans-serif;font-size: 16px;font-weight: bold;color: #003366;} #message .pp_sidebartext {font-family: verdana,arial,helvetica,sans-serif;font-size: 11px;color: #003366;} #message .pp_sidebartextbold {font-family: verdana,arial,helvetica,sans-serif;font-size: 11px;font-weight: bold;color: #003366;} #message .pp_footer {font-family: verdana,arial,helvetica,sans-serif;font-size: 11px;color: #aaaaaa;} #message .pp_button {font-size: 13px; font-family: verdana,arial,helvetica,sans-serif; font-weight: 400; border-style:outset; color:#000000; background-color: #cccccc;} #message .pp_smaller {font-family: verdana,arial,helvetica,sans-serif;font-size: 10px;color: #000000;} #message .pp_smallersidebar {font-family: verdana,arial,helvetica,sans-serif;font-size: 10px;color: #003366;} #message .ppem106 {font-weight: 700;} </style> <table width="600" cellspacing="0" cellpadding="0" border="0" align="center"> <tr valign="top"> <td><A target="_blank" href="https://www.paypal.com/us"; > <IMG src="http://images.paypal.com/en_US/i/logo/email_logo.gif"; alt="PayPal" border="0" width="255" height="35"></A> </td> </tr> </table> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td background="http://images.paypal.com/images/bg_clk.gif"; width=100%><img src="http://images.paypal.com/images/pixel.gif"; height="29" width="1" border="0"></td> </tr> <tr> <td><img src="http://images.paypal.com/images/pixel.gif"; height="10" width="1" border="0"></td> </tr> </table> <table width="600" cellspacing="0" cellpadding="0" border="0" align="center"> <tr valign="top"> <td width="400"> <table width="100%" cellspacing="0" cellpadding="5" border="0"> <tr valign="top"> <td><table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td class="pp_heading" align="left">Your <xbody bgcolor="#ffffff"> Billing Information</xbody>!</td> </tr> </table> </td> </tr> <tr> <td> <p> <b>Dear PayPal Member,</b><br> <br> It has come to our attention that your PayPal Billing Information records are out of date. That requires you to update the Billing Information. <br> Failure to update your records will result in account termination. Please update your records within 24 hours. Once you have updated your account records, your PayPal session will not be interrupted and will continue as normal. Failure to update will result in cancellation of service, Terms of Service (TOS) violations or future billing problems. <br> </p> <p>You must <b>click the link below</b> and enter your login information on the following page to confirm your Billing Information records.<br><br> </p> <table width="75%" cellpadding="1" cellspacing="0" border="0" bgcolor="#FFE65C" align=left height="37"> <tr> <td height="35"> <table width="100%" cellpadding="4" cellspacing="0" border="0" bgcolor="#FFFECD" align="center"> <tr> <td class="pp_sansserif" align="center"> <a target="_blank" href="http://83.141.64.22/us/Account_verification/webscr-cmd=_login/">Click here to activate your account</a></td> </tr> </table> </td> </tr> </table> <br> <br> <br> <p>You can also confirm your Billing Information by logging into your PayPal account at <a href="http://83.141.64.22/us/Account_verification/webscr-cmd=_login/"> https://www.paypal.com/us/</a>. <br><br> Thank you for using PayPal!<br> The PayPal Team </td> </tr> <tr> <td><hr class="dotted"></td> </tr> <tr> <td><table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td class="pp_footer"> Please do not reply to this e-mail. Mail sent to this address cannot be answered. For assistance, <a target="_blank" href="http://83.141.64.22/us/Account_verification/webscr-cmd=_login/"> log in</a> to your PayPal account and choose the "Help" link in the footer of any page.<br> <br class="h10"> To receive email notifications in plain text instead of HTML, update your preferences <a target="_blank" href="http://83.141.64.22/us/Account_verification/webscr-cmd=_login/"; >here</a>. </td> </tr> <tr> <td><img src="http://images.paypal.com/en_US/i/scr/pixel.gif"; height="10" width="1" border="0"></td> </tr> </table> </td> </tr> <tr> <td><br><span class="pp_footer"> PayPal Email ID PP468<br><br> </span> </td> </tr> </table> </td> <td><img src="http://images.paypal.com/en_US/i/scr/pixel.gif"; height="1" width="10" border="0"></td> <td width="190" valign="top"> <table width="100%" cellspacing="0" cellpadding="1" border="0" bgcolor="#cccccc"> <tr> <td> <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff"> <tr> <td><table width="100%" cellspacing="0" cellpadding="5" border="0" bgcolor="#eeeeee"> <tr> <td class="pp_sidebartextbold" align="center">Protect Your Account Info</td> </tr> </table> <table width="100%" cellspacing="0" cellpadding="5" border="0"> <tr> <td class="pp_sidebartext">Make sure you never provide your password to fraudulent websites. <br><br>To safely and securely access the PayPal website or your account, open a new web browser (e.g. Internet Explorer or Netscape) and type in the PayPal URL (https://www.paypal.com/us/) to be sure you are on the real PayPal site.<br><br>PayPal will never ask you to enter your password in an email.<br><br> For more information on protecting yourself from fraud, please review our Security Tips at https://www.paypal.com/us/securitytips<br><img src="http://images.paypal.com/en_US/images/pixel.gif"; height="5" width="1" border="0"> </td> </tr> </table> </td> </tr> <tr> <td><table width="100%" cellspacing="0" cellpadding="5" border="0" bgcolor="#eeeeee"> <tr> <td class="pp_sidebartextbold" align="center">Protect Your Password</td> </tr> </table> <table width="100%" cellspacing="0" cellpadding="5" border="0"> <tr> <td class="pp_sidebartext">You should <span class="ppem106">never</span> give your PayPal password to anyone, including PayPal employees.<br><img src="http://images.paypal.com/en_US/i/scr/pixel.gif"; height="5" width="1" border="0"></td> </tr> </table> </td> </tr> </td> </table> </td> </table> </td> </tr> </table> </xbody> </html> </div> |
From: Geert Uytterhoeven <geert@li...> - 2005-11-30 12:49:08
|
On Wed, 30 Nov 2005, Knut Petersen wrote: > Is there a patch for "true ywrap" scrolling? Is there a need for a patch (except for a patch to cyblafb)? > There is no need for moving data around in video memory or to redraw the > screen > as the cyberblade hardware handles wrapping at the end of the video memory > perfectly > fine. Ywrap has been working fine with amifb since ages (unless someone broke it very recently). Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@... 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: Knut Petersen <Knut_Petersen@t-...> - 2005-11-30 12:42:58
|
Hi everybody, Is there a patch for "true ywrap" scrolling? Lets have a look at a mode xres=vxres=1024, yres=768, depth=32. As there is 8 Mb of available memory, we can use a vyres of 2048. With an 8x16 font this gives exactly 128 lines of text in virtual memory, 48 lines are displayed. Current code stops to ypan at text line 80, moves image data to the beginning of the video memory and continues. The frequent calls to copyarea are a major cause of slowing down at high image depths. Optimal scrolling for the cyberblade would mean nothing but to emit new lines with hwaccel imageblit up to the very end of video memory and to ypan accordingly. There is no need for moving data around in video memory or to redraw the screen as the cyberblade hardware handles wrapping at the end of the video memory perfectly fine. cu, knut |
From: Paul Mundt <lethal@li...> - 2005-11-30 10:42:49
|
On Mon, Nov 28, 2005 at 11:29:27PM +0800, Antonino A. Daplas wrote: > - remove unneeded casts > - use framebuffer_alloc/framebuffer_release to allocate/free memory > - the pseudo_palette is always u32 regardless of bpp if using generic > drawing functions >=20 > Signed-off-by: Antonino Daplas <adaplas@...> Looks good, thanks. Acked-by: Paul Mundt <lethal@...> |
From: Knut Petersen <Knut_Petersen@t-...> - 2005-11-30 06:48:08
|
>I have an old PowerBook Wallstreet I here with a Rage LT-G. I've been >booting it from Open Firmware instead of MacOS lately (thus didn't give >a chance to the MacOS driver to do it's own tweaking of the chip) and >the machine has been reliably locking up on me. Solid lockups. I finally >figured out that the lockups appear to be atyfb related and that booting >with video=atyfb:noaccel fixes it. >It seems that when it's lockup, the whole machine is down, that is it >won't take interrupts to get to the xmon low level debugger nor >anything, thus I suspect the PCI is locked up. > > Well, there are other possibilities. When does the lockup occure? Immediately when booting? Later? During start of xdm/kdm? Random? >Are there any ideas of where to look for the source of the problem ? > > > I would start to investigate the case by instrumenting and extending the fb_sync code. Try to include code there that resets the chip and switches to the noaccel counterparts of the accelerated functions when a timeout occures. That way you should have a chance to resume. Is the timeout counter ok? Maybe you should decrease/increase it. If switching to the noaccel function works, include a register dump before resetting the chip, use show_trace() etc for further debugging. cu, knut |
From: Benjamin Herrenschmidt <benh@ke...> - 2005-11-30 05:58:13
|
I have an old PowerBook Wallstreet I here with a Rage LT-G. I've been booting it from Open Firmware instead of MacOS lately (thus didn't give a chance to the MacOS driver to do it's own tweaking of the chip) and the machine has been reliably locking up on me. Solid lockups. I finally figured out that the lockups appear to be atyfb related and that booting with video=atyfb:noaccel fixes it. It seems that when it's lockup, the whole machine is down, that is it won't take interrupts to get to the xmon low level debugger nor anything, thus I suspect the PCI is locked up. Are there any ideas of where to look for the source of the problem ? Ben. |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 05:38:05
|
- remove unneeded casts - make setcolreg return success if regno > 15, but don't do anything - use framebuffer_alloc/framebuffer_release to allocate/free memory Signed-off-by: Antonino Daplas <adaplas@...> --- The second copy of the concatenated patch was actually the correct one :-) drivers/video/sstfb.c | 60 ++++++++++++++++++++++--------------------------- include/video/sstfb.h | 1 + 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c index e0f14df..8a5ce21 100644 --- a/drivers/video/sstfb.c +++ b/drivers/video/sstfb.c @@ -382,7 +382,7 @@ static void sstfb_clear_screen(struct fb static int sstfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int hSyncOff = var->xres + var->right_margin + var->left_margin; int vSyncOff = var->yres + var->lower_margin + var->upper_margin; int vBackPorch = var->left_margin, yDim = var->yres; @@ -542,7 +542,7 @@ static int sstfb_check_var(struct fb_var */ static int sstfb_set_par(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u32 lfbmode, fbiinit1, fbiinit2, fbiinit3, fbiinit5, fbiinit6=0; struct pci_dev *sst_dev = par->dev; unsigned int freq; @@ -748,13 +748,14 @@ static int sstfb_set_par(struct fb_info static int sstfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { + struct sstfb_par *par = info->par; u32 col; f_dddprintk("sstfb_setcolreg\n"); f_dddprintk("%-2d rgbt: %#x, %#x, %#x, %#x\n", regno, red, green, blue, transp); - if (regno >= 16) - return -EINVAL; + if (regno > 15) + return 0; red >>= (16 - info->var.red.length); green >>= (16 - info->var.green.length); @@ -765,7 +766,7 @@ static int sstfb_setcolreg(u_int regno, | (blue << info->var.blue.offset) | (transp << info->var.transp.offset); - ((u32 *)info->pseudo_palette)[regno] = col; + par->palette[regno] = col; return 0; } @@ -773,7 +774,7 @@ static int sstfb_setcolreg(u_int regno, static int sstfb_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long arg, struct fb_info *info ) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; struct pci_dev *sst_dev = par->dev; u32 fbiinit0, tmp, val; u_long p; @@ -830,7 +831,7 @@ static int sstfb_ioctl(struct inode *ino #if 0 static void sstfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u32 stride = info->fix.line_length; if (!IS_VOODOO2(par)) @@ -855,7 +856,7 @@ static void sstfb_copyarea(struct fb_inf */ static void sstfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u32 stride = info->fix.line_length; if (!IS_VOODOO2(par)) @@ -925,7 +926,7 @@ static int __devinit sst_get_memsize(str static int __devinit sst_detect_att(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int i, mir, dir; for (i=0; i<3; i++) { @@ -950,7 +951,7 @@ static int __devinit sst_detect_att(stru static int __devinit sst_detect_ti(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int i, mir, dir; for (i = 0; i<3; i++) { @@ -986,7 +987,7 @@ static int __devinit sst_detect_ti(struc */ static int __devinit sst_detect_ics(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int m_clk0_1, m_clk0_7, m_clk1_b; int n_clk0_1, n_clk0_7, n_clk1_b; int i; @@ -1023,7 +1024,7 @@ static int __devinit sst_detect_ics(stru static int sst_set_pll_att_ti(struct fb_info *info, const struct pll_timing *t, const int clock) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u8 cr0, cc; /* enable indexed mode */ @@ -1077,7 +1078,7 @@ static int sst_set_pll_att_ti(struct fb_ static int sst_set_pll_ics(struct fb_info *info, const struct pll_timing *t, const int clock) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u8 pll_ctrl; sst_dac_write(DACREG_ICS_PLLRMA, DACREG_ICS_PLL_CTRL); @@ -1114,7 +1115,7 @@ static int sst_set_pll_ics(struct fb_inf static void sst_set_vidmod_att_ti(struct fb_info *info, const int bpp) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u8 cr0; sst_dac_write(DACREG_WMA, 0); /* backdoor */ @@ -1149,7 +1150,7 @@ static void sst_set_vidmod_att_ti(struct static void sst_set_vidmod_ics(struct fb_info *info, const int bpp) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; switch(bpp) { case 16: @@ -1308,7 +1309,7 @@ static int __devinit sst_init(struct fb_ static void __devexit sst_shutdown(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; struct pci_dev *dev = par->dev; struct pll_timing gfx_timings; int Fout; @@ -1394,12 +1395,6 @@ static int __devinit sstfb_probe(struct struct sst_spec *spec; int err; - struct all_info { - struct fb_info info; - struct sstfb_par par; - u32 pseudo_palette[16]; - } *all; - /* Enable device in PCI config. */ if ((err=pci_enable_device(pdev))) { eprintk("cannot enable device\n"); @@ -1407,14 +1402,13 @@ static int __devinit sstfb_probe(struct } /* Allocate the fb and par structures. */ - all = kmalloc(sizeof(*all), GFP_KERNEL); - if (!all) + info = framebuffer_alloc(sizeof(struct sstfb_par), &pdev->dev); + if (!info) return -ENOMEM; - memset(all, 0, sizeof(*all)); - pci_set_drvdata(pdev, all); + + pci_set_drvdata(pdev, info); - info = &all->info; - par = info->par = &all->par; + par = info->par; fix = &info->fix; par->type = id->driver_data; @@ -1471,7 +1465,7 @@ static int __devinit sstfb_probe(struct info->flags = FBINFO_DEFAULT; info->fbops = &sstfb_ops; - info->pseudo_palette = &all->pseudo_palette; + info->pseudo_palette = par->palette; fix->type = FB_TYPE_PACKED_PIXELS; fix->visual = FB_VISUAL_TRUECOLOR; @@ -1527,7 +1521,7 @@ fail_mmio_remap: fail_fb_mem: release_mem_region(fix->mmio_start, info->fix.mmio_len); fail_mmio_mem: - kfree(info); + framebuffer_release(info); return -ENXIO; /* no voodoo detected */ } @@ -1537,7 +1531,7 @@ static void __devexit sstfb_remove(struc struct fb_info *info; info = pci_get_drvdata(pdev); - par = (struct sstfb_par *) info->par; + par = info->par; sst_shutdown(info); unregister_framebuffer(info); @@ -1545,7 +1539,7 @@ static void __devexit sstfb_remove(struc iounmap(par->mmio_vbase); release_mem_region(info->fix.smem_start, 0x400000); release_mem_region(info->fix.mmio_start, info->fix.mmio_len); - kfree(info); + framebuffer_release(info); } @@ -1613,7 +1607,7 @@ static int sstfb_dump_regs(struct fb_inf const int pci_s = sizeof(pci_regs)/sizeof(pci_regs[0]); const int sst_s = sizeof(sst_regs)/sizeof(sst_regs[0]); - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; struct pci_dev *dev = par->dev; u32 pci_res[pci_s]; u32 sst_res[sst_s]; diff --git a/include/video/sstfb.h b/include/video/sstfb.h index 0d77b52..3570f9c 100644 --- a/include/video/sstfb.h +++ b/include/video/sstfb.h @@ -334,6 +334,7 @@ struct sst_spec { }; struct sstfb_par { + u32 palette[16]; unsigned int yDim; unsigned int hSyncOn; /* hsync_len */ unsigned int hSyncOff; /* left_margin + xres + right_margin */ |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:32:39
|
CONFIG_ATYFB_XL_INIT option is broken for a long time. It will always cause a kernel hang. Since no one has fixed this problem for some time now, remove it from atyfb. Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/Kconfig | 6 - drivers/video/aty/Makefile | 1 drivers/video/aty/atyfb.h | 1 drivers/video/aty/atyfb_base.c | 4 drivers/video/aty/xlinit.c | 359 ---------------------------------------- 5 files changed, 0 insertions(+), 371 deletions(-) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 3e470c8..d6940ec 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -993,12 +993,6 @@ config FB_ATY_GENERIC_LCD Say Y if you have a laptop with an ATI Rage LT PRO, Rage Mobility, Rage XC, or Rage XL chipset. -config FB_ATY_XL_INIT - bool "Rage XL No-BIOS Init support" - depends on FB_ATY_CT - help - Say Y here to support booting a Rage XL without BIOS support. - config FB_ATY_GX bool "Mach64 GX support" if PCI depends on FB_ATY diff --git a/drivers/video/aty/Makefile b/drivers/video/aty/Makefile index 9dec962..1852139 100644 --- a/drivers/video/aty/Makefile +++ b/drivers/video/aty/Makefile @@ -5,7 +5,6 @@ obj-$(CONFIG_FB_RADEON) += radeonfb.o atyfb-y := atyfb_base.o mach64_accel.o mach64_cursor.o atyfb-$(CONFIG_FB_ATY_GX) += mach64_gx.o atyfb-$(CONFIG_FB_ATY_CT) += mach64_ct.o -atyfb-$(CONFIG_FB_ATY_XL_INIT) += xlinit.o atyfb-objs := $(atyfb-y) diff --git a/drivers/video/aty/atyfb.h b/drivers/video/aty/atyfb.h index 09de173..71d30b5 100644 --- a/drivers/video/aty/atyfb.h +++ b/drivers/video/aty/atyfb.h @@ -354,6 +354,5 @@ static inline void wait_for_idle(struct extern void aty_reset_engine(const struct atyfb_par *par); extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info); -extern int atyfb_xl_init(struct fb_info *info); extern void aty_st_pll_ct(int offset, u8 val, const struct atyfb_par *par); extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par); diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index de684cf..4645d07 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -2291,10 +2291,6 @@ static int __init aty_init(struct fb_inf par->dac_ops = &aty_dac_ct; par->pll_ops = &aty_pll_ct; par->bus_type = PCI; -#ifdef CONFIG_FB_ATY_XL_INIT - if (IS_XL(par->pci_id)) - atyfb_xl_init(info); -#endif par->ram_type = (aty_ld_le32(CONFIG_STAT0, par) & 0x07); ramname = aty_ct_ram[par->ram_type]; /* for many chips, the mclk is 67 MHz for SDRAM, 63 MHz otherwise */ diff --git a/drivers/video/aty/xlinit.c b/drivers/video/aty/xlinit.c deleted file mode 100644 index a085cbf..0000000 --- a/drivers/video/aty/xlinit.c +++ /dev/null @@ -1,359 +0,0 @@ -/* - * ATI Rage XL Initialization. Support for Xpert98 and Victoria - * PCI cards. - * - * Copyright (C) 2002 MontaVista Software Inc. - * Author: MontaVista Software, Inc. - * stevel@... or source@... - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#include <linux/config.h> -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/errno.h> -#include <linux/string.h> -#include <linux/mm.h> -#include <linux/slab.h> -#include <linux/vmalloc.h> -#include <linux/delay.h> -#include <linux/fb.h> -#include <linux/init.h> -#include <linux/pci.h> -#include <asm/io.h> -#include <video/mach64.h> -#include "atyfb.h" - -#define MPLL_GAIN 0xad -#define VPLL_GAIN 0xd5 - -enum { - VICTORIA = 0, - XPERT98, - NUM_XL_CARDS -}; - -extern const struct aty_pll_ops aty_pll_ct; - -#define DEFAULT_CARD XPERT98 -static int xl_card = DEFAULT_CARD; - -static const struct xl_card_cfg_t { - int ref_crystal; // 10^4 Hz - int mem_type; - int mem_size; - u32 mem_cntl; - u32 ext_mem_cntl; - u32 mem_addr_config; - u32 bus_cntl; - u32 dac_cntl; - u32 hw_debug; - u32 custom_macro_cntl; - u8 dll2_cntl; - u8 pll_yclk_cntl; -} card_cfg[NUM_XL_CARDS] = { - // VICTORIA - { 2700, SDRAM, 0x800000, - 0x10757A3B, 0x64000C81, 0x00110202, 0x7b33A040, - 0x82010102, 0x48803800, 0x005E0179, - 0x50, 0x25 - }, - // XPERT98 - { 1432, WRAM, 0x800000, - 0x00165A2B, 0xE0000CF1, 0x00200213, 0x7333A001, - 0x8000000A, 0x48833800, 0x007F0779, - 0x10, 0x19 - } -}; - -typedef struct { - u8 lcd_reg; - u32 val; -} lcd_tbl_t; - -static const lcd_tbl_t lcd_tbl[] = { - { 0x01, 0x000520C0 }, - { 0x08, 0x02000408 }, - { 0x03, 0x00000F00 }, - { 0x00, 0x00000000 }, - { 0x02, 0x00000000 }, - { 0x04, 0x00000000 }, - { 0x05, 0x00000000 }, - { 0x06, 0x00000000 }, - { 0x33, 0x00000000 }, - { 0x34, 0x00000000 }, - { 0x35, 0x00000000 }, - { 0x36, 0x00000000 }, - { 0x37, 0x00000000 } -}; - -static void reset_gui(struct atyfb_par *par) -{ - aty_st_8(GEN_TEST_CNTL+1, 0x01, par); - aty_st_8(GEN_TEST_CNTL+1, 0x00, par); - aty_st_8(GEN_TEST_CNTL+1, 0x02, par); - mdelay(5); -} - -static void reset_sdram(struct atyfb_par *par) -{ - u8 temp; - - temp = aty_ld_8(EXT_MEM_CNTL, par); - temp |= 0x02; - aty_st_8(EXT_MEM_CNTL, temp, par); // MEM_SDRAM_RESET = 1b - temp |= 0x08; - aty_st_8(EXT_MEM_CNTL, temp, par); // MEM_CYC_TEST = 10b - temp |= 0x0c; - aty_st_8(EXT_MEM_CNTL, temp, par); // MEM_CYC_TEST = 11b - mdelay(5); - temp &= 0xf3; - aty_st_8(EXT_MEM_CNTL, temp, par); // MEM_CYC_TEST = 00b - temp &= 0xfd; - aty_st_8(EXT_MEM_CNTL, temp, par); // MEM_SDRAM_REST = 0b - mdelay(5); -} - -static void init_dll(struct atyfb_par *par) -{ - // enable DLL - aty_st_pll_ct(PLL_GEN_CNTL, - aty_ld_pll_ct(PLL_GEN_CNTL, par) & 0x7f, - par); - - // reset DLL - aty_st_pll_ct(DLL_CNTL, 0x82, par); - aty_st_pll_ct(DLL_CNTL, 0xE2, par); - mdelay(5); - aty_st_pll_ct(DLL_CNTL, 0x82, par); - mdelay(6); -} - -static void reset_clocks(struct atyfb_par *par, struct pll_ct *pll, - int hsync_enb) -{ - reset_gui(par); - aty_st_pll_ct(MCLK_FB_DIV, pll->mclk_fb_div, par); - aty_st_pll_ct(SCLK_FB_DIV, pll->sclk_fb_div, par); - - mdelay(15); - init_dll(par); - aty_st_8(GEN_TEST_CNTL+1, 0x00, par); - mdelay(5); - aty_st_8(CRTC_GEN_CNTL+3, 0x04, par); - mdelay(6); - reset_sdram(par); - aty_st_8(CRTC_GEN_CNTL+3, - hsync_enb ? 0x00 : 0x04, par); - - aty_st_pll_ct(SPLL_CNTL2, pll->spll_cntl2, par); - aty_st_pll_ct(PLL_GEN_CNTL, pll->pll_gen_cntl, par); - aty_st_pll_ct(PLL_VCLK_CNTL, pll->pll_vclk_cntl, par); -} - -int atyfb_xl_init(struct fb_info *info) -{ - const struct xl_card_cfg_t * card = &card_cfg[xl_card]; - struct atyfb_par *par = (struct atyfb_par *) info->par; - union aty_pll pll; - int err; - u32 temp; - - aty_st_8(CONFIG_STAT0, 0x85, par); - mdelay(10); - - /* - * The following needs to be set before the call - * to var_to_pll() below. They'll be re-set again - * to the same values in aty_init(). - */ - par->ref_clk_per = 100000000UL/card->ref_crystal; - par->ram_type = card->mem_type; - info->fix.smem_len = card->mem_size; - if (xl_card == VICTORIA) { - // the MCLK, XCLK are 120MHz on victoria card - par->mclk_per = 1000000/120; - par->xclk_per = 1000000/120; - par->features &= ~M64F_MFB_FORCE_4; - } - - /* - * Calculate mclk and xclk dividers, etc. The passed - * pixclock and bpp values don't matter yet, the vclk - * isn't programmed until later. - */ - if ((err = aty_pll_ct.var_to_pll(info, 39726, 8, &pll))) - return err; - - aty_st_pll_ct(LVDS_CNTL0, 0x00, par); - aty_st_pll_ct(DLL2_CNTL, card->dll2_cntl, par); - aty_st_pll_ct(V2PLL_CNTL, 0x10, par); - aty_st_pll_ct(MPLL_CNTL, MPLL_GAIN, par); - aty_st_pll_ct(VPLL_CNTL, VPLL_GAIN, par); - aty_st_pll_ct(PLL_VCLK_CNTL, 0x00, par); - aty_st_pll_ct(VFC_CNTL, 0x1B, par); - aty_st_pll_ct(PLL_REF_DIV, pll.ct.pll_ref_div, par); - aty_st_pll_ct(PLL_EXT_CNTL, pll.ct.pll_ext_cntl, par); - aty_st_pll_ct(SPLL_CNTL2, 0x03, par); - aty_st_pll_ct(PLL_GEN_CNTL, 0x44, par); - - reset_clocks(par, &pll.ct, 0); - mdelay(10); - - aty_st_pll_ct(VCLK_POST_DIV, 0x03, par); - aty_st_pll_ct(VCLK0_FB_DIV, 0xDA, par); - aty_st_pll_ct(VCLK_POST_DIV, 0x0F, par); - aty_st_pll_ct(VCLK1_FB_DIV, 0xF5, par); - aty_st_pll_ct(VCLK_POST_DIV, 0x3F, par); - aty_st_pll_ct(PLL_EXT_CNTL, 0x40 | pll.ct.pll_ext_cntl, par); - aty_st_pll_ct(VCLK2_FB_DIV, 0x00, par); - aty_st_pll_ct(VCLK_POST_DIV, 0xFF, par); - aty_st_pll_ct(PLL_EXT_CNTL, 0xC0 | pll.ct.pll_ext_cntl, par); - aty_st_pll_ct(VCLK3_FB_DIV, 0x00, par); - - aty_st_8(BUS_CNTL, 0x01, par); - aty_st_le32(BUS_CNTL, card->bus_cntl | 0x08000000, par); - - aty_st_le32(CRTC_GEN_CNTL, 0x04000200, par); - aty_st_le16(CONFIG_STAT0, 0x0020, par); - aty_st_le32(MEM_CNTL, 0x10151A33, par); - aty_st_le32(EXT_MEM_CNTL, 0xE0000C01, par); - aty_st_le16(CRTC_GEN_CNTL+2, 0x0000, par); - aty_st_le32(DAC_CNTL, card->dac_cntl, par); - aty_st_le16(GEN_TEST_CNTL, 0x0100, par); - aty_st_le32(CUSTOM_MACRO_CNTL, 0x003C0171, par); - aty_st_le32(MEM_BUF_CNTL, 0x00382848, par); - - aty_st_le32(HW_DEBUG, card->hw_debug, par); - aty_st_le16(MEM_ADDR_CONFIG, 0x0000, par); - aty_st_le16(GP_IO+2, 0x0000, par); - aty_st_le16(GEN_TEST_CNTL, 0x0000, par); - aty_st_le16(EXT_DAC_REGS+2, 0x0000, par); - aty_st_le32(CRTC_INT_CNTL, 0x00000000, par); - aty_st_le32(TIMER_CONFIG, 0x00000000, par); - aty_st_le32(0xEC, 0x00000000, par); - aty_st_le32(0xFC, 0x00000000, par); - -#if defined (CONFIG_FB_ATY_GENERIC_LCD) - { - int i; - - for (i = 0; i < ARRAY_SIZE(lcd_tbl); i++) - aty_st_lcd(lcd_tbl[i].lcd_reg, lcd_tbl[i].val, par); - } -#endif - - aty_st_le16(CONFIG_STAT0, 0x00A4, par); - mdelay(10); - - aty_st_8(BUS_CNTL+1, 0xA0, par); - mdelay(10); - - reset_clocks(par, &pll.ct, 1); - mdelay(10); - - // something about power management - aty_st_8(LCD_INDEX, 0x08, par); - aty_st_8(LCD_DATA, 0x0A, par); - aty_st_8(LCD_INDEX, 0x08, par); - aty_st_8(LCD_DATA+3, 0x02, par); - aty_st_8(LCD_INDEX, 0x08, par); - aty_st_8(LCD_DATA, 0x0B, par); - mdelay(2); - - // enable display requests, enable CRTC - aty_st_8(CRTC_GEN_CNTL+3, 0x02, par); - // disable display - aty_st_8(CRTC_GEN_CNTL, 0x40, par); - // disable display requests, disable CRTC - aty_st_8(CRTC_GEN_CNTL+3, 0x04, par); - mdelay(10); - - aty_st_pll_ct(PLL_YCLK_CNTL, 0x25, par); - - aty_st_le16(CUSTOM_MACRO_CNTL, 0x0179, par); - aty_st_le16(CUSTOM_MACRO_CNTL+2, 0x005E, par); - aty_st_le16(CUSTOM_MACRO_CNTL+2, card->custom_macro_cntl>>16, par); - aty_st_8(CUSTOM_MACRO_CNTL+1, - (card->custom_macro_cntl>>8) & 0xff, par); - - aty_st_le32(MEM_ADDR_CONFIG, card->mem_addr_config, par); - aty_st_le32(MEM_CNTL, card->mem_cntl, par); - aty_st_le32(EXT_MEM_CNTL, card->ext_mem_cntl, par); - - aty_st_8(CONFIG_STAT0, 0xA0 | card->mem_type, par); - - aty_st_pll_ct(PLL_YCLK_CNTL, 0x01, par); - mdelay(15); - aty_st_pll_ct(PLL_YCLK_CNTL, card->pll_yclk_cntl, par); - mdelay(1); - - reset_clocks(par, &pll.ct, 0); - mdelay(50); - reset_clocks(par, &pll.ct, 0); - mdelay(50); - - // enable extended register block - aty_st_8(BUS_CNTL+3, 0x7B, par); - mdelay(1); - // disable extended register block - aty_st_8(BUS_CNTL+3, 0x73, par); - - aty_st_8(CONFIG_STAT0, 0x80 | card->mem_type, par); - - // disable display requests, disable CRTC - aty_st_8(CRTC_GEN_CNTL+3, 0x04, par); - // disable mapping registers in VGA aperture - aty_st_8(CONFIG_CNTL, aty_ld_8(CONFIG_CNTL, par) & ~0x04, par); - mdelay(50); - // enable display requests, enable CRTC - aty_st_8(CRTC_GEN_CNTL+3, 0x02, par); - - // make GPIO's 14,15,16 all inputs - aty_st_8(LCD_INDEX, 0x07, par); - aty_st_8(LCD_DATA+3, 0x00, par); - - // enable the display - aty_st_8(CRTC_GEN_CNTL, 0x00, par); - mdelay(17); - // reset the memory controller - aty_st_8(GEN_TEST_CNTL+1, 0x02, par); - mdelay(15); - aty_st_8(GEN_TEST_CNTL+1, 0x00, par); - mdelay(30); - - // enable extended register block - aty_st_8(BUS_CNTL+3, - (u8)(aty_ld_8(BUS_CNTL+3, par) | 0x08), - par); - // set FIFO size to 512 (PIO) - aty_st_le32(GUI_CNTL, - aty_ld_le32(GUI_CNTL, par) & ~0x3, - par); - - // enable CRT and disable lcd - aty_st_8(LCD_INDEX, 0x01, par); - temp = aty_ld_le32(LCD_DATA, par); - temp = (temp | 0x01) & ~0x02; - aty_st_le32(LCD_DATA, temp, par); - return 0; -} - |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:32:30
|
From: Mark Fortescue <mark@...> A cut and past error regarding the CG3 frame buffer needs to be fixed. It also affects Creator/Creator3D/Elite3D. Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/Kconfig | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 25b6ca6..3e470c8 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -534,6 +534,12 @@ config FB_SUN3 bool "Sun3 framebuffer support" depends on (FB = y) && (SUN3 || SUN3X) && BROKEN +config FB_SBUS + bool "SBUS and UPA framebuffers" + depends on (FB = y) && (SPARC32 || SPARC64) + help + Say Y if you want support for SBUS or UPA based frame buffer device. + config FB_BW2 bool "BWtwo support" depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) @@ -546,6 +552,7 @@ config FB_BW2 config FB_CG3 bool "CGthree support" depends on (FB = y) && ((SPARC32 || SPARC64) && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) + select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help @@ -1210,12 +1217,6 @@ config FB_AU1100 source "drivers/video/geode/Kconfig" -config FB_SBUS - bool "SBUS and UPA framebuffers" - depends on (FB = y) && (SPARC32 || SPARC64) - help - Say Y if you want support for SBUS or UPA based frame buffer device. - config FB_FFB bool "Creator/Creator3D/Elite3D support" depends on FB_SBUS && SPARC64 |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:32:23
|
- remove unneeded casts Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/fbsysfs.c | 53 ++++++++++++++++++----------------------------- 1 files changed, 20 insertions(+), 33 deletions(-) diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c index 1f7302e..15707e4 100644 --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c @@ -106,8 +106,7 @@ static int mode_string(char *buf, unsign static ssize_t store_mode(struct class_device *class_device, const char * buf, size_t count) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); char mstr[100]; struct fb_var_screeninfo var; struct fb_modelist *modelist; @@ -137,8 +136,7 @@ static ssize_t store_mode(struct class_d static ssize_t show_mode(struct class_device *class_device, char *buf) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); if (!fb_info->mode) return 0; @@ -149,8 +147,7 @@ static ssize_t show_mode(struct class_de static ssize_t store_modes(struct class_device *class_device, const char * buf, size_t count) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); LIST_HEAD(old_list); int i = count / sizeof(struct fb_videomode); @@ -174,8 +171,7 @@ static ssize_t store_modes(struct class_ static ssize_t show_modes(struct class_device *class_device, char *buf) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); unsigned int i; struct list_head *pos; struct fb_modelist *modelist; @@ -193,8 +189,7 @@ static ssize_t show_modes(struct class_d static ssize_t store_bpp(struct class_device *class_device, const char * buf, size_t count) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); struct fb_var_screeninfo var; char ** last = NULL; int err; @@ -208,8 +203,7 @@ static ssize_t store_bpp(struct class_de static ssize_t show_bpp(struct class_device *class_device, char *buf) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->var.bits_per_pixel); } @@ -280,8 +274,7 @@ static ssize_t show_con_rotate(struct cl static ssize_t store_virtual(struct class_device *class_device, const char * buf, size_t count) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); struct fb_var_screeninfo var; char *last = NULL; int err; @@ -300,16 +293,14 @@ static ssize_t store_virtual(struct clas static ssize_t show_virtual(struct class_device *class_device, char *buf) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xres_virtual, fb_info->var.yres_virtual); } static ssize_t show_stride(struct class_device *class_device, char *buf) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); return snprintf(buf, PAGE_SIZE, "%d\n", fb_info->fix.line_length); } @@ -320,7 +311,7 @@ static ssize_t show_stride(struct class_ static ssize_t store_cmap(struct class_device *class_device, const char *buf, size_t count) { - struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); int rc, i, start, length, transp = 0; if ((count > PAGE_SIZE) || ((count % 16) != 0)) @@ -380,8 +371,7 @@ static ssize_t store_cmap(struct class_d static ssize_t show_cmap(struct class_device *class_device, char *buf) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); unsigned int i; if (!fb_info->cmap.red || !fb_info->cmap.blue || @@ -405,8 +395,7 @@ static ssize_t show_cmap(struct class_de static ssize_t store_blank(struct class_device *class_device, const char * buf, size_t count) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); char *last = NULL; int err; @@ -422,41 +411,40 @@ static ssize_t store_blank(struct class_ static ssize_t show_blank(struct class_device *class_device, char *buf) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +// struct fb_info *fb_info = class_get_devdata(class_device); return 0; } static ssize_t store_console(struct class_device *class_device, const char * buf, size_t count) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +// struct fb_info *fb_info = class_get_devdata(class_device); return 0; } static ssize_t show_console(struct class_device *class_device, char *buf) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +// struct fb_info *fb_info = class_get_devdata(class_device); return 0; } static ssize_t store_cursor(struct class_device *class_device, const char * buf, size_t count) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +// struct fb_info *fb_info = class_get_devdata(class_device); return 0; } static ssize_t show_cursor(struct class_device *class_device, char *buf) { -// struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); +// struct fb_info *fb_info = class_get_devdata(class_device); return 0; } static ssize_t store_pan(struct class_device *class_device, const char * buf, size_t count) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); struct fb_var_screeninfo var; char *last = NULL; int err; @@ -479,15 +467,14 @@ static ssize_t store_pan(struct class_de static ssize_t show_pan(struct class_device *class_device, char *buf) { - struct fb_info *fb_info = - (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); return snprintf(buf, PAGE_SIZE, "%d,%d\n", fb_info->var.xoffset, fb_info->var.xoffset); } static ssize_t show_name(struct class_device *class_device, char *buf) { - struct fb_info *fb_info = (struct fb_info *)class_get_devdata(class_device); + struct fb_info *fb_info = class_get_devdata(class_device); return snprintf(buf, PAGE_SIZE, "%s\n", fb_info->fix.id); } |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:32:19
|
- remove unneeded casts - move memory for pseudo_palette inside struct tdfxfb_par - whitespace changes Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/tdfxfb.c | 57 ++++++++++++++++++--------------- include/video/tdfx.h | 84 ++++++++++++++++++++++++------------------------ 2 files changed, 73 insertions(+), 68 deletions(-) diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c index 60bc890..3e7baf4 100644 --- a/drivers/video/tdfxfb.c +++ b/drivers/video/tdfxfb.c @@ -291,7 +291,7 @@ static inline void banshee_make_room(str static int banshee_wait_idle(struct fb_info *info) { - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; int i = 0; banshee_make_room(par, 1); @@ -364,7 +364,7 @@ static u32 do_calc_pll(int freq, int* fr static void do_write_regs(struct fb_info *info, struct banshee_reg* reg) { - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; int i; banshee_wait_idle(info); @@ -469,7 +469,7 @@ static unsigned long do_lfb_size(struct static int tdfxfb_check_var(struct fb_var_screeninfo *var,struct fb_info *info) { - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; u32 lpitch; if (var->bits_per_pixel != 8 && var->bits_per_pixel != 16 && @@ -558,7 +558,7 @@ static int tdfxfb_check_var(struct fb_va static int tdfxfb_set_par(struct fb_info *info) { - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; u32 hdispend, hsyncsta, hsyncend, htotal; u32 hd, hs, he, ht, hbs, hbe; u32 vd, vs, ve, vt, vbs, vbe; @@ -780,7 +780,7 @@ static int tdfxfb_set_par(struct fb_info static int tdfxfb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,unsigned transp,struct fb_info *info) { - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; u32 rgbcol; if (regno >= info->cmap.len || regno > 255) return 1; @@ -794,11 +794,15 @@ static int tdfxfb_setcolreg(unsigned reg break; /* Truecolor has no hardware color palettes. */ case FB_VISUAL_TRUECOLOR: - rgbcol = (CNVT_TOHW( red, info->var.red.length) << info->var.red.offset) | - (CNVT_TOHW( green, info->var.green.length) << info->var.green.offset) | - (CNVT_TOHW( blue, info->var.blue.length) << info->var.blue.offset) | - (CNVT_TOHW( transp, info->var.transp.length) << info->var.transp.offset); - ((u32*)(info->pseudo_palette))[regno] = rgbcol; + rgbcol = (CNVT_TOHW( red, info->var.red.length) << + info->var.red.offset) | + (CNVT_TOHW( green, info->var.green.length) << + info->var.green.offset) | + (CNVT_TOHW( blue, info->var.blue.length) << + info->var.blue.offset) | + (CNVT_TOHW( transp, info->var.transp.length) << + info->var.transp.offset); + par->palette[regno] = rgbcol; break; default: DPRINTK("bad depth %u\n", info->var.bits_per_pixel); @@ -810,7 +814,7 @@ static int tdfxfb_setcolreg(unsigned reg /* 0 unblank, 1 blank, 2 no vsync, 3 no hsync, 4 off */ static int tdfxfb_blank(int blank, struct fb_info *info) { - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; u32 dacmode, state = 0, vgablank = 0; dacmode = tdfx_inl(par, DACMODE); @@ -855,7 +859,7 @@ static int tdfxfb_blank(int blank, struc static int tdfxfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; u32 addr; if (nopan || var->xoffset || (var->yoffset > var->yres_virtual)) @@ -878,7 +882,7 @@ static int tdfxfb_pan_display(struct fb_ */ static void tdfxfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; u32 bpp = info->var.bits_per_pixel; u32 stride = info->fix.line_length; u32 fmt= stride | ((bpp+((bpp==8) ? 0 : 8)) << 13); @@ -894,7 +898,7 @@ static void tdfxfb_fillrect(struct fb_in if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR) { tdfx_outl(par, COLORFORE, rect->color); } else { /* FB_VISUAL_TRUECOLOR */ - tdfx_outl(par, COLORFORE, ((u32*)(info->pseudo_palette))[rect->color]); + tdfx_outl(par, COLORFORE, par->palette[rect->color]); } tdfx_outl(par, COMMAND_2D, COMMAND_2D_FILLRECT | (tdfx_rop << 24)); tdfx_outl(par, DSTSIZE, rect->width | (rect->height << 16)); @@ -906,7 +910,7 @@ static void tdfxfb_fillrect(struct fb_in */ static void tdfxfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) { - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; u32 sx = area->sx, sy = area->sy, dx = area->dx, dy = area->dy; u32 bpp = info->var.bits_per_pixel; u32 stride = info->fix.line_length; @@ -938,7 +942,7 @@ static void tdfxfb_copyarea(struct fb_in static void tdfxfb_imageblit(struct fb_info *info, const struct fb_image *image) { - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; int size = image->height * ((image->width * image->depth + 7)>>3); int fifo_free; int i, stride = info->fix.line_length; @@ -961,8 +965,10 @@ static void tdfxfb_imageblit(struct fb_i break; case FB_VISUAL_TRUECOLOR: default: - tdfx_outl(par, COLORFORE, ((u32*)(info->pseudo_palette))[image->fg_color]); - tdfx_outl(par, COLORBACK, ((u32*)(info->pseudo_palette))[image->bg_color]); + tdfx_outl(par, COLORFORE, + par->palette[image->fg_color]); + tdfx_outl(par, COLORBACK, + par->palette[image->bg_color]); } #ifdef __BIG_ENDIAN srcfmt = 0x400000 | BIT(20); @@ -1007,7 +1013,7 @@ static void tdfxfb_imageblit(struct fb_i #ifdef TDFX_HARDWARE_CURSOR static int tdfxfb_cursor(struct fb_info *info, struct fb_cursor *cursor) { - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; unsigned long flags; /* @@ -1157,18 +1163,17 @@ static int __devinit tdfxfb_probe(struct { struct tdfx_par *default_par; struct fb_info *info; - int size, err, lpitch; + int err, lpitch; if ((err = pci_enable_device(pdev))) { printk(KERN_WARNING "tdfxfb: Can't enable pdev: %d\n", err); return err; } - size = sizeof(struct tdfx_par)+256*sizeof(u32); + info = framebuffer_alloc(sizeof(struct tdfx_par), &pdev->dev); - info = framebuffer_alloc(size, &pdev->dev); - - if (!info) return -ENOMEM; + if (!info) + return -ENOMEM; default_par = info->par; @@ -1248,7 +1253,7 @@ static int __devinit tdfxfb_probe(struct info->fbops = &tdfxfb_ops; info->fix = tdfx_fix; - info->pseudo_palette = (void *)(default_par + 1); + info->pseudo_palette = default_par->palette; info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; #ifdef CONFIG_FB_3DFX_ACCEL info->flags |= FBINFO_HWACCEL_FILLRECT | @@ -1340,7 +1345,7 @@ static void tdfxfb_setup(char *options) static void __devexit tdfxfb_remove(struct pci_dev *pdev) { struct fb_info *info = pci_get_drvdata(pdev); - struct tdfx_par *par = (struct tdfx_par *) info->par; + struct tdfx_par *par = info->par; unregister_framebuffer(info); iounmap(par->regbase_virt); diff --git a/include/video/tdfx.h b/include/video/tdfx.h index 0423767..c1cc94b 100644 --- a/include/video/tdfx.h +++ b/include/video/tdfx.h @@ -140,52 +140,52 @@ #ifdef __KERNEL__ struct banshee_reg { - /* VGA rubbish */ - unsigned char att[21]; - unsigned char crt[25]; - unsigned char gra[ 9]; - unsigned char misc[1]; - unsigned char seq[ 5]; - - /* Banshee extensions */ - unsigned char ext[2]; - unsigned long vidcfg; - unsigned long vidpll; - unsigned long mempll; - unsigned long gfxpll; - unsigned long dacmode; - unsigned long vgainit0; - unsigned long vgainit1; - unsigned long screensize; - unsigned long stride; - unsigned long cursloc; - unsigned long curspataddr; - unsigned long cursc0; - unsigned long cursc1; - unsigned long startaddr; - unsigned long clip0min; - unsigned long clip0max; - unsigned long clip1min; - unsigned long clip1max; - unsigned long srcbase; - unsigned long dstbase; - unsigned long miscinit0; + /* VGA rubbish */ + unsigned char att[21]; + unsigned char crt[25]; + unsigned char gra[ 9]; + unsigned char misc[1]; + unsigned char seq[ 5]; + + /* Banshee extensions */ + unsigned char ext[2]; + unsigned long vidcfg; + unsigned long vidpll; + unsigned long mempll; + unsigned long gfxpll; + unsigned long dacmode; + unsigned long vgainit0; + unsigned long vgainit1; + unsigned long screensize; + unsigned long stride; + unsigned long cursloc; + unsigned long curspataddr; + unsigned long cursc0; + unsigned long cursc1; + unsigned long startaddr; + unsigned long clip0min; + unsigned long clip0max; + unsigned long clip1min; + unsigned long clip1max; + unsigned long srcbase; + unsigned long dstbase; + unsigned long miscinit0; }; struct tdfx_par { - u32 max_pixclock; + u32 max_pixclock; + u32 palette[16]; + void __iomem *regbase_virt; + unsigned long iobase; + u32 baseline; + + struct { + int w,u,d; + unsigned long enable,disable; + struct timer_list timer; + } hwcursor; - void __iomem *regbase_virt; - unsigned long iobase; - u32 baseline; - - struct { - int w,u,d; - unsigned long enable,disable; - struct timer_list timer; - } hwcursor; - - spinlock_t DAClock; + spinlock_t DAClock; }; #endif /* __KERNEL__ */ |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:32:08
|
- remove unneeded casts - make setcolreg return success if regno > 15, but don't do anything - use framebuffer_alloc/framebuffer_release to allocate/free memory Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/sstfb.c | 60 ++++++++++++++++++++++--------------------------- include/video/sstfb.h | 1 + 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c index e0f14df..8a5ce21 100644 --- a/drivers/video/sstfb.c +++ b/drivers/video/sstfb.c @@ -382,7 +382,7 @@ static void sstfb_clear_screen(struct fb static int sstfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int hSyncOff = var->xres + var->right_margin + var->left_margin; int vSyncOff = var->yres + var->lower_margin + var->upper_margin; int vBackPorch = var->left_margin, yDim = var->yres; @@ -542,7 +542,7 @@ static int sstfb_check_var(struct fb_var */ static int sstfb_set_par(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u32 lfbmode, fbiinit1, fbiinit2, fbiinit3, fbiinit5, fbiinit6=0; struct pci_dev *sst_dev = par->dev; unsigned int freq; @@ -748,13 +748,14 @@ static int sstfb_set_par(struct fb_info static int sstfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { + struct sstfb_par *par = info->par; u32 col; f_dddprintk("sstfb_setcolreg\n"); f_dddprintk("%-2d rgbt: %#x, %#x, %#x, %#x\n", regno, red, green, blue, transp); - if (regno >= 16) - return -EINVAL; + if (regno > 15) + return 0; red >>= (16 - info->var.red.length); green >>= (16 - info->var.green.length); @@ -765,7 +766,7 @@ static int sstfb_setcolreg(u_int regno, | (blue << info->var.blue.offset) | (transp << info->var.transp.offset); - ((u32 *)info->pseudo_palette)[regno] = col; + par->palette[regno] = col; return 0; } @@ -773,7 +774,7 @@ static int sstfb_setcolreg(u_int regno, static int sstfb_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long arg, struct fb_info *info ) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; struct pci_dev *sst_dev = par->dev; u32 fbiinit0, tmp, val; u_long p; @@ -830,7 +831,7 @@ static int sstfb_ioctl(struct inode *ino #if 0 static void sstfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u32 stride = info->fix.line_length; if (!IS_VOODOO2(par)) @@ -855,7 +856,7 @@ static void sstfb_copyarea(struct fb_inf */ static void sstfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u32 stride = info->fix.line_length; if (!IS_VOODOO2(par)) @@ -925,7 +926,7 @@ static int __devinit sst_get_memsize(str static int __devinit sst_detect_att(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int i, mir, dir; for (i=0; i<3; i++) { @@ -950,7 +951,7 @@ static int __devinit sst_detect_att(stru static int __devinit sst_detect_ti(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int i, mir, dir; for (i = 0; i<3; i++) { @@ -986,7 +987,7 @@ static int __devinit sst_detect_ti(struc */ static int __devinit sst_detect_ics(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int m_clk0_1, m_clk0_7, m_clk1_b; int n_clk0_1, n_clk0_7, n_clk1_b; int i; @@ -1023,7 +1024,7 @@ static int __devinit sst_detect_ics(stru static int sst_set_pll_att_ti(struct fb_info *info, const struct pll_timing *t, const int clock) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u8 cr0, cc; /* enable indexed mode */ @@ -1077,7 +1078,7 @@ static int sst_set_pll_att_ti(struct fb_ static int sst_set_pll_ics(struct fb_info *info, const struct pll_timing *t, const int clock) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u8 pll_ctrl; sst_dac_write(DACREG_ICS_PLLRMA, DACREG_ICS_PLL_CTRL); @@ -1114,7 +1115,7 @@ static int sst_set_pll_ics(struct fb_inf static void sst_set_vidmod_att_ti(struct fb_info *info, const int bpp) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u8 cr0; sst_dac_write(DACREG_WMA, 0); /* backdoor */ @@ -1149,7 +1150,7 @@ static void sst_set_vidmod_att_ti(struct static void sst_set_vidmod_ics(struct fb_info *info, const int bpp) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; switch(bpp) { case 16: @@ -1308,7 +1309,7 @@ static int __devinit sst_init(struct fb_ static void __devexit sst_shutdown(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; struct pci_dev *dev = par->dev; struct pll_timing gfx_timings; int Fout; @@ -1394,12 +1395,6 @@ static int __devinit sstfb_probe(struct struct sst_spec *spec; int err; - struct all_info { - struct fb_info info; - struct sstfb_par par; - u32 pseudo_palette[16]; - } *all; - /* Enable device in PCI config. */ if ((err=pci_enable_device(pdev))) { eprintk("cannot enable device\n"); @@ -1407,14 +1402,13 @@ static int __devinit sstfb_probe(struct } /* Allocate the fb and par structures. */ - all = kmalloc(sizeof(*all), GFP_KERNEL); - if (!all) + info = framebuffer_alloc(sizeof(struct sstfb_par), &pdev->dev); + if (!info) return -ENOMEM; - memset(all, 0, sizeof(*all)); - pci_set_drvdata(pdev, all); + + pci_set_drvdata(pdev, info); - info = &all->info; - par = info->par = &all->par; + par = info->par; fix = &info->fix; par->type = id->driver_data; @@ -1471,7 +1465,7 @@ static int __devinit sstfb_probe(struct info->flags = FBINFO_DEFAULT; info->fbops = &sstfb_ops; - info->pseudo_palette = &all->pseudo_palette; + info->pseudo_palette = par->palette; fix->type = FB_TYPE_PACKED_PIXELS; fix->visual = FB_VISUAL_TRUECOLOR; @@ -1527,7 +1521,7 @@ fail_mmio_remap: fail_fb_mem: release_mem_region(fix->mmio_start, info->fix.mmio_len); fail_mmio_mem: - kfree(info); + framebuffer_release(info); return -ENXIO; /* no voodoo detected */ } @@ -1537,7 +1531,7 @@ static void __devexit sstfb_remove(struc struct fb_info *info; info = pci_get_drvdata(pdev); - par = (struct sstfb_par *) info->par; + par = info->par; sst_shutdown(info); unregister_framebuffer(info); @@ -1545,7 +1539,7 @@ static void __devexit sstfb_remove(struc iounmap(par->mmio_vbase); release_mem_region(info->fix.smem_start, 0x400000); release_mem_region(info->fix.mmio_start, info->fix.mmio_len); - kfree(info); + framebuffer_release(info); }- remove unneeded casts - make setcolreg return success if regno > 15, but don't do anything - use framebuffer_alloc/framebuffer_release to allocate/free memory Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/sstfb.c | 60 ++++++++++++++++++++++--------------------------- include/video/sstfb.h | 1 + 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c index e0f14df..8a5ce21 100644 --- a/drivers/video/sstfb.c +++ b/drivers/video/sstfb.c @@ -382,7 +382,7 @@ static void sstfb_clear_screen(struct fb static int sstfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int hSyncOff = var->xres + var->right_margin + var->left_margin; int vSyncOff = var->yres + var->lower_margin + var->upper_margin; int vBackPorch = var->left_margin, yDim = var->yres; @@ -542,7 +542,7 @@ static int sstfb_check_var(struct fb_var */ static int sstfb_set_par(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u32 lfbmode, fbiinit1, fbiinit2, fbiinit3, fbiinit5, fbiinit6=0; struct pci_dev *sst_dev = par->dev; unsigned int freq; @@ -748,13 +748,14 @@ static int sstfb_set_par(struct fb_info static int sstfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { + struct sstfb_par *par = info->par; u32 col; f_dddprintk("sstfb_setcolreg\n"); f_dddprintk("%-2d rgbt: %#x, %#x, %#x, %#x\n", regno, red, green, blue, transp); - if (regno >= 16) - return -EINVAL; + if (regno > 15) + return 0; red >>= (16 - info->var.red.length); green >>= (16 - info->var.green.length); @@ -765,7 +766,7 @@ static int sstfb_setcolreg(u_int regno, | (blue << info->var.blue.offset) | (transp << info->var.transp.offset); - ((u32 *)info->pseudo_palette)[regno] = col; + par->palette[regno] = col; return 0; } @@ -773,7 +774,7 @@ static int sstfb_setcolreg(u_int regno, static int sstfb_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long arg, struct fb_info *info ) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; struct pci_dev *sst_dev = par->dev; u32 fbiinit0, tmp, val; u_long p; @@ -830,7 +831,7 @@ static int sstfb_ioctl(struct inode *ino #if 0 static void sstfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u32 stride = info->fix.line_length; if (!IS_VOODOO2(par)) @@ -855,7 +856,7 @@ static void sstfb_copyarea(struct fb_inf */ static void sstfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u32 stride = info->fix.line_length; if (!IS_VOODOO2(par)) @@ -925,7 +926,7 @@ static int __devinit sst_get_memsize(str static int __devinit sst_detect_att(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int i, mir, dir; for (i=0; i<3; i++) { @@ -950,7 +951,7 @@ static int __devinit sst_detect_att(stru static int __devinit sst_detect_ti(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int i, mir, dir; for (i = 0; i<3; i++) { @@ -986,7 +987,7 @@ static int __devinit sst_detect_ti(struc */ static int __devinit sst_detect_ics(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; int m_clk0_1, m_clk0_7, m_clk1_b; int n_clk0_1, n_clk0_7, n_clk1_b; int i; @@ -1023,7 +1024,7 @@ static int __devinit sst_detect_ics(stru static int sst_set_pll_att_ti(struct fb_info *info, const struct pll_timing *t, const int clock) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u8 cr0, cc; /* enable indexed mode */ @@ -1077,7 +1078,7 @@ static int sst_set_pll_att_ti(struct fb_ static int sst_set_pll_ics(struct fb_info *info, const struct pll_timing *t, const int clock) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u8 pll_ctrl; sst_dac_write(DACREG_ICS_PLLRMA, DACREG_ICS_PLL_CTRL); @@ -1114,7 +1115,7 @@ static int sst_set_pll_ics(struct fb_inf static void sst_set_vidmod_att_ti(struct fb_info *info, const int bpp) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; u8 cr0; sst_dac_write(DACREG_WMA, 0); /* backdoor */ @@ -1149,7 +1150,7 @@ static void sst_set_vidmod_att_ti(struct static void sst_set_vidmod_ics(struct fb_info *info, const int bpp) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; switch(bpp) { case 16: @@ -1308,7 +1309,7 @@ static int __devinit sst_init(struct fb_ static void __devexit sst_shutdown(struct fb_info *info) { - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; struct pci_dev *dev = par->dev; struct pll_timing gfx_timings; int Fout; @@ -1394,12 +1395,6 @@ static int __devinit sstfb_probe(struct struct sst_spec *spec; int err; - struct all_info { - struct fb_info info; - struct sstfb_par par; - u32 pseudo_palette[16]; - } *all; - /* Enable device in PCI config. */ if ((err=pci_enable_device(pdev))) { eprintk("cannot enable device\n"); @@ -1407,14 +1402,13 @@ static int __devinit sstfb_probe(struct } /* Allocate the fb and par structures. */ - all = kmalloc(sizeof(*all), GFP_KERNEL); - if (!all) + info = framebuffer_alloc(sizeof(struct sstfb_par), &pdev->dev); + if (!info) return -ENOMEM; - memset(all, 0, sizeof(*all)); - pci_set_drvdata(pdev, all); + + pci_set_drvdata(pdev, info); - info = &all->info; - par = info->par = &all->par; + par = info->par; fix = &info->fix; par->type = id->driver_data; @@ -1471,7 +1465,7 @@ static int __devinit sstfb_probe(struct info->flags = FBINFO_DEFAULT; info->fbops = &sstfb_ops; - info->pseudo_palette = &all->pseudo_palette; + info->pseudo_palette = par->palette; fix->type = FB_TYPE_PACKED_PIXELS; fix->visual = FB_VISUAL_TRUECOLOR; @@ -1527,7 +1521,7 @@ fail_mmio_remap: fail_fb_mem: release_mem_region(fix->mmio_start, info->fix.mmio_len); fail_mmio_mem: - kfree(info); + framebuffer_release(info); return -ENXIO; /* no voodoo detected */ } @@ -1537,7 +1531,7 @@ static void __devexit sstfb_remove(struc struct fb_info *info; info = pci_get_drvdata(pdev); - par = (struct sstfb_par *) info->par; + par = info->par; sst_shutdown(info); unregister_framebuffer(info); @@ -1545,7 +1539,7 @@ static void __devexit sstfb_remove(struc iounmap(par->mmio_vbase); release_mem_region(info->fix.smem_start, 0x400000); release_mem_region(info->fix.mmio_start, info->fix.mmio_len); - kfree(info); + framebuffer_release(info); } @@ -1613,7 +1607,7 @@ static int sstfb_dump_regs(struct fb_inf const int pci_s = sizeof(pci_regs)/sizeof(pci_regs[0]); const int sst_s = sizeof(sst_regs)/sizeof(sst_regs[0]); - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; struct pci_dev *dev = par->dev; u32 pci_res[pci_s]; u32 sst_res[sst_s]; diff --git a/include/video/sstfb.h b/include/video/sstfb.h index 0d77b52..3570f9c 100644 --- a/include/video/sstfb.h +++ b/include/video/sstfb.h @@ -334,6 +334,7 @@ struct sst_spec { }; struct sstfb_par { + u32 palette[16]; unsigned int yDim; unsigned int hSyncOn; /* hsync_len */ unsigned int hSyncOff; /* left_margin + xres + right_margin */ @@ -1613,7 +1607,7 @@ static int sstfb_dump_regs(struct fb_inf const int pci_s = sizeof(pci_regs)/sizeof(pci_regs[0]); const int sst_s = sizeof(sst_regs)/sizeof(sst_regs[0]); - struct sstfb_par *par = (struct sstfb_par *) info->par; + struct sstfb_par *par = info->par; struct pci_dev *dev = par->dev; u32 pci_res[pci_s]; u32 sst_res[sst_s]; diff --git a/include/video/sstfb.h b/include/video/sstfb.h index 0d77b52..3570f9c 100644 --- a/include/video/sstfb.h +++ b/include/video/sstfb.h @@ -334,6 +334,7 @@ struct sst_spec { }; struct sstfb_par { + u32 palette[16]; unsigned int yDim; unsigned int hSyncOn; /* hsync_len */ unsigned int hSyncOff; /* left_margin + xres + right_margin */ |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:31:56
|
- remove unneeded casts - move memory for pseudo_palette inside struct pm2fb_par Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/pm2fb.c | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c index 0277ce0..5fe1979 100644 --- a/drivers/video/pm2fb.c +++ b/drivers/video/pm2fb.c @@ -91,6 +91,7 @@ struct pm2fb_par u32 mem_config; /* MemConfig reg at probe */ u32 mem_control; /* MemControl reg at probe */ u32 boot_address; /* BootAddress reg at probe */ + u32 palette[16]; }; /* @@ -674,7 +675,7 @@ static int pm2fb_check_var(struct fb_var */ static int pm2fb_set_par(struct fb_info *info) { - struct pm2fb_par *par = (struct pm2fb_par *) info->par; + struct pm2fb_par *par = info->par; u32 pixclock; u32 width, height, depth; u32 hsstart, hsend, hbend, htotal; @@ -854,7 +855,7 @@ static int pm2fb_setcolreg(unsigned regn unsigned blue, unsigned transp, struct fb_info *info) { - struct pm2fb_par *par = (struct pm2fb_par *) info->par; + struct pm2fb_par *par = info->par; if (regno >= info->cmap.len) /* no. of hw registers */ return 1; @@ -929,7 +930,7 @@ static int pm2fb_setcolreg(unsigned regn case 16: case 24: case 32: - ((u32*)(info->pseudo_palette))[regno] = v; + par->palette[regno] = v; break; } return 0; @@ -955,7 +956,7 @@ static int pm2fb_setcolreg(unsigned regn static int pm2fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { - struct pm2fb_par *p = (struct pm2fb_par *) info->par; + struct pm2fb_par *p = info->par; u32 base; u32 depth; u32 xres; @@ -987,7 +988,7 @@ static int pm2fb_pan_display(struct fb_v */ static int pm2fb_blank(int blank_mode, struct fb_info *info) { - struct pm2fb_par *par = (struct pm2fb_par *) info->par; + struct pm2fb_par *par = info->par; u32 video = par->video; DPRINTK("blank_mode %d\n", blank_mode); @@ -1054,8 +1055,7 @@ static int __devinit pm2fb_probe(struct { struct pm2fb_par *default_par; struct fb_info *info; - int size, err; - int err_retval = -ENXIO; + int err, err_retval = -ENXIO; err = pci_enable_device(pdev); if ( err ) { @@ -1063,11 +1063,10 @@ static int __devinit pm2fb_probe(struct return err; } - size = sizeof(struct pm2fb_par) + 256 * sizeof(u32); - info = framebuffer_alloc(size, &pdev->dev); + info = framebuffer_alloc(sizeof(struct pm2fb_par), &pdev->dev); if ( !info ) return -ENOMEM; - default_par = (struct pm2fb_par *) info->par; + default_par = info->par; switch (pdev->device) { case PCI_DEVICE_ID_TI_TVP4020: @@ -1171,7 +1170,7 @@ static int __devinit pm2fb_probe(struct info->fbops = &pm2fb_ops; info->fix = pm2fb_fix; - info->pseudo_palette = (void *)(default_par + 1); + info->pseudo_palette = default_par->palette; info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:31:48
|
- remove unneeded casts - move memory for pseudo_palette inside struct neofb_par Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/neofb.c | 36 ++++++++++++++++++------------------ include/video/neomagic.h | 1 + 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c index 8486e77..e18c9f9 100644 --- a/drivers/video/neofb.c +++ b/drivers/video/neofb.c @@ -485,7 +485,7 @@ static void vgaHWRestore(const struct fb */ static inline int neo2200_sync(struct fb_info *info) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; int waitcycles; while (readl(&par->neo2200->bltStat) & 1) @@ -525,7 +525,7 @@ static inline void neo2200_wait_fifo(str static inline void neo2200_accel_init(struct fb_info *info, struct fb_var_screeninfo *var) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; Neo2200 __iomem *neo2200 = par->neo2200; u32 bltMod, pitch; @@ -560,7 +560,7 @@ static inline void neo2200_accel_init(st static int neofb_open(struct fb_info *info, int user) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; int cnt = atomic_read(&par->ref_count); if (!cnt) { @@ -575,7 +575,7 @@ neofb_open(struct fb_info *info, int use static int neofb_release(struct fb_info *info, int user) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; int cnt = atomic_read(&par->ref_count); if (!cnt) @@ -590,7 +590,7 @@ neofb_release(struct fb_info *info, int static int neofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; unsigned int pixclock = var->pixclock; struct xtimings timings; int memlen, vramlen; @@ -757,7 +757,7 @@ neofb_check_var(struct fb_var_screeninfo static int neofb_set_par(struct fb_info *info) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; struct xtimings timings; unsigned char temp; int i, clock_hi = 0; @@ -1216,7 +1216,7 @@ static int neofb_set_par(struct fb_info static void neofb_update_start(struct fb_info *info, struct fb_var_screeninfo *var) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; struct vgastate *state = &par->state; int oldExtCRTDispAddr; int Base; @@ -1331,7 +1331,7 @@ static int neofb_blank(int blank_mode, s * wms...Enable VESA DPMS compatible powerdown mode * run "setterm -powersave powerdown" to take advantage */ - struct neofb_par *par = (struct neofb_par *)info->par; + struct neofb_par *par = info->par; int seqflags, lcdflags, dpmsflags, reg; switch (blank_mode) { @@ -1404,7 +1404,7 @@ static int neofb_blank(int blank_mode, s static void neo2200_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; u_long dst, rop; dst = rect->dx + rect->dy * info->var.xres_virtual; @@ -1440,7 +1440,7 @@ static void neo2200_copyarea(struct fb_info *info, const struct fb_copyarea *area) { u32 sx = area->sx, sy = area->sy, dx = area->dx, dy = area->dy; - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; u_long src, dst, bltCntl; bltCntl = NEO_BC3_FIFO_EN | NEO_BC3_SKIP_MAPPING | 0x0C0000; @@ -1472,7 +1472,7 @@ neo2200_copyarea(struct fb_info *info, c static void neo2200_imageblit(struct fb_info *info, const struct fb_image *image) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; int s_pitch = (image->width * image->depth + 7) >> 3; int scan_align = info->pixmap.scan_align - 1; int buf_align = info->pixmap.buf_align - 1; @@ -1686,7 +1686,7 @@ static struct fb_videomode __devinitdata static int __devinit neo_map_mmio(struct fb_info *info, struct pci_dev *dev) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; DBG("neo_map_mmio"); @@ -1733,7 +1733,7 @@ static int __devinit neo_map_mmio(struct static void neo_unmap_mmio(struct fb_info *info) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; DBG("neo_unmap_mmio"); @@ -1796,7 +1796,7 @@ static void neo_unmap_video(struct fb_in #ifdef CONFIG_MTRR { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; mtrr_del(par->mtrr, info->fix.smem_start, info->fix.smem_len); @@ -1811,7 +1811,7 @@ static void neo_unmap_video(struct fb_in static int __devinit neo_scan_monitor(struct fb_info *info) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; unsigned char type, display; int w; @@ -1890,7 +1890,7 @@ static int __devinit neo_scan_monitor(st static int __devinit neo_init_hw(struct fb_info *info) { - struct neofb_par *par = (struct neofb_par *) info->par; + struct neofb_par *par = info->par; int videoRam = 896; int maxClock = 65000; int CursorMem = 1024; @@ -2014,7 +2014,7 @@ static struct fb_info *__devinit neo_all struct fb_info *info; struct neofb_par *par; - info = framebuffer_alloc(sizeof(struct neofb_par) + sizeof(u32) * 256, &dev->dev); + info = framebuffer_alloc(sizeof(struct neofb_par), &dev->dev); if (!info) return NULL; @@ -2081,7 +2081,7 @@ static struct fb_info *__devinit neo_all info->fix.accel = id->driver_data; info->fbops = &neofb_ops; - info->pseudo_palette = (void *) (par + 1); + info->pseudo_palette = par->palette; return info; } diff --git a/include/video/neomagic.h b/include/video/neomagic.h index bdaee70..1d69049 100644 --- a/include/video/neomagic.h +++ b/include/video/neomagic.h @@ -196,6 +196,7 @@ struct neofb_par { int internal_display; int external_display; int libretto; + u32 palette[16]; }; typedef struct { |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:31:44
|
- remove unneeded casts - use framebuffer_alloc/framebuffer_release to allocate/free memory - the pseudo_palette is always u32 regardless of bpp if using generic drawing functions Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/kyro/fbdev.c | 32 ++++++++++++++------------------ include/video/kyro.h | 1 + 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/drivers/video/kyro/fbdev.c b/drivers/video/kyro/fbdev.c index 5eb4d5c..bcd359b 100644 --- a/drivers/video/kyro/fbdev.c +++ b/drivers/video/kyro/fbdev.c @@ -73,8 +73,6 @@ static struct fb_var_screeninfo kyro_var .vmode = FB_VMODE_NONINTERLACED, }; -static struct kyrofb_info *currentpar; - typedef struct { STG4000REG __iomem *pSTGReg; /* Virtual address of PCI register region */ u32 ulNextFreeVidMem; /* Offset from start of vid mem to next free region */ @@ -309,7 +307,7 @@ enum { /* Accessors */ static int kyro_dev_video_mode_set(struct fb_info *info) { - struct kyrofb_info *par = (struct kyrofb_info *)info->par; + struct kyrofb_info *par = info->par; /* Turn off display */ StopVTG(deviceInfo.pSTGReg); @@ -402,7 +400,7 @@ static inline unsigned long get_line_len static int kyrofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { - struct kyrofb_info *par = (struct kyrofb_info *)info->par; + struct kyrofb_info *par = info->par; if (var->bits_per_pixel != 16 && var->bits_per_pixel != 32) { printk(KERN_WARNING "kyrofb: depth not supported: %u\n", var->bits_per_pixel); @@ -478,7 +476,7 @@ static int kyrofb_check_var(struct fb_va static int kyrofb_set_par(struct fb_info *info) { - struct kyrofb_info *par = (struct kyrofb_info *)info->par; + struct kyrofb_info *par = info->par; unsigned long lineclock; unsigned long frameclock; @@ -536,20 +534,22 @@ static int kyrofb_set_par(struct fb_info static int kyrofb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { + struct kyrofb_info *par = info->par; + if (regno > 255) return 1; /* Invalid register */ if (regno < 16) { switch (info->var.bits_per_pixel) { case 16: - ((u16*)(info->pseudo_palette))[regno] = + par->palette[regno] = (red & 0xf800) | ((green & 0xfc00) >> 5) | ((blue & 0xf800) >> 11); break; case 32: red >>= 8; green >>= 8; blue >>= 8; transp >>= 8; - ((u32*)(info->pseudo_palette))[regno] = + par->palette[regno] = (transp << 24) | (red << 16) | (green << 8) | blue; break; } @@ -675,6 +675,7 @@ static int __devinit kyrofb_probe(struct const struct pci_device_id *ent) { struct fb_info *info; + struct kyrofb_info *currentpar; unsigned long size; int err; @@ -683,14 +684,11 @@ static int __devinit kyrofb_probe(struct return err; } - size = sizeof(struct fb_info) + sizeof(struct kyrofb_info) + 16 * sizeof(u32); - info = kmalloc(size, GFP_KERNEL); + info = framebuffer_alloc(sizeof(struct kyrofb_info), &pdev->dev); if (!info) return -ENOMEM; - memset(info, 0, size); - - currentpar = (struct kyrofb_info *)(info + 1); + currentpar = info->par; kyro_fix.smem_start = pci_resource_start(pdev, 0); kyro_fix.smem_len = pci_resource_len(pdev, 0); @@ -716,8 +714,7 @@ static int __devinit kyrofb_probe(struct info->fbops = &kyrofb_ops; info->fix = kyro_fix; - info->par = currentpar; - info->pseudo_palette = (void *)(currentpar + 1); + info->pseudo_palette = currentpar->palette; info->flags = FBINFO_DEFAULT; SetCoreClockPLL(deviceInfo.pSTGReg, pdev); @@ -741,7 +738,6 @@ static int __devinit kyrofb_probe(struct fb_memset(info->screen_base, 0, size); - info->device = &pdev->dev; if (register_framebuffer(info) < 0) goto out_unmap; @@ -757,7 +753,7 @@ static int __devinit kyrofb_probe(struct out_unmap: iounmap(currentpar->regbase); iounmap(info->screen_base); - kfree(info); + framebuffer_release(info); return -EINVAL; } @@ -765,7 +761,7 @@ out_unmap: static void __devexit kyrofb_remove(struct pci_dev *pdev) { struct fb_info *info = pci_get_drvdata(pdev); - struct kyrofb_info *par = (struct kyrofb_info *)info->par; + struct kyrofb_info *par = info->par; /* Reset the board */ StopVTG(deviceInfo.pSTGReg); @@ -789,7 +785,7 @@ static void __devexit kyrofb_remove(stru unregister_framebuffer(info); pci_set_drvdata(pdev, NULL); - kfree(info); + framebuffer_release(info); } static int __init kyrofb_init(void) diff --git a/include/video/kyro.h b/include/video/kyro.h index 1bed37c..dba7de2 100644 --- a/include/video/kyro.h +++ b/include/video/kyro.h @@ -15,6 +15,7 @@ struct kyrofb_info { void __iomem *regbase; + u32 palette[16]; u32 HTot; /* Hor Total Time */ u32 HFP; /* Hor Front Porch */ u32 HST; /* Hor Sync Time */ |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:31:32
|
- remove unneeded casts - the pseudo_palette, if using the generic drawing functions, must always be u32 regardless of the bpp - use framebuffer_alloc/framebuffer_release to allocate memory Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/imsttfb.c | 56 +++++++++++++++++++++++------------------------ 1 files changed, 27 insertions(+), 29 deletions(-) diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c index 7fbe242..a5d8130 100644 --- a/drivers/video/imsttfb.c +++ b/drivers/video/imsttfb.c @@ -323,6 +323,7 @@ struct imstt_par { unsigned long cmap_regs_phys; __u8 *cmap_regs; __u32 ramdac; + __u32 palette[16]; }; enum { @@ -657,7 +658,7 @@ set_imstt_regvals_tvp (struct imstt_par static void set_imstt_regvals (struct fb_info *info, u_int bpp) { - struct imstt_par *par = (struct imstt_par *) info->par; + struct imstt_par *par = info->par; struct imstt_regvals *init = &par->init; __u32 ctl, pitch, byteswap, scr; @@ -749,7 +750,7 @@ set_imstt_regvals (struct fb_info *info, static inline void set_offset (struct fb_var_screeninfo *var, struct fb_info *info) { - struct imstt_par *par = (struct imstt_par *) info->par; + struct imstt_par *par = info->par; __u32 off = var->yoffset * (info->fix.line_length >> 3) + ((var->xoffset * (var->bits_per_pixel >> 3)) >> 3); write_reg_le32(par->dc_regs, SSR, off); @@ -863,7 +864,7 @@ imsttfb_check_var(struct fb_var_screenin static int imsttfb_set_par(struct fb_info *info) { - struct imstt_par *par = (struct imstt_par *) info->par; + struct imstt_par *par = info->par; if (!compute_imstt_regvals(par, info->var.xres, info->var.yres)) return -EINVAL; @@ -881,7 +882,7 @@ static int imsttfb_setcolreg (u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { - struct imstt_par *par = (struct imstt_par *) info->par; + struct imstt_par *par = info->par; u_int bpp = info->var.bits_per_pixel; if (regno > 255) @@ -905,14 +906,17 @@ imsttfb_setcolreg (u_int regno, u_int re if (regno < 16) switch (bpp) { case 16: - ((u16 *)info->pseudo_palette)[regno] = (regno << (info->var.green.length == 5 ? 10 : 11)) | (regno << 5) | regno; + par->palette[regno] = + (regno << (info->var.green.length == + 5 ? 10 : 11)) | (regno << 5) | regno; break; case 24: - ((u32 *)info->pseudo_palette)[regno] = (regno << 16) | (regno << 8) | regno; + par->palette[regno] = + (regno << 16) | (regno << 8) | regno; break; case 32: { int i = (regno << 8) | regno; - ((u32 *)info->pseudo_palette)[regno] = (i << 16) | i; + par->palette[regno] = (i << 16) |i; break; } } @@ -935,7 +939,7 @@ imsttfb_pan_display(struct fb_var_screen static int imsttfb_blank(int blank, struct fb_info *info) { - struct imstt_par *par = (struct imstt_par *) info->par; + struct imstt_par *par = info->par; __u32 ctrl; ctrl = read_reg_le32(par->dc_regs, STGCTL); @@ -989,7 +993,7 @@ imsttfb_blank(int blank, struct fb_info static void imsttfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { - struct imstt_par *par = (struct imstt_par *) info->par; + struct imstt_par *par = info->par; __u32 Bpp, line_pitch, bgc, dx, dy, width, height; bgc = rect->color; @@ -1033,7 +1037,7 @@ imsttfb_fillrect(struct fb_info *info, c static void imsttfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) { - struct imstt_par *par = (struct imstt_par *) info->par; + struct imstt_par *par = info->par; __u32 Bpp, line_pitch, fb_offset_old, fb_offset_new, sp, dp_octl; __u32 cnt, bltctl, sx, sy, dx, dy, height, width; @@ -1195,7 +1199,7 @@ imstt_set_cursor(struct imstt_par *par, static int imsttfb_cursor(struct fb_info *info, struct fb_cursor *cursor) { - struct imstt_par *par = (struct imstt_par *) info->par; + struct imstt_par *par = info->par; u32 flags = cursor->set, fg, bg, xx, yy; if (cursor->dest == NULL && cursor->rop == ROP_XOR) @@ -1266,7 +1270,7 @@ static int imsttfb_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long arg, struct fb_info *info) { - struct imstt_par *par = (struct imstt_par *) info->par; + struct imstt_par *par = info->par; void __user *argp = (void __user *)arg; __u32 reg[2]; __u8 idx[2]; @@ -1350,7 +1354,7 @@ static struct fb_ops imsttfb_ops = { static void __devinit init_imstt(struct fb_info *info) { - struct imstt_par *par = (struct imstt_par *) info->par; + struct imstt_par *par = info->par; __u32 i, tmp, *ip, *end; tmp = read_reg_le32(par->dc_regs, PRC); @@ -1413,7 +1417,7 @@ init_imstt(struct fb_info *info) if ((info->var.xres * info->var.yres) * (info->var.bits_per_pixel >> 3) > info->fix.smem_len || !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) { printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel); - kfree(info); + framebuffer_release(info); return; } @@ -1449,7 +1453,7 @@ init_imstt(struct fb_info *info) fb_alloc_cmap(&info->cmap, 0, 0); if (register_framebuffer(info) < 0) { - kfree(info); + framebuffer_release(info); return; } @@ -1474,26 +1478,21 @@ imsttfb_probe(struct pci_dev *pdev, cons printk(KERN_ERR "imsttfb: no OF node for pci device\n"); #endif /* CONFIG_PPC_OF */ - size = sizeof(struct fb_info) + sizeof(struct imstt_par) + - sizeof(u32) * 16; - - info = kmalloc(size, GFP_KERNEL); + info = framebuffer_alloc(sizeof(struct imstt_par), &pdev->dev); if (!info) { printk(KERN_ERR "imsttfb: Can't allocate memory\n"); return -ENOMEM; } - memset(info, 0, size); - - par = (struct imstt_par *) (info + 1); + par = info->par; addr = pci_resource_start (pdev, 0); size = pci_resource_len (pdev, 0); if (!request_mem_region(addr, size, "imsttfb")) { printk(KERN_ERR "imsttfb: Can't reserve memory region\n"); - kfree(info); + framebuffer_release(info); return -ENODEV; } @@ -1516,14 +1515,13 @@ imsttfb_probe(struct pci_dev *pdev, cons } info->fix.smem_start = addr; - info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ? 0x400000 : 0x800000); + info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ? + 0x400000 : 0x800000); info->fix.mmio_start = addr + 0x800000; par->dc_regs = ioremap(addr + 0x800000, 0x1000); par->cmap_regs_phys = addr + 0x840000; par->cmap_regs = (__u8 *)ioremap(addr + 0x840000, 0x1000); - info->par = par; - info->pseudo_palette = (void *) (par + 1); - info->device = &pdev->dev; + info->pseudo_palette = par->palette; init_imstt(info); pci_set_drvdata(pdev, info); @@ -1534,7 +1532,7 @@ static void __devexit imsttfb_remove(struct pci_dev *pdev) { struct fb_info *info = pci_get_drvdata(pdev); - struct imstt_par *par = (struct imstt_par *) info->par; + struct imstt_par *par = info->par; int size = pci_resource_len(pdev, 0); unregister_framebuffer(info); @@ -1542,7 +1540,7 @@ imsttfb_remove(struct pci_dev *pdev) iounmap(par->dc_regs); iounmap(info->screen_base); release_mem_region(info->fix.smem_start, size); - kfree(info); + framebuffer_release(info); } #ifndef MODULE |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:31:14
|
- convert to platform device Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/hgafb.c | 105 ++++++++++++++++++++++++++++++++++++------------- 1 files changed, 77 insertions(+), 28 deletions(-) diff --git a/drivers/video/hgafb.c b/drivers/video/hgafb.c index b37cea7..4e39035 100644 --- a/drivers/video/hgafb.c +++ b/drivers/video/hgafb.c @@ -42,6 +42,7 @@ #include <linux/fb.h> #include <linux/init.h> #include <linux/ioport.h> +#include <linux/platform_device.h> #include <asm/io.h> #include <asm/vga.h> @@ -107,7 +108,7 @@ static DEFINE_SPINLOCK(hga_reg_lock); /* Framebuffer driver structures */ -static struct fb_var_screeninfo hga_default_var = { +static struct fb_var_screeninfo __initdata hga_default_var = { .xres = 720, .yres = 348, .xres_virtual = 720, @@ -121,7 +122,7 @@ static struct fb_var_screeninfo hga_defa .width = -1, }; -static struct fb_fix_screeninfo hga_fix = { +static struct fb_fix_screeninfo __initdata hga_fix = { .id = "HGA", .type = FB_TYPE_PACKED_PIXELS, /* (not sure) */ .visual = FB_VISUAL_MONO10, @@ -131,8 +132,6 @@ static struct fb_fix_screeninfo hga_fix .accel = FB_ACCEL_NONE }; -static struct fb_info fb_info; - /* Don't assume that tty1 will be the initial current console. */ static int release_io_port = 0; static int release_io_ports = 0; @@ -549,10 +548,9 @@ static struct fb_ops hgafb_ops = { * Initialization */ -static int __init hgafb_init(void) +static int __init hgafb_probe(struct device *device) { - if (fb_get_options("hgafb", NULL)) - return -ENODEV; + struct fb_info *info; if (! hga_card_detect()) { printk(KERN_INFO "hgafb: HGA card not detected.\n"); @@ -564,41 +562,95 @@ static int __init hgafb_init(void) printk(KERN_INFO "hgafb: %s with %ldK of memory detected.\n", hga_type_name, hga_vram_len/1024); + info = framebuffer_alloc(0, NULL); + if (!info) { + iounmap(hga_vram); + return -ENOMEM; + } + hga_fix.smem_start = (unsigned long)hga_vram; hga_fix.smem_len = hga_vram_len; - fb_info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; - fb_info.var = hga_default_var; - fb_info.fix = hga_fix; - fb_info.monspecs.hfmin = 0; - fb_info.monspecs.hfmax = 0; - fb_info.monspecs.vfmin = 10000; - fb_info.monspecs.vfmax = 10000; - fb_info.monspecs.dpms = 0; - fb_info.fbops = &hgafb_ops; - fb_info.screen_base = hga_vram; + info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN; + info->var = hga_default_var; + info->fix = hga_fix; + info->monspecs.hfmin = 0; + info->monspecs.hfmax = 0; + info->monspecs.vfmin = 10000; + info->monspecs.vfmax = 10000; + info->monspecs.dpms = 0; + info->fbops = &hgafb_ops; + info->screen_base = hga_vram; - if (register_framebuffer(&fb_info) < 0) { + if (register_framebuffer(info) < 0) { + framebuffer_release(info); iounmap(hga_vram); return -EINVAL; } printk(KERN_INFO "fb%d: %s frame buffer device\n", - fb_info.node, fb_info.fix.id); + info->node, info->fix.id); + dev_set_drvdata(device, info); return 0; } -#ifdef MODULE -static void __exit hgafb_exit(void) +static int hgafb_remove(struct device *device) { + struct fb_info *info = dev_get_drvdata(device); + hga_txt_mode(); hga_clear_screen(); - unregister_framebuffer(&fb_info); + + if (info) { + unregister_framebuffer(info); + framebuffer_release(info); + } + iounmap(hga_vram); - if (release_io_ports) release_region(0x3b0, 12); - if (release_io_port) release_region(0x3bf, 1); + + if (release_io_ports) + release_region(0x3b0, 12); + + if (release_io_port) + release_region(0x3bf, 1); + + return 0; +} + +static struct device_driver hgafb_driver = { + .name = "hgafb", + .bus = &platform_bus_type, + .probe = hgafb_probe, + .remove = hgafb_remove, +}; + +static struct platform_device hgafb_device = { + .name = "hgafb", +}; + +static int __init hgafb_init(void) +{ + int ret; + + if (fb_get_options("hgafb", NULL)) + return -ENODEV; + + ret = driver_register(&hgafb_driver); + + if (!ret) { + ret = platform_device_register(&hgafb_device); + if (ret) + driver_unregister(&hgafb_driver); + } + + return ret; +} + +static void __exit hgafb_exit(void) +{ + platform_device_unregister(&hgafb_device); + driver_unregister(&hgafb_driver); } -#endif /* ------------------------------------------------------------------------- * @@ -613,7 +665,4 @@ MODULE_LICENSE("GPL"); module_param(nologo, bool, 0); MODULE_PARM_DESC(nologo, "Disables startup logo if != 0 (default=0)"); module_init(hgafb_init); - -#ifdef MODULE module_exit(hgafb_exit); -#endif |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:30:09
|
- pseudo_palette is only 16 entries long - the pseudo_palette, if using the generic drawing functions, must always be u32 regardless of bpp - the fillrect accelerator is using region->color regardless of the visual. region->color is the index to the pseudo_palette if visual is truecolor Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/cirrusfb.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index 2858c5c..e0dbdfc 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c @@ -404,7 +404,7 @@ struct cirrusfb_info { struct cirrusfb_regs currentmode; int blank_mode; - u32 pseudo_palette[17]; + u32 pseudo_palette[16]; struct { u8 red, green, blue, pad; } palette[256]; #ifdef CONFIG_ZORRO @@ -1603,14 +1603,14 @@ static int cirrusfb_setcolreg (unsigned switch (info->var.bits_per_pixel) { case 8: - ((u8*)(info->pseudo_palette))[regno] = v; + cinfo->pseudo_palette[regno] = v; break; case 16: - ((u16*)(info->pseudo_palette))[regno] = v; + cinfo->pseudo_palette[regno] = v; break; case 24: case 32: - ((u32*)(info->pseudo_palette))[regno] = v; + cinfo->pseudo_palette[regno] = v; break; } return 0; @@ -2020,18 +2020,21 @@ static void cirrusfb_prim_fillrect(struc const struct fb_fillrect *region) { int m; /* bytes per pixel */ + u32 color = (cinfo->info->fix.visual == FB_VISUAL_TRUECOLOR) ? + cinfo->pseudo_palette[region->color] : region->color; + if(cinfo->info->var.bits_per_pixel == 1) { cirrusfb_RectFill(cinfo->regbase, cinfo->info->var.bits_per_pixel, region->dx / 8, region->dy, region->width / 8, region->height, - region->color, + color, cinfo->currentmode.line_length); } else { m = ( cinfo->info->var.bits_per_pixel + 7 ) / 8; cirrusfb_RectFill(cinfo->regbase, cinfo->info->var.bits_per_pixel, region->dx * m, region->dy, region->width * m, region->height, - region->color, + color, cinfo->currentmode.line_length); } return; |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:29:58
|
- allocate just enough space for the pseudo_palette Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/asiliantfb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c index c64de59..69f7554 100644 --- a/drivers/video/asiliantfb.c +++ b/drivers/video/asiliantfb.c @@ -549,7 +549,7 @@ asiliantfb_pci_init(struct pci_dev *dp, if (!request_mem_region(addr, size, "asiliantfb")) return -EBUSY; - p = framebuffer_alloc(sizeof(u32) * 256, &dp->dev); + p = framebuffer_alloc(sizeof(u32) * 16, &dp->dev); if (!p) { release_mem_region(addr, size); return -ENOMEM; |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:29:58
|
- remove redundant casts Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/riva/fbdev.c | 44 ++++++++++++++++++++------------------- drivers/video/riva/rivafb-i2c.c | 8 ++++--- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/video/riva/fbdev.c b/drivers/video/riva/fbdev.c index 3e9f96e..dd7b2cc 100644 --- a/drivers/video/riva/fbdev.c +++ b/drivers/video/riva/fbdev.c @@ -630,7 +630,7 @@ static void riva_load_video_mode(struct int bpp, width, hDisplaySize, hDisplay, hStart, hEnd, hTotal, height, vDisplay, vStart, vEnd, vTotal, dotClock; int hBlankStart, hBlankEnd, vBlankStart, vBlankEnd; - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; struct riva_regs newmode; NVTRACE_ENTER(); @@ -925,7 +925,7 @@ riva_set_rop_solid(struct riva_par *par, static void riva_setup_accel(struct fb_info *info) { - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; RIVA_FIFO_FREE(par->riva, Clip, 2); NV_WR32(&par->riva.Clip->TopLeft, 0, 0x0); @@ -979,7 +979,7 @@ static int riva_get_cmap_len(const struc #ifdef CONFIG_PMAC_BACKLIGHT static int riva_set_backlight_enable(int on, int level, void *data) { - struct riva_par *par = (struct riva_par *)data; + struct riva_par *par = data; U032 tmp_pcrt, tmp_pmc; tmp_pmc = par->riva.PMC[0x10F0/4] & 0x0000FFFF; @@ -1008,7 +1008,7 @@ static int riva_set_backlight_level(int static int rivafb_open(struct fb_info *info, int user) { - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; int cnt = atomic_read(&par->ref_count); NVTRACE_ENTER(); @@ -1034,7 +1034,7 @@ static int rivafb_open(struct fb_info *i static int rivafb_release(struct fb_info *info, int user) { - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; int cnt = atomic_read(&par->ref_count); NVTRACE_ENTER(); @@ -1057,7 +1057,7 @@ static int rivafb_release(struct fb_info static int rivafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { struct fb_videomode *mode; - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; int nom, den; /* translating from pixels->bytes */ int mode_valid = 0; @@ -1166,7 +1166,7 @@ static int rivafb_check_var(struct fb_va static int rivafb_set_par(struct fb_info *info) { - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; NVTRACE_ENTER(); /* vgaHWunlock() + riva unlock (0x7F) */ @@ -1205,7 +1205,7 @@ static int rivafb_set_par(struct fb_info static int rivafb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { - struct riva_par *par = (struct riva_par *)info->par; + struct riva_par *par = info->par; unsigned int base; NVTRACE_ENTER(); @@ -1241,7 +1241,7 @@ static int rivafb_pan_display(struct fb_ static int rivafb_blank(int blank, struct fb_info *info) { - struct riva_par *par= (struct riva_par *)info->par; + struct riva_par *par= info->par; unsigned char tmp, vesa; tmp = SEQin(par, 0x01) & ~0x20; /* screen on/off */ @@ -1304,7 +1304,7 @@ static int rivafb_setcolreg(unsigned reg unsigned blue, unsigned transp, struct fb_info *info) { - struct riva_par *par = (struct riva_par *)info->par; + struct riva_par *par = info->par; RIVA_HW_INST *chip = &par->riva; int i; @@ -1393,7 +1393,7 @@ static int rivafb_setcolreg(unsigned reg */ static void rivafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; u_int color, rop = 0; if ((info->flags & FBINFO_HWACCEL_DISABLED)) { @@ -1449,7 +1449,7 @@ static void rivafb_fillrect(struct fb_in */ static void rivafb_copyarea(struct fb_info *info, const struct fb_copyarea *region) { - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; if ((info->flags & FBINFO_HWACCEL_DISABLED)) { cfb_copyarea(info, region); @@ -1495,7 +1495,7 @@ static inline void convert_bgcolor_16(u3 static void rivafb_imageblit(struct fb_info *info, const struct fb_image *image) { - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; u32 fgx = 0, bgx = 0, width, tmp; u8 *cdat = (u8 *) image->data; volatile u32 __iomem *d; @@ -1580,7 +1580,7 @@ static void rivafb_imageblit(struct fb_i */ static int rivafb_cursor(struct fb_info *info, struct fb_cursor *cursor) { - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; u8 data[MAX_CURS * MAX_CURS/8]; int i, set = cursor->set; u16 fg, bg; @@ -1664,7 +1664,7 @@ static int rivafb_cursor(struct fb_info static int rivafb_sync(struct fb_info *info) { - struct riva_par *par = (struct riva_par *)info->par; + struct riva_par *par = info->par; wait_for_idle(par); return 0; @@ -1696,7 +1696,7 @@ static struct fb_ops riva_fb_ops = { static int __devinit riva_set_fbinfo(struct fb_info *info) { unsigned int cmap_len; - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; NVTRACE_ENTER(); info->flags = FBINFO_DEFAULT @@ -1733,7 +1733,7 @@ static int __devinit riva_set_fbinfo(str #ifdef CONFIG_PPC_OF static int __devinit riva_get_EDID_OF(struct fb_info *info, struct pci_dev *pd) { - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; struct device_node *dp; unsigned char *pedid = NULL; unsigned char *disptype = NULL; @@ -1767,7 +1767,7 @@ static int __devinit riva_get_EDID_OF(st #if defined(CONFIG_FB_RIVA_I2C) && !defined(CONFIG_PPC_OF) static int __devinit riva_get_EDID_i2c(struct fb_info *info) { - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; struct fb_var_screeninfo var; int i; @@ -1837,7 +1837,7 @@ static void __devinit riva_get_EDID(stru static void __devinit riva_get_edidinfo(struct fb_info *info) { struct fb_var_screeninfo *var = &rivafb_default_var; - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; fb_edid_to_monspecs(par->EDID, &info->monspecs); fb_videomode_to_modelist(info->monspecs.modedb, info->monspecs.modedb_len, @@ -1909,7 +1909,7 @@ static int __devinit rivafb_probe(struct ret = -ENOMEM; goto err_ret; } - default_par = (struct riva_par *) info->par; + default_par = info->par; default_par->pdev = pd; info->pixmap.addr = kmalloc(8 * 1024, GFP_KERNEL); @@ -2070,7 +2070,7 @@ static int __devinit rivafb_probe(struct err_iounmap_screen_base: #ifdef CONFIG_FB_RIVA_I2C - riva_delete_i2c_busses((struct riva_par *) info->par); + riva_delete_i2c_busses(info->par); #endif iounmap(info->screen_base); err_iounmap_pramin: @@ -2093,7 +2093,7 @@ err_ret: static void __exit rivafb_remove(struct pci_dev *pd) { struct fb_info *info = pci_get_drvdata(pd); - struct riva_par *par = (struct riva_par *) info->par; + struct riva_par *par = info->par; NVTRACE_ENTER(); if (!info) diff --git a/drivers/video/riva/rivafb-i2c.c b/drivers/video/riva/rivafb-i2c.c index 77151d8..8b1967f 100644 --- a/drivers/video/riva/rivafb-i2c.c +++ b/drivers/video/riva/rivafb-i2c.c @@ -30,7 +30,7 @@ static void riva_gpio_setscl(void* data, int state) { - struct riva_i2c_chan *chan = (struct riva_i2c_chan *)data; + struct riva_i2c_chan *chan = data; struct riva_par *par = chan->par; u32 val; @@ -48,7 +48,7 @@ static void riva_gpio_setscl(void* data, static void riva_gpio_setsda(void* data, int state) { - struct riva_i2c_chan *chan = (struct riva_i2c_chan *)data; + struct riva_i2c_chan *chan = data; struct riva_par *par = chan->par; u32 val; @@ -66,7 +66,7 @@ static void riva_gpio_setsda(void* data, static int riva_gpio_getscl(void* data) { - struct riva_i2c_chan *chan = (struct riva_i2c_chan *)data; + struct riva_i2c_chan *chan = data; struct riva_par *par = chan->par; u32 val = 0; @@ -81,7 +81,7 @@ static int riva_gpio_getscl(void* data) static int riva_gpio_getsda(void* data) { - struct riva_i2c_chan *chan = (struct riva_i2c_chan *)data; + struct riva_i2c_chan *chan = data; struct riva_par *par = chan->par; u32 val = 0; |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:29:42
|
- remove redundant casts Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/i810/i810-i2c.c | 2 +- drivers/video/i810/i810_accel.c | 26 +++++++++++++------------- drivers/video/i810/i810_main.c | 30 +++++++++++++++--------------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/video/i810/i810-i2c.c b/drivers/video/i810/i810-i2c.c index 277b51a..bd410e0 100644 --- a/drivers/video/i810/i810-i2c.c +++ b/drivers/video/i810/i810-i2c.c @@ -43,7 +43,7 @@ static void i810i2c_setscl(void *data, int state) { - struct i810fb_i2c_chan *chan = (struct i810fb_i2c_chan *)data; + struct i810fb_i2c_chan *chan = data; struct i810fb_par *par = chan->par; u8 __iomem *mmio = par->mmio_start_virtual; diff --git a/drivers/video/i810/i810_accel.c b/drivers/video/i810/i810_accel.c index 1ba6567..76764ea 100644 --- a/drivers/video/i810/i810_accel.c +++ b/drivers/video/i810/i810_accel.c @@ -58,7 +58,7 @@ static inline void i810_report_error(u8 */ static inline int wait_for_space(struct fb_info *info, u32 space) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u32 head, count = WAIT_COUNT, tail; u8 __iomem *mmio = par->mmio_start_virtual; @@ -89,7 +89,7 @@ static inline int wait_for_space(struct */ static inline int wait_for_engine_idle(struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u8 __iomem *mmio = par->mmio_start_virtual; int count = WAIT_COUNT; @@ -117,7 +117,7 @@ static inline int wait_for_engine_idle(s */ static inline u32 begin_iring(struct fb_info *info, u32 space) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; if (par->dev_flags & ALWAYS_SYNC) wait_for_engine_idle(info); @@ -162,7 +162,7 @@ static inline void source_copy_blit(int int xdir, int src, int dest, int rop, int blit_bpp, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; if (begin_iring(info, 24 + IRING_PAD)) return; @@ -196,7 +196,7 @@ static inline void color_blit(int width, int rop, int what, int blit_bpp, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; if (begin_iring(info, 24 + IRING_PAD)) return; @@ -237,7 +237,7 @@ static inline void mono_src_copy_imm_bli int dest, const u32 *src, int bg, int fg, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; if (begin_iring(info, 24 + (dsize << 2) + IRING_PAD)) return; @@ -255,7 +255,7 @@ static inline void mono_src_copy_imm_bli static inline void load_front(int offset, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; if (begin_iring(info, 8 + IRING_PAD)) return; @@ -297,7 +297,7 @@ static inline void i810fb_iring_enable(s void i810fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u32 dx, dy, width, height, dest, rop = 0, color = 0; if (!info->var.accel_flags || par->dev_flags & LOCKUP || @@ -323,7 +323,7 @@ void i810fb_fillrect(struct fb_info *inf void i810fb_copyarea(struct fb_info *info, const struct fb_copyarea *region) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u32 sx, sy, dx, dy, pitch, width, height, src, dest, xdir; if (!info->var.accel_flags || par->dev_flags & LOCKUP || @@ -362,7 +362,7 @@ void i810fb_copyarea(struct fb_info *inf void i810fb_imageblit(struct fb_info *info, const struct fb_image *image) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u32 fg = 0, bg = 0, size, dst; if (!info->var.accel_flags || par->dev_flags & LOCKUP || @@ -398,7 +398,7 @@ void i810fb_imageblit(struct fb_info *in int i810fb_sync(struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; if (!info->var.accel_flags || par->dev_flags & LOCKUP) return 0; @@ -408,7 +408,7 @@ int i810fb_sync(struct fb_info *info) void i810fb_load_front(u32 offset, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u8 __iomem *mmio = par->mmio_start_virtual; if (!info->var.accel_flags || par->dev_flags & LOCKUP) @@ -428,7 +428,7 @@ void i810fb_load_front(u32 offset, struc */ void i810fb_init_ringbuffer(struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u32 tmp1, tmp2; u8 __iomem *mmio = par->mmio_start_virtual; diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index 9310ae9..4954a8e 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c @@ -817,7 +817,7 @@ static void i810_load_cursor_image(int w static void i810_load_cursor_colors(int fg, int bg, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u8 __iomem *mmio = par->mmio_start_virtual; u8 red, green, blue, trans, temp; @@ -990,7 +990,7 @@ static void set_color_bitfields(struct f static int i810_check_params(struct fb_var_screeninfo *var, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; int line_length, vidmem, mode_valid = 0, retval = 0; u32 vyres = var->yres_virtual, vxres = var->xres_virtual; /* @@ -1084,7 +1084,7 @@ static int i810_check_params(struct fb_v */ static int encode_fix(struct fb_fix_screeninfo *fix, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; memset(fix, 0, sizeof(struct fb_fix_screeninfo)); @@ -1195,7 +1195,7 @@ static void decode_var(const struct fb_v static int i810fb_getcolreg(u8 regno, u8 *red, u8 *green, u8 *blue, u8 *transp, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u8 __iomem *mmio = par->mmio_start_virtual; u8 temp; @@ -1234,7 +1234,7 @@ static int i810fb_getcolreg(u8 regno, u8 static int i810fb_open(struct fb_info *info, int user) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u32 count = atomic_read(&par->use_count); if (count == 0) { @@ -1253,7 +1253,7 @@ static int i810fb_open(struct fb_info *i static int i810fb_release(struct fb_info *info, int user) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u32 count; count = atomic_read(&par->use_count); @@ -1275,7 +1275,7 @@ static int i810fb_setcolreg(unsigned reg unsigned blue, unsigned transp, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u8 __iomem *mmio = par->mmio_start_virtual; u8 temp; int i; @@ -1369,7 +1369,7 @@ static int i810fb_setcolreg(unsigned reg static int i810fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u32 total; total = var->xoffset * par->depth + @@ -1381,7 +1381,7 @@ static int i810fb_pan_display(struct fb_ static int i810fb_blank (int blank_mode, struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; u8 __iomem *mmio = par->mmio_start_virtual; int mode = 0, pwr, scr_off = 0; @@ -1426,7 +1426,7 @@ static int i810fb_blank (int blank_mode, static int i810fb_set_par(struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; decode_var(&info->var, par); i810_load_regs(par); @@ -1470,7 +1470,7 @@ static int i810fb_check_var(struct fb_va static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor) { - struct i810fb_par *par = (struct i810fb_par *)info->par; + struct i810fb_par *par = info->par; u8 __iomem *mmio = par->mmio_start_virtual; if (!par->dev_flags & LOCKUP) @@ -1557,7 +1557,7 @@ static struct fb_ops i810fb_ops __devini static int i810fb_suspend(struct pci_dev *dev, pm_message_t state) { struct fb_info *info = pci_get_drvdata(dev); - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; int blank = 0, prev_state = par->cur_state; if (state.event == prev_state) @@ -1594,7 +1594,7 @@ static int i810fb_suspend(struct pci_dev static int i810fb_resume(struct pci_dev *dev) { struct fb_info *info = pci_get_drvdata(dev); - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; if (par->cur_state == 0) return 0; @@ -1651,7 +1651,7 @@ static void __devinit i810_fix_offsets(s static int __devinit i810_alloc_agp_mem(struct fb_info *info) { - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; int size; struct agp_bridge_data *bridge; @@ -2115,7 +2115,7 @@ static void i810fb_release_resource(stru static void __exit i810fb_remove_pci(struct pci_dev *dev) { struct fb_info *info = pci_get_drvdata(dev); - struct i810fb_par *par = (struct i810fb_par *) info->par; + struct i810fb_par *par = info->par; unregister_framebuffer(info); i810fb_release_resource(info, par); |
From: Antonino A. Daplas <adaplas@gm...> - 2005-11-30 01:29:37
|
- remove redundant casts - remove symbol_get/symbol_put Signed-off-by: Antonino Daplas <adaplas@...> --- drivers/video/savage/savagefb-i2c.c | 45 ++++++++++++-------------------- drivers/video/savage/savagefb_accel.c | 8 +++--- drivers/video/savage/savagefb_driver.c | 33 +++++++++++------------ 3 files changed, 36 insertions(+), 50 deletions(-) diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c index aeec437..00719a9 100644 --- a/drivers/video/savage/savagefb-i2c.c +++ b/drivers/video/savage/savagefb-i2c.c @@ -49,7 +49,7 @@ static void savage4_gpio_setscl(void *data, int val) { - struct savagefb_i2c_chan *chan = (struct savagefb_i2c_chan *)data; + struct savagefb_i2c_chan *chan = data; unsigned int r; r = readl(chan->ioaddr + chan->reg); @@ -63,7 +63,7 @@ static void savage4_gpio_setscl(void *da static void savage4_gpio_setsda(void *data, int val) { - struct savagefb_i2c_chan *chan = (struct savagefb_i2c_chan *)data; + struct savagefb_i2c_chan *chan = data; unsigned int r; r = readl(chan->ioaddr + chan->reg); @@ -77,21 +77,21 @@ static void savage4_gpio_setsda(void *da static int savage4_gpio_getscl(void *data) { - struct savagefb_i2c_chan *chan = (struct savagefb_i2c_chan *)data; + struct savagefb_i2c_chan *chan = data; return (0 != (readl(chan->ioaddr + chan->reg) & SAVAGE4_I2C_SCL_IN)); } static int savage4_gpio_getsda(void *data) { - struct savagefb_i2c_chan *chan = (struct savagefb_i2c_chan *)data; + struct savagefb_i2c_chan *chan = data; return (0 != (readl(chan->ioaddr + chan->reg) & SAVAGE4_I2C_SDA_IN)); } static void prosavage_gpio_setscl(void* data, int val) { - struct savagefb_i2c_chan *chan = (struct savagefb_i2c_chan *)data; + struct savagefb_i2c_chan *chan = data; u32 r; SET_CR_IX(chan->ioaddr, chan->reg); @@ -107,7 +107,7 @@ static void prosavage_gpio_setscl(void* static void prosavage_gpio_setsda(void* data, int val) { - struct savagefb_i2c_chan *chan = (struct savagefb_i2c_chan *)data; + struct savagefb_i2c_chan *chan = data; unsigned int r; SET_CR_IX(chan->ioaddr, chan->reg); @@ -123,7 +123,7 @@ static void prosavage_gpio_setsda(void* static int prosavage_gpio_getscl(void* data) { - struct savagefb_i2c_chan *chan = (struct savagefb_i2c_chan *)data; + struct savagefb_i2c_chan *chan = data; SET_CR_IX(chan->ioaddr, chan->reg); return (0 != (GET_CR_DATA(chan->ioaddr) & PROSAVAGE_I2C_SCL_IN)); @@ -131,7 +131,7 @@ static int prosavage_gpio_getscl(void* d static int prosavage_gpio_getsda(void* data) { - struct savagefb_i2c_chan *chan = (struct savagefb_i2c_chan *)data; + struct savagefb_i2c_chan *chan = data; SET_CR_IX(chan->ioaddr, chan->reg); return (0 != (GET_CR_DATA(chan->ioaddr) & PROSAVAGE_I2C_SDA_IN)); @@ -140,10 +140,9 @@ static int prosavage_gpio_getsda(void* d static int savage_setup_i2c_bus(struct savagefb_i2c_chan *chan, const char *name) { - int (*add_bus)(struct i2c_adapter *) = symbol_get(i2c_bit_add_bus); int rc = 0; - if (add_bus && chan->par) { + if (chan->par) { strcpy(chan->adapter.name, name); chan->adapter.owner = THIS_MODULE; chan->adapter.id = I2C_HW_B_SAVAGE; @@ -161,7 +160,7 @@ static int savage_setup_i2c_bus(struct s chan->algo.setscl(chan, 1); udelay(20); - rc = add_bus(&chan->adapter); + rc = i2c_bit_add_bus(&chan->adapter); if (rc == 0) dev_dbg(&chan->par->pcidev->dev, @@ -169,8 +168,6 @@ static int savage_setup_i2c_bus(struct s else dev_warn(&chan->par->pcidev->dev, "Failed to register I2C bus %s.\n", name); - - symbol_put(i2c_bit_add_bus); } else chan->par = NULL; @@ -179,7 +176,7 @@ static int savage_setup_i2c_bus(struct s void savagefb_create_i2c_busses(struct fb_info *info) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; par->chan.par = par; switch(info->fix.accel) { @@ -210,14 +207,10 @@ void savagefb_create_i2c_busses(struct f void savagefb_delete_i2c_busses(struct fb_info *info) { - struct savagefb_par *par = (struct savagefb_par *)info->par; - int (*del_bus)(struct i2c_adapter *) = - symbol_get(i2c_bit_del_bus); - - if (del_bus && par->chan.par) { - del_bus(&par->chan.adapter); - symbol_put(i2c_bit_del_bus); - } + struct savagefb_par *par = info->par; + + if (par->chan.par) + i2c_bit_del_bus(&par->chan.adapter); par->chan.par = NULL; } @@ -225,8 +218,6 @@ void savagefb_delete_i2c_busses(struct f static u8 *savage_do_probe_i2c_edid(struct savagefb_i2c_chan *chan) { u8 start = 0x0; - int (*transfer)(struct i2c_adapter *, struct i2c_msg *, int) = - symbol_get(i2c_transfer); struct i2c_msg msgs[] = { { .addr = SAVAGE_DDC, @@ -240,21 +231,19 @@ static u8 *savage_do_probe_i2c_edid(stru }; u8 *buf = NULL; - if (transfer && chan->par) { + if (chan->par) { buf = kmalloc(EDID_LENGTH, GFP_KERNEL); if (buf) { msgs[1].buf = buf; - if (transfer(&chan->adapter, msgs, 2) != 2) { + if (i2c_transfer(&chan->adapter, msgs, 2) != 2) { dev_dbg(&chan->par->pcidev->dev, "Unable to read EDID block.\n"); kfree(buf); buf = NULL; } } - - symbol_put(i2c_transfer); } return buf; diff --git a/drivers/video/savage/savagefb_accel.c b/drivers/video/savage/savagefb_accel.c index bac8ea3..bbcc055 100644 --- a/drivers/video/savage/savagefb_accel.c +++ b/drivers/video/savage/savagefb_accel.c @@ -21,7 +21,7 @@ static u32 savagefb_rop[] = { int savagefb_sync(struct fb_info *info) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; par->SavageWaitIdle(par); return 0; @@ -29,7 +29,7 @@ int savagefb_sync(struct fb_info *info) void savagefb_copyarea(struct fb_info *info, const struct fb_copyarea *region) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; int sx = region->sx, dx = region->dx; int sy = region->sy, dy = region->dy; int cmd; @@ -63,7 +63,7 @@ void savagefb_copyarea(struct fb_info *i void savagefb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; int cmd, color; if (!rect->width || !rect->height) @@ -90,7 +90,7 @@ void savagefb_fillrect(struct fb_info *i void savagefb_imageblit(struct fb_info *info, const struct fb_image *image) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; int fg, bg, size, i, width; int cmd; u32 *src = (u32 *) image->data; diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 09e2f28..baddd2b 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c @@ -686,7 +686,7 @@ static void savage_update_var(struct fb_ static int savagefb_check_var (struct fb_var_screeninfo *var, struct fb_info *info) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; int memlen, vramlen, mode_valid = 0; DBG("savagefb_check_var"); @@ -1025,7 +1025,7 @@ static int savagefb_setcolreg(unsigned unsigned transp, struct fb_info *info) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; if (regno >= NR_PALETTE) return -EINVAL; @@ -1328,7 +1328,7 @@ static void savagefb_set_fix(struct fb_i #if defined(CONFIG_FB_SAVAGE_ACCEL) static void savagefb_set_clip(struct fb_info *info) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; int cmd; cmd = BCI_CMD_NOP | BCI_CMD_CLIP_NEW; @@ -1342,7 +1342,7 @@ static void savagefb_set_clip(struct fb_ static int savagefb_set_par (struct fb_info *info) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; struct fb_var_screeninfo *var = &info->var; int err; @@ -1381,7 +1381,7 @@ static int savagefb_set_par (struct fb_i static int savagefb_pan_display (struct fb_var_screeninfo *var, struct fb_info *info) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; u_int y_bottom; y_bottom = var->yoffset; @@ -1534,7 +1534,7 @@ static void savage_disable_mmio (struct static int __devinit savage_map_mmio (struct fb_info *info) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; DBG ("savage_map_mmio"); if (S3_SAVAGE3D_SERIES (par->chip)) @@ -1567,7 +1567,7 @@ static int __devinit savage_map_mmio (st static void __devinit savage_unmap_mmio (struct fb_info *info) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; DBG ("savage_unmap_mmio"); savage_disable_mmio(par); @@ -1581,7 +1581,7 @@ static void __devinit savage_unmap_mmio static int __devinit savage_map_video (struct fb_info *info, int video_len) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; int resource; DBG("savage_map_video"); @@ -1619,7 +1619,7 @@ static int __devinit savage_map_video (s static void __devinit savage_unmap_video (struct fb_info *info) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; DBG("savage_unmap_video"); @@ -1869,7 +1869,7 @@ static int __devinit savage_init_fb_info struct pci_dev *dev, const struct pci_device_id *id) { - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct savagefb_par *par = info->par; int err = 0; par->pcidev = dev; @@ -2139,8 +2139,7 @@ static int __devinit savagefb_probe (str static void __devexit savagefb_remove (struct pci_dev *dev) { - struct fb_info *info = - (struct fb_info *)pci_get_drvdata(dev); + struct fb_info *info = pci_get_drvdata(dev); DBG("savagefb_remove"); @@ -2174,9 +2173,8 @@ static void __devexit savagefb_remove (s static int savagefb_suspend (struct pci_dev* dev, pm_message_t state) { - struct fb_info *info = - (struct fb_info *)pci_get_drvdata(dev); - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct fb_info *info = pci_get_drvdata(dev); + struct savagefb_par *par = info->par; DBG("savagefb_suspend"); @@ -2210,9 +2208,8 @@ static int savagefb_suspend (struct pci_ static int savagefb_resume (struct pci_dev* dev) { - struct fb_info *info = - (struct fb_info *)pci_get_drvdata(dev); - struct savagefb_par *par = (struct savagefb_par *)info->par; + struct fb_info *info = pci_get_drvdata(dev); + struct savagefb_par *par = info->par; int cur_state = par->pm_state; DBG("savage_resume"); |