drm/nouveau/pmu: add msgqueue member
authorAlexandre Courbot <acourbot@nvidia.com>
Thu, 19 Jan 2017 04:16:40 +0000 (13:16 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 7 Mar 2017 07:05:12 +0000 (17:05 +1000)
NVIDIA-provided PMU firmware is controlled by a msgqueue. Add a member
to the PMU structure as well as the required cleanup code if this
feature is used.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvkm/subdev/pmu.h
drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c

index 179b6ed3f595fe6dc85e5ba36ac18572cbe61fe2..e7f04732a4250c96f8bbe602d7cbbb7b12c7b5a6 100644 (file)
@@ -7,6 +7,7 @@ struct nvkm_pmu {
        const struct nvkm_pmu_func *func;
        struct nvkm_subdev subdev;
        struct nvkm_falcon *falcon;
+       struct nvkm_msgqueue *queue;
 
        struct {
                u32 base;
index ad4ac4e8b29e11cdb1bf8d5273862228c0ca2f18..1871a92e8f2f1448db19427fdce1646f08f2d2c8 100644 (file)
@@ -23,6 +23,7 @@
  */
 #include "priv.h"
 
+#include <core/msgqueue.h>
 #include <subdev/timer.h>
 
 void
@@ -118,6 +119,7 @@ static void *
 nvkm_pmu_dtor(struct nvkm_subdev *subdev)
 {
        struct nvkm_pmu *pmu = nvkm_pmu(subdev);
+       nvkm_msgqueue_del(&pmu->queue);
        nvkm_falcon_del(&pmu->falcon);
        return nvkm_pmu(subdev);
 }