Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=167f07f1bc20ea1ab51d833deb0c18f5ab93618f
Commit:     167f07f1bc20ea1ab51d833deb0c18f5ab93618f
Parent:     b1e7223f28b4ed5073d2029a3597bf514ff514f2
Author:     Antonino A. Daplas <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:39:54 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:33 2007 -0700

    fbcon: check console-fb mapping in fbcon_get_requirement
    
    - 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 <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 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 fb_info *info,
 {
        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 fb_info *info,
        } 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;
                }
        }
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to