1 /*
2  * Allwinner SoCs display driver.
3  *
4  * Copyright (C) 2016 Allwinner.
5  *
6  * This file is licensed under the terms of the GNU General Public
7  * License version 2.  This program is licensed "as is" without any
8  * warranty of any kind, whether express or implied.
9  */
10 
11 #include "../dev_disp.h"
12 #include "disp_private.h"
13 
14 extern struct disp_drv_info g_disp_drv;
15 
16 
dump_layer_config(struct disp_layer_config_data * data)17 u32 dump_layer_config(struct disp_layer_config_data *data)
18 {
19     u32 count = 0;
20     char buf[512];
21 
22     count +=
23         sprintf(buf + count, " %6s ",
24             (data->config.info.mode == LAYER_MODE_BUFFER) ?
25             "buffer" : "color");
26     count +=
27         sprintf(buf + count, " %8s ",
28             (data->config.enable == 1) ? "enable" : "disable");
29     count += sprintf(buf + count, "ch[%1d] ", data->config.channel);
30     count += sprintf(buf + count, "lyr[%1d] ", data->config.layer_id);
31     count += sprintf(buf + count, "z[%1d] ", data->config.info.zorder);
32     count +=
33         sprintf(buf + count, "pre_m[%1s] ",
34             (data->config.info.fb.pre_multiply) ? "Y" : "N");
35     count +=
36         sprintf(buf + count, "alpha[%5s %3d] ",
37             (data->config.info.alpha_mode) ? "globl" : "pixel",
38             data->config.info.alpha_value);
39     count += sprintf(buf + count, "fmt[%3d] ", data->config.info.fb.format);
40     count +=
41         sprintf(buf + count, "size[%4d,%4d;%4d,%4d;%4d,%4d] ",
42             data->config.info.fb.size[0].width,
43             data->config.info.fb.size[0].height,
44             data->config.info.fb.size[0].width,
45             data->config.info.fb.size[0].height,
46             data->config.info.fb.size[0].width,
47             data->config.info.fb.size[0].height);
48     count +=
49         sprintf(buf + count, "crop[%4d,%4d,%4d,%4d] ",
50             (int) (data->config.info.fb.crop.x >> 32),
51             (int) (data->config.info.fb.crop.y >> 32),
52             (int) (data->config.info.fb.crop.width >> 32),
53             (int) (data->config.info.fb.crop.height >> 32));
54     count +=
55         sprintf(buf + count, "frame[%4d,%4d,%4d,%4d] ",
56             data->config.info.screen_win.x,
57             data->config.info.screen_win.y,
58             data->config.info.screen_win.width,
59             data->config.info.screen_win.height);
60     count +=
61         sprintf(buf + count, "addr[%8llx,%8llx,%8llx] ",
62             data->config.info.fb.addr[0], data->config.info.fb.addr[1],
63             data->config.info.fb.addr[2]);
64     count += sprintf(buf + count, "flag[0x%8x] ", data->flag);
65     count += sprintf(buf + count, "\n");
66 
67     DE_WRN("%s", buf);
68     return count;
69 }
70 
71 
72 
73 
74