diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-11-17 07:56:37 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-12-02 00:44:04 -0500 |
commit | 3704791d97b0ff01411fa6342e6312721ae423f0 (patch) | |
tree | 4e82e574246c5febb9e6097df8fbb132b1fad7df /drivers/gpu | |
parent | 373535431bb78d0919140b7dd1fecb7c0dd40da4 (diff) |
drm/nouveau/device: store revision
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/device/base.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/include/core/device.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/device/base.c b/drivers/gpu/drm/nouveau/core/engine/device/base.c index 786119e633e9..9262f27904c8 100644 --- a/drivers/gpu/drm/nouveau/core/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/core/engine/device/base.c | |||
@@ -138,7 +138,7 @@ nouveau_devobj_info(struct nouveau_object *object, void *data, u32 size) | |||
138 | } | 138 | } |
139 | 139 | ||
140 | args->v0.chipset = device->chipset; | 140 | args->v0.chipset = device->chipset; |
141 | args->v0.revision = device->chipset >= 0x10 ? nv_rd32(device, 0) : 0x00; | 141 | args->v0.revision = device->chiprev; |
142 | if (pfb) args->v0.ram_size = args->v0.ram_user = pfb->ram->size; | 142 | if (pfb) args->v0.ram_size = args->v0.ram_user = pfb->ram->size; |
143 | else args->v0.ram_size = args->v0.ram_user = 0; | 143 | else args->v0.ram_size = args->v0.ram_user = 0; |
144 | if (imem) args->v0.ram_user = args->v0.ram_user - imem->reserved; | 144 | if (imem) args->v0.ram_user = args->v0.ram_user - imem->reserved; |
@@ -354,12 +354,14 @@ nouveau_devobj_ctor(struct nouveau_object *parent, | |||
354 | /* determine chipset and derive architecture from it */ | 354 | /* determine chipset and derive architecture from it */ |
355 | if ((boot0 & 0x1f000000) > 0) { | 355 | if ((boot0 & 0x1f000000) > 0) { |
356 | device->chipset = (boot0 & 0x1ff00000) >> 20; | 356 | device->chipset = (boot0 & 0x1ff00000) >> 20; |
357 | device->chiprev = (boot0 & 0x000000ff); | ||
357 | switch (device->chipset & 0x1f0) { | 358 | switch (device->chipset & 0x1f0) { |
358 | case 0x010: { | 359 | case 0x010: { |
359 | if (0x461 & (1 << (device->chipset & 0xf))) | 360 | if (0x461 & (1 << (device->chipset & 0xf))) |
360 | device->card_type = NV_10; | 361 | device->card_type = NV_10; |
361 | else | 362 | else |
362 | device->card_type = NV_11; | 363 | device->card_type = NV_11; |
364 | device->chiprev = 0x00; | ||
363 | break; | 365 | break; |
364 | } | 366 | } |
365 | case 0x020: device->card_type = NV_20; break; | 367 | case 0x020: device->card_type = NV_20; break; |
diff --git a/drivers/gpu/drm/nouveau/core/include/core/device.h b/drivers/gpu/drm/nouveau/core/include/core/device.h index 0d839e1ddaf4..0e0ce436600f 100644 --- a/drivers/gpu/drm/nouveau/core/include/core/device.h +++ b/drivers/gpu/drm/nouveau/core/include/core/device.h | |||
@@ -92,6 +92,7 @@ struct nouveau_device { | |||
92 | GM100 = 0x110, | 92 | GM100 = 0x110, |
93 | } card_type; | 93 | } card_type; |
94 | u32 chipset; | 94 | u32 chipset; |
95 | u8 chiprev; | ||
95 | u32 crystal; | 96 | u32 crystal; |
96 | 97 | ||
97 | struct nouveau_oclass *oclass[NVDEV_SUBDEV_NR]; | 98 | struct nouveau_oclass *oclass[NVDEV_SUBDEV_NR]; |