1 #ifndef __NOUVEAU_DISPLAY_H__
2 #define __NOUVEAU_DISPLAY_H__
4 #include <subdev/mmu.h>
6 #include "nouveau_drm.h"
8 struct nouveau_framebuffer
{
9 struct drm_framebuffer base
;
10 struct nouveau_bo
*nvbo
;
15 struct nvif_object h_base
[4];
16 struct nvif_object h_core
;
19 static inline struct nouveau_framebuffer
*
20 nouveau_framebuffer(struct drm_framebuffer
*fb
)
22 return container_of(fb
, struct nouveau_framebuffer
, base
);
25 int nouveau_framebuffer_init(struct drm_device
*, struct nouveau_framebuffer
*,
26 struct drm_mode_fb_cmd2
*, struct nouveau_bo
*);
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
;
35 struct nouveau_display
{
37 void (*dtor
)(struct drm_device
*);
38 int (*init
)(struct drm_device
*);
39 void (*fini
)(struct drm_device
*);
41 int (*fb_ctor
)(struct drm_framebuffer
*);
42 void (*fb_dtor
)(struct drm_framebuffer
*);
44 struct nvif_object disp
;
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
;
56 static inline struct nouveau_display
*
57 nouveau_display(struct drm_device
*dev
)
59 return nouveau_drm(dev
)->display
;
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
);
66 int nouveau_display_suspend(struct drm_device
*dev
, bool runtime
);
67 void nouveau_display_resume(struct drm_device
*dev
, bool runtime
);
68 int nouveau_display_vblank_enable(struct drm_device
*, int);
69 void nouveau_display_vblank_disable(struct drm_device
*, int);
70 int nouveau_display_scanoutpos(struct drm_device
*, int, unsigned int,
71 int *, int *, ktime_t
*, ktime_t
*);
72 int nouveau_display_vblstamp(struct drm_device
*, int, int *,
73 struct timeval
*, unsigned);
75 int nouveau_crtc_page_flip(struct drm_crtc
*crtc
, struct drm_framebuffer
*fb
,
76 struct drm_pending_vblank_event
*event
,
77 uint32_t page_flip_flags
);
78 int nouveau_finish_page_flip(struct nouveau_channel
*,
79 struct nouveau_page_flip_state
*);
81 int nouveau_display_dumb_create(struct drm_file
*, struct drm_device
*,
82 struct drm_mode_create_dumb
*args
);
83 int nouveau_display_dumb_map_offset(struct drm_file
*, struct drm_device
*,
84 u32 handle
, u64
*offset
);
86 void nouveau_hdmi_mode_set(struct drm_encoder
*, struct drm_display_mode
*);
88 int nouveau_crtc_set_config(struct drm_mode_set
*set
);
89 #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
90 extern int nouveau_backlight_init(struct drm_device
*);
91 extern void nouveau_backlight_exit(struct drm_device
*);
94 nouveau_backlight_init(struct drm_device
*dev
)
100 nouveau_backlight_exit(struct drm_device
*dev
) {