aboutsummaryrefslogtreecommitdiff
path: root/include/linux/fb_quickdraw.h
blob: becfe741ff18b093b32aca3ea6ff181917cc0ee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* Copyright (c) 2014, Motorola Mobility, LLC.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */
#ifndef _FB_QUICKDRAW_H_
#define _FB_QUICKDRAW_H_

#define FB_QUICKDRAW_IOCTL_MAGIC 'q'
#define FB_QUICKDRAW_INIT		_IO(FB_QUICKDRAW_IOCTL_MAGIC, 1)
#define FB_QUICKDRAW_ADD_BUFFER		_IOW(FB_QUICKDRAW_IOCTL_MAGIC, 2, \
					struct fb_quickdraw_buffer_data)
#define FB_QUICKDRAW_REMOVE_BUFFER	_IOW(FB_QUICKDRAW_IOCTL_MAGIC, 3, int)
#define FB_QUICKDRAW_LOCK_BUFFER	_IOW(FB_QUICKDRAW_IOCTL_MAGIC, 4, int)
#define FB_QUICKDRAW_UNLOCK_BUFFER	_IOW(FB_QUICKDRAW_IOCTL_MAGIC, 5, int)

struct fb_quickdraw_rect {
	int x;
	int y;
	int w;
	int h;
};

struct fb_quickdraw_buffer_data {
	int buffer_id;
	int user_fd;
	int format;
	struct fb_quickdraw_rect rect;
};

#ifdef __KERNEL__

#define FB_QUICKDRAW_NAME	"fb_quickdraw"

#define COORD_NO_OVERRIDE          -1
#define QUICKDRAW_ESD_RECOVERED -1337

#ifdef CONFIG_FB_QUICKDRAW

int fb_quickdraw_prepare(unsigned char panel_state);
int fb_quickdraw_execute(int buffer_id, int x, int y);
int fb_quickdraw_erase(int x1, int y1, int x2, int y2);
int fb_quickdraw_cleanup(void);

#else

static inline int fb_quickdraw_prepare(unsigned char panel_state)
	{ return 0; };
static inline int fb_quickdraw_execute(int buffer_id, int x, int y)
	{ return 0; };
static inline int fb_quickdraw_erase(int x1, int y1, int x2, int y2)
	{ return 0; };
static inline int fb_quickdraw_cleanup(void)
	{ return 0; };
#endif /* CONFIG_FB_QUICKDRAW */

#endif /* __KERNEL__ */

#endif /* _FB_QUICKDRAW_H_ */