1 #ifndef __NOUVEAU_DISPLAY_H__
2 #define __NOUVEAU_DISPLAY_H__
6 #include "nouveau_drm.h"
8 struct nouveau_framebuffer
{
9 struct drm_framebuffer base
;
10 struct nouveau_bo
*nvbo
;
11 struct nouveau_vma vma
;
17 static inline struct nouveau_framebuffer
*
18 nouveau_framebuffer(struct drm_framebuffer
*fb
)
20 return container_of(fb
, struct nouveau_framebuffer
, base
);
23 int nouveau_framebuffer_init(struct drm_device
*, struct nouveau_framebuffer
*,
24 struct drm_mode_fb_cmd2
*, struct nouveau_bo
*);
26 struct nouveau_page_flip_state
{
27 struct list_head head
;
28 struct drm_pending_vblank_event
*event
;
29 int crtc
, bpp
, pitch
, x
, y
;
33 struct nouveau_display
{
35 void (*dtor
)(struct drm_device
*);
36 int (*init
)(struct drm_device
*);
37 void (*fini
)(struct drm_device
*);
39 struct nouveau_object
*core
;
40 struct nouveau_eventh
**vblank
;
42 struct drm_property
*dithering_mode
;
43 struct drm_property
*dithering_depth
;
44 struct drm_property
*underscan_property
;
45 struct drm_property
*underscan_hborder_property
;
46 struct drm_property
*underscan_vborder_property
;
47 /* not really hue and saturation: */
48 struct drm_property
*vibrant_hue_property
;
49 struct drm_property
*color_vibrance_property
;
52 static inline struct nouveau_display
*
53 nouveau_display(struct drm_device
*dev
)
55 return nouveau_drm(dev
)->display
;
58 int nouveau_display_create(struct drm_device
*dev
);
59 void nouveau_display_destroy(struct drm_device
*dev
);
60 int nouveau_display_init(struct drm_device
*dev
);
61 void nouveau_display_fini(struct drm_device
*dev
);
62 int nouveau_display_suspend(struct drm_device
*dev
);
63 void nouveau_display_repin(struct drm_device
*dev
);
64 void nouveau_display_resume(struct drm_device
*dev
);
65 int nouveau_display_vblank_enable(struct drm_device
*, int);
66 void nouveau_display_vblank_disable(struct drm_device
*, int);
67 int nouveau_display_scanoutpos(struct drm_device
*, int, unsigned int,
68 int *, int *, ktime_t
*, ktime_t
*);
69 int nouveau_display_vblstamp(struct drm_device
*, int, int *,
70 struct timeval
*, unsigned);
72 int nouveau_crtc_page_flip(struct drm_crtc
*crtc
, struct drm_framebuffer
*fb
,
73 struct drm_pending_vblank_event
*event
,
74 uint32_t page_flip_flags
);
75 int nouveau_finish_page_flip(struct nouveau_channel
*,
76 struct nouveau_page_flip_state
*);
78 int nouveau_display_dumb_create(struct drm_file
*, struct drm_device
*,
79 struct drm_mode_create_dumb
*args
);
80 int nouveau_display_dumb_map_offset(struct drm_file
*, struct drm_device
*,
81 u32 handle
, u64
*offset
);
83 void nouveau_hdmi_mode_set(struct drm_encoder
*, struct drm_display_mode
*);
85 int nouveau_crtc_set_config(struct drm_mode_set
*set
);
86 #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
87 extern int nouveau_backlight_init(struct drm_device
*);
88 extern void nouveau_backlight_exit(struct drm_device
*);
91 nouveau_backlight_init(struct drm_device
*dev
)
97 nouveau_backlight_exit(struct drm_device
*dev
) {