summaryrefslogtreecommitdiff
path: root/drivers/media/video/tiler/dmm_drv.h
blob: 6e9a076b1d0d994f4e087c4451d5d8f9bf61f42e (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/*
 * dmm_drv.h
 *
 * DMM driver support functions for TI OMAP processors.
 *
 * Copyright (C) 2009-2010 Texas Instruments, Inc.
 *
 * This package is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#ifndef _DMM_DRV_H
#define _DMM_DRV_H

#include "dmm_def.h"

/* ========================================================================== */
/**
 *  dmm_pat_area_refill()
 *
 * @brief  Initiate a PAT area refill (or terminate an ongoing - consult
 * documentation).
 *
 * @param patDesc - PATDescrT* - [in] Pointer to a PAT area descriptor that's
 * needed to extract settings from for the refill procedure initation.
 *
 * @param dmmPatAreaSel - signed long - [in] Selects which PAT area will be
 *  configured for a area refill procedure.
 *
 * @param refillType - dmmPATRefillMethodT - [in] Selects the refill method -
 * manual or automatic.
 *
 * @param forcedRefill - int - [in] Selects if forced refill should be used
 * effectively terminating any ongoing area refills related to the selected
 * area.
 *
 * @return errorCodeT
 *
 * @pre If forced mode is not used, no refills should be ongoing for the
 * selected
 * area - error status returned if this occurs.
 *
 * @post If non valid data is provided for patDesc and the refill engines fail
 * to perform the request, an error status is returned.
 *
 * @see errorCodeT,  PATDescrT, dmmPATRefillMethodT, int for further detail.
 */
/* ========================================================================== */
enum errorCodeT dmm_pat_area_refill(struct PATDescrT *patDesc,
				    signed long dmmPatAreaSel,
				    enum dmmPATRefillMethodT refillType,
				    int forcedRefill);

/* ========================================================================== */
/**
 *  dmm_pat_refill_area_status_get()
 *
 * @brief  Gets the status for the selected PAT area.
 *
 * @param dmmPatAreaSel - signed long - [in] Selects which PAT area status will
 *  be queried.
 *
 * @param areaStatus - dmmPATStatusT* - [out] Structure containing the PAT area
 * status that will be filled by dmmPatRefillAreaStatusGet().
 *
 * @return errorCodeT
 *
 * @pre There is no pre conditions.
 *
 * @post If the query fails the provided areaStatus structure is not updated at
 * all!
 *
 * @see errorCodeT, dmmPATStatusT for further detail.
 */
/* ========================================================================== */
enum errorCodeT dmm_pat_refill_area_status_get(signed long dmmPatAreaStatSel,
		struct dmmPATStatusT *areaStatus);

/* ========================================================================== */
/**
 *  dmm_instance_init()
 *
 * @brief  Initializes the Tiler cotnext.
 *
 * @param dmmInstanceCtxPtr - void * - [in] Tiler context instance.
 *
 * @param contXSize - signed long - [in] Tiler container width.
 *
 * @param contYSize - signed long - [in] Tiler container height.
 *
 * @param hMSP - MSP_HANDLE - [in] MSP handle related to this dmm_drv cotnext.
 *
 * @param usrAppData - void * - [in] Pointer to user specific data structure.
 *
 * @param usrCallback - MSP_usrCallback - [in] Pointer to callback supplied by
 * the user for notificiation events (interupts).
 *
 * @return int True if operation succeded.
 *
 * @pre There is no pre conditions.
 *
 * @post There is no post conditions.
 *
 * @see dmmTILERContCtxT for further detail.
 */
/* ========================================================================== */
int dmm_instance_init(void *dmmInstanceCtxPtr,
		      signed long contXSize,
		      signed long contYSize,
		      void *hMSP,
		      void *usrAppData);

/* ========================================================================== */
/**
 *  dmm_instance_deinit()
 *
 * @brief  Deinitializes the Tiler cotnext.
 *
 * @param dmmInstanceCtxPtr - void * - [in] Tiler context instance.
 *
 * @return int True if operation succeded.
 *
 * @pre There is no pre conditions.
 *
 * @post There is no post conditions.
 *
 * @see dmmTILERContCtxT for further detail.
 */
/* ========================================================================== */
int dmm_instance_deinit(void *dmmInstanceCtxPtr);

/* ========================================================================== */
/**
 *  dmm_copy2tiler_alias_view()
 *
 * @brief  Auxiliary function for copying data to the Tiler alias view.
 *
 * @param destPtr - void * - [in] Destination pointer in Tiler alias view.
 *
 * @param srcPtr - void * - [in] Data source pointer.
 *
 * @param width - signed long - [in] Data width.
 *
 * @param height - signed long - [in] Data height.
 *
 * @param stride - signed long - [in] Data stride.
 *
 * @param accType - dmmMemoryAccessT - [in] Tiler memory view access type.
 *
 * @return errorCodeT error if event can't be signaled.
 *
 * @pre There is no pre conditions.
 *
 * @post There is no post conditions.
 *
 * @see dmmTILERContCtxT for further detail.
 */
/* ========================================================================== */
enum errorCodeT dmm_copy2tiler_alias_view(void *destPtr,
		void *srcPtr,
		signed long width,
		signed long height,
		signed long stride,
		enum dmmMemoryAccessT accType);

/* ========================================================================== */
/**
 *  dmm_virtual_buffer_manipulations()
 *
 * @brief  Manipulates virtual buffers.
 *
 * @param dmmInstanceCtxPtr - void * - [in] Dmm context instance.
 *
 * @param sysPtr - void * - [in] Tiler system pointer to a 2D area.
 *
 * @param patOp - MSP_Dmm_Phy2VirtOpsT - [in] Refill operaion to perform.
 *
 * @param affectedArea - PATAreaT* - [in] Area that will be affected.
 *
 * @param destinationArea - PATAreaT* - [in] Destination coordinates.
 *
 * @return void * pointer to the area targeted by the operation.
 *
 * @pre There is no pre conditions.
 *
 * @post There is no post conditions.
 *
 * @see dmmTILERContPageAreaT for further detail.
 */
/* ========================================================================== */
void *dmm_virtual_buffer_manipulations(void *dmmInstanceCtxPtr,
				       void *sysPtr,
				       struct PATAreaT *affectedArea,
				       struct PATAreaT *destinationArea);

#endif /* _DMM_DRV_H */