Back to home page

OSCL-LXR

 
 

    


0001 #ifndef __NV50_KMS_H__
0002 #define __NV50_KMS_H__
0003 #include <linux/workqueue.h>
0004 #include <nvif/mem.h>
0005 #include <nvif/push.h>
0006 
0007 #include "nouveau_display.h"
0008 
0009 struct nv50_msto;
0010 struct nouveau_encoder;
0011 
0012 struct nv50_disp {
0013     struct nvif_disp *disp;
0014     struct nv50_core *core;
0015     struct nvif_object caps;
0016 
0017 #define NV50_DISP_SYNC(c, o)                                ((c) * 0x040 + (o))
0018 #define NV50_DISP_CORE_NTFY                       NV50_DISP_SYNC(0      , 0x00)
0019 #define NV50_DISP_WNDW_SEM0(c)                    NV50_DISP_SYNC(1 + (c), 0x00)
0020 #define NV50_DISP_WNDW_SEM1(c)                    NV50_DISP_SYNC(1 + (c), 0x10)
0021 #define NV50_DISP_WNDW_NTFY(c)                    NV50_DISP_SYNC(1 + (c), 0x20)
0022 #define NV50_DISP_BASE_SEM0(c)                    NV50_DISP_WNDW_SEM0(0 + (c))
0023 #define NV50_DISP_BASE_SEM1(c)                    NV50_DISP_WNDW_SEM1(0 + (c))
0024 #define NV50_DISP_BASE_NTFY(c)                    NV50_DISP_WNDW_NTFY(0 + (c))
0025 #define NV50_DISP_OVLY_SEM0(c)                    NV50_DISP_WNDW_SEM0(4 + (c))
0026 #define NV50_DISP_OVLY_SEM1(c)                    NV50_DISP_WNDW_SEM1(4 + (c))
0027 #define NV50_DISP_OVLY_NTFY(c)                    NV50_DISP_WNDW_NTFY(4 + (c))
0028     struct nouveau_bo *sync;
0029 
0030     struct mutex mutex;
0031 };
0032 
0033 static inline struct nv50_disp *
0034 nv50_disp(struct drm_device *dev)
0035 {
0036     return nouveau_display(dev)->priv;
0037 }
0038 
0039 struct nv50_disp_interlock {
0040     enum nv50_disp_interlock_type {
0041         NV50_DISP_INTERLOCK_CORE = 0,
0042         NV50_DISP_INTERLOCK_CURS,
0043         NV50_DISP_INTERLOCK_BASE,
0044         NV50_DISP_INTERLOCK_OVLY,
0045         NV50_DISP_INTERLOCK_WNDW,
0046         NV50_DISP_INTERLOCK_WIMM,
0047         NV50_DISP_INTERLOCK__SIZE
0048     } type;
0049     u32 data;
0050     u32 wimm;
0051 };
0052 
0053 void corec37d_ntfy_init(struct nouveau_bo *, u32);
0054 
0055 void head907d_olut_load(struct drm_color_lut *, int size, void __iomem *);
0056 
0057 struct nv50_chan {
0058     struct nvif_object user;
0059     struct nvif_device *device;
0060 };
0061 
0062 struct nv50_dmac {
0063     struct nv50_chan base;
0064 
0065     struct nvif_push _push;
0066     struct nvif_push *push;
0067     u32 *ptr;
0068 
0069     struct nvif_object sync;
0070     struct nvif_object vram;
0071 
0072     /* Protects against concurrent pushbuf access to this channel, lock is
0073      * grabbed by evo_wait (if the pushbuf reservation is successful) and
0074      * dropped again by evo_kick. */
0075     struct mutex lock;
0076 
0077     u32 cur;
0078     u32 put;
0079     u32 max;
0080 };
0081 
0082 struct nv50_outp_atom {
0083     struct list_head head;
0084 
0085     struct drm_encoder *encoder;
0086     bool flush_disable;
0087 
0088     union nv50_outp_atom_mask {
0089         struct {
0090             bool ctrl:1;
0091         };
0092         u8 mask;
0093     } set, clr;
0094 };
0095 
0096 int nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
0097              const s32 *oclass, u8 head, void *data, u32 size,
0098              s64 syncbuf, struct nv50_dmac *dmac);
0099 void nv50_dmac_destroy(struct nv50_dmac *);
0100 
0101 /*
0102  * For normal encoders this just returns the encoder. For active MST encoders,
0103  * this returns the real outp that's driving displays on the topology.
0104  * Inactive MST encoders return NULL, since they would have no real outp to
0105  * return anyway.
0106  */
0107 struct nouveau_encoder *nv50_real_outp(struct drm_encoder *encoder);
0108 
0109 u32 *evo_wait(struct nv50_dmac *, int nr);
0110 void evo_kick(u32 *, struct nv50_dmac *);
0111 
0112 extern const u64 disp50xx_modifiers[];
0113 extern const u64 disp90xx_modifiers[];
0114 extern const u64 wndwc57e_modifiers[];
0115 #endif