From a5f5af8698a5cb3a68608a40a8782bdf8263cb97 Mon Sep 17 00:00:00 2001 From: Martin Peres Date: Thu, 4 Oct 2012 00:28:21 +0200 Subject: [PATCH 1/6] drm/nouveau/hwmon: fix the initialization condition Signed-off-by: Martin Peres Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_pm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c index b9d5335df742..47677e3f8d7e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_pm.c +++ b/drivers/gpu/drm/nouveau/nouveau_pm.c @@ -706,8 +706,7 @@ nouveau_hwmon_init(struct drm_device *dev) struct device *hwmon_dev; int ret = 0; - if (!therm || !therm->temp_get || !therm->attr_get || - !therm->attr_set || therm->temp_get(therm) < 0) + if (!therm || !therm->temp_get || !therm->attr_get || !therm->attr_set) return -ENODEV; hwmon_dev = hwmon_device_register(&dev->pdev->dev); From a6fd5cf3c986dab3950185a53ef02a399bf2cf2b Mon Sep 17 00:00:00 2001 From: Martin Peres Date: Thu, 4 Oct 2012 00:44:19 +0200 Subject: [PATCH 2/6] drm/nouveau/pm: fix a typo related to the move to the therm subdev Reported-by: Vekin on IRC Reported-by: Emil Velikov Signed-off-by: Martin Peres Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c index 47677e3f8d7e..75314a1befc6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_pm.c +++ b/drivers/gpu/drm/nouveau/nouveau_pm.c @@ -52,7 +52,7 @@ nouveau_pm_perflvl_aux(struct drm_device *dev, struct nouveau_pm_level *perflvl, { struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_pm *pm = nouveau_pm(dev); - struct nouveau_therm *therm = nouveau_therm(drm); + struct nouveau_therm *therm = nouveau_therm(drm->device); int ret; /*XXX: not on all boards, we should control based on temperature From eed6187d9f19535ac9339b684537f8535bf563b7 Mon Sep 17 00:00:00 2001 From: Martin Peres Date: Thu, 4 Oct 2012 01:00:13 +0200 Subject: [PATCH 3/6] drm/nouveau/pm: do not stop reclocking if failing to set the fan speed With the introduction of fan management modes, fan may not be drivable. We should allow reclocking nonetheless. This return was stupid to begin with since it may have left the card in an intermediate state (clocks corresponding to a perflvl and voltage corresponding to another one). The reclocking code will need to be rewritten in a near-future in order to provide a better error handling. Reported-by: Marcin Slusarz Signed-off-by: Martin Peres Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_pm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c b/drivers/gpu/drm/nouveau/nouveau_pm.c index 75314a1befc6..112d0deeb6d5 100644 --- a/drivers/gpu/drm/nouveau/nouveau_pm.c +++ b/drivers/gpu/drm/nouveau/nouveau_pm.c @@ -64,7 +64,6 @@ nouveau_pm_perflvl_aux(struct drm_device *dev, struct nouveau_pm_level *perflvl, ret = therm->fan_set(therm, perflvl->fanspeed); if (ret && ret != -ENODEV) { NV_ERROR(drm, "fanspeed set failed: %d\n", ret); - return ret; } } From 5db4c6c5dd26f7737c1fa45ea73549b8aef6e395 Mon Sep 17 00:00:00 2001 From: Marcin Slusarz Date: Thu, 11 Oct 2012 23:53:48 +0200 Subject: [PATCH 4/6] drm/nv50/fb: fix double free of vram mm nouveau_fb_destroy already calls nouveau_mm_fini on vram mm. Signed-off-by: Marcin Slusarz Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c index 436e9efe7ef5..42d7539e6525 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c @@ -277,7 +277,6 @@ nv50_fb_dtor(struct nouveau_object *object) __free_page(priv->r100c08_page); } - nouveau_mm_fini(&priv->base.vram); nouveau_fb_destroy(&priv->base); } From df1b4b91e5dae04782f65f657d771b23ca3bdc99 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Sun, 14 Oct 2012 01:58:26 +0400 Subject: [PATCH 5/6] drm/nouveau: only call ttm_agp_tt_create when __OS_HAS_AGP ttm_agp_tt_create is itself defined under CONFIG_AGP, so there's no point calling it otherwise. Signed-off-by: Max Filippov Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_bo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 259e5f1adf47..35ac57f0aab6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -456,6 +456,7 @@ static struct ttm_tt * nouveau_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size, uint32_t page_flags, struct page *dummy_read) { +#if __OS_HAS_AGP struct nouveau_drm *drm = nouveau_bdev(bdev); struct drm_device *dev = drm->dev; @@ -463,6 +464,7 @@ nouveau_ttm_tt_create(struct ttm_bo_device *bdev, unsigned long size, return ttm_agp_tt_create(bdev, dev->agp->bridge, size, page_flags, dummy_read); } +#endif return nouveau_sgdma_create_ttm(bdev, size, page_flags, dummy_read); } From 565f571c48f01a681243a356e9083f5cf24b432e Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 16 Oct 2012 16:25:08 +1000 Subject: [PATCH 6/6] drm/nouveau/bios: fix typo in error message Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c b/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c index 9ed6e728a94c..7d750382a833 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/dcb.c @@ -43,7 +43,7 @@ dcb_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) *ver = nv_ro08(bios, dcb); if (*ver >= 0x41) { - nv_warn(bios, "DCB *ver 0x%02x unknown\n", *ver); + nv_warn(bios, "DCB version 0x%02x unknown\n", *ver); return 0x0000; } else if (*ver >= 0x30) {