blob: 70259732d9380e12e2d91aaf08c9b93656e832cb [file] [log] [blame]
Ben Skeggs15907002018-05-08 20:39:47 +10001#ifndef __NV50_KMS_WNDW_H__
2#define __NV50_KMS_WNDW_H__
3#define nv50_wndw(p) container_of((p), struct nv50_wndw, plane)
4#include "disp.h"
5#include "atom.h"
6
7#include <nvif/notify.h>
8
9struct nv50_wndw_ctxdma {
10 struct list_head head;
11 struct nvif_object object;
12};
13
14struct nv50_wndw {
15 const struct nv50_wndw_func *func;
16 const struct nv50_wimm_func *immd;
17 int id;
18
19 struct {
20 struct nvif_object *parent;
21 struct list_head list;
22 } ctxdma;
23
24 struct drm_plane plane;
25
26 struct nv50_dmac wndw;
27 struct nv50_dmac wimm;
28
29 struct nvif_notify notify;
30 u16 ntfy;
31 u16 sema;
32 u32 data;
33};
34
35int nv50_wndw_new_(const struct nv50_wndw_func *, struct drm_device *,
36 enum drm_plane_type, const char *name, int index,
37 const u32 *format, struct nv50_wndw **);
38void nv50_wndw_init(struct nv50_wndw *);
39void nv50_wndw_fini(struct nv50_wndw *);
40u32 nv50_wndw_flush_set(struct nv50_wndw *, u32 interlock,
41 struct nv50_wndw_atom *);
42u32 nv50_wndw_flush_clr(struct nv50_wndw *, u32 interlock, bool flush,
43 struct nv50_wndw_atom *);
Ben Skeggsccd27db2018-05-08 20:39:47 +100044void nv50_wndw_ntfy_enable(struct nv50_wndw *, struct nv50_wndw_atom *);
Ben Skeggs15907002018-05-08 20:39:47 +100045int nv50_wndw_wait_armed(struct nv50_wndw *, struct nv50_wndw_atom *);
46
47struct nv50_wndw_func {
48 int (*acquire)(struct nv50_wndw *, struct nv50_wndw_atom *asyw,
49 struct nv50_head_atom *asyh);
50 void (*release)(struct nv50_wndw *, struct nv50_wndw_atom *asyw,
51 struct nv50_head_atom *asyh);
52 void (*prepare)(struct nv50_wndw *, struct nv50_head_atom *asyh,
53 struct nv50_wndw_atom *asyw);
54
55 void (*sema_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
56 void (*sema_clr)(struct nv50_wndw *);
Ben Skeggsccd27db2018-05-08 20:39:47 +100057 void (*ntfy_reset)(struct nouveau_bo *, u32 offset);
Ben Skeggs15907002018-05-08 20:39:47 +100058 void (*ntfy_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
59 void (*ntfy_clr)(struct nv50_wndw *);
Ben Skeggsccd27db2018-05-08 20:39:47 +100060 int (*ntfy_wait_begun)(struct nouveau_bo *, u32 offset,
61 struct nvif_device *);
Ben Skeggs15907002018-05-08 20:39:47 +100062 void (*image_set)(struct nv50_wndw *, struct nv50_wndw_atom *);
63 void (*image_clr)(struct nv50_wndw *);
64 void (*lut)(struct nv50_wndw *, struct nv50_wndw_atom *);
65
66 u32 (*update)(struct nv50_wndw *, u32 interlock);
67};
68
69extern const struct drm_plane_funcs nv50_wndw;
70
71struct nv50_wimm_func {
72 void (*point)(struct nv50_wndw *, struct nv50_wndw_atom *);
73
74 u32 (*update)(struct nv50_wndw *, u32 interlock);
75};
76#endif