Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105565
b: refs/heads/master
c: 1ca6b62
h: refs/heads/master
i:
  105563: 04c1257
v: v3
  • Loading branch information
Krzysztof Helt authored and Linus Torvalds committed Jul 24, 2008
1 parent 336d77d commit aa04352
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 74 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7fc80b7bd682b47825e806018cca8ff7dc6bb55a
refs/heads/master: 1ca6b62f8ca668ccfab0da9112c0125ef82343bd
95 changes: 22 additions & 73 deletions trunk/drivers/video/neofb.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ static inline int neo2200_sync(struct fb_info *info)
{
struct neofb_par *par = info->par;

while (readl(&par->neo2200->bltStat) & 1);
while (readl(&par->neo2200->bltStat) & 1)
cpu_relax();
return 0;
}

Expand Down Expand Up @@ -587,34 +588,14 @@ static int
neofb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
struct neofb_par *par = info->par;
unsigned int pixclock = var->pixclock;
struct xtimings timings;
int memlen, vramlen;
int mode_ok = 0;

DBG("neofb_check_var");

if (!pixclock)
pixclock = 10000; /* 10ns = 100MHz */
timings.pixclock = 1000000000 / pixclock;
if (timings.pixclock < 1)
timings.pixclock = 1;

if (timings.pixclock > par->maxClock)
if (PICOS2KHZ(var->pixclock) > par->maxClock)
return -EINVAL;

timings.dblscan = var->vmode & FB_VMODE_DOUBLE;
timings.interlaced = var->vmode & FB_VMODE_INTERLACED;
timings.HDisplay = var->xres;
timings.HSyncStart = timings.HDisplay + var->right_margin;
timings.HSyncEnd = timings.HSyncStart + var->hsync_len;
timings.HTotal = timings.HSyncEnd + var->left_margin;
timings.VDisplay = var->yres;
timings.VSyncStart = timings.VDisplay + var->lower_margin;
timings.VSyncEnd = timings.VSyncStart + var->vsync_len;
timings.VTotal = timings.VSyncEnd + var->upper_margin;
timings.sync = var->sync;

/* Is the mode larger than the LCD panel? */
if (par->internal_display &&
((var->xres > par->NeoPanelWidth) ||
Expand Down Expand Up @@ -1923,9 +1904,6 @@ static int __devinit neo_init_hw(struct fb_info *info)
int maxClock = 65000;
int CursorMem = 1024;
int CursorOff = 0x100;
int linearSize = 1024;
int maxWidth = 1024;
int maxHeight = 1024;

DBG("neo_init_hw");

Expand All @@ -1944,81 +1922,52 @@ static int __devinit neo_init_hw(struct fb_info *info)
case FB_ACCEL_NEOMAGIC_NM2070:
videoRam = 896;
maxClock = 65000;
CursorMem = 2048;
CursorOff = 0x100;
linearSize = 1024;
maxWidth = 1024;
maxHeight = 1024;
break;
case FB_ACCEL_NEOMAGIC_NM2090:
case FB_ACCEL_NEOMAGIC_NM2093:
videoRam = 1152;
maxClock = 80000;
CursorMem = 2048;
CursorOff = 0x100;
linearSize = 2048;
maxWidth = 1024;
maxHeight = 1024;
break;
case FB_ACCEL_NEOMAGIC_NM2097:
videoRam = 1152;
maxClock = 80000;
CursorMem = 1024;
CursorOff = 0x100;
linearSize = 2048;
maxWidth = 1024;
maxHeight = 1024;
break;
case FB_ACCEL_NEOMAGIC_NM2160:
videoRam = 2048;
maxClock = 90000;
CursorMem = 1024;
CursorOff = 0x100;
linearSize = 2048;
maxWidth = 1024;
maxHeight = 1024;
break;
case FB_ACCEL_NEOMAGIC_NM2200:
videoRam = 2560;
maxClock = 110000;
CursorMem = 1024;
CursorOff = 0x1000;
linearSize = 4096;
maxWidth = 1280;
maxHeight = 1024; /* ???? */

par->neo2200 = (Neo2200 __iomem *) par->mmio_vbase;
break;
case FB_ACCEL_NEOMAGIC_NM2230:
videoRam = 3008;
maxClock = 110000;
CursorMem = 1024;
CursorOff = 0x1000;
linearSize = 4096;
maxWidth = 1280;
maxHeight = 1024; /* ???? */

par->neo2200 = (Neo2200 __iomem *) par->mmio_vbase;
break;
case FB_ACCEL_NEOMAGIC_NM2360:
videoRam = 4096;
maxClock = 110000;
CursorMem = 1024;
CursorOff = 0x1000;
linearSize = 4096;
maxWidth = 1280;
maxHeight = 1024; /* ???? */

par->neo2200 = (Neo2200 __iomem *) par->mmio_vbase;
break;
case FB_ACCEL_NEOMAGIC_NM2380:
videoRam = 6144;
maxClock = 110000;
break;
}
switch (info->fix.accel) {
case FB_ACCEL_NEOMAGIC_NM2070:
case FB_ACCEL_NEOMAGIC_NM2090:
case FB_ACCEL_NEOMAGIC_NM2093:
CursorMem = 2048;
CursorOff = 0x100;
break;
case FB_ACCEL_NEOMAGIC_NM2097:
case FB_ACCEL_NEOMAGIC_NM2160:
CursorMem = 1024;
CursorOff = 0x100;
break;
case FB_ACCEL_NEOMAGIC_NM2200:
case FB_ACCEL_NEOMAGIC_NM2230:
case FB_ACCEL_NEOMAGIC_NM2360:
case FB_ACCEL_NEOMAGIC_NM2380:
CursorMem = 1024;
CursorOff = 0x1000;
linearSize = 8192;
maxWidth = 1280;
maxHeight = 1024; /* ???? */

par->neo2200 = (Neo2200 __iomem *) par->mmio_vbase;
break;
Expand All @@ -2032,7 +1981,7 @@ static int __devinit neo_init_hw(struct fb_info *info)
*/
par->maxClock = maxClock;
par->cursorOff = CursorOff;
return ((videoRam * 1024));
return videoRam * 1024;
}


Expand Down

0 comments on commit aa04352

Please sign in to comment.