]>
Commit | Line | Data |
---|---|---|
77145f1c BS |
1 | #ifndef __NOUVEAU_DISPLAY_H__ |
2 | #define __NOUVEAU_DISPLAY_H__ | |
3 | ||
5ce3bf3c | 4 | #include <subdev/mmu.h> |
77145f1c BS |
5 | |
6 | #include "nouveau_drm.h" | |
7 | ||
8 | struct nouveau_framebuffer { | |
9 | struct drm_framebuffer base; | |
10 | struct nouveau_bo *nvbo; | |
be83cd4e | 11 | struct nvkm_vma vma; |
8a423647 | 12 | u32 r_handle; |
77145f1c BS |
13 | u32 r_format; |
14 | u32 r_pitch; | |
0ad72863 BS |
15 | struct nvif_object h_base[4]; |
16 | struct nvif_object h_core; | |
77145f1c BS |
17 | }; |
18 | ||
19 | static inline struct nouveau_framebuffer * | |
20 | nouveau_framebuffer(struct drm_framebuffer *fb) | |
21 | { | |
22 | return container_of(fb, struct nouveau_framebuffer, base); | |
23 | } | |
24 | ||
25 | int nouveau_framebuffer_init(struct drm_device *, struct nouveau_framebuffer *, | |
26 | struct drm_mode_fb_cmd2 *, struct nouveau_bo *); | |
27 | ||
28 | struct nouveau_page_flip_state { | |
29 | struct list_head head; | |
30 | struct drm_pending_vblank_event *event; | |
31 | int crtc, bpp, pitch, x, y; | |
32 | u64 offset; | |
33 | }; | |
34 | ||
35 | struct nouveau_display { | |
36 | void *priv; | |
37 | void (*dtor)(struct drm_device *); | |
38 | int (*init)(struct drm_device *); | |
39 | void (*fini)(struct drm_device *); | |
40 | ||
ab0af559 BS |
41 | int (*fb_ctor)(struct drm_framebuffer *); |
42 | void (*fb_dtor)(struct drm_framebuffer *); | |
43 | ||
0ad72863 | 44 | struct nvif_object disp; |
ab0af559 | 45 | |
77145f1c BS |
46 | struct drm_property *dithering_mode; |
47 | struct drm_property *dithering_depth; | |
48 | struct drm_property *underscan_property; | |
49 | struct drm_property *underscan_hborder_property; | |
50 | struct drm_property *underscan_vborder_property; | |
51 | /* not really hue and saturation: */ | |
52 | struct drm_property *vibrant_hue_property; | |
53 | struct drm_property *color_vibrance_property; | |
54 | }; | |
55 | ||
56 | static inline struct nouveau_display * | |
57 | nouveau_display(struct drm_device *dev) | |
58 | { | |
59 | return nouveau_drm(dev)->display; | |
60 | } | |
61 | ||
62 | int nouveau_display_create(struct drm_device *dev); | |
63 | void nouveau_display_destroy(struct drm_device *dev); | |
64 | int nouveau_display_init(struct drm_device *dev); | |
65 | void nouveau_display_fini(struct drm_device *dev); | |
6fbb702e BS |
66 | int nouveau_display_suspend(struct drm_device *dev, bool runtime); |
67 | void nouveau_display_resume(struct drm_device *dev, bool runtime); | |
51cb4b39 BS |
68 | int nouveau_display_vblank_enable(struct drm_device *, int); |
69 | void nouveau_display_vblank_disable(struct drm_device *, int); | |
d83ef853 | 70 | int nouveau_display_scanoutpos(struct drm_device *, int, unsigned int, |
3bb403bf VS |
71 | int *, int *, ktime_t *, ktime_t *, |
72 | const struct drm_display_mode *); | |
d83ef853 BS |
73 | int nouveau_display_vblstamp(struct drm_device *, int, int *, |
74 | struct timeval *, unsigned); | |
77145f1c | 75 | |
77145f1c | 76 | int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, |
ed8d1975 KP |
77 | struct drm_pending_vblank_event *event, |
78 | uint32_t page_flip_flags); | |
77145f1c BS |
79 | int nouveau_finish_page_flip(struct nouveau_channel *, |
80 | struct nouveau_page_flip_state *); | |
81 | ||
82 | int nouveau_display_dumb_create(struct drm_file *, struct drm_device *, | |
83 | struct drm_mode_create_dumb *args); | |
84 | int nouveau_display_dumb_map_offset(struct drm_file *, struct drm_device *, | |
85 | u32 handle, u64 *offset); | |
77145f1c BS |
86 | |
87 | void nouveau_hdmi_mode_set(struct drm_encoder *, struct drm_display_mode *); | |
88 | ||
5addcf0a | 89 | int nouveau_crtc_set_config(struct drm_mode_set *set); |
77145f1c BS |
90 | #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT |
91 | extern int nouveau_backlight_init(struct drm_device *); | |
92 | extern void nouveau_backlight_exit(struct drm_device *); | |
93 | #else | |
94 | static inline int | |
95 | nouveau_backlight_init(struct drm_device *dev) | |
96 | { | |
97 | return 0; | |
98 | } | |
99 | ||
100 | static inline void | |
101 | nouveau_backlight_exit(struct drm_device *dev) { | |
102 | } | |
103 | #endif | |
104 | ||
105 | #endif |