[Nouveau] nouveau_subdev misc patches

2012-05-20 Thread Emil Velikov
Hello all, this series includes a wide range of fixes - from a few month's old one-liners from Andreas Heider regarding vga_switcheroo, via a null pointer dereference and double memory allocation, to a buffer overflow. Please review and comment --- drivers/gpu/drm/nouveau/nouveau_acpi.c |

[Nouveau] [PATCH 01/14] drm/nouveau: Check dsm on switcheroo unregister

2012-05-20 Thread Emil Velikov
From: Andreas Heider andr...@meetr.de Currently vga_switcheroo_unregister_handler is called unconditionally when nouveau is unloaded, even when nouveau never registered a handler. This interferes with other switcheroo handlers, as vga_switcheroo doesn't check who called unregister_handler, but

[Nouveau] [PATCH 02/14] drm/nouveau: Unregister switcheroo client on exit

2012-05-20 Thread Emil Velikov
From: Andreas Heider andr...@meetr.de Currently nouveau only registers as a vga_switcheroo client, but never unregisters. This patch adds the necessary unregister calls. Signed-off-by: Andreas Heider andr...@meetr.de --- v2: Rebased on top of master drivers/gpu/drm/nouveau/nouveau_state.c |

[Nouveau] [PATCH 03/14] drm/nouveau/device: Simplify init, fini fuction

2012-05-20 Thread Emil Velikov
Removes unnecessary goto statement fini subdevices before destroying them Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- drivers/gpu/drm/nouveau/nouveau_device.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git

[Nouveau] [PATCH 04/14] drm/nouveau: Remove non-relevant function prototypes

2012-05-20 Thread Emil Velikov
Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- drivers/gpu/drm/nouveau/nouveau_fb.h |1 - drivers/gpu/drm/nouveau/nouveau_gpio.h |3 --- 2 files changed, 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_fb.h b/drivers/gpu/drm/nouveau/nouveau_fb.h index

[Nouveau] [PATCH 05/14] drm/nouveau/gpuobj: Do not handle gpuobj_init during fail path in gpuobj_fini

2012-05-20 Thread Emil Velikov
This approach is already handled by the subdev system. Remove unneeded variable in the process Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- drivers/gpu/drm/nouveau/nouveau_gpuobj.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git

[Nouveau] [PATCH 06/14] drm/nouveau/instmem: Do not handle instmem_init during fail path in instmem_fini

2012-05-20 Thread Emil Velikov
This approach is already handled by the subdev system. Remove unneeded variable in the process Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- drivers/gpu/drm/nouveau/nv50_instmem.c | 10 +++--- drivers/gpu/drm/nouveau/nvc0_instmem.c | 10 +++--- 2 files changed, 6

[Nouveau] [PATCH 07/14] drm/nouveau/volt: Purge volt-get and volt-set checks

2012-05-20 Thread Emil Velikov
Both functions are constantly present if the volt subdev is created Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- drivers/gpu/drm/nouveau/nouveau_pm.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_pm.c

[Nouveau] [PATCH 08/14] drm/nv50_bar: Remove duplicate assignments

2012-05-20 Thread Emil Velikov
Both variables are already set in nouveau_subdev_create() Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- drivers/gpu/drm/nouveau/nv50_bar.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nv50_bar.c b/drivers/gpu/drm/nouveau/nv50_bar.c index

[Nouveau] [PATCH 09/14] drm/nv04_instmem: Remove duplicate assignment

2012-05-20 Thread Emil Velikov
The variable is already set in nouveau_subdev_create() Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- drivers/gpu/drm/nouveau/nv04_instmem.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nv04_instmem.c b/drivers/gpu/drm/nouveau/nv04_instmem.c index

[Nouveau] [PATCH 10/14] drm/nv30_fb: Purge optional variable

2012-05-20 Thread Emil Velikov
Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- drivers/gpu/drm/nouveau/nv30_fb.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nv30_fb.c b/drivers/gpu/drm/nouveau/nv30_fb.c index ce08f08..bc1c65b 100644 ---

[Nouveau] [PATCH 11/14] drm/nv40/fb: Blend if statement within the switch

2012-05-20 Thread Emil Velikov
No functional change, just bike-shedding Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- drivers/gpu/drm/nouveau/nv40_fb.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nv40_fb.c b/drivers/gpu/drm/nouveau/nv40_fb.c index

[Nouveau] [PATCH 12/14] drm/nv10/fb: Prevent double memory allocation

2012-05-20 Thread Emil Velikov
Appropriate memory is allocated in nouveau_subdev_create() Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- drivers/gpu/drm/nouveau/nv10_fb.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nv10_fb.c b/drivers/gpu/drm/nouveau/nv10_fb.c index

[Nouveau] [PATCH 13/14] drm/nouveau/perf: Prevent buffer oveflow

2012-05-20 Thread Emil Velikov
If the vbios is corrupted it can indicate more performance entries than the ones statically allocated, causing overwriting of kernel memory Signed-off-by: Emil Velikov emil.l.veli...@gmail.com --- drivers/gpu/drm/nouveau/nouveau_perf.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[Nouveau] [PATCH 14/14] drm/nouveau/therm: Rework nouveau_therm_create()

2012-05-20 Thread Emil Velikov
It contains a few changes mainly targeting the following * Therm table is present in BIT vbios * Parse the vbios table before hooking temp_get(), as it contains the therm sensor calibration data * Add dummy_therm_temp_get() function to prevent multiple null dereff's Signed-off-by: Emil Velikov