|
@@ -263,9 +263,7 @@ struct cg6_par {
|
|
u32 flags;
|
|
u32 flags;
|
|
#define CG6_FLAG_BLANKED 0x00000001
|
|
#define CG6_FLAG_BLANKED 0x00000001
|
|
|
|
|
|
- unsigned long physbase;
|
|
|
|
unsigned long which_io;
|
|
unsigned long which_io;
|
|
- unsigned long fbsize;
|
|
|
|
};
|
|
};
|
|
|
|
|
|
static int cg6_sync(struct fb_info *info)
|
|
static int cg6_sync(struct fb_info *info)
|
|
@@ -596,16 +594,14 @@ static int cg6_mmap(struct fb_info *info, struct vm_area_struct *vma)
|
|
struct cg6_par *par = (struct cg6_par *)info->par;
|
|
struct cg6_par *par = (struct cg6_par *)info->par;
|
|
|
|
|
|
return sbusfb_mmap_helper(cg6_mmap_map,
|
|
return sbusfb_mmap_helper(cg6_mmap_map,
|
|
- par->physbase, par->fbsize,
|
|
|
|
|
|
+ info->fix.smem_start, info->fix.smem_len,
|
|
par->which_io, vma);
|
|
par->which_io, vma);
|
|
}
|
|
}
|
|
|
|
|
|
static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
|
|
static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
|
|
{
|
|
{
|
|
- struct cg6_par *par = (struct cg6_par *)info->par;
|
|
|
|
-
|
|
|
|
return sbusfb_ioctl_helper(cmd, arg, info,
|
|
return sbusfb_ioctl_helper(cmd, arg, info,
|
|
- FBTYPE_SUNFAST_COLOR, 8, par->fbsize);
|
|
|
|
|
|
+ FBTYPE_SUNFAST_COLOR, 8, info->fix.smem_len);
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -631,12 +627,12 @@ static void __devinit cg6_init_fix(struct fb_info *info, int linebytes)
|
|
break;
|
|
break;
|
|
};
|
|
};
|
|
if (((conf >> CG6_FHC_REV_SHIFT) & CG6_FHC_REV_MASK) >= 11) {
|
|
if (((conf >> CG6_FHC_REV_SHIFT) & CG6_FHC_REV_MASK) >= 11) {
|
|
- if (par->fbsize <= 0x100000)
|
|
|
|
|
|
+ if (info->fix.smem_len <= 0x100000)
|
|
cg6_card_name = "TGX";
|
|
cg6_card_name = "TGX";
|
|
else
|
|
else
|
|
cg6_card_name = "TGX+";
|
|
cg6_card_name = "TGX+";
|
|
} else {
|
|
} else {
|
|
- if (par->fbsize <= 0x100000)
|
|
|
|
|
|
+ if (info->fix.smem_len <= 0x100000)
|
|
cg6_card_name = "GX";
|
|
cg6_card_name = "GX";
|
|
else
|
|
else
|
|
cg6_card_name = "GX+";
|
|
cg6_card_name = "GX+";
|
|
@@ -738,7 +734,8 @@ static void cg6_unmap_regs(struct of_device *op, struct fb_info *info,
|
|
of_iounmap(&op->resource[0], par->fhc, sizeof(u32));
|
|
of_iounmap(&op->resource[0], par->fhc, sizeof(u32));
|
|
|
|
|
|
if (info->screen_base)
|
|
if (info->screen_base)
|
|
- of_iounmap(&op->resource[0], info->screen_base, par->fbsize);
|
|
|
|
|
|
+ of_iounmap(&op->resource[0], info->screen_base,
|
|
|
|
+ info->fix.smem_len);
|
|
}
|
|
}
|
|
|
|
|
|
static int __devinit cg6_probe(struct of_device *op,
|
|
static int __devinit cg6_probe(struct of_device *op,
|
|
@@ -759,7 +756,7 @@ static int __devinit cg6_probe(struct of_device *op,
|
|
|
|
|
|
spin_lock_init(&par->lock);
|
|
spin_lock_init(&par->lock);
|
|
|
|
|
|
- par->physbase = op->resource[0].start;
|
|
|
|
|
|
+ info->fix.smem_start = op->resource[0].start;
|
|
par->which_io = op->resource[0].flags & IORESOURCE_BITS;
|
|
par->which_io = op->resource[0].flags & IORESOURCE_BITS;
|
|
|
|
|
|
sbusfb_fill_var(&info->var, dp, 8);
|
|
sbusfb_fill_var(&info->var, dp, 8);
|
|
@@ -769,11 +766,11 @@ static int __devinit cg6_probe(struct of_device *op,
|
|
|
|
|
|
linebytes = of_getintprop_default(dp, "linebytes",
|
|
linebytes = of_getintprop_default(dp, "linebytes",
|
|
info->var.xres);
|
|
info->var.xres);
|
|
- par->fbsize = PAGE_ALIGN(linebytes * info->var.yres);
|
|
|
|
|
|
+ info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres);
|
|
|
|
|
|
dblbuf = of_getintprop_default(dp, "dblbuf", 0);
|
|
dblbuf = of_getintprop_default(dp, "dblbuf", 0);
|
|
if (dblbuf)
|
|
if (dblbuf)
|
|
- par->fbsize *= 4;
|
|
|
|
|
|
+ info->fix.smem_len *= 4;
|
|
|
|
|
|
par->fbc = of_ioremap(&op->resource[0], CG6_FBC_OFFSET,
|
|
par->fbc = of_ioremap(&op->resource[0], CG6_FBC_OFFSET,
|
|
4096, "cgsix fbc");
|
|
4096, "cgsix fbc");
|
|
@@ -792,7 +789,7 @@ static int __devinit cg6_probe(struct of_device *op,
|
|
info->fbops = &cg6_ops;
|
|
info->fbops = &cg6_ops;
|
|
|
|
|
|
info->screen_base = of_ioremap(&op->resource[0], CG6_RAM_OFFSET,
|
|
info->screen_base = of_ioremap(&op->resource[0], CG6_RAM_OFFSET,
|
|
- par->fbsize, "cgsix ram");
|
|
|
|
|
|
+ info->fix.smem_len, "cgsix ram");
|
|
if (!par->fbc || !par->tec || !par->thc ||
|
|
if (!par->fbc || !par->tec || !par->thc ||
|
|
!par->bt || !par->fhc || !info->screen_base)
|
|
!par->bt || !par->fhc || !info->screen_base)
|
|
goto out_unmap_regs;
|
|
goto out_unmap_regs;
|
|
@@ -817,7 +814,7 @@ static int __devinit cg6_probe(struct of_device *op,
|
|
|
|
|
|
printk(KERN_INFO "%s: CGsix [%s] at %lx:%lx\n",
|
|
printk(KERN_INFO "%s: CGsix [%s] at %lx:%lx\n",
|
|
dp->full_name, info->fix.id,
|
|
dp->full_name, info->fix.id,
|
|
- par->which_io, par->physbase);
|
|
|
|
|
|
+ par->which_io, info->fix.smem_start);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
|
|