2 *-----------------------------------------------------------------------------
3 * Filename: emgd_shared.h
5 *-----------------------------------------------------------------------------
6 * Copyright (c) 2002-2010, Intel Corporation.
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 *-----------------------------------------------------------------------------
28 * This include file contains information that is shared between the various
29 * EMGD driver components.
30 *-----------------------------------------------------------------------------
33 #ifndef _EMGD_SHARED_H
34 #define _EMGD_SHARED_H
37 * Module name is the name of the drm kernel module. This is used by
38 * user space components to open a connection to the module. A typical
39 * call would look like -- drmOpen(EMGD_MODULE_NAME, NULL);
41 #define EMGD_MODULE_NAME "emgd"
43 #define EMGD_DRIVER_NAME "emgd"
46 * EMGD-specific numbering of the PVR DRM ioctls. The EMGD DRM module is in
47 * charge, and includes the PVR DRM code. As such, the PVR ioctls are included
48 * in with the EMGD ioctls ("emgd_drm.h"), and must be kept in sync. Both sets
49 * of these ioctls are mapped to the device specific range between 0x40 and
52 * Client driver must use these values!
54 #define DRM_PVR_RESERVED1 0x12
55 #define DRM_PVR_RESERVED2 0x13
56 #define DRM_PVR_RESERVED3 0x14
57 #define DRM_PVR_RESERVED4 0x15
58 #define DRM_PVR_RESERVED5 0x16
59 #define DRM_PVR_RESERVED6 0x1E
63 * The following typedefs support the ability of non-HAL software to have a
64 * function called when a VBlank interrupt occurs.
68 * A pointer to a non-HAL-provided function that processes a VBlank interrupt.
70 typedef int (*emgd_process_vblank_interrupt_t)(void *priv);
73 * This structure allows the HAL to track a non-HAL callback (and its
74 * parameter) to call when a VBlank interrupt occurs for a given port. An
75 * opaque pointer to this structure serves as a unique identifier for the
76 * callback/port combination.
78 typedef struct _emgd_vblank_callback {
79 /** Non-HAL callback function to process a VBlank interrupt. */
80 emgd_process_vblank_interrupt_t callback;
81 /** An opaque pointer to a non-HAL data structure (passed to callback). */
83 /** Which HAL port number is associated with this interrupt callback. */
84 unsigned long port_number;
85 } emgd_vblank_callback_t;
88 * An opaque pointer to a emgd_vblank_callback_t. This pointer serves as a
89 * unique identifier for the callback/port combination.
91 typedef void *emgd_vblank_callback_h;
94 * A special value of a emgd_vblank_callback_h, meaning ALL devices/displays.
96 #define ALL_PORT_CALLBACKS ((void *) 1001)