aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/emgd/include/igd_pi.h
blob: f8783f7543bfbc5a2b0897a0adb538b2fbd4e3cf (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
/* -*- pse-c -*-
 *-----------------------------------------------------------------------------
 * Filename: igd_pi.h
 * $Revision: 1.5 $
 *-----------------------------------------------------------------------------
 * Copyright © 2002-2010, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *-----------------------------------------------------------------------------
 * Description:
 *  
 *-----------------------------------------------------------------------------
 */

#ifndef _IGD_PI_H
#define _IGD_PI_H

/* Typedefinitions */
typedef int        (*pd_register_p)  (void *handle, void *driver);
typedef void      *(*pd_malloc_p)(unsigned long size);
typedef void      *(*pd_memset_p)(void *address, int c, unsigned long size);
typedef void      *(*pd_memcpy_p)(void *dst, void *src, unsigned long size);
typedef void       (*pd_free_p)  (void *address);
typedef void       (*pd_usleep_p)(unsigned long usec);
typedef void       (*pd_ui_usleep_p)(unsigned long usec);
typedef char      *(*pd_strcpy_p)(char *dest, char const *src);
typedef int       *(*pd_printf_p)(const char *format, ...);
typedef int        (*pd_check_attr_p)(void *curr, void *in);
typedef void      *(*pd_get_attr_p)(void *attr_list,
		unsigned long num_attrs, unsigned long attr_id, unsigned long flag);
typedef void *(*pd_get_igd_debug_p)( void );
typedef unsigned long *(*pd_get_dropped_debug_messages_p)( void );
typedef void *(*pd_get_debug_log_mutex_p)( void );
typedef int        (*pd_filter_timings_p)(void *context, void *inlist,
		void **olist, void *dvo_info, void *display_info);



/* Data structures to pass callback functions from child to parent */
typedef struct _igd_main_cb {
	unsigned long       version;
	pd_register_p       pd_register;
	pd_malloc_p         pd_malloc;
	pd_memset_p         pd_memset;
	pd_memcpy_p         pd_memcpy;
	pd_free_p           pd_free;
	pd_usleep_p         pd_usleep;
	pd_ui_usleep_p      pd_ui_usleep;
	pd_strcpy_p         pd_strcpy;
	pd_check_attr_p     pd_check_attr;
	pd_get_attr_p       pd_get_attr;
	pd_filter_timings_p pd_filter_timings;
	pd_get_igd_debug_p  pd_get_igd_debug;
	pd_get_debug_log_mutex_p        pd_get_debug_log_mutex;
	pd_get_dropped_debug_messages_p pd_get_dropped_debug_messages;
} igd_main_cb_t;

typedef struct _igd_dpd_cb {
	unsigned long   version;
} igd_dpd_cb_t;


/* Port driver init and exit function type definitions */
typedef int (*pd_init_p)  (void *);
typedef int (*pd_exit_p)  (void);

/* Function to register with main driver. */
int igd_pd_register(void *handle, void *pd_driver);

/* Function to allocate memory */
void *igd_pd_malloc(unsigned long size);

/* Function to set the memory */
void *igd_pd_memset(void *address, int c, unsigned long size);

/* Function to copy block of memory */
void *igd_pd_memcpy(void *dst, void *src, unsigned long size);

/* Functions to free memory */
void igd_pd_free(void *ptr);

/* Function to sleep in micro seconds. This can be called with millisecond
 * ranges. */
void igd_pd_usleep(unsigned long usec);

/* Function to sleep in micro seconds uniterrupted. This can be called with millisecond
 * ranges. */
void igd_pd_ui_usleep(unsigned long usec);


/* Function to do a string copy */
char *igd_pd_strcpy(char *dest, char const *src);

/* Function to check value of an attribute */
int igd_pd_check_attr(void *curr, void *in);

/* This function searches for the requested attr_id in the attribute list
 * and returns the pointer.
 *
 * In case of LIST attribute, it will return the proper list entry. */
void *igd_pd_get_attr(void *attr_list, unsigned long num_attrs,
		unsigned long attr_id, unsigned long flag);

int igd_pd_filter_timings(
	void *context,
	void *ilist,
	void **olist,
	void *dvo,
	void *display);

void *igd_pd_get_igd_debug( void );

#endif /* _IGD_PI_H */

/*----------------------------------------------------------------------------
 * File Revision History
 * $Id: igd_pi.h,v 1.5 2010/07/23 16:54:51 bpaauwe Exp $
 * $Source: /nfs/fm/proj/eia/cvsroot/koheo/linux/egd_drm/include/igd_pi.h,v $
 *----------------------------------------------------------------------------
 */