diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/engctx.h b/drivers/gpu/drm/nouveau/include/nvkm/core/engctx.h index e4bf2982c19026e5b6f2e20d6b004a780ff01f69..aa465def4f95f9ddd31ef9f5b7e787edb87e7e34 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/engctx.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/engctx.h @@ -4,7 +4,7 @@ #include -#define NV_ENGCTX_(eng,var) (NV_ENGCTX_CLASS | ((var) << 8) | (eng)) +#define NV_ENGCTX_(eng,var) (((var) << 8) | (eng)) #define NV_ENGCTX(name,var) NV_ENGCTX_(NVDEV_ENGINE_##name, (var)) struct nvkm_engctx { diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h b/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h index 67e3afcbdd9700ae1cd658a3efd428ac3b25d77b..0b5f05aec2dffe1e02d829d78c81024b8c94ad6e 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/engine.h @@ -2,7 +2,7 @@ #define __NVKM_ENGINE_H__ #include -#define NV_ENGINE_(eng,var) (NV_ENGINE_CLASS | ((var) << 8) | (eng)) +#define NV_ENGINE_(eng,var) (((var) << 8) | (eng)) #define NV_ENGINE(name,var) NV_ENGINE_(NVDEV_ENGINE_##name, (var)) struct nvkm_engine { diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/object.h b/drivers/gpu/drm/nouveau/include/nvkm/core/object.h index 04e8a62ade32f54c9d155f72d56fae6c7e1f177a..ef0ff9e1a9480844172be924e6813e41512cd0c4 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/object.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/object.h @@ -11,10 +11,10 @@ #define NV_MEMOBJ_CLASS 0x04000000 #define NV_GPUOBJ_CLASS 0x02000000 #define NV_ENGCTX_CLASS 0x01000000 -#define NV_OBJECT_CLASS 0x0000ffff struct nvkm_object { struct nvkm_oclass *oclass; + u32 pclass; struct nvkm_object *parent; struct nvkm_engine *engine; atomic_t refcount; @@ -70,8 +70,8 @@ struct nvkm_oclass { #define nv_oclass(o) nv_object(o)->oclass #define nv_hclass(o) nv_oclass(o)->handle -#define nv_iclass(o,i) (nv_hclass(o) & (i)) -#define nv_mclass(o) nv_iclass(o, NV_OBJECT_CLASS) +#define nv_iclass(o,i) (nv_object(o)->pclass & (i)) +#define nv_mclass(o) nv_oclass(o)->handle static inline struct nvkm_object * nv_pclass(struct nvkm_object *parent, u32 oclass) diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h index 8e762830902d1423c10c3c5af4fc351fae112d6e..ce5f1b93ef9aa804e6c910f46af088493fa01e93 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/subdev.h @@ -2,7 +2,7 @@ #define __NVKM_SUBDEV_H__ #include -#define NV_SUBDEV_(sub,var) (NV_SUBDEV_CLASS | ((var) << 8) | (sub)) +#define NV_SUBDEV_(sub,var) (((var) << 8) | (sub)) #define NV_SUBDEV(name,var) NV_SUBDEV_(NVDEV_SUBDEV_##name, (var)) struct nvkm_subdev { diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h index 3e77c924434b3a050b6f0623c781c067ed66a262..0ec929e00b36ecd7351d034454639510e9dc57a4 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/fifo.h @@ -50,7 +50,7 @@ struct nvkm_fifo_base { }; #define nvkm_fifo_context_create(p,e,c,g,s,a,f,d) \ - nvkm_gpuobj_create((p), (e), (c), 0, (g), (s), (a), (f), (d)) + nvkm_gpuobj_create((p), (e), (c), NV_ENGCTX_CLASS, (g), (s), (a), (f), (d)) #define nvkm_fifo_context_destroy(p) \ nvkm_gpuobj_destroy(&(p)->gpuobj) #define nvkm_fifo_context_init(p) \ diff --git a/drivers/gpu/drm/nouveau/nvkm/core/object.c b/drivers/gpu/drm/nouveau/nvkm/core/object.c index b32a041636a403fb51f1f65971eeda4f5971f17a..98ba58ec1d3943a64a88042d4abee2db2d615031 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/object.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/object.c @@ -107,7 +107,7 @@ nvkm_object_create_(struct nvkm_object *parent, struct nvkm_object *engine, nvkm_object_ref(parent, &object->parent); nvkm_object_ref(engine, (struct nvkm_object **)&object->engine); object->oclass = oclass; - object->oclass->handle |= pclass; + object->pclass = pclass; atomic_set(&object->refcount, 1); atomic_set(&object->usecount, 0);