drm/nouveau/pmu/gm20b: add msgqueue support
authorAlexandre Courbot <acourbot@nvidia.com>
Fri, 10 Feb 2017 07:29:01 +0000 (16:29 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 7 Mar 2017 07:05:12 +0000 (17:05 +1000)
gm20b PMU firmware is driven by a msgqueue, so connect relevant PMU
hooks to their msgqueue counterparts.

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

index 0b8a1cc4a0ee4c2f1ff6d3ff960e689c08d9c6bf..48ae02d456563f201f7cb31cf602ba9e3f5b9655 100644 (file)
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include <engine/falcon.h>
+#include <core/msgqueue.h>
 #include "priv.h"
 
+static void
+gm20b_pmu_recv(struct nvkm_pmu *pmu)
+{
+       nvkm_msgqueue_recv(pmu->queue);
+}
+
 static const struct nvkm_pmu_func
 gm20b_pmu = {
-       .reset = gt215_pmu_reset,
+       .intr = gt215_pmu_intr,
+       .recv = gm20b_pmu_recv,
 };
 
 int
 gm20b_pmu_new(struct nvkm_device *device, int index, struct nvkm_pmu **ppmu)
 {
-       return nvkm_pmu_new_(&gm20b_pmu, device, index, ppmu);
+       int ret;
+
+       ret = nvkm_pmu_new_(&gm20b_pmu, device, index, ppmu);
+       if (ret)
+               return ret;
+
+       return 0;
 }