blob: 72eeb7a9d4be501e638c507b77e5a78bf0663b99 [file] [log] [blame]
Alan Cox5c49fd32011-11-03 18:22:04 +00001/**************************************************************************
2 * Copyright (c) 2007-2011, Intel Corporation.
3 * All Rights Reserved.
4 * Copyright (c) 2008, Tungsten Graphics Inc. Cedar Park, TX., USA.
5 * All Rights Reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License,
9 * version 2, as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 **************************************************************************/
21
22#ifndef _PSB_DRM_H_
23#define _PSB_DRM_H_
24
25#define PSB_NUM_PIPE 3
26
Alan Cox5c49fd32011-11-03 18:22:04 +000027
28/*
Alan Cox61bedf72011-11-16 22:38:42 +000029 * Manage the LUT for an output
Alan Cox5c49fd32011-11-03 18:22:04 +000030 */
Alan Cox5c49fd32011-11-03 18:22:04 +000031struct drm_psb_dpst_lut_arg {
32 uint8_t lut[256];
33 int output_id;
34};
35
Alan Cox61bedf72011-11-16 22:38:42 +000036/*
37 * Validate modes
38 */
Alan Cox5c49fd32011-11-03 18:22:04 +000039struct drm_psb_mode_operation_arg {
40 u32 obj_id;
41 u16 operation;
42 struct drm_mode_modeinfo mode;
Alan Cox61bedf72011-11-16 22:38:42 +000043 u64 data;
Alan Cox5c49fd32011-11-03 18:22:04 +000044};
45
Alan Cox61bedf72011-11-16 22:38:42 +000046/*
47 * Query the stolen memory for smarter management of
48 * memory by the server
49 */
Alan Cox5c49fd32011-11-03 18:22:04 +000050struct drm_psb_stolen_memory_arg {
51 u32 base;
52 u32 size;
53};
54
Alan Cox5c49fd32011-11-03 18:22:04 +000055struct drm_psb_get_pipe_from_crtc_id_arg {
56 /** ID of CRTC being requested **/
57 u32 crtc_id;
Alan Cox5c49fd32011-11-03 18:22:04 +000058 /** pipe of requested CRTC **/
59 u32 pipe;
60};
61
Alan Cox5c49fd32011-11-03 18:22:04 +000062struct drm_psb_gem_create {
63 __u64 size;
64 __u32 handle;
65 __u32 flags;
66#define PSB_GEM_CREATE_STOLEN 1 /* Stolen memory can be used */
67};
68
69struct drm_psb_gem_mmap {
70 __u32 handle;
71 __u32 pad;
72 /**
73 * Fake offset to use for subsequent mmap call
74 *
75 * This is a fixed-size type for 32/64 compatibility.
76 */
77 __u64 offset;
78};
79
Alan Cox61bedf72011-11-16 22:38:42 +000080/* Controlling the kernel modesetting buffers */
81
82#define DRM_PSB_GEM_CREATE 0x00 /* Create a GEM object */
83#define DRM_PSB_GEM_MMAP 0x01 /* Map GEM memory */
84#define DRM_PSB_STOLEN_MEMORY 0x02 /* Report stolen memory */
85#define DRM_PSB_2D_OP 0x03 /* Will be merged later */
86#define DRM_PSB_GAMMA 0x04 /* Set gamma table */
87#define DRM_PSB_ADB 0x05 /* Get backlight */
88#define DRM_PSB_DPST_BL 0x06 /* Set backlight */
89#define DRM_PSB_GET_PIPE_FROM_CRTC_ID 0x1 /* CRTC to physical pipe# */
90#define DRM_PSB_MODE_OPERATION 0x07 /* Mode validation/DC set */
91#define PSB_MODE_OPERATION_MODE_VALID 0x01
92
93
Alan Cox5c49fd32011-11-03 18:22:04 +000094#endif