1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27#ifndef __NOUVEAU_CRTC_H__
28#define __NOUVEAU_CRTC_H__
29
30struct nouveau_crtc {
31 struct drm_crtc base;
32
33 int index;
34
35 uint32_t dpms_saved_fp_control;
36 uint32_t fp_users;
37 int saturation;
38 int color_vibrance;
39 int vibrant_hue;
40 int sharpness;
41 int last_dpms;
42
43 int cursor_saved_x, cursor_saved_y;
44
45 struct {
46 int cpp;
47 bool blanked;
48 uint32_t offset;
49 uint32_t tile_flags;
50 } fb;
51
52 struct {
53 struct nouveau_bo *nvbo;
54 bool visible;
55 uint32_t offset;
56 void (*set_offset)(struct nouveau_crtc *, uint32_t offset);
57 void (*set_pos)(struct nouveau_crtc *, int x, int y);
58 void (*hide)(struct nouveau_crtc *, bool update);
59 void (*show)(struct nouveau_crtc *, bool update);
60 } cursor;
61
62 struct {
63 struct nouveau_bo *nvbo;
64 uint16_t r[256];
65 uint16_t g[256];
66 uint16_t b[256];
67 int depth;
68 } lut;
69
70 int (*set_dither)(struct nouveau_crtc *crtc, bool update);
71 int (*set_scale)(struct nouveau_crtc *crtc, bool update);
72 int (*set_color_vibrance)(struct nouveau_crtc *crtc, bool update);
73};
74
75static inline struct nouveau_crtc *nouveau_crtc(struct drm_crtc *crtc)
76{
77 return container_of(crtc, struct nouveau_crtc, base);
78}
79
80static inline struct drm_crtc *to_drm_crtc(struct nouveau_crtc *crtc)
81{
82 return &crtc->base;
83}
84
85int nv50_crtc_create(struct drm_device *dev, int index);
86int nv50_crtc_cursor_set(struct drm_crtc *drm_crtc, struct drm_file *file_priv,
87 uint32_t buffer_handle, uint32_t width,
88 uint32_t height);
89int nv50_crtc_cursor_move(struct drm_crtc *drm_crtc, int x, int y);
90
91int nv04_cursor_init(struct nouveau_crtc *);
92int nv50_cursor_init(struct nouveau_crtc *);
93
94struct nouveau_connector *
95nouveau_crtc_connector_get(struct nouveau_crtc *crtc);
96
97#endif
98