a5faf0507cdb203b0dcec1cb0efafdb00596df14
[profile/ivi/libdrm.git] / linux-core / nv50_output.h
1 /*
2  * Copyright (C) 2008 Maarten Maathuis.
3  * All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sublicense, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject to
11  * the following conditions:
12  *
13  * The above copyright notice and this permission notice (including the
14  * next paragraph) shall be included in all copies or substantial
15  * portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20  * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
21  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24  *
25  */
26
27 #ifndef __NV50_OUTPUT_H__
28 #define __NV50_OUTPUT_H__
29
30 #include "nv50_crtc.h"
31
32 #define OUTPUT_UNKNOWN 0
33 #define OUTPUT_DAC 1
34 #define OUTPUT_TMDS 2
35 #define OUTPUT_LVDS 3
36 #define OUTPUT_TV 4
37
38 struct nv50_output {
39         struct list_head item;
40
41         struct drm_device *dev;
42         int bus;
43         int dcb_entry;
44         int type;
45
46         struct nv50_crtc *crtc;
47         struct nouveau_hw_mode *native_mode;
48
49         int (*validate_mode) (struct nv50_output *output, struct nouveau_hw_mode *mode);
50         int (*execute_mode) (struct nv50_output *output, bool disconnect);
51         int (*set_clock_mode) (struct nv50_output *output);
52         /* this is not a normal modeset call, it is a direct register write, so it's executed immediately */
53         int (*set_power_mode) (struct nv50_output *output, int mode);
54         bool (*detect) (struct nv50_output *output);
55         int (*destroy) (struct nv50_output *output);
56 };
57
58 int nv50_output_or_offset(struct nv50_output *output);
59 int nv50_sor_create(struct drm_device *dev, int dcb_entry);
60 int nv50_dac_create(struct drm_device *dev, int dcb_entry);
61
62 #endif /* __NV50_OUTPUT_H__ */