1 /*
2  * Copyright (c) 2006-2023, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2022-03-05     bernard      first version.
9  */
10 
11 #ifndef RT_LCD_H__
12 #define RT_LCD_H__
13 
14 /* ioctls
15    0x46 is 'F'                                                          */
16 
17 #define FBIOGET_VSCREENINFO     0x4600
18 #define FBIOPUT_VSCREENINFO     0x4601
19 #define FBIOGET_FSCREENINFO     0x4602
20 #define FBIOGET_PIXELINFO       0x4603
21 #define FBIOGETCMAP             0x4604
22 #define FBIOPUTCMAP             0x4605
23 #define FBIOPAN_DISPLAY         0x4606
24 #define FBIO_CURSOR             0x4608
25 /* #define FBIOGET_MONITORSPEC  0x460C */
26 /* #define FBIOPUT_MONITORSPEC  0x460D */
27 /* #define FBIOSWITCH_MONIBIT   0x460E */
28 
29 #define FBIOGET_CON2FBMAP       0x460F
30 #define FBIOPUT_CON2FBMAP       0x4610
31 #define FBIOBLANK               0x4611          /* arg: 0 or vesa level + 1 */
32 #define FBIOGET_VBLANK          0x4612
33 #define FBIO_ALLOC              0x4613
34 #define FBIO_FREE               0x4614
35 #define FBIOGET_GLYPH           0x4615
36 #define FBIOGET_HWCINFO         0x4616
37 #define FBIOPUT_MODEINFO        0x4617
38 #define FBIOGET_DISPINFO        0x4618
39 #define FBIO_WAITFORVSYNC       0x4620
40 
41 struct fb_bitfield
42 {
43     uint32_t offset;        /* beginning of bitfield */
44     uint32_t length;        /* length of bitfield */
45     uint32_t msb_right;     /* != 0 : Most significant bit is */
46     /* right */
47 };
48 
49 struct fb_var_screeninfo
50 {
51     uint32_t xres;               /* visible resolution */
52     uint32_t yres;
53     uint32_t xres_virtual;       /* virtual resolution  */
54     uint32_t yres_virtual;
55     uint32_t xoffset;            /* offset from virtual to visible */
56     uint32_t yoffset;            /* resolution */
57 
58     uint32_t bits_per_pixel;     /* guess what */
59     uint32_t grayscale;          /* 0 = color, 1 = grayscale, */
60     /* >1 = FOURCC */
61     struct fb_bitfield red;      /* bitfield in fb mem if true color, */
62     struct fb_bitfield green;    /* else only length is significant */
63     struct fb_bitfield blue;
64     struct fb_bitfield transp;   /* transparency */
65 
66     uint32_t nonstd;             /* != 0 Non standard pixel format */
67 
68     uint32_t activate;           /* see FB_ACTIVATE_* */
69 
70     uint32_t height;             /* height of picture in mm */
71     uint32_t width;              /* width of picture in mm */
72 
73     uint32_t accel_flags;        /* (OBSOLETE) see fb_info.flags */
74 
75     /* Timing: All values in pixclocks, except pixclock (of course) */
76     uint32_t pixclock;          /* pixel clock in ps (pico seconds) */
77     uint32_t left_margin;       /* time from sync to picture */
78     uint32_t right_margin;      /* time from picture to sync */
79     uint32_t upper_margin;      /* time from sync to picture */
80     uint32_t lower_margin;
81     uint32_t hsync_len;         /* length of horizontal sync */
82     uint32_t vsync_len;         /* length of vertical sync */
83     uint32_t sync;              /* see FB_SYNC_* */
84     uint32_t vmode;             /* see FB_VMODE_* */
85     uint32_t rotate;            /* angle we rotate counter clockwise */
86     uint32_t colorspace;        /* colorspace for FOURCC-based modes */
87     uint32_t reserved[4];       /* Reserved for future compatibility */
88 };
89 
90 struct fb_fix_screeninfo
91 {
92     char id[16];               /* identification string eg "TT Builtin" */
93     unsigned long smem_start;  /* Start of frame buffer mem */
94     /* (physical address) */
95     uint32_t smem_len;         /* Length of frame buffer mem */
96     uint32_t type;             /* see FB_TYPE_* */
97     uint32_t type_aux;         /* Interleave for interleaved Planes */
98     uint32_t visual;           /* see FB_VISUAL_* */
99     uint16_t xpanstep;         /* zero if no hardware panning */
100     uint16_t ypanstep;         /* zero if no hardware panning */
101     uint16_t ywrapstep;        /* zero if no hardware ywrap */
102     uint32_t line_length;      /* length of a line in bytes */
103     unsigned long mmio_start;  /* Start of Memory Mapped I/O */
104     /* (physical address) */
105     uint32_t mmio_len;         /* Length of Memory Mapped I/O */
106     uint32_t accel;            /* Indicate to driver which */
107     /*  specific chip/card we have  */
108     uint16_t capabilities;     /* see FB_CAP_* */
109     uint16_t reserved[2];      /* Reserved for future compatibility */
110 };
111 
112 #endif
113