aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/emgd/emgd/drm/drm_emgd_private.h
blob: 9b5ca7b075d2465b0b4cbd954617b2bbc8f4f252 (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
/* -*- pse-c -*-
 *-----------------------------------------------------------------------------
 * Filename: drm_emgd_private.h
 * $Revision: 1.15 $
 *-----------------------------------------------------------------------------
 * 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:
 *  This file contains the EMGD-specific drm_device.dev_private structure,
 *  which is used to share data with the EMGD-specific, IMG 3rd-Party Display
 *  Driver (3DD, implimented in the
 *  "egd_drm/pvr/services4/3rdparty/emgd_displayclass" directory).
 *-----------------------------------------------------------------------------
 */
#ifndef _DRM_EMGD_PRIVATE_H_
#define _DRM_EMGD_PRIVATE_H_

#include <drm/drmP.h>
#include <drm/drm.h>
#include "context.h"



/**
 * This enum is used to record the currently-saved register state (e.g. for VT
 * switching)--either the Linux console's state is saved (i.e. the X server is
 * active), or the X server's state is saved (i.e. the Linux console is
 * active).
 */
typedef enum _drm_emgd_saved_state {
	CONSOLE_STATE_SAVED = 0,
	X_SERVER_STATE_SAVED = 1,
} drm_emgd_saved_state;


/**
 * This structure allows the EMGD-proper code to communicate information and
 * function pointers to the IMG 3rd-Party Display Driver (mrstlfb).
 */
typedef struct _drm_emgd_private {
	/** Non-zero if the HAL is running */
	int hal_running;

	/**
	 * Which register state is currently saved for VT switches (X or the
	 * console; note: the opposite is what's actively installed in the
	 * hardware)
	 */
	drm_emgd_saved_state saved_registers;

	/**
	 * Saved state of the console, when suspending (or hibernating) the system.
	 * emgd_driver_suspend() allocates this, and emgd_driver_resume() frees
	 * this.
	 */
	void *suspended_state;

	/**
	 * A flag which emgd_driver_pre_init() sets and emgd_alter_displays()
	 * clears.  If set (i.e. to 1), this indicates that emgd_alter_displays()
	 * must power on the port drivers' hardware.
	 */
	int must_power_on_ports;

	/** Non-zero if the X server is running (i.e. PVR can't do mode changes) */
	int xserver_running;

	/** Non-zero if emgd_start_pvrsrv() started the PVR services, else zero. */
	int pvrsrv_started;

	/**
	 * Function to re-initialize the 3DD's data structures, after calls to
	 * alter_displays()
	 */
	int (*reinit_3dd)(struct drm_device *dev);


	/** The context is set during the DRM module load function. */
	igd_context_t *context;

	/* The selected DC is copied to here each time alter_displays() is called
	 * via an ioctl.
	 */
	unsigned long dc;

	/**
	 * The port number of the primary display handle is copied to here each
	 * time alter_displays() is called via an ioctl.
	 */
	unsigned short primary_port_number;

	/**
	 * The primary display handle is copied to here each time alter_displays()
	 * is called via an ioctl.
	 */
	igd_display_h primary;

	/**
	 * The port number of the secondary display handle is copied to here each
	 * time alter_displays() is called via an ioctl.
	 */
	unsigned short secondary_port_number;

	/**
	 * The secondary display handle is copied to here each time alter_displays()
	 * is called via an ioctl.
	 */
	igd_display_h secondary;

	/**
	 * Store the device information so it can be passed back to userspace
	 * callers via an ioctl.
	 */
	igd_init_info_t *init_info;

    
    /** TODO:  May use this in future.
     * MSVDX
     */   
    void *msvdx_private;


} drm_emgd_private;

#endif