clk: rockchip: support setting ddr clock via SCPI APIs
[firefly-linux-kernel-4.4.55.git] / drivers / video / rockchip / bmp_helper.h
1 /*
2  * drivers/video/rockchip/bmp_helper.h
3  *
4  * Copyright (C) 2012 Rockchip Corporation
5  * Author: Mark Yao <mark.yao@rock-chips.com>
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License version 2 as published by
9  * the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program.  If not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #ifndef _BMP_HELPER_H_
21 #define _BMP_HELPER_H_
22
23 typedef struct bmpheader {
24         unsigned short type;
25         unsigned int size;
26         unsigned int reserved;
27         unsigned int offset;
28 }__attribute__((packed)) BITMAPHEADER;
29
30 typedef struct bmpinfoheader {
31         unsigned int size;
32         unsigned int width;
33         unsigned int height;
34         unsigned short planes;
35         unsigned short bitcount;
36         unsigned int compression;
37         unsigned int imagesize;
38         unsigned int xpelspermeter;
39         unsigned int ypelspermeter;
40         unsigned int colors;
41         unsigned int colorsimportant;
42 }__attribute__((packed)) BITMAPINFOHEADER;
43
44 #define BMP_RLE8_ESCAPE         0
45 #define BMP_RLE8_EOL            0
46 #define BMP_RLE8_EOBMP          1
47 #define BMP_RLE8_DELTA          2
48
49 #define range(x, min, max) ((x) < (min)) ? (min) : (((x) > (max)) ? (max) : (x))
50
51 int bmpencoder(void *__iomem *vaddr,int width, int height, u8 data_format,
52                void *data, void (*fn)(void *, void *, int));
53 int bmpdecoder(void *bmp_addr, void *dst, int *width, int *height, int *bits);
54 #endif /* _BMP_HELPER_H_ */