• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2019 Allwinnertech Co.Ltd
3  * Authors: zhengwanyu
4  *
5  * This program is free software; you can redistribute  it and/or modify it
6  * under  the terms of  the GNU General  Public License as published by the
7  * Free Software Foundation;  either version 2 of the  License, or (at your
8  * option) any later version.
9  *
10  */
11 #ifndef _SUNXI_DRM_BOOTLOGO_H_
12 #define _SUNXI_DRM_BOOTLOGO_H_
13 
14 #include <drm/drm_atomic.h>
15 #include <drm/drm_crtc.h>
16 #include <drm/drm_fb_helper.h>
17 #include <drm/drm_crtc_helper.h>
18 #include <linux/dma-buf.h>
19 #include <linux/dma-mapping.h>
20 #include <linux/module.h>
21 
22 enum bootlogo_pictures_format {
23 	BOOTLOGO_FORMAT_BMP = 0,
24 	BOOTLOGO_FORMAT_OTHERS = 1,
25 };
26 
27 struct bmp_header {
28 	/* Header */
29 	char signature[2];
30 	u32 file_size;
31 	u32 reserved;
32 	u32 data_offset;
33 	/* InfoHeader */
34 	u32 size;
35 	u32 width;
36 	u32 height;
37 	u16 planes;
38 	u16 bit_count;
39 	u32 compression;
40 	u32 image_size;
41 	u32 x_pixels_per_m;
42 	u32 y_pixels_per_m;
43 	u32 colors_used;
44 	u32 colors_important;
45 	/* ColorTable */
46 } __packed;
47 
48 struct bootlogo_info {
49 	unsigned int pics_format;
50 
51 	unsigned int phy_addr;
52 	unsigned int width;
53 	unsigned int height;
54 	unsigned int bpp;
55 	unsigned int stride;
56 	unsigned int left;
57 	unsigned int top;
58 	unsigned int right;
59 	unsigned int bottom;
60 };
61 
62 void sunxi_drm_get_bootlogoinfo_from_dts_info(
63 	struct bootlogo_info *bootlogo, char *dts_attr);
64 void sunxi_drm_get_bootlogoinfo_from_bmp_header(
65 	struct bootlogo_info *bootlogo, struct bmp_header *header,
66 	unsigned int fb_base);
67 int sunxi_drm_parse_bmp_header(struct bmp_header *header,
68 				unsigned long phy_addr);
69 int sunxi_drm_fbdev_copy_bootlogo(
70 	struct drm_device *dev, struct bootlogo_info *bootlogo);
71 #endif
72