diff options
Diffstat (limited to 'drivers/video/console/fbcon.c')
-rw-r--r-- | drivers/video/console/fbcon.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 6fc3501581d6..34899bd7c9f3 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -3043,6 +3043,43 @@ static void fbcon_new_modelist(struct fb_info *info) | |||
3043 | } | 3043 | } |
3044 | } | 3044 | } |
3045 | 3045 | ||
3046 | static void fbcon_get_requirement(struct fb_info *info, | ||
3047 | struct fb_blit_caps *caps) | ||
3048 | { | ||
3049 | struct vc_data *vc; | ||
3050 | struct display *p; | ||
3051 | int charcnt; | ||
3052 | |||
3053 | if (caps->flags) { | ||
3054 | int i; | ||
3055 | |||
3056 | for (i = first_fb_vc; i <= last_fb_vc; i++) { | ||
3057 | vc = vc_cons[i].d; | ||
3058 | if (vc && vc->vc_mode == KD_TEXT) { | ||
3059 | p = &fb_display[i]; | ||
3060 | caps->x |= 1 << (vc->vc_font.width - 1); | ||
3061 | caps->y |= 1 << (vc->vc_font.height - 1); | ||
3062 | charcnt = (p->userfont) ? | ||
3063 | FNTCHARCNT(p->fontdata) : 256; | ||
3064 | if (caps->len < charcnt) | ||
3065 | caps->len = charcnt; | ||
3066 | } | ||
3067 | } | ||
3068 | } else { | ||
3069 | vc = vc_cons[fg_console].d; | ||
3070 | |||
3071 | if (vc && vc->vc_mode == KD_TEXT) { | ||
3072 | p = &fb_display[fg_console]; | ||
3073 | caps->x |= 1 << (vc->vc_font.width - 1); | ||
3074 | caps->y |= 1 << (vc->vc_font.height - 1); | ||
3075 | charcnt = (p->userfont) ? | ||
3076 | FNTCHARCNT(p->fontdata) : 256; | ||
3077 | if (caps->len < charcnt) | ||
3078 | caps->len = charcnt; | ||
3079 | } | ||
3080 | } | ||
3081 | } | ||
3082 | |||
3046 | static int fbcon_event_notify(struct notifier_block *self, | 3083 | static int fbcon_event_notify(struct notifier_block *self, |
3047 | unsigned long action, void *data) | 3084 | unsigned long action, void *data) |
3048 | { | 3085 | { |
@@ -3050,6 +3087,7 @@ static int fbcon_event_notify(struct notifier_block *self, | |||
3050 | struct fb_info *info = event->info; | 3087 | struct fb_info *info = event->info; |
3051 | struct fb_videomode *mode; | 3088 | struct fb_videomode *mode; |
3052 | struct fb_con2fbmap *con2fb; | 3089 | struct fb_con2fbmap *con2fb; |
3090 | struct fb_blit_caps *caps; | ||
3053 | int ret = 0; | 3091 | int ret = 0; |
3054 | 3092 | ||
3055 | /* | 3093 | /* |
@@ -3098,6 +3136,10 @@ static int fbcon_event_notify(struct notifier_block *self, | |||
3098 | case FB_EVENT_NEW_MODELIST: | 3136 | case FB_EVENT_NEW_MODELIST: |
3099 | fbcon_new_modelist(info); | 3137 | fbcon_new_modelist(info); |
3100 | break; | 3138 | break; |
3139 | case FB_EVENT_GET_REQ: | ||
3140 | caps = event->data; | ||
3141 | fbcon_get_requirement(info, caps); | ||
3142 | break; | ||
3101 | } | 3143 | } |
3102 | 3144 | ||
3103 | done: | 3145 | done: |