drm/nouveau/device: store revision
authorBen Skeggs <bskeggs@redhat.com>
Mon, 17 Nov 2014 12:56:37 +0000 (22:56 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 2 Dec 2014 05:44:04 +0000 (15:44 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/engine/device/base.c
drivers/gpu/drm/nouveau/core/include/core/device.h

index 786119e633e98244ce8a4675851d8ceea926b1a0..9262f27904c86b730ce86175a18c8b56cad94cd2 100644 (file)
@@ -138,7 +138,7 @@ nouveau_devobj_info(struct nouveau_object *object, void *data, u32 size)
        }
 
        args->v0.chipset  = device->chipset;
-       args->v0.revision = device->chipset >= 0x10 ? nv_rd32(device, 0) : 0x00;
+       args->v0.revision = device->chiprev;
        if (pfb)  args->v0.ram_size = args->v0.ram_user = pfb->ram->size;
        else      args->v0.ram_size = args->v0.ram_user = 0;
        if (imem) args->v0.ram_user = args->v0.ram_user - imem->reserved;
@@ -354,12 +354,14 @@ nouveau_devobj_ctor(struct nouveau_object *parent,
                /* determine chipset and derive architecture from it */
                if ((boot0 & 0x1f000000) > 0) {
                        device->chipset = (boot0 & 0x1ff00000) >> 20;
+                       device->chiprev = (boot0 & 0x000000ff);
                        switch (device->chipset & 0x1f0) {
                        case 0x010: {
                                if (0x461 & (1 << (device->chipset & 0xf)))
                                        device->card_type = NV_10;
                                else
                                        device->card_type = NV_11;
+                               device->chiprev = 0x00;
                                break;
                        }
                        case 0x020: device->card_type = NV_20; break;
index 0d839e1ddaf4eb2626ff1325cc6af2113d09ddd2..0e0ce436600fa8e6e1c4872f9da987a281edbfbe 100644 (file)
@@ -92,6 +92,7 @@ struct nouveau_device {
                GM100    = 0x110,
        } card_type;
        u32 chipset;
+       u8  chiprev;
        u32 crystal;
 
        struct nouveau_oclass *oclass[NVDEV_SUBDEV_NR];