forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/gpu/drm/nouveau/dispnv50/disp.h
....@@ -1,12 +1,18 @@
11 #ifndef __NV50_KMS_H__
22 #define __NV50_KMS_H__
3
+#include <linux/workqueue.h>
34 #include <nvif/mem.h>
5
+#include <nvif/push.h>
46
57 #include "nouveau_display.h"
8
+
9
+struct nv50_msto;
10
+struct nouveau_encoder;
611
712 struct nv50_disp {
813 struct nvif_disp *disp;
914 struct nv50_core *core;
15
+ struct nvif_object caps;
1016
1117 #define NV50_DISP_SYNC(c, o) ((c) * 0x040 + (o))
1218 #define NV50_DISP_CORE_NTFY NV50_DISP_SYNC(0 , 0x00)
....@@ -46,6 +52,8 @@
4652
4753 void corec37d_ntfy_init(struct nouveau_bo *, u32);
4854
55
+void head907d_olut_load(struct drm_color_lut *, int size, void __iomem *);
56
+
4957 struct nv50_chan {
5058 struct nvif_object user;
5159 struct nvif_device *device;
....@@ -54,7 +62,8 @@
5462 struct nv50_dmac {
5563 struct nv50_chan base;
5664
57
- struct nvif_mem push;
65
+ struct nvif_push _push;
66
+ struct nvif_push *push;
5867 u32 *ptr;
5968
6069 struct nvif_object sync;
....@@ -64,6 +73,24 @@
6473 * grabbed by evo_wait (if the pushbuf reservation is successful) and
6574 * dropped again by evo_kick. */
6675 struct mutex lock;
76
+
77
+ u32 cur;
78
+ u32 put;
79
+ u32 max;
80
+};
81
+
82
+struct nv50_outp_atom {
83
+ struct list_head head;
84
+
85
+ struct drm_encoder *encoder;
86
+ bool flush_disable;
87
+
88
+ union nv50_outp_atom_mask {
89
+ struct {
90
+ bool ctrl:1;
91
+ };
92
+ u8 mask;
93
+ } set, clr;
6794 };
6895
6996 int nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
....@@ -71,20 +98,18 @@
7198 s64 syncbuf, struct nv50_dmac *dmac);
7299 void nv50_dmac_destroy(struct nv50_dmac *);
73100
101
+/*
102
+ * For normal encoders this just returns the encoder. For active MST encoders,
103
+ * this returns the real outp that's driving displays on the topology.
104
+ * Inactive MST encoders return NULL, since they would have no real outp to
105
+ * return anyway.
106
+ */
107
+struct nouveau_encoder *nv50_real_outp(struct drm_encoder *encoder);
108
+
74109 u32 *evo_wait(struct nv50_dmac *, int nr);
75110 void evo_kick(u32 *, struct nv50_dmac *);
76111
77
-#define evo_mthd(p, m, s) do { \
78
- const u32 _m = (m), _s = (s); \
79
- if (drm_debug & DRM_UT_KMS) \
80
- pr_err("%04x %d %s\n", _m, _s, __func__); \
81
- *((p)++) = ((_s << 18) | _m); \
82
-} while(0)
83
-
84
-#define evo_data(p, d) do { \
85
- const u32 _d = (d); \
86
- if (drm_debug & DRM_UT_KMS) \
87
- pr_err("\t%08x\n", _d); \
88
- *((p)++) = _d; \
89
-} while(0)
112
+extern const u64 disp50xx_modifiers[];
113
+extern const u64 disp90xx_modifiers[];
114
+extern const u64 wndwc57e_modifiers[];
90115 #endif