* PATCH for cg14 framebuffer
@ 2004-11-10 2:45 Bob Breuer
2004-11-10 4:57 ` David S. Miller
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bob Breuer @ 2004-11-10 2:45 UTC (permalink / raw)
To: sparclinux
This patch fixes the cg14 framebuffer. Fixed the initialization with
a NULL sbus_dev and also the colormap setup. Tested with 2.6.9 and
both the linux logo and console text are displayed without problems.
Looks like the other sbus framebuffers are also missing the fb_set_cmap call.
--- linux-2.6.9/drivers/video/cg14.c.orig 2004-10-18 16:55:28.000000000 -0500
+++ linux-2.6.9/drivers/video/cg14.c 2004-11-09 01:46:15.000000000 -0600
@@ -255,6 +255,9 @@ static int cg14_setcolreg(unsigned regno
if (regno >= 256)
return 1;
+ red >>= 8;
+ green >>= 8;
+ blue >>= 8;
val = (red | (green << 8) | (blue << 16));
spin_lock_irqsave(&par->lock, flags);
@@ -322,7 +325,8 @@ static int cg14_ioctl(struct inode *inod
break;
case MDI_16_PIX:
- cur_mode |= 0x20;
+ cur_mode |= (CG14_MCR_PIXMODE_16 <<
+ CG14_MCR_PIXMODE_SHIFT);
break;
case MDI_8_PIX:
@@ -331,7 +335,7 @@ static int cg14_ioctl(struct inode *inod
default:
ret = -ENOSYS;
break;
- };
+ }
if (!ret) {
sbus_writeb(cur_mode, ®s->mcr);
par->mode = mode;
@@ -341,9 +345,9 @@ static int cg14_ioctl(struct inode *inod
default:
ret = sbusfb_ioctl_helper(cmd, arg, info,
- FBTYPE_MDICOLOR, 24, par->fbsize);
+ FBTYPE_MDICOLOR, 8, par->fbsize);
break;
- };
+ }
return ret;
}
@@ -355,11 +359,16 @@ static int cg14_ioctl(struct inode *inod
static void cg14_init_fix(struct fb_info *info, int linebytes)
{
struct cg14_par *par = (struct cg14_par *)info->par;
+ const char *name;
+
+ name = "cgfourteen";
+ if (par->sdev)
+ name = par->sdev->prom_name;
- strlcpy(info->fix.id, par->sdev->prom_name, sizeof(info->fix.id));
+ strlcpy(info->fix.id, name, sizeof(info->fix.id));
info->fix.type = FB_TYPE_PACKED_PIXELS;
- info->fix.visual = FB_VISUAL_TRUECOLOR;
+ info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
info->fix.line_length = linebytes;
@@ -484,8 +493,11 @@ static void cg14_init_one(struct sbus_de
spin_lock_init(&all->par.lock);
sbusfb_fill_var(&all->info.var, node, 8);
+ all->info.var.red.length = 8;
+ all->info.var.green.length = 8;
+ all->info.var.blue.length = 8;
- linebytes = prom_getintdefault(sdev->prom_node, "linebytes",
+ linebytes = prom_getintdefault(node, "linebytes",
all->info.var.xres);
all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres);
@@ -562,6 +574,7 @@ static void cg14_init_one(struct sbus_de
kfree(all);
return;
}
+ fb_set_cmap(&all->info.cmap, &all->info);
cg14_init_fix(&all->info, linebytes);
@@ -574,8 +587,8 @@ static void cg14_init_one(struct sbus_de
list_add(&all->list, &cg14_list);
- printk("cg14: cgfourteen at %lx:%lx\n",
- all->par.physbase, all->par.iospace);
+ printk("cg14: cgfourteen at %lx:%lx, %dMB\n",
+ all->par.iospace, all->par.physbase, all->par.ramsize >> 20);
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: PATCH for cg14 framebuffer
2004-11-10 2:45 PATCH for cg14 framebuffer Bob Breuer
@ 2004-11-10 4:57 ` David S. Miller
2004-11-10 6:13 ` Bob Breuer
2004-11-10 6:14 ` David S. Miller
2 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2004-11-10 4:57 UTC (permalink / raw)
To: sparclinux
On Tue, 09 Nov 2004 20:45:32 -0600
Bob Breuer <breuerr@mc.net> wrote:
> This patch fixes the cg14 framebuffer. Fixed the initialization with
> a NULL sbus_dev and also the colormap setup. Tested with 2.6.9 and
> both the linux logo and console text are displayed without problems.
>
> Looks like the other sbus framebuffers are also missing the fb_set_cmap call.
Doesn't the cg14 come up in 24-bit color mode? That's why I used
"24" and TRUECOLOR. And that's also what the 2.4.x driver uses.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATCH for cg14 framebuffer
2004-11-10 2:45 PATCH for cg14 framebuffer Bob Breuer
2004-11-10 4:57 ` David S. Miller
@ 2004-11-10 6:13 ` Bob Breuer
2004-11-10 6:14 ` David S. Miller
2 siblings, 0 replies; 4+ messages in thread
From: Bob Breuer @ 2004-11-10 6:13 UTC (permalink / raw)
To: sparclinux
Well, it looks as if it can display 8, 16, or 24 bit modes (implied
from the CG14_MCR_PIXMODE_* defines). The __cg14_reset function
drops it back into 8 bit mode. Something to do with cg3 emulation
maybe.
David S. Miller wrote:
> On Tue, 09 Nov 2004 20:45:32 -0600
> Bob Breuer <breuerr@mc.net> wrote:
>
>
>>This patch fixes the cg14 framebuffer. Fixed the initialization with
>>a NULL sbus_dev and also the colormap setup. Tested with 2.6.9 and
>>both the linux logo and console text are displayed without problems.
>>
>>Looks like the other sbus framebuffers are also missing the fb_set_cmap call.
>
>
> Doesn't the cg14 come up in 24-bit color mode? That's why I used
> "24" and TRUECOLOR. And that's also what the 2.4.x driver uses.
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: PATCH for cg14 framebuffer
2004-11-10 2:45 PATCH for cg14 framebuffer Bob Breuer
2004-11-10 4:57 ` David S. Miller
2004-11-10 6:13 ` Bob Breuer
@ 2004-11-10 6:14 ` David S. Miller
2 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2004-11-10 6:14 UTC (permalink / raw)
To: sparclinux
On Wed, 10 Nov 2004 00:13:42 -0600
Bob Breuer <breuerr@mc.net> wrote:
> Well, it looks as if it can display 8, 16, or 24 bit modes (implied
> from the CG14_MCR_PIXMODE_* defines). The __cg14_reset function
> drops it back into 8 bit mode. Something to do with cg3 emulation
> maybe.
That's right, my bad.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-11-10 6:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-10 2:45 PATCH for cg14 framebuffer Bob Breuer
2004-11-10 4:57 ` David S. Miller
2004-11-10 6:13 ` Bob Breuer
2004-11-10 6:14 ` David S. Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.