Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 206394 Details for
Bug 288089
fbcondecor patch failes on linux-2.6.31.2
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for linux-2.6.31.2
4200_fbcondecor-0.9.6.patch (text/plain), 10.57 KB, created by
Mike Pagano
on 2009-10-08 00:33:18 UTC
(
hide
)
Description:
patch for linux-2.6.31.2
Filename:
MIME Type:
Creator:
Mike Pagano
Created:
2009-10-08 00:33:18 UTC
Size:
10.57 KB
patch
obsolete
>--- a/drivers/video/console/fbcon.c 2009-10-07 20:24:23.000000000 -0400 >+++ b/drivers/video/console/fbcon.c 2009-10-07 20:23:26.000000000 -0400 >@@ -80,6 +80,7 @@ > #include <asm/system.h> > > #include "fbcon.h" >+#include "fbcondecor.h" > > #ifdef FBCONDEBUG > # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args) >@@ -95,7 +96,7 @@ enum { > > static struct display fb_display[MAX_NR_CONSOLES]; > >-static signed char con2fb_map[MAX_NR_CONSOLES]; >+signed char con2fb_map[MAX_NR_CONSOLES]; > static signed char con2fb_map_boot[MAX_NR_CONSOLES]; > > static int logo_lines; >@@ -286,7 +287,7 @@ static inline int fbcon_is_inactive(stru > vc->vc_mode != KD_TEXT || ops->graphics); > } > >-static inline int get_color(struct vc_data *vc, struct fb_info *info, >+inline int get_color(struct vc_data *vc, struct fb_info *info, > u16 c, int is_fg) > { > int depth = fb_get_color_depth(&info->var, &info->fix); >@@ -391,6 +392,7 @@ static void fb_flashcursor(struct work_s > CM_ERASE : CM_DRAW; > ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1), > get_color(vc, info, c, 0)); >+ > release_console_sem(); > } > >@@ -527,6 +529,7 @@ static int search_for_mapped_con(void) > static int fbcon_takeover(int show_logo) > { > int err, i; >+ struct fb_info *info; > > if (!num_registered_fb) > return -ENODEV; >@@ -540,6 +543,8 @@ static int fbcon_takeover(int show_logo) > err = take_over_console(&fb_con, first_fb_vc, last_fb_vc, > fbcon_is_default); > >+ info = registered_fb[info_idx]; >+ > if (err) { > for (i = first_fb_vc; i <= last_fb_vc; i++) { > con2fb_map[i] = -1; >@@ -547,6 +552,9 @@ static int fbcon_takeover(int show_logo) > info_idx = -1; > } else { > fbcon_has_console_bind = 1; >+ unlock_fb_info(info); >+ fbcon_decor_init(); >+ lock_fb_info(info); > } > > return err; >@@ -988,6 +996,12 @@ static const char *fbcon_startup(void) > rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); > cols /= vc->vc_font.width; > rows /= vc->vc_font.height; >+ >+ if (fbcon_decor_active(info, vc)) { >+ cols = vc->vc_decor.twidth / vc->vc_font.width; >+ rows = vc->vc_decor.theight / vc->vc_font.height; >+ } >+ > vc_resize(vc, cols, rows); > > DPRINTK("mode: %s\n", info->fix.id); >@@ -1017,7 +1031,7 @@ static void fbcon_init(struct vc_data *v > cap = info->flags; > > if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW || >- (info->fix.type == FB_TYPE_TEXT)) >+ (info->fix.type == FB_TYPE_TEXT) || fbcon_decor_active(info, vc)) > logo = 0; > > if (var_to_display(p, &info->var, info)) >@@ -1219,6 +1233,11 @@ static void fbcon_clear(struct vc_data * > if (sy < vc->vc_top && vc->vc_top == logo_lines) > vc->vc_top = 0; > >+ if (fbcon_decor_active(info, vc)) { >+ fbcon_decor_clear(vc, info, sy, sx, height, width); >+ return; >+ } >+ > /* Split blits that cross physical y_wrap boundary */ > > y_break = p->vrows - p->yscroll; >@@ -1238,10 +1257,15 @@ static void fbcon_putcs(struct vc_data * > struct display *p = &fb_display[vc->vc_num]; > struct fbcon_ops *ops = info->fbcon_par; > >- if (!fbcon_is_inactive(vc, info)) >- ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, >- get_color(vc, info, scr_readw(s), 1), >- get_color(vc, info, scr_readw(s), 0)); >+ if (!fbcon_is_inactive(vc, info)) { >+ >+ if (fbcon_decor_active(info, vc)) >+ fbcon_decor_putcs(vc, info, s, count, ypos, xpos); >+ else >+ ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, >+ get_color(vc, info, scr_readw(s), 1), >+ get_color(vc, info, scr_readw(s), 0)); >+ } > } > > static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) >@@ -1257,8 +1281,13 @@ static void fbcon_clear_margins(struct v > struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; > struct fbcon_ops *ops = info->fbcon_par; > >- if (!fbcon_is_inactive(vc, info)) >- ops->clear_margins(vc, info, bottom_only); >+ if (!fbcon_is_inactive(vc, info)) { >+ if (fbcon_decor_active(info, vc)) { >+ fbcon_decor_clear_margins(vc, info, bottom_only); >+ } else { >+ ops->clear_margins(vc, info, bottom_only); >+ } >+ } > } > > static void fbcon_cursor(struct vc_data *vc, int mode) >@@ -1778,7 +1807,7 @@ static int fbcon_scroll(struct vc_data * > count = vc->vc_rows; > if (softback_top) > fbcon_softback_note(vc, t, count); >- if (logo_shown >= 0) >+ if (logo_shown >= 0 || fbcon_decor_active(info, vc)) > goto redraw_up; > switch (p->scrollmode) { > case SCROLL_MOVE: >@@ -1871,6 +1900,8 @@ static int fbcon_scroll(struct vc_data * > count = vc->vc_rows; > if (logo_shown >= 0) > goto redraw_down; >+ if (fbcon_decor_active(info, vc)) >+ goto redraw_down; > switch (p->scrollmode) { > case SCROLL_MOVE: > fbcon_redraw_blit(vc, info, p, b - 1, b - t - count, >@@ -2019,6 +2050,13 @@ static void fbcon_bmove_rec(struct vc_da > } > return; > } >+ >+ if (fbcon_decor_active(info, vc) && sy == dy && height == 1) { >+ /* must use slower redraw bmove to keep background pic intact */ >+ fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width); >+ return; >+ } >+ > ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, > height, width); > } >@@ -2089,8 +2127,8 @@ static int fbcon_resize(struct vc_data * > var.yres = virt_h * virt_fh; > x_diff = info->var.xres - var.xres; > y_diff = info->var.yres - var.yres; >- if (x_diff < 0 || x_diff > virt_fw || >- y_diff < 0 || y_diff > virt_fh) { >+ if ((x_diff < 0 || x_diff > virt_fw || >+ y_diff < 0 || y_diff > virt_fh) && !vc->vc_decor.state) { > const struct fb_videomode *mode; > > DPRINTK("attempting resize %ix%i\n", var.xres, var.yres); >@@ -2126,6 +2164,19 @@ static int fbcon_switch(struct vc_data * > > info = registered_fb[con2fb_map[vc->vc_num]]; > ops = info->fbcon_par; >+ prev_console = ops->currcon; >+ if (prev_console != -1) >+ old_info = registered_fb[con2fb_map[prev_console]]; >+ >+ if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) { >+ struct vc_data *vc_curr = vc_cons[prev_console].d; >+ if (vc_curr && fbcon_decor_active_vc(vc_curr)) { >+ /* Clear the screen to avoid displaying funky colors during >+ * palette updates. */ >+ memset((u8*)info->screen_base + info->fix.line_length * info->var.yoffset, >+ 0, info->var.yres * info->fix.line_length); >+ } >+ } > > if (softback_top) { > if (softback_lines) >@@ -2144,9 +2195,6 @@ static int fbcon_switch(struct vc_data * > logo_shown = FBCON_LOGO_CANSHOW; > } > >- prev_console = ops->currcon; >- if (prev_console != -1) >- old_info = registered_fb[con2fb_map[prev_console]]; > /* > * FIXME: If we have multiple fbdev's loaded, we need to > * update all info->currcon. Perhaps, we can place this >@@ -2184,6 +2232,18 @@ static int fbcon_switch(struct vc_data * > fbcon_del_cursor_timer(old_info); > } > >+ if (fbcon_decor_active_vc(vc)) { >+ struct vc_data *vc_curr = vc_cons[prev_console].d; >+ >+ if (!vc_curr->vc_decor.theme || >+ strcmp(vc->vc_decor.theme, vc_curr->vc_decor.theme) || >+ (fbcon_decor_active_nores(info, vc_curr) && >+ !fbcon_decor_active(info, vc_curr))) { >+ if (fbcon_decor_call_helper("modechange", vc->vc_num)) >+ fbcon_decor_disable(vc, 0); >+ } >+ } >+ > if (fbcon_is_inactive(vc, info) || > ops->blank_state != FB_BLANK_UNBLANK) > fbcon_del_cursor_timer(info); >@@ -2295,15 +2355,20 @@ static int fbcon_blank(struct vc_data *v > info->fbops->fb_restore_state(info); > } > >- if (!fbcon_is_inactive(vc, info)) { >+ if (!fbcon_is_inactive(vc, info)) { > if (ops->blank_state != blank) { > ops->blank_state = blank; > fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); > ops->cursor_flash = (!blank); > >- if (!(info->flags & FBINFO_MISC_USEREVENT)) >- if (fb_blank(info, blank)) >- fbcon_generic_blank(vc, info, blank); >+ if (!(info->flags & FBINFO_MISC_USEREVENT)) { >+ if (fb_blank(info, blank)) { >+ if (fbcon_decor_active(info, vc)) >+ fbcon_decor_blank(vc, info, blank); >+ else >+ fbcon_generic_blank(vc, info, blank); >+ } >+ } > } > > if (!blank) >@@ -2454,13 +2519,22 @@ static int fbcon_do_set_font(struct vc_d > } > > if (resize) { >+ /* reset wrap/pan */ > int cols, rows; > > cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); > rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); >+ >+ info->var.xoffset = info->var.yoffset = p->yscroll = 0; >+ if (fbcon_decor_active(info, vc)) { >+ cols = vc->vc_decor.twidth; >+ rows = vc->vc_decor.theight; >+ } > cols /= w; > rows /= h; >+ > vc_resize(vc, cols, rows); >+ > if (CON_IS_VISIBLE(vc) && softback_buf) > fbcon_update_softback(vc); > } else if (CON_IS_VISIBLE(vc) >@@ -2589,7 +2663,7 @@ static int fbcon_set_palette(struct vc_d > int i, j, k, depth; > u8 val; > >- if (fbcon_is_inactive(vc, info)) >+ if (fbcon_is_inactive(vc, info) || vc->vc_num != fg_console) > return -EINVAL; > > if (!CON_IS_VISIBLE(vc)) >@@ -2615,7 +2689,49 @@ static int fbcon_set_palette(struct vc_d > } else > fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap); > >- return fb_set_cmap(&palette_cmap, info); >+ if (fbcon_decor_active(info, vc_cons[fg_console].d) && >+ info->fix.visual == FB_VISUAL_DIRECTCOLOR) { >+ >+ u16 *red, *green, *blue; >+ int minlen = min(min(info->var.red.length, info->var.green.length), >+ info->var.blue.length); >+ int h; >+ >+ struct fb_cmap cmap = { >+ .start = 0, >+ .len = (1 << minlen), >+ .red = NULL, >+ .green = NULL, >+ .blue = NULL, >+ .transp = NULL >+ }; >+ >+ red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL); >+ >+ if (!red) >+ goto out; >+ >+ green = red + 256; >+ blue = green + 256; >+ cmap.red = red; >+ cmap.green = green; >+ cmap.blue = blue; >+ >+ for (i = 0; i < cmap.len; i++) { >+ red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1); >+ } >+ >+ h = fb_set_cmap(&cmap, info); >+ fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d); >+ kfree(red); >+ >+ return h; >+ >+ } else if (fbcon_decor_active(info, vc_cons[fg_console].d) && >+ info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL) >+ fb_set_cmap(&info->bgdecor.cmap, info); >+ >+out: return fb_set_cmap(&palette_cmap, info); > } > > static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) >@@ -2841,7 +2957,18 @@ static void fbcon_modechanged(struct fb_ > rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); > cols /= vc->vc_font.width; > rows /= vc->vc_font.height; >- vc_resize(vc, cols, rows); >+ >+ if (!fbcon_decor_active_nores(info, vc)) { >+ vc_resize(vc, cols, rows); >+ } else { >+ /* HACK: Do this properly at some point.. */ >+ unlock_fb_info(info); >+ int res = fbcon_decor_call_helper("modechange", vc->vc_num); >+ lock_fb_info(info); >+ if (res) >+ fbcon_decor_disable(vc, 0); >+ } >+ > updatescrollmode(p, info, vc); > scrollback_max = 0; > scrollback_current = 0; >@@ -3475,6 +3602,7 @@ static void fbcon_exit(void) > } > } > >+ fbcon_decor_exit(); > fbcon_has_exited = 1; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 288089
: 206394