1 /**********************************************************************
3 * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
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.
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.
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.
18 * The full GNU General Public License is included in this distribution in
19 * the file called "COPYING".
21 * Contact Information:
22 * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23 * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
25 ******************************************************************************/
30 #define OMAPLCD_IRQ 25
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
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
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)
64 #define OMAPLCD_INTMASK_VSYNC (1 << 1)
65 #define OMAPLCD_INTMASK_OFF 0
67 struct OMAPLFB_BUFFER {
68 struct IMG_SYS_PHYADDR sSysAddr;
69 void __iomem *sCPUVAddr;
71 struct PVRSRV_SYNC_DATA *psSyncData;
72 struct OMAPLFB_BUFFER *psNext;
75 struct OMAPLFB_SWAPCHAIN {
78 struct OMAPLFB_BUFFER *psBuffer;
79 struct PVRSRV_DC_DISP2SRV_KMJTABLE *psPVRJTable;
83 struct OMAPLFB_FBINFO {
84 struct IMG_SYS_PHYADDR sSysAddr;
85 void __iomem *sCPUVAddr;
88 u32 ui32RoundedBufferSize;
93 enum PVRSRV_PIXEL_FORMAT ePixelFormat;
96 struct OMAPLFB_DEVINFO {
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;
106 struct OMAPLFB_SWAPCHAIN *psSwapChain;
107 struct IMG_DEV_VIRTADDR sDisplayDevVAddr;
108 struct fb_info *psLINFBInfo;
109 struct notifier_block sLINNotifBlock;
112 #define OMAPLFB_PAGE_SIZE 4096
113 #define OMAPLFB_PAGE_MASK (OMAPLFB_PAGE_SIZE - 1)
114 #define OMAPLFB_PAGE_TRUNC (~OMAPLFB_PAGE_MASK)
116 #define OMAPLFB_PAGE_ROUNDUP(x) (((x) + OMAPLFB_PAGE_MASK) & OMAPLFB_PAGE_TRUNC)
118 #ifdef CONFIG_PVR_DEBUG_EXTRA
119 #define DEBUG_PRINTK(x) printk x
121 #define DEBUG_PRINTK(x)
124 #define DISPLAY_DEVICE_NAME "PowerVR OMAP Linux Display Driver"
125 #define DRVNAME "omaplfb"
126 #define DEVNAME DRVNAME
127 #define DRIVER_PREFIX DRVNAME
129 enum PVRSRV_ERROR OMAPLFBInit(void);
130 enum PVRSRV_ERROR OMAPLFBDeinit(void);
132 void OMAPLFBDriverSuspend(void);
133 void OMAPLFBDriverResume(void);
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 *));