1 /* $NetBSD: nv50.h,v 1.3 2021/12/18 23:45:36 riastradh Exp $ */ 2 3 /* SPDX-License-Identifier: MIT */ 4 #ifndef __NV50_GR_H__ 5 #define __NV50_GR_H__ 6 #define nv50_gr(p) container_of((p), struct nv50_gr, base) 7 #include "priv.h" 8 9 struct nv50_gr { 10 struct nvkm_gr base; 11 const struct nv50_gr_func *func; 12 spinlock_t lock; 13 u32 size; 14 }; 15 16 int nv50_gr_new_(const struct nvkm_gr_func *, struct nvkm_device *, int index, 17 struct nvkm_gr **); 18 int nv50_gr_init(struct nvkm_gr *); 19 void nv50_gr_intr(struct nvkm_gr *); 20 u64 nv50_gr_units(struct nvkm_gr *); 21 22 int g84_gr_tlb_flush(struct nvkm_gr *); 23 24 #define nv50_gr_chan(p) container_of((p), struct nv50_gr_chan, object) 25 #include <core/object.h> 26 27 struct nv50_gr_chan { 28 struct nvkm_object object; 29 struct nv50_gr *gr; 30 }; 31 32 int nv50_gr_chan_new(struct nvkm_gr *, struct nvkm_fifo_chan *, 33 const struct nvkm_oclass *, struct nvkm_object **); 34 35 extern const struct nvkm_object_func nv50_gr_object; 36 37 int nv50_grctx_init(struct nvkm_device *, u32 *size); 38 void nv50_grctx_fill(struct nvkm_device *, struct nvkm_gpuobj *); 39 #endif 40