aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/pvr/kerneldisplay.h
blob: c601906ab14d7aca5433202491a5ca96a9c3fcb1 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**********************************************************************
 *
 * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful but, except
 * as otherwise stated in writing, 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.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * The full GNU General Public License is included in this distribution in
 * the file called "COPYING".
 *
 * Contact Information:
 * Imagination Technologies Ltd. <gpl-support@imgtec.com>
 * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
 *
 ******************************************************************************/

#if !defined(__KERNELDISPLAY_H__)
#define __KERNELDISPLAY_H__

#include <linux/module.h>

#define DC_FLIP_COMMAND				0

#define DC_STATE_NO_FLUSH_COMMANDS		0
#define DC_STATE_FLUSH_COMMANDS			1

struct PVRSRV_DC_SRV2DISP_KMJTABLE {
	struct module *owner;
	u32 ui32TableSize;
	enum PVRSRV_ERROR (*pfnOpenDCDevice)(u32, void **,
					struct PVRSRV_SYNC_DATA *);
	enum PVRSRV_ERROR (*pfnCloseDCDevice)(void *);
	enum PVRSRV_ERROR (*pfnEnumDCFormats)(void *, u32 *,
					 struct DISPLAY_FORMAT *);
	enum PVRSRV_ERROR (*pfnEnumDCDims)(void *, struct DISPLAY_FORMAT *,
				      u32 *, struct DISPLAY_DIMS *);
	enum PVRSRV_ERROR (*pfnGetDCSystemBuffer)(void *, void **);
	enum PVRSRV_ERROR (*pfnGetDCInfo)(void *, struct DISPLAY_INFO *);
	enum PVRSRV_ERROR (*pfnGetBufferAddr)(void *, void *,
					 struct IMG_SYS_PHYADDR **, u32 *,
					 void __iomem **, void **, IMG_BOOL *);
	enum PVRSRV_ERROR (*pfnCreateDCSwapChain)(void *, u32,
					     struct DISPLAY_SURF_ATTRIBUTES *,
					     struct DISPLAY_SURF_ATTRIBUTES *,
					     u32, struct PVRSRV_SYNC_DATA **,
					     u32, void **, u32 *);
	enum PVRSRV_ERROR (*pfnDestroyDCSwapChain)(void *, void *);
	enum PVRSRV_ERROR (*pfnSetDCDstRect)(void *, void *, struct IMG_RECT *);
	enum PVRSRV_ERROR (*pfnSetDCSrcRect)(void *, void *, struct IMG_RECT *);
	enum PVRSRV_ERROR (*pfnSetDCDstColourKey)(void *, void *, u32);
	enum PVRSRV_ERROR (*pfnSetDCSrcColourKey)(void *, void *, u32);
	enum PVRSRV_ERROR (*pfnGetDCBuffers)(void *, void *, u32 *, void **);
	void (*pfnSetDCState)(void *, u32);
};

struct PVRSRV_DC_DISP2SRV_KMJTABLE {
	u32 ui32TableSize;
	enum PVRSRV_ERROR (*pfnPVRSRVRegisterDCDevice)(
				struct PVRSRV_DC_SRV2DISP_KMJTABLE*, u32 *);
	enum PVRSRV_ERROR (*pfnPVRSRVRemoveDCDevice)(u32);
	enum PVRSRV_ERROR (*pfnPVRSRVOEMFunction)(u32, void *, u32, void *,
				u32);
	enum PVRSRV_ERROR (*pfnPVRSRVRegisterCmdProcList)(u32,
				IMG_BOOL (**)(void *, u32, void *), u32[][2],
				u32);
	enum PVRSRV_ERROR (*pfnPVRSRVRemoveCmdProcList)(u32, u32);
	void (*pfnPVRSRVCmdComplete)(void *, IMG_BOOL);
	enum PVRSRV_ERROR (*pfnPVRSRVRegisterSystemISRHandler)(
				IMG_BOOL (*)(void *), void *, u32, u32);
	enum PVRSRV_ERROR (*pfnPVRSRVRegisterPowerDevice)(u32,
			enum PVRSRV_ERROR (*)(void *, enum PVR_POWER_STATE,
					 enum PVR_POWER_STATE),
			enum PVRSRV_ERROR (*)(void *, enum PVR_POWER_STATE,
					 enum PVR_POWER_STATE),
			enum PVRSRV_ERROR (*)(void *, IMG_BOOL,
					 enum PVR_POWER_STATE),
			enum PVRSRV_ERROR (*)(void *, IMG_BOOL,
					 enum PVR_POWER_STATE),
			void *, enum PVR_POWER_STATE, enum PVR_POWER_STATE);
};

struct DISPLAYCLASS_FLIP_COMMAND {
	void *hExtDevice;
	void *hExtSwapChain;
	void *hExtBuffer;
	void *hPrivateTag;
	u32 ui32ClipRectCount;
	struct IMG_RECT *psClipRect;
	u32 ui32SwapInterval;
};

IMG_BOOL PVRGetDisplayClassJTable(struct PVRSRV_DC_DISP2SRV_KMJTABLE *psJTable);

#endif