~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to drivers/gpu/pvr/omaplfb/omaplfb.h

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
/* max number of overlays to which a framebuffer data can be direct */
31
 
#define OMAPFB_MAX_OVL_PER_FB 3
32
 
 
33
 
extern IMG_BOOL PVRGetDisplayClassJTable(PVRSRV_DC_DISP2SRV_KMJTABLE *psJTable);
34
 
 
35
 
typedef void * OMAP_HANDLE;
36
 
 
37
 
typedef enum tag_omap_bool
38
 
{
39
 
        OMAP_FALSE = 0,
40
 
        OMAP_TRUE  = 1,
41
 
} OMAP_BOOL, *OMAP_PBOOL;
42
 
 
43
 
typedef struct OMAPLFB_BUFFER_TAG
44
 
{
45
 
        unsigned long                ulBufferSize;
46
 
        IMG_SYS_PHYADDR              sSysAddr;
47
 
        IMG_CPU_VIRTADDR             sCPUVAddr;
48
 
        PVRSRV_SYNC_DATA*            psSyncData;
49
 
        struct OMAPLFB_BUFFER_TAG*   psNext;
50
 
 
51
 
} OMAPLFB_BUFFER;
52
 
 
53
 
typedef struct OMAPLFB_FLIP_ITEM_TAG
54
 
{
55
 
        OMAP_HANDLE      hCmdComplete;
56
 
        unsigned long    ulSwapInterval;
57
 
        OMAP_BOOL        bValid;
58
 
        OMAP_BOOL        bFlipped;
59
 
        OMAP_BOOL        bCmdCompleted;
60
 
        IMG_SYS_PHYADDR* sSysAddr;
61
 
 
62
 
} OMAPLFB_FLIP_ITEM;
63
 
 
64
 
typedef struct PVRPDP_SWAPCHAIN_TAG
65
 
{
66
 
        unsigned int                    uiSwapChainID;
67
 
        unsigned long                   ulBufferCount;
68
 
        OMAPLFB_BUFFER*                 psBuffer;
69
 
        OMAPLFB_FLIP_ITEM*              psFlipItems;
70
 
        unsigned long                   ulInsertIndex;
71
 
        unsigned long                   ulRemoveIndex;
72
 
        PVRSRV_DC_DISP2SRV_KMJTABLE*    psPVRJTable;
73
 
        OMAP_BOOL                       bFlushCommands;
74
 
        unsigned long                   ulSetFlushStateRefCount;
75
 
        OMAP_BOOL                       bBlanked;
76
 
        spinlock_t*                     psSwapChainLock;
77
 
        void*                           pvDevInfo;
78
 
 
79
 
} OMAPLFB_SWAPCHAIN;
80
 
 
81
 
typedef struct OMAPLFB_FBINFO_TAG
82
 
{
83
 
        unsigned long       ulFBSize;
84
 
        unsigned long       ulBufferSize;
85
 
        unsigned long       ulRoundedBufferSize;
86
 
        unsigned long       ulWidth;
87
 
        unsigned long       ulHeight;
88
 
        unsigned long       ulByteStride;
89
 
        IMG_SYS_PHYADDR     sSysAddr;
90
 
        IMG_CPU_VIRTADDR    sCPUVAddr;
91
 
        PVRSRV_PIXEL_FORMAT ePixelFormat;
92
 
 
93
 
}OMAPLFB_FBINFO;
94
 
 
95
 
typedef struct OMAPLFB_DEVINFO_TAG
96
 
{
97
 
        unsigned int                    uiSwapChainID;
98
 
        IMG_UINT32                      uDeviceID;
99
 
        OMAPLFB_BUFFER                  sSystemBuffer;
100
 
        PVRSRV_DC_DISP2SRV_KMJTABLE     sPVRJTable;
101
 
        PVRSRV_DC_SRV2DISP_KMJTABLE     sDCJTable;
102
 
        OMAPLFB_FBINFO                  sFBInfo;
103
 
        OMAPLFB_SWAPCHAIN*              psSwapChain;
104
 
        OMAP_BOOL                       bFlushCommands;
105
 
        struct fb_info*                 psLINFBInfo;
106
 
        struct notifier_block           sLINNotifBlock;
107
 
        OMAP_BOOL                       bDeviceSuspended;
108
 
        struct mutex                    sSwapChainLockMutex;
109
 
        IMG_DEV_VIRTADDR                sDisplayDevVAddr;
110
 
        DISPLAY_INFO                    sDisplayInfo;
111
 
        DISPLAY_FORMAT                  sDisplayFormat;
112
 
        DISPLAY_DIMS                    sDisplayDim;
113
 
        struct workqueue_struct*        sync_display_wq;
114
 
        struct work_struct              sync_display_work;
115
 
#if defined(SUPPORT_DRI_DRM)
116
 
        OMAP_BOOL                       bLeaveVT;
117
 
#endif
118
 
}  OMAPLFB_DEVINFO;
119
 
 
120
 
typedef enum _OMAP_ERROR_
121
 
{
122
 
        OMAP_OK                             =  0,
123
 
        OMAP_ERROR_GENERIC                  =  1,
124
 
        OMAP_ERROR_OUT_OF_MEMORY            =  2,
125
 
        OMAP_ERROR_TOO_FEW_BUFFERS          =  3,
126
 
        OMAP_ERROR_INVALID_PARAMS           =  4,
127
 
        OMAP_ERROR_INIT_FAILURE             =  5,
128
 
        OMAP_ERROR_CANT_REGISTER_CALLBACK   =  6,
129
 
        OMAP_ERROR_INVALID_DEVICE           =  7,
130
 
        OMAP_ERROR_DEVICE_REGISTER_FAILED   =  8
131
 
 
132
 
} OMAP_ERROR;
133
 
 
134
 
#define OMAPLFB_PAGE_SIZE 4096
135
 
#define OMAPLFB_PAGE_MASK (OMAPLFB_PAGE_SIZE - 1)
136
 
#define OMAPLFB_PAGE_TRUNC (~OMAPLFB_PAGE_MASK)
137
 
 
138
 
#define OMAPLFB_PAGE_ROUNDUP(x) (((x)+OMAPLFB_PAGE_MASK) & OMAPLFB_PAGE_TRUNC)
139
 
 
140
 
#define DISPLAY_DEVICE_NAME "PowerVR OMAP Linux Display Driver"
141
 
#define DRVNAME "omaplfb"
142
 
#define DEVNAME DRVNAME
143
 
#define DRIVER_PREFIX DRVNAME
144
 
 
145
 
#define FRAMEBUFFER_COUNT               num_registered_fb
146
 
 
147
 
#ifdef  DEBUG
148
 
#define DEBUG_PRINTK(format, ...) printk("DEBUG " DRIVER_PREFIX \
149
 
        " (%s %i): " format "\n", __func__, __LINE__, ## __VA_ARGS__)
150
 
#else
151
 
#define DEBUG_PRINTK(format,...)
152
 
#endif
153
 
 
154
 
#define WARNING_PRINTK(format, ...) printk("WARNING " DRIVER_PREFIX \
155
 
        " (%s %i): " format "\n", __func__, __LINE__, ## __VA_ARGS__)
156
 
#define ERROR_PRINTK(format, ...) printk("ERROR " DRIVER_PREFIX \
157
 
        " (%s %i): " format "\n", __func__, __LINE__, ## __VA_ARGS__)
158
 
 
159
 
OMAP_ERROR OMAPLFBInit(void);
160
 
OMAP_ERROR OMAPLFBDeinit(void);
161
 
OMAP_ERROR UnBlankDisplay(OMAPLFB_DEVINFO *psDevInfo);
162
 
void *OMAPLFBAllocKernelMem(unsigned long ulSize);
163
 
void OMAPLFBFreeKernelMem(void *pvMem);
164
 
void OMAPLFBPresentSync(OMAPLFB_DEVINFO *psDevInfo,
165
 
        OMAPLFB_FLIP_ITEM *psFlipItem);
166
 
void OMAPLFBPresentSyncAddr(OMAPLFB_DEVINFO *psDevInfo, unsigned long aPhyAddr);
167
 
OMAP_ERROR OMAPLFBGetLibFuncAddr(char *szFunctionName,
168
 
        PFN_DC_GET_PVRJTABLE *ppfnFuncTable);
169
 
void OMAPLFBFlip(OMAPLFB_SWAPCHAIN *psSwapChain, unsigned long aPhyAddr);
170
 
#ifdef LDM_PLATFORM
171
 
void OMAPLFBDriverSuspend(void);
172
 
void OMAPLFBDriverResume(void);
173
 
#endif
174
 
 
175
 
#endif
176