Modify it to adjust Tizen IVI enviroment
[platform/upstream/kmscon.git] / fblog / 0005-fblog-add-framebuffer-helpers.patch
1 From c0dbeaf1fa932dbae6027a49ddbff973b2689eea Mon Sep 17 00:00:00 2001
2 From: David Herrmann <dh.herrmann@googlemail.com>
3 Date: Sat, 16 Jun 2012 23:04:48 +0200
4 Subject: [PATCH 05/10] fblog: add framebuffer helpers
5
6 These helpers scan the system for all available framebuffers and register
7 or unregister them. This is needed during startup and stopping fblog so we
8 are aware of all connected displays.
9
10 The third helper handles mode changes by rescanning the mode and adjusting
11 the buffer size.
12
13 Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
14 ---
15  drivers/video/console/fblog.c |   29 +++++++++++++++++++++++++++++
16  1 file changed, 29 insertions(+)
17
18 diff --git a/drivers/video/console/fblog.c b/drivers/video/console/fblog.c
19 index e790971..7d4032e 100644
20 --- a/drivers/video/console/fblog.c
21 +++ b/drivers/video/console/fblog.c
22 @@ -399,6 +399,35 @@ static void fblog_unregister(struct fblog_fb *fb)
23         kfree(fb);
24  }
25  
26 +static void fblog_register_all(void)
27 +{
28 +       int i;
29 +
30 +       for (i = 0; i < FB_MAX; ++i)
31 +               fblog_register(registered_fb[i]);
32 +}
33 +
34 +static void fblog_unregister_all(void)
35 +{
36 +       int i;
37 +
38 +       for (i = 0; i < FB_MAX; ++i)
39 +               fblog_unregister(fblog_info2fb(registered_fb[i]));
40 +}
41 +
42 +static void fblog_refresh(struct fblog_fb *fb)
43 +{
44 +       unsigned int width, height;
45 +
46 +       if (!fb || !fb->font)
47 +               return;
48 +
49 +       width = fb->info->var.xres / fb->font->width;
50 +       height = fb->info->var.yres / fb->font->height;
51 +       fblog_buf_resize(&fb->buf, width, height);
52 +       fblog_redraw(fb);
53 +}
54 +
55  static int __init fblog_init(void)
56  {
57         return 0;
58 -- 
59 1.7.10.4
60