| .. | .. |
|---|
| 1 | 1 | #ifndef __NV50_KMS_H__ |
|---|
| 2 | 2 | #define __NV50_KMS_H__ |
|---|
| 3 | +#include <linux/workqueue.h> |
|---|
| 3 | 4 | #include <nvif/mem.h> |
|---|
| 5 | +#include <nvif/push.h> |
|---|
| 4 | 6 | |
|---|
| 5 | 7 | #include "nouveau_display.h" |
|---|
| 8 | + |
|---|
| 9 | +struct nv50_msto; |
|---|
| 10 | +struct nouveau_encoder; |
|---|
| 6 | 11 | |
|---|
| 7 | 12 | struct nv50_disp { |
|---|
| 8 | 13 | struct nvif_disp *disp; |
|---|
| 9 | 14 | struct nv50_core *core; |
|---|
| 15 | + struct nvif_object caps; |
|---|
| 10 | 16 | |
|---|
| 11 | 17 | #define NV50_DISP_SYNC(c, o) ((c) * 0x040 + (o)) |
|---|
| 12 | 18 | #define NV50_DISP_CORE_NTFY NV50_DISP_SYNC(0 , 0x00) |
|---|
| .. | .. |
|---|
| 46 | 52 | |
|---|
| 47 | 53 | void corec37d_ntfy_init(struct nouveau_bo *, u32); |
|---|
| 48 | 54 | |
|---|
| 55 | +void head907d_olut_load(struct drm_color_lut *, int size, void __iomem *); |
|---|
| 56 | + |
|---|
| 49 | 57 | struct nv50_chan { |
|---|
| 50 | 58 | struct nvif_object user; |
|---|
| 51 | 59 | struct nvif_device *device; |
|---|
| .. | .. |
|---|
| 54 | 62 | struct nv50_dmac { |
|---|
| 55 | 63 | struct nv50_chan base; |
|---|
| 56 | 64 | |
|---|
| 57 | | - struct nvif_mem push; |
|---|
| 65 | + struct nvif_push _push; |
|---|
| 66 | + struct nvif_push *push; |
|---|
| 58 | 67 | u32 *ptr; |
|---|
| 59 | 68 | |
|---|
| 60 | 69 | struct nvif_object sync; |
|---|
| .. | .. |
|---|
| 64 | 73 | * grabbed by evo_wait (if the pushbuf reservation is successful) and |
|---|
| 65 | 74 | * dropped again by evo_kick. */ |
|---|
| 66 | 75 | 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; |
|---|
| 67 | 94 | }; |
|---|
| 68 | 95 | |
|---|
| 69 | 96 | int nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp, |
|---|
| .. | .. |
|---|
| 71 | 98 | s64 syncbuf, struct nv50_dmac *dmac); |
|---|
| 72 | 99 | void nv50_dmac_destroy(struct nv50_dmac *); |
|---|
| 73 | 100 | |
|---|
| 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 | + |
|---|
| 74 | 109 | u32 *evo_wait(struct nv50_dmac *, int nr); |
|---|
| 75 | 110 | void evo_kick(u32 *, struct nv50_dmac *); |
|---|
| 76 | 111 | |
|---|
| 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[]; |
|---|
| 90 | 115 | #endif |
|---|