diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 07:54:16 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 05:40:32 +0300 |
commit | 41a634064db489713945e228e216336080ba57f8 (patch) | |
tree | 5ca615eea8bc281f826d4e7a109063068156ac0e /drivers/gpu/drm/nouveau/nv50_display.c | |
parent | f58ddf9581655d3fea51465f06f292d365af9c87 (diff) | |
download | linux-41a634064db489713945e228e216336080ba57f8.tar.xz |
drm/nouveau/nvif: return min/max versions for supported object classes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_display.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_display.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index 65e70f085325..817ce09acb19 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c @@ -69,29 +69,30 @@ nv50_chan_create(struct nvif_device *device, struct nvif_object *disp, struct nv50_chan *chan) { const u32 handle = (oclass[0] << 16) | head; - s32 sclass[8]; - int ret, i; + struct nvif_sclass *sclass; + int ret, i, n; chan->device = device; - ret = nvif_object_sclass(disp, sclass, ARRAY_SIZE(sclass)); - WARN_ON(ret > ARRAY_SIZE(sclass)); + ret = n = nvif_object_sclass_get(disp, &sclass); if (ret < 0) return ret; while (oclass[0]) { - for (i = 0; i < ARRAY_SIZE(sclass); i++) { - if (sclass[i] == oclass[0]) { + for (i = 0; i < n; i++) { + if (sclass[i].oclass == oclass[0]) { ret = nvif_object_init(disp, handle, oclass[0], data, size, &chan->user); if (ret == 0) nvif_object_map(&chan->user); + nvif_object_sclass_put(&sclass); return ret; } } oclass++; } + nvif_object_sclass_put(&sclass); return -ENOSYS; } |