All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Linux Fbdev development list <linux-fbdev-devel@lists.sourceforge.net>
Subject: [PATCH 02/20] fbcon: Check console-fb mapping in fbcon_get_requirement
Date: Sat, 05 May 2007 22:43:25 +0800	[thread overview]
Message-ID: <463C980D.7000806@gmail.com> (raw)

- Check the console-to-fb mapping in fbcon_get_requirement(), otherwise the
value returned may not be valid for the driver.

- Minor cleanup

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
---

 drivers/video/console/fbcon.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 34899bd..73813c6 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -3048,14 +3048,14 @@ static void fbcon_get_requirement(struct
 {
 	struct vc_data *vc;
 	struct display *p;
-	int charcnt;
 
 	if (caps->flags) {
-		int i;
+		int i, charcnt;
 
 		for (i = first_fb_vc; i <= last_fb_vc; i++) {
 			vc = vc_cons[i].d;
-			if (vc && vc->vc_mode == KD_TEXT) {
+			if (vc && vc->vc_mode == KD_TEXT &&
+			    info->node == con2fb_map[i]) {
 				p = &fb_display[i];
 				caps->x |= 1 << (vc->vc_font.width - 1);
 				caps->y |= 1 << (vc->vc_font.height - 1);
@@ -3068,14 +3068,13 @@ static void fbcon_get_requirement(struct
 	} else {
 		vc = vc_cons[fg_console].d;
 
-		if (vc && vc->vc_mode == KD_TEXT) {
+		if (vc && vc->vc_mode == KD_TEXT &&
+		    info->node == con2fb_map[fg_console]) {
 			p = &fb_display[fg_console];
-			caps->x |= 1 << (vc->vc_font.width - 1);
-			caps->y |= 1 << (vc->vc_font.height - 1);
-			charcnt = (p->userfont) ?
+			caps->x = 1 << (vc->vc_font.width - 1);
+			caps->y = 1 << (vc->vc_font.height - 1);
+			caps->len = (p->userfont) ?
 				FNTCHARCNT(p->fontdata) : 256;
-			if (caps->len < charcnt)
-				caps->len = charcnt;
 		}
 	}
 }


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

                 reply	other threads:[~2007-05-05 15:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=463C980D.7000806@gmail.com \
    --to=adaplas@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.