gpu: pvr: pdumpfs: add stream_frames debugfs entry
[sgx.git] / pvr / omaplfb.h
1 /**********************************************************************
2  *
3  * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful but, except
10  * as otherwise stated in writing, without any warranty; without even the
11  * implied warranty of merchantability or fitness for a particular purpose.
12  * See the GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * The full GNU General Public License is included in this distribution in
19  * the file called "COPYING".
20  *
21  * Contact Information:
22  * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23  * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
24  *
25  ******************************************************************************/
26
27 #ifndef __OMAPLFB_H__
28 #define __OMAPLFB_H__
29
30 #define OMAPLCD_IRQ                     25
31
32 #define OMAPLCD_SYSCONFIG               0x0410
33 #define OMAPLCD_CONFIG                  0x0444
34 #define OMAPLCD_DEFAULT_COLOR0          0x044C
35 #define OMAPLCD_TIMING_H                0x0464
36 #define OMAPLCD_TIMING_V                0x0468
37 #define OMAPLCD_POL_FREQ                0x046C
38 #define OMAPLCD_DIVISOR                 0x0470
39 #define OMAPLCD_SIZE_DIG                0x0478
40 #define OMAPLCD_SIZE_LCD                0x047C
41 #define OMAPLCD_GFX_POSITION            0x0488
42 #define OMAPLCD_GFX_SIZE                0x048C
43 #define OMAPLCD_GFX_ATTRIBUTES          0x04a0
44 #define OMAPLCD_GFX_FIFO_THRESHOLD      0x04a4
45 #define OMAPLCD_GFX_WINDOW_SKIP         0x04b4
46
47 #define OMAPLCD_IRQSTATUS               0x0418
48 #define OMAPLCD_IRQENABLE               0x041c
49 #define OMAPLCD_CONTROL                 0x0440
50 #define OMAPLCD_GFX_BA0                 0x0480
51 #define OMAPLCD_GFX_BA1                 0x0484
52 #define OMAPLCD_GFX_ROW_INC             0x04ac
53 #define OMAPLCD_GFX_PIX_INC             0x04b0
54 #define OMAPLCD_VID1_BA0                0x04bc
55 #define OMAPLCD_VID1_BA1                0x04c0
56 #define OMAPLCD_VID1_ROW_INC            0x04d8
57 #define OMAPLCD_VID1_PIX_INC            0x04dc
58
59 #define OMAP_CONTROL_GODIGITAL          (1 << 6)
60 #define OMAP_CONTROL_GOLCD              (1 << 5)
61 #define OMAP_CONTROL_DIGITALENABLE      (1 << 1)
62 #define OMAP_CONTROL_LCDENABLE          (1 << 0)
63
64 #define OMAPLCD_INTMASK_VSYNC           (1 << 1)
65 #define OMAPLCD_INTMASK_OFF             0
66
67 struct OMAPLFB_BUFFER {
68         struct IMG_SYS_PHYADDR sSysAddr;
69         void __iomem *sCPUVAddr;
70         u32 ui32BufferSize;
71         struct PVRSRV_SYNC_DATA *psSyncData;
72         struct OMAPLFB_BUFFER *psNext;
73 };
74
75 struct OMAPLFB_SWAPCHAIN {
76
77         u32 ui32BufferCount;
78         struct OMAPLFB_BUFFER *psBuffer;
79         struct PVRSRV_DC_DISP2SRV_KMJTABLE *psPVRJTable;
80         IMG_BOOL bBlanked;
81 };
82
83 struct OMAPLFB_FBINFO {
84         struct IMG_SYS_PHYADDR sSysAddr;
85         void __iomem *sCPUVAddr;
86         u32 ui32FBSize;
87         u32 ui32BufferSize;
88         u32 ui32RoundedBufferSize;
89         u32 ui32Width;
90         u32 ui32Height;
91         u32 ui32ByteStride;
92
93         enum PVRSRV_PIXEL_FORMAT ePixelFormat;
94 };
95
96 struct OMAPLFB_DEVINFO {
97         u32 ui32DeviceID;
98         struct DISPLAY_INFO sDisplayInfo;
99         struct OMAPLFB_BUFFER sSystemBuffer;
100         struct DISPLAY_FORMAT sDisplayFormat;
101         struct DISPLAY_DIMS sDisplayDim;
102         struct PVRSRV_DC_DISP2SRV_KMJTABLE sPVRJTable;
103         struct PVRSRV_DC_SRV2DISP_KMJTABLE sDCJTable;
104         struct OMAPLFB_FBINFO sFBInfo;
105         u32 ui32RefCount;
106         struct OMAPLFB_SWAPCHAIN *psSwapChain;
107         struct IMG_DEV_VIRTADDR sDisplayDevVAddr;
108         struct fb_info *psLINFBInfo;
109         struct notifier_block sLINNotifBlock;
110 };
111
112 #define OMAPLFB_PAGE_SIZE 4096
113 #define OMAPLFB_PAGE_MASK (OMAPLFB_PAGE_SIZE - 1)
114 #define OMAPLFB_PAGE_TRUNC (~OMAPLFB_PAGE_MASK)
115
116 #define OMAPLFB_PAGE_ROUNDUP(x) (((x) + OMAPLFB_PAGE_MASK) & OMAPLFB_PAGE_TRUNC)
117
118 #ifdef  CONFIG_PVR_DEBUG_EXTRA
119 #define DEBUG_PRINTK(x) printk x
120 #else
121 #define DEBUG_PRINTK(x)
122 #endif
123
124 #define DISPLAY_DEVICE_NAME "PowerVR OMAP Linux Display Driver"
125 #define DRVNAME "omaplfb"
126 #define DEVNAME DRVNAME
127 #define DRIVER_PREFIX DRVNAME
128
129 enum PVRSRV_ERROR OMAPLFBInit(void);
130 enum PVRSRV_ERROR OMAPLFBDeinit(void);
131
132 void OMAPLFBDriverSuspend(void);
133 void OMAPLFBDriverResume(void);
134
135 void *OMAPLFBAllocKernelMem(u32 ui32Size);
136 void OMAPLFBFreeKernelMem(void *pvMem);
137 enum PVRSRV_ERROR OMAPLFBGetLibFuncAddr(char *szFunctionName,
138         IMG_BOOL (**ppfnFuncTable)(struct PVRSRV_DC_DISP2SRV_KMJTABLE *));
139
140 #endif