Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17636
b: refs/heads/master
c: 7227576
h: refs/heads/master
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Jan 10, 2006
1 parent 731177f commit 6e31299
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 34 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: cb639258f92b2407c50f79a95364f42932481389
refs/heads/master: 7227576f4b9dcffe32f8e6b228361b38814bbe7f
60 changes: 27 additions & 33 deletions trunk/drivers/video/sstfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ static void sstfb_clear_screen(struct fb_info *info)
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;
Expand Down Expand Up @@ -542,7 +542,7 @@ static int sstfb_check_var(struct fb_var_screeninfo *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;
Expand Down Expand Up @@ -748,13 +748,14 @@ static int sstfb_set_par(struct fb_info *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);
Expand All @@ -765,15 +766,15 @@ static int sstfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
| (blue << info->var.blue.offset)
| (transp << info->var.transp.offset);

((u32 *)info->pseudo_palette)[regno] = col;
par->palette[regno] = col;

return 0;
}

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;
Expand Down Expand Up @@ -830,7 +831,7 @@ static int sstfb_ioctl(struct inode *inode, struct file *file,
#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))
Expand All @@ -855,7 +856,7 @@ static void sstfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
*/
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))
Expand Down Expand Up @@ -925,7 +926,7 @@ static int __devinit sst_get_memsize(struct fb_info *info, __u32 *memsize)

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++) {
Expand All @@ -950,7 +951,7 @@ static int __devinit sst_detect_att(struct fb_info *info)

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++) {
Expand Down Expand Up @@ -986,7 +987,7 @@ static int __devinit sst_detect_ti(struct fb_info *info)
*/
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;
Expand Down Expand Up @@ -1023,7 +1024,7 @@ static int __devinit sst_detect_ics(struct fb_info *info)
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 */
Expand Down Expand Up @@ -1077,7 +1078,7 @@ static int sst_set_pll_att_ti(struct fb_info *info,
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);
Expand Down Expand Up @@ -1114,7 +1115,7 @@ static int sst_set_pll_ics(struct fb_info *info,

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 */
Expand Down Expand Up @@ -1149,7 +1150,7 @@ static void sst_set_vidmod_att_ti(struct fb_info *info, const int bpp)

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:
Expand Down Expand Up @@ -1308,7 +1309,7 @@ static int __devinit sst_init(struct fb_info *info, struct sstfb_par *par)

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;
Expand Down Expand Up @@ -1394,27 +1395,20 @@ static int __devinit sstfb_probe(struct pci_dev *pdev,
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");
return err;
}

/* 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;
Expand Down Expand Up @@ -1471,7 +1465,7 @@ static int __devinit sstfb_probe(struct pci_dev *pdev,

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;
Expand Down Expand Up @@ -1527,7 +1521,7 @@ static int __devinit sstfb_probe(struct pci_dev *pdev,
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 */
}

Expand All @@ -1537,15 +1531,15 @@ static void __devexit sstfb_remove(struct pci_dev *pdev)
struct fb_info *info;

info = pci_get_drvdata(pdev);
par = (struct sstfb_par *) info->par;
par = info->par;

sst_shutdown(info);
unregister_framebuffer(info);
iounmap(info->screen_base);
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);
}


Expand Down Expand Up @@ -1613,7 +1607,7 @@ static int sstfb_dump_regs(struct fb_info *info)

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];
Expand Down
1 change: 1 addition & 0 deletions trunk/include/video/sstfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 6e31299

Please sign in to comment.