drm/nouveau/pm: change signal iter to u16
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sun, 7 Jun 2015 20:40:19 +0000 (22:40 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 28 Aug 2015 02:39:58 +0000 (12:39 +1000)
16 bits is large enough to store the maximum number of signals available
for one domain (i.e. 256).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/include/nvif/class.h
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c
drivers/gpu/drm/nouveau/nvkm/engine/pm/priv.h

index cf2af89b711242af552a3606aa73e4f5af1ade1a..871247c654a6cc6cbacd010d144c2462bc905d3e 100644 (file)
@@ -259,14 +259,15 @@ struct nvif_perfmon_query_domain_v0 {
        __u8  id;
        __u8  counter_nr;
        __u8  iter;
-       __u32 signal_nr;
+       __u16 signal_nr;
+       __u8  pad05[2];
 };
 
 struct nvif_perfmon_query_signal_v0 {
        __u8  version;
        __u8  domain;
-       __u8  pad02[2];
-       __u32 iter;
+       __u16 iter;
+       __u8  pad03[4];
        char  name[64];
 };
 
index d61beffd2404e875e9cd417e2e038553e97e5549..fab05985ba40a5813e0052f04e4ac29795e6b814 100644 (file)
@@ -45,10 +45,10 @@ nvkm_pm_count_perfdom(struct nvkm_pm *ppm)
        return domain_nr;
 }
 
-static u32
+static u16
 nvkm_perfdom_count_perfsig(struct nvkm_perfdom *dom)
 {
-       u32 signal_nr = 0;
+       u16 signal_nr = 0;
        int i;
 
        if (dom) {
@@ -183,9 +183,9 @@ nvkm_perfmon_mthd_query_signal(struct nvkm_object *object, void *data, u32 size)
        nv_ioctl(object, "perfmon query signal size %d\n", size);
        if (nvif_unpack(args->v0, 0, 0, false)) {
                nv_ioctl(object,
-                        "perfmon query signal vers %d dom %d iter %08x\n",
+                        "perfmon query signal vers %d dom %d iter %04x\n",
                         args->v0.version, args->v0.domain, args->v0.iter);
-               si = (args->v0.iter & 0xffffffff) - 1;
+               si = (args->v0.iter & 0xffff) - 1;
        } else
                return ret;
 
@@ -209,7 +209,7 @@ nvkm_perfmon_mthd_query_signal(struct nvkm_object *object, void *data, u32 size)
                }
        }
 
-       args->v0.iter = 0xffffffff;
+       args->v0.iter = 0xffff;
        return 0;
 }
 
index 06a6e60856ff4abe09384a4edf19d3deb05c13ba..71667fcbd9de266b5097cc1d54ee41d97f6b3f82 100644 (file)
@@ -44,7 +44,7 @@ struct nvkm_perfdom {
        char name[32];
        u32 addr;
        u8  quad;
-       u32 signal_nr;
+       u16 signal_nr;
        struct nvkm_perfsig signal[];
 };