xref: /openbmc/linux/include/drm/gma_drm.h (revision 838fa588)
1838fa588SAlan Cox /**************************************************************************
2838fa588SAlan Cox  * Copyright (c) 2007-2011, Intel Corporation.
3838fa588SAlan Cox  * All Rights Reserved.
4838fa588SAlan Cox  * Copyright (c) 2008, Tungsten Graphics Inc.  Cedar Park, TX., USA.
5838fa588SAlan Cox  * All Rights Reserved.
6838fa588SAlan Cox  *
7838fa588SAlan Cox  * This program is free software; you can redistribute it and/or modify it
8838fa588SAlan Cox  * under the terms and conditions of the GNU General Public License,
9838fa588SAlan Cox  * version 2, as published by the Free Software Foundation.
10838fa588SAlan Cox  *
11838fa588SAlan Cox  * This program is distributed in the hope it will be useful, but WITHOUT
12838fa588SAlan Cox  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13838fa588SAlan Cox  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14838fa588SAlan Cox  * more details.
15838fa588SAlan Cox  *
16838fa588SAlan Cox  * You should have received a copy of the GNU General Public License along with
17838fa588SAlan Cox  * this program; if not, write to the Free Software Foundation, Inc.,
18838fa588SAlan Cox  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19838fa588SAlan Cox  *
20838fa588SAlan Cox  **************************************************************************/
21838fa588SAlan Cox 
22838fa588SAlan Cox #ifndef _PSB_DRM_H_
23838fa588SAlan Cox #define _PSB_DRM_H_
24838fa588SAlan Cox 
25838fa588SAlan Cox /*
26838fa588SAlan Cox  *	Manage the LUT for an output
27838fa588SAlan Cox  */
28838fa588SAlan Cox struct drm_psb_dpst_lut_arg {
29838fa588SAlan Cox 	uint8_t lut[256];
30838fa588SAlan Cox 	int output_id;
31838fa588SAlan Cox };
32838fa588SAlan Cox 
33838fa588SAlan Cox /*
34838fa588SAlan Cox  *	Validate modes
35838fa588SAlan Cox  */
36838fa588SAlan Cox struct drm_psb_mode_operation_arg {
37838fa588SAlan Cox 	u32 obj_id;
38838fa588SAlan Cox 	u16 operation;
39838fa588SAlan Cox 	struct drm_mode_modeinfo mode;
40838fa588SAlan Cox 	u64 data;
41838fa588SAlan Cox };
42838fa588SAlan Cox 
43838fa588SAlan Cox /*
44838fa588SAlan Cox  *	Query the stolen memory for smarter management of
45838fa588SAlan Cox  *	memory by the server
46838fa588SAlan Cox  */
47838fa588SAlan Cox struct drm_psb_stolen_memory_arg {
48838fa588SAlan Cox 	u32 base;
49838fa588SAlan Cox 	u32 size;
50838fa588SAlan Cox };
51838fa588SAlan Cox 
52838fa588SAlan Cox struct drm_psb_get_pipe_from_crtc_id_arg {
53838fa588SAlan Cox 	/** ID of CRTC being requested **/
54838fa588SAlan Cox 	u32 crtc_id;
55838fa588SAlan Cox 	/** pipe of requested CRTC **/
56838fa588SAlan Cox 	u32 pipe;
57838fa588SAlan Cox };
58838fa588SAlan Cox 
59838fa588SAlan Cox struct drm_psb_gem_create {
60838fa588SAlan Cox 	__u64 size;
61838fa588SAlan Cox 	__u32 handle;
62838fa588SAlan Cox 	__u32 flags;
63838fa588SAlan Cox #define GMA_GEM_CREATE_STOLEN		1	/* Stolen memory can be used */
64838fa588SAlan Cox };
65838fa588SAlan Cox 
66838fa588SAlan Cox struct drm_psb_gem_mmap {
67838fa588SAlan Cox 	__u32 handle;
68838fa588SAlan Cox 	__u32 pad;
69838fa588SAlan Cox 	/**
70838fa588SAlan Cox 	 * Fake offset to use for subsequent mmap call
71838fa588SAlan Cox 	 *
72838fa588SAlan Cox 	 * This is a fixed-size type for 32/64 compatibility.
73838fa588SAlan Cox 	 */
74838fa588SAlan Cox 	__u64 offset;
75838fa588SAlan Cox };
76838fa588SAlan Cox 
77838fa588SAlan Cox /* Controlling the kernel modesetting buffers */
78838fa588SAlan Cox 
79838fa588SAlan Cox #define DRM_GMA_GEM_CREATE	0x00		/* Create a GEM object */
80838fa588SAlan Cox #define DRM_GMA_GEM_MMAP	0x01		/* Map GEM memory */
81838fa588SAlan Cox #define DRM_GMA_STOLEN_MEMORY	0x02		/* Report stolen memory */
82838fa588SAlan Cox #define DRM_GMA_2D_OP		0x03		/* Will be merged later */
83838fa588SAlan Cox #define DRM_GMA_GAMMA		0x04		/* Set gamma table */
84838fa588SAlan Cox #define DRM_GMA_ADB		0x05		/* Get backlight */
85838fa588SAlan Cox #define DRM_GMA_DPST_BL		0x06		/* Set backlight */
86838fa588SAlan Cox #define DRM_GMA_GET_PIPE_FROM_CRTC_ID 0x1	/* CRTC to physical pipe# */
87838fa588SAlan Cox #define DRM_GMA_MODE_OPERATION	0x07		/* Mode validation/DC set */
88838fa588SAlan Cox #define 	PSB_MODE_OPERATION_MODE_VALID	0x01
89838fa588SAlan Cox 
90838fa588SAlan Cox 
91838fa588SAlan Cox #endif
92