hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/gpu/drm/nouveau/nouveau_display.h
....@@ -1,43 +1,24 @@
1
-/* SPDX-License-Identifier: GPL-2.0 */
1
+/* SPDX-License-Identifier: MIT */
22 #ifndef __NOUVEAU_DISPLAY_H__
33 #define __NOUVEAU_DISPLAY_H__
4
+
45 #include "nouveau_drv.h"
6
+
57 #include <nvif/disp.h>
68
7
-struct nouveau_framebuffer {
8
- struct drm_framebuffer base;
9
- struct nouveau_bo *nvbo;
10
- struct nouveau_vma *vma;
11
- u32 r_handle;
12
- u32 r_format;
13
- u32 r_pitch;
14
- struct nvif_object h_base[4];
15
- struct nvif_object h_core;
16
-};
9
+#include <drm/drm_framebuffer.h>
1710
18
-static inline struct nouveau_framebuffer *
19
-nouveau_framebuffer(struct drm_framebuffer *fb)
20
-{
21
- return container_of(fb, struct nouveau_framebuffer, base);
22
-}
23
-
24
-int nouveau_framebuffer_new(struct drm_device *,
25
- const struct drm_mode_fb_cmd2 *,
26
- struct nouveau_bo *, struct nouveau_framebuffer **);
27
-
28
-struct nouveau_page_flip_state {
29
- struct list_head head;
30
- struct drm_pending_vblank_event *event;
31
- struct drm_crtc *crtc;
32
- int bpp, pitch;
33
- u64 offset;
34
-};
11
+int
12
+nouveau_framebuffer_new(struct drm_device *dev,
13
+ const struct drm_mode_fb_cmd2 *mode_cmd,
14
+ struct drm_gem_object *gem,
15
+ struct drm_framebuffer **pfb);
3516
3617 struct nouveau_display {
3718 void *priv;
3819 void (*dtor)(struct drm_device *);
39
- int (*init)(struct drm_device *);
40
- void (*fini)(struct drm_device *);
20
+ int (*init)(struct drm_device *, bool resume, bool runtime);
21
+ void (*fini)(struct drm_device *, bool suspend, bool runtime);
4122
4223 struct nvif_disp disp;
4324
....@@ -51,6 +32,8 @@
5132 struct drm_property *color_vibrance_property;
5233
5334 struct drm_atomic_state *suspend;
35
+
36
+ const u64 *format_modifiers;
5437 };
5538
5639 static inline struct nouveau_display *
....@@ -61,22 +44,17 @@
6144
6245 int nouveau_display_create(struct drm_device *dev);
6346 void nouveau_display_destroy(struct drm_device *dev);
64
-int nouveau_display_init(struct drm_device *dev);
47
+int nouveau_display_init(struct drm_device *dev, bool resume, bool runtime);
48
+void nouveau_display_hpd_resume(struct drm_device *dev);
6549 void nouveau_display_fini(struct drm_device *dev, bool suspend, bool runtime);
6650 int nouveau_display_suspend(struct drm_device *dev, bool runtime);
6751 void nouveau_display_resume(struct drm_device *dev, bool runtime);
68
-int nouveau_display_vblank_enable(struct drm_device *, unsigned int);
69
-void nouveau_display_vblank_disable(struct drm_device *, unsigned int);
70
-bool nouveau_display_scanoutpos(struct drm_device *, unsigned int,
71
- bool, int *, int *, ktime_t *,
72
- ktime_t *, const struct drm_display_mode *);
73
-
74
-int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
75
- struct drm_pending_vblank_event *event,
76
- uint32_t page_flip_flags,
77
- struct drm_modeset_acquire_ctx *ctx);
78
-int nouveau_finish_page_flip(struct nouveau_channel *,
79
- struct nouveau_page_flip_state *);
52
+int nouveau_display_vblank_enable(struct drm_crtc *crtc);
53
+void nouveau_display_vblank_disable(struct drm_crtc *crtc);
54
+bool nouveau_display_scanoutpos(struct drm_crtc *crtc,
55
+ bool in_vblank_irq, int *vpos, int *hpos,
56
+ ktime_t *stime, ktime_t *etime,
57
+ const struct drm_display_mode *mode);
8058
8159 int nouveau_display_dumb_create(struct drm_file *, struct drm_device *,
8260 struct drm_mode_create_dumb *args);
....@@ -85,30 +63,9 @@
8563
8664 void nouveau_hdmi_mode_set(struct drm_encoder *, struct drm_display_mode *);
8765
88
-#ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
89
-extern int nouveau_backlight_init(struct drm_device *);
90
-extern void nouveau_backlight_exit(struct drm_device *);
91
-extern void nouveau_backlight_ctor(void);
92
-extern void nouveau_backlight_dtor(void);
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
-
104
-static inline void
105
-nouveau_backlight_ctor(void) {
106
-}
107
-
108
-static inline void
109
-nouveau_backlight_dtor(void) {
110
-}
111
-#endif
66
+void
67
+nouveau_framebuffer_get_layout(struct drm_framebuffer *fb, uint32_t *tile_mode,
68
+ uint8_t *kind);
11269
11370 struct drm_framebuffer *
11471 nouveau_user_framebuffer_create(struct drm_device *, struct drm_file *,