drm/nouveau/nvif: return min/max versions for supported object classes
[deliverable/linux.git] / drivers / gpu / drm / nouveau / nouveau_drm.c
index 65ceb6fa42094bf6b5a7f3dbcfc4584ee17c3caa..37dbd5e1c08f0e748c50b5206505cfbf9c8d8b83 100644 (file)
@@ -152,9 +152,9 @@ static void
 nouveau_accel_init(struct nouveau_drm *drm)
 {
        struct nvif_device *device = &drm->device;
+       struct nvif_sclass *sclass;
        u32 arg0, arg1;
-       s32 sclass[16];
-       int ret, i;
+       int ret, i, n;
 
        if (nouveau_noaccel)
                return;
@@ -163,12 +163,12 @@ nouveau_accel_init(struct nouveau_drm *drm)
        /*XXX: this is crap, but the fence/channel stuff is a little
         *     backwards in some places.  this will be fixed.
         */
-       ret = nvif_object_sclass(&device->object, sclass, ARRAY_SIZE(sclass));
+       ret = n = nvif_object_sclass_get(&device->object, &sclass);
        if (ret < 0)
                return;
 
-       for (ret = -ENOSYS, i = 0; ret && i < ARRAY_SIZE(sclass); i++) {
-               switch (sclass[i]) {
+       for (ret = -ENOSYS, i = 0; i < n; i++) {
+               switch (sclass[i].oclass) {
                case NV03_CHANNEL_DMA:
                        ret = nv04_fence_create(drm);
                        break;
@@ -195,6 +195,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
                }
        }
 
+       nvif_object_sclass_put(&sclass);
        if (ret) {
                NV_ERROR(drm, "failed to initialise sync subsystem, %d\n", ret);
                nouveau_accel_fini(drm);
This page took 0.027691 seconds and 5 git commands to generate.