Skip to contentSkip to conversation

problem with gen_update_var

PATCH Antonino Daplas 2 participants 4 messages Jun 10, 2002 – Jun 17, 2002 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

Hi,

gen_update_var will break panning/wrapping since it passes info->var to fb_pan_display. However, fbcon updates display->var.

Tony

fbgen.c renamed from fbgen.c.orig +3 -0
@@ -514,6 +514,9 @@
     
 	if (con == info->currcon) {
 		if (info->fbops->fb_pan_display) {
+			info->var.xoffset = fb_display[con].var.xoffset;
+			info->var.yoffset = fb_display[con].var.yoffset;
+			info->var.vmode = fb_display[con].var.vmode;
 			if ((err = info->fbops->fb_pan_display(&info->var, con, info)))
 				return err;
 		}
#1 lore raw
Quoted 5 lines

Hi,

gen_update_var will break panning/wrapping since it passes info->var to fb_pan_display. However, fbcon updates display->var.

It works. The var info struct fb_info is always the foreground console. Notice gen_update_var is only called when it is the foreground console.

_______________________________________________________________

Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/

#2 lore raw
Quoted 10 lines · James Simmons
Quoted 5 lines

Hi,

gen_update_var will break panning/wrapping since it passes info->var to fb_pan_display. However, fbcon updates display->var.

It works. The var info struct fb_info is always the foreground console. Notice gen_update_var is only called when it is the foreground console.

In ywrap_up in fbcon.c, it has this code:

    p->var.xoffset = 0;
    p->var.yoffset = p->yscroll*fontheight(p);
    p->var.vmode |= FB_VMODE_YWRAP;
    p->fb_info->updatevar(unit, p->fb_info);

(*p is struct display). gen_update_var will call pan_display(info->var, con, info). But as can be seen, info->var is not updated by ywrap_up.

Unless, the low-level driver's implementation is to get the offsets from fb_display[con].var, that's the only time it will work. But it will break userland apps that will call pan_display(var, con, info) expecting that the offsets contained in the passed var parameter will be updated.

Tony

_______________________________________________________________

Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/

#3 lore raw
Quoted 10 lines

In ywrap_up in fbcon.c, it has this code:

    p->var.xoffset = 0;
    p->var.yoffset = p->yscroll*fontheight(p);
    p->var.vmode |= FB_VMODE_YWRAP;
    p->fb_info->updatevar(unit, p->fb_info);

(*p is struct display). gen_update_var will call pan_display(info->var, con, info).

Only if con == currcon.

Quoted 1 line

But as can be seen, info->var is not updated by ywrap_up.

Your right. I will fix that.

Quoted 5 lines

Unless, the low-level driver's implementation is to get the offsets from fb_display[con].var, that's the only time it will work. But it will break userland apps that will call pan_display(var, con, info) expecting that the offsets contained in the passed var parameter will be updated.

Don't worry about userland apps. They can't pan non foreground consoles. Only fbcon inside the kernel can.

_______________________________________________________________

Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/