From 24663c00784bd3965844521dd49ee53d422dac97 Mon Sep 17 00:00:00 2001 From: Marco La Porta Date: Wed, 11 Feb 2009 13:04:20 -0800 Subject: [PATCH] --- yaml --- r: 131277 b: refs/heads/master c: 067f1293cc5916f8d88b602beeb8787d58515608 h: refs/heads/master i: 131275: 91d899bb9ea99818bc6c7959b3ae327caa32c9b2 v: v3 --- [refs] | 2 +- trunk/drivers/video/geode/lxfb_core.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index cc7051299f7e..c5a59bfebe64 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 57f63bc8fe79e6598e7253f10f53f58c9fdc57be +refs/heads/master: 067f1293cc5916f8d88b602beeb8787d58515608 diff --git a/trunk/drivers/video/geode/lxfb_core.c b/trunk/drivers/video/geode/lxfb_core.c index b965ecdbc604..889cbe39e580 100644 --- a/trunk/drivers/video/geode/lxfb_core.c +++ b/trunk/drivers/video/geode/lxfb_core.c @@ -278,13 +278,10 @@ static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) static int lxfb_set_par(struct fb_info *info) { - if (info->var.bits_per_pixel > 8) { + if (info->var.bits_per_pixel > 8) info->fix.visual = FB_VISUAL_TRUECOLOR; - fb_dealloc_cmap(&info->cmap); - } else { + else info->fix.visual = FB_VISUAL_PSEUDOCOLOR; - fb_alloc_cmap(&info->cmap, 1<var.bits_per_pixel, 0); - } info->fix.line_length = lx_get_pitch(info->var.xres, info->var.bits_per_pixel); @@ -451,6 +448,11 @@ static struct fb_info * __init lxfb_init_fbinfo(struct device *dev) info->pseudo_palette = (void *)par + sizeof(struct lxfb_par); + if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { + framebuffer_release(info); + return NULL; + } + info->var.grayscale = 0; return info; @@ -579,8 +581,10 @@ static int __init lxfb_probe(struct pci_dev *pdev, pci_release_region(pdev, 3); } - if (info) + if (info) { + fb_dealloc_cmap(&info->cmap); framebuffer_release(info); + } return ret; } @@ -604,6 +608,7 @@ static void lxfb_remove(struct pci_dev *pdev) iounmap(par->vp_regs); pci_release_region(pdev, 3); + fb_dealloc_cmap(&info->cmap); pci_set_drvdata(pdev, NULL); framebuffer_release(info); }