Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47434847 authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds
Browse files

[PATCH] fbcon: Add ability to save/restore graphics state



Add hooks to save and restore the graphics state.  These hooks are called in
fbcon_blank() when entering/leaving KD_GRAPHICS mode.  This is needed by
savagefb at least so it can cooperate with savage_dri and by cyblafb.

State save/restoration can be full or partial.

Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 56f0d64d
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -2191,11 +2191,14 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
		ops->graphics = 1;
		ops->graphics = 1;


		if (!blank) {
		if (!blank) {
			if (info->fbops->fb_save_state)
				info->fbops->fb_save_state(info);
			var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
			var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
			fb_set_var(info, &var);
			fb_set_var(info, &var);
			ops->graphics = 0;
			ops->graphics = 0;
			ops->var = info->var;
			ops->var = info->var;
		}
		} else if (info->fbops->fb_restore_state)
			info->fbops->fb_restore_state(info);
	}
	}


 	if (!fbcon_is_inactive(vc, info)) {
 	if (!fbcon_is_inactive(vc, info)) {
+6 −0
Original line number Original line Diff line number Diff line
@@ -617,6 +617,12 @@ struct fb_ops {


	/* perform fb specific mmap */
	/* perform fb specific mmap */
	int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma);
	int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma);

	/* save current hardware state */
	void (*fb_save_state)(struct fb_info *info);

	/* restore saved state */
	void (*fb_restore_state)(struct fb_info *info);
};
};


#ifdef CONFIG_FB_TILEBLITTING
#ifdef CONFIG_FB_TILEBLITTING