LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Eger <eger@havoc.gtf.org>
To: Andrew Morton <akpm@osdl.org>
Cc: David Eger <eger@theboonies.us>,
	linux-fbdev-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/4] James' fbcon init and con2fb cleanup
Date: Thu, 20 May 2004 11:54:39 -0400	[thread overview]
Message-ID: <20040520155439.GA17330@havoc.gtf.org> (raw)
In-Reply-To: <20040519030319.1f0e6eec.akpm@osdl.org>


James' patch to fix up the fbcon initialization sequence:
 fixes con2fb initialization


# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/05/15 21:42:23+02:00 eger@rosencrantz.theboonies.us 
#   fbcon initialization cleanup; No more calling fb_console_init twice. 
#   - James Simmons
# 
# drivers/video/fbmem.c
#   2004/05/15 21:36:32+02:00 eger@rosencrantz.theboonies.us +2 -2
#   fb con init cleanup
# 
# drivers/video/console/fbcon.h
#   2004/05/15 21:36:32+02:00 eger@rosencrantz.theboonies.us +1 -1
#   fix con2fb API
# 
# drivers/video/console/fbcon.c
#   2004/05/15 21:36:31+02:00 eger@rosencrantz.theboonies.us +21 -28
#   fbcon init cleanup:
#    factor out retrieving the vc_data from the fbcon_event_notify path
#    remove fbcon_event_notifier_registered cruft
#    cleanup/fix con2fb code
# 
diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
--- a/drivers/video/console/fbcon.c	Sat May 15 22:54:19 2004
+++ b/drivers/video/console/fbcon.c	Sat May 15 22:54:19 2004
@@ -296,15 +296,17 @@
  *	Maps a virtual console @unit to a frame buffer device
  *	@newidx.
  */
-int set_con2fb_map(int unit, int newidx)
+int set_con2fb_map(int start, int end, int newidx)
 {
-	struct vc_data *vc = vc_cons[unit].d;
+	struct vc_data *vc = vc_cons[start].d;
+	int i;
 
 	if (!vc)
 		return -ENODEV;
-	con2fb_map[unit] = newidx;
+	for (i = start; i < end; i++)
+		con2fb_map[i] = newidx;
 	fbcon_is_default = (vc->vc_sw == &fb_con) ? 1 : 0;
-	return take_over_console(&fb_con, unit, unit, fbcon_is_default);
+	return take_over_console(&fb_con, start, end, fbcon_is_default);
 }
 
 /*
@@ -2203,34 +2205,32 @@
 	return 0;
 }
 
-static void fbcon_suspended(struct fb_info *info)
+static void fbcon_suspended(struct fb_info *info, struct vc_data *vc)
 {
 	/* Clear cursor, restore saved data */
-	info->cursor.enable = 0;
-	info->fbops->fb_cursor(info, &info->cursor);
+	fbcon_cursor(vc, CM_ERASE);
 }
 
-static void fbcon_resumed(struct fb_info *info)
+static void fbcon_resumed(struct fb_info *info, struct vc_data *vc)
 {
-	struct vc_data *vc;
-
-	if (info->currcon < 0)
-		return;
-	vc = vc_cons[info->currcon].d;
-
 	update_screen(vc->vc_num);
 }
 static int fbcon_event_notify(struct notifier_block *self, 
 			      unsigned long action, void *data)
 {
 	struct fb_info *info = (struct fb_info *) data;
+	struct vc_data *vc;
+
+	if (info->currcon < 0)
+		return 0;
+	vc = vc_cons[info->currcon].d;
 
 	switch(action) {
 	case FB_EVENT_SUSPEND:
-		fbcon_suspended(info);
+		fbcon_suspended(info, vc);
 		break;
 	case FB_EVENT_RESUME:
-		fbcon_resumed(info);
+		fbcon_resumed(info, vc);
 		break;
 	}
 	return 0;
@@ -2265,12 +2265,14 @@
 	.notifier_call	= fbcon_event_notify,
 };
 
-static int fbcon_event_notifier_registered;
-
 int __init fb_console_init(void)
 {
 	int err;
 
+	acquire_console_sem();
+	fb_register_client(&fbcon_event_notifer);
+	release_console_sem();
+
 	if (!num_registered_fb)
 		return -ENODEV;
 
@@ -2281,12 +2283,6 @@
 	if (err)
 		return err;
 
-	acquire_console_sem();
-	if (!fbcon_event_notifier_registered) {
-		fb_register_client(&fbcon_event_notifer);
-		fbcon_event_notifier_registered = 1;
-	} 
-	release_console_sem();
 	return 0;
 }
 
@@ -2289,10 +2285,7 @@
 void __exit fb_console_exit(void)
 {
 	acquire_console_sem();
-	if (fbcon_event_notifier_registered) {
-		fb_unregister_client(&fbcon_event_notifer);
-		fbcon_event_notifier_registered = 0;
-	}
+	fb_unregister_client(&fbcon_event_notifer);
 	release_console_sem();
 	give_up_console(&fb_con);
 }	
diff -Nru a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
--- a/drivers/video/console/fbcon.h	Sat May 15 22:54:19 2004
+++ b/drivers/video/console/fbcon.h	Sat May 15 22:54:19 2004
@@ -38,7 +38,7 @@
 
 /* drivers/video/console/fbcon.c */
 extern char con2fb_map[MAX_NR_CONSOLES];
-extern int set_con2fb_map(int unit, int newidx);
+extern int set_con2fb_map(int start, int end, int newidx);
 
     /*
      *  Attribute Decoding
diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c
--- a/drivers/video/fbmem.c	Sat May 15 22:54:19 2004
+++ b/drivers/video/fbmem.c	Sat May 15 22:54:19 2004
@@ -1096,9 +1096,9 @@
 		if (!registered_fb[con2fb.framebuffer])
 		    return -EINVAL;
 		if (con2fb.console != 0)
-			set_con2fb_map(con2fb.console-1, con2fb.framebuffer);
+			set_con2fb_map(con2fb.console-1, con2fb.console-1, con2fb.framebuffer);
 		else
-			fb_console_init();		
+			set_con2fb_map(0, MAX_NR_CONSOLES, con2fb.framebuffer);
 		return 0;
 #endif	/* CONFIG_FRAMEBUFFER_CONSOLE */
 	case FBIOBLANK:

  parent reply	other threads:[~2004-05-20 15:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-19  9:36 FB accel capabilities patch David Eger
2004-05-19 10:03 ` Andrew Morton
2004-05-19 11:14   ` [Linux-fbdev-devel] " Geert Uytterhoeven
2004-05-19 23:31   ` Benjamin Herrenschmidt
2004-05-20  8:19     ` [OT ML related] Emiliano 'AlberT' Gabrielli
2004-05-20  8:54       ` Jurriaan
2004-05-20  9:09         ` Emiliano 'AlberT' Gabrielli
2004-05-20  9:20           ` DervishD
2004-05-20  9:23             ` Emiliano 'AlberT' Gabrielli
2004-05-20  9:32               ` Russell King
2004-05-20 15:54   ` David Eger [this message]
2004-05-20 15:59     ` [PATCH 2/4] FB accel capabilities (core update) David Eger
2004-05-20 16:00     ` [PATCH 1/4] James' fbcon init and con2fb cleanup James Simmons
2004-05-20 16:01     ` [PATCH 3/4] s/FBINFO_FLAG_/FBINFO_/g David Eger
2004-05-20 16:03     ` [PATCH 4/4] radeonfb accel capabilities David Eger
2004-05-19 19:34 ` [Linux-fbdev-devel] FB accel capabilities patch James Simmons
2004-05-19 21:39   ` David Eger
2004-05-19 21:47     ` James Simmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040520155439.GA17330@havoc.gtf.org \
    --to=eger@havoc.gtf.org \
    --cc=akpm@osdl.org \
    --cc=eger@theboonies.us \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 1/4] James'\'' fbcon init and con2fb cleanup' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).