9f5e9318632153e945cfddb95b403ad5ffb071fd
[profile/ivi/intel-emgd-kmod.git] / pvr / services4 / srvkm / env / linux / pvr_drm.h
1 /**********************************************************************
2  Copyright (c) Imagination Technologies Ltd.
3
4  Permission is hereby granted, free of charge, to any person obtaining a copy
5  of this software and associated documentation files (the "Software"), to deal
6  in the Software without restriction, including without limitation the rights
7  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  copies of the Software, and to permit persons to whom the Software is
9  furnished to do so, subject to the following conditions:
10
11  The above copyright notice and this permission notice shall be included in
12  all copies or substantial portions of the Software.
13
14  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  THE SOFTWARE.
21  ******************************************************************************/
22
23 #if !defined(__PVR_DRM_H__)
24 #define __PVR_DRM_H__
25
26 #if defined(SUPPORT_DRI_DRM)
27 IMG_INT PVRCore_Init(IMG_VOID);
28 IMG_VOID PVRCore_Cleanup(IMG_VOID);
29 IMG_INT PVRSRVOpen(struct drm_device *dev, struct drm_file *pFile);
30 IMG_INT PVRSRVRelease(struct drm_device *dev, struct drm_file *pFile);
31 IMG_INT PVRSRVDriverSuspend(struct drm_device *pDevice, pm_message_t state);
32 IMG_INT PVRSRVDriverResume(struct drm_device *pDevice);
33
34 IMG_INT PVRSRV_BridgeDispatchKM(struct drm_device *dev, IMG_VOID *arg, struct drm_file *pFile);
35
36 #if defined(SUPPORT_DRI_DRM_EXT)
37 #define DRI_DRM_STATIC
38 IMG_INT PVRSRVDrmLoad(struct drm_device *dev, unsigned long flags);
39 IMG_INT PVRSRVDrmUnload(struct drm_device *dev);
40 IMG_VOID PVRSRVDrmPostClose(struct drm_device *dev, struct drm_file *file);
41 IMG_INT PVRDRMIsMaster(struct drm_device *dev, IMG_VOID *arg, struct drm_file *pFile);
42 IMG_INT PVRDRMUnprivCmd(struct drm_device *dev, IMG_VOID *arg, struct drm_file *pFile);
43 IMG_INT PVRDRM_Dummy_ioctl(struct drm_device *dev, IMG_VOID *arg, struct drm_file *pFile);
44 #else
45 #define DRI_DRM_STATIC  static
46 #endif
47
48 #if defined(PDUMP)
49 int dbgdrv_init(void);
50 void dbgdrv_cleanup(void);
51 IMG_INT dbgdrv_ioctl(struct drm_device *dev, IMG_VOID *arg, struct drm_file *pFile);
52 #endif
53
54 #if !defined(SUPPORT_DRI_DRM_EXT)
55 #define PVR_DRM_SRVKM_IOCTL     _IO(0, PVR_DRM_SRVKM_CMD)
56 #define PVR_DRM_IS_MASTER_IOCTL _IO(0, PVR_DRM_IS_MASTER_CMD)
57 #define PVR_DRM_UNPRIV_IOCTL    _IO(0, PVR_DRM_UNPRIV_CMD)
58 #define PVR_DRM_DBGDRV_IOCTL    _IO(0, PVR_DRM_DBGDRV_CMD)
59 #endif
60
61 #endif
62
63 #endif
64
65