aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/nouveau/core/core/parent.c17
-rw-r--r--drivers/gpu/drm/nouveau/core/include/core/parent.h3
-rw-r--r--drivers/gpu/drm/nouveau/core/include/subdev/timer.h2
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/bios/base.c21
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/clock/nv50.c1
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c2
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/timer/nv04.c2
7 files changed, 14 insertions, 34 deletions
diff --git a/drivers/gpu/drm/nouveau/core/core/parent.c b/drivers/gpu/drm/nouveau/core/core/parent.c
index a1ea034611d5..db7c54943102 100644
--- a/drivers/gpu/drm/nouveau/core/core/parent.c
+++ b/drivers/gpu/drm/nouveau/core/core/parent.c
@@ -101,23 +101,6 @@ nouveau_parent_create_(struct nouveau_object *parent,
101 return 0; 101 return 0;
102} 102}
103 103
104int
105_nouveau_parent_ctor(struct nouveau_object *parent,
106 struct nouveau_object *engine,
107 struct nouveau_oclass *oclass, void *data, u32 size,
108 struct nouveau_object **pobject)
109{
110 struct nouveau_parent *object;
111 int ret;
112
113 ret = nouveau_parent_create(parent, engine, oclass, 0, NULL, 0, &object);
114 *pobject = nv_object(object);
115 if (ret)
116 return ret;
117
118 return 0;
119}
120
121void 104void
122nouveau_parent_destroy(struct nouveau_parent *parent) 105nouveau_parent_destroy(struct nouveau_parent *parent)
123{ 106{
diff --git a/drivers/gpu/drm/nouveau/core/include/core/parent.h b/drivers/gpu/drm/nouveau/core/include/core/parent.h
index d3aa251a5eb6..3c2e940eb0f8 100644
--- a/drivers/gpu/drm/nouveau/core/include/core/parent.h
+++ b/drivers/gpu/drm/nouveau/core/include/core/parent.h
@@ -50,9 +50,6 @@ int nouveau_parent_create_(struct nouveau_object *, struct nouveau_object *,
50 int size, void **); 50 int size, void **);
51void nouveau_parent_destroy(struct nouveau_parent *); 51void nouveau_parent_destroy(struct nouveau_parent *);
52 52
53int _nouveau_parent_ctor(struct nouveau_object *, struct nouveau_object *,
54 struct nouveau_oclass *, void *, u32,
55 struct nouveau_object **);
56void _nouveau_parent_dtor(struct nouveau_object *); 53void _nouveau_parent_dtor(struct nouveau_object *);
57#define _nouveau_parent_init _nouveau_object_init 54#define _nouveau_parent_init _nouveau_object_init
58#define _nouveau_parent_fini _nouveau_object_fini 55#define _nouveau_parent_fini _nouveau_object_fini
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/timer.h b/drivers/gpu/drm/nouveau/core/include/subdev/timer.h
index 49bff901544c..c24ec8ab3db4 100644
--- a/drivers/gpu/drm/nouveau/core/include/subdev/timer.h
+++ b/drivers/gpu/drm/nouveau/core/include/subdev/timer.h
@@ -26,7 +26,7 @@ void nouveau_timer_alarm(void *, u32 nsec, struct nouveau_alarm *);
26struct nouveau_timer { 26struct nouveau_timer {
27 struct nouveau_subdev base; 27 struct nouveau_subdev base;
28 u64 (*read)(struct nouveau_timer *); 28 u64 (*read)(struct nouveau_timer *);
29 void (*alarm)(struct nouveau_timer *, u32 time, struct nouveau_alarm *); 29 void (*alarm)(struct nouveau_timer *, u64 time, struct nouveau_alarm *);
30}; 30};
31 31
32static inline struct nouveau_timer * 32static inline struct nouveau_timer *
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c
index 2fbb6df697cd..dcb5c2befc92 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c
@@ -185,23 +185,22 @@ static void
185nouveau_bios_shadow_acpi(struct nouveau_bios *bios) 185nouveau_bios_shadow_acpi(struct nouveau_bios *bios)
186{ 186{
187 struct pci_dev *pdev = nv_device(bios)->pdev; 187 struct pci_dev *pdev = nv_device(bios)->pdev;
188 int cnt = 65536 / 4096; 188 int ret, cnt, i;
189 int ret; 189 u8 data[3];
190 190
191 if (!nouveau_acpi_rom_supported(pdev)) 191 if (!nouveau_acpi_rom_supported(pdev))
192 return; 192 return;
193 193
194 bios->data = kmalloc(65536, GFP_KERNEL);
195 bios->size = 0; 194 bios->size = 0;
196 if (!bios->data) 195 if (nouveau_acpi_get_bios_chunk(data, 0, 3) == 3)
197 return; 196 bios->size = data[2] * 512;
198
199 while (cnt--) {
200 ret = nouveau_acpi_get_bios_chunk(bios->data, bios->size, 4096);
201 if (ret != 4096)
202 return;
203 197
204 bios->size += 4096; 198 bios->data = kmalloc(bios->size, GFP_KERNEL);
199 for (i = 0; bios->data && i < bios->size; i += cnt) {
200 cnt = min((bios->size - i), (u32)4096);
201 ret = nouveau_acpi_get_bios_chunk(bios->data, i, cnt);
202 if (ret != cnt)
203 break;
205 } 204 }
206} 205}
207 206
diff --git a/drivers/gpu/drm/nouveau/core/subdev/clock/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/clock/nv50.c
index fd181fbceddb..f4147f67eda6 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/clock/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/clock/nv50.c
@@ -90,6 +90,7 @@ nv50_clock_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
90 return ret; 90 return ret;
91 91
92 priv->base.pll_set = nv50_clock_pll_set; 92 priv->base.pll_set = nv50_clock_pll_set;
93 priv->base.pll_calc = nv04_clock_pll_calc;
93 return 0; 94 return 0;
94} 95}
95 96
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c
index f87a7a3eb4e7..9360ddd469e7 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv50.c
@@ -92,7 +92,7 @@ nv50_fan_pwm_clock(struct nouveau_therm *therm)
92 if (nv_rd32(therm, 0xc040) & 0x800000) { 92 if (nv_rd32(therm, 0xc040) & 0x800000) {
93 /* Use the HOST clock (100 MHz) 93 /* Use the HOST clock (100 MHz)
94 * Where does this constant(2.4) comes from? */ 94 * Where does this constant(2.4) comes from? */
95 pwm_clock = (100000000 >> pwm_div) / 10 / 24; 95 pwm_clock = (100000000 >> pwm_div) * 10 / 24;
96 } else { 96 } else {
97 /* Where does this constant(20) comes from? */ 97 /* Where does this constant(20) comes from? */
98 pwm_clock = (crystal * 1000) >> pwm_div; 98 pwm_clock = (crystal * 1000) >> pwm_div;
diff --git a/drivers/gpu/drm/nouveau/core/subdev/timer/nv04.c b/drivers/gpu/drm/nouveau/core/subdev/timer/nv04.c
index 49976be4d73b..c26ca9bef671 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/timer/nv04.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/timer/nv04.c
@@ -85,7 +85,7 @@ nv04_timer_alarm_trigger(struct nouveau_timer *ptimer)
85} 85}
86 86
87static void 87static void
88nv04_timer_alarm(struct nouveau_timer *ptimer, u32 time, 88nv04_timer_alarm(struct nouveau_timer *ptimer, u64 time,
89 struct nouveau_alarm *alarm) 89 struct nouveau_alarm *alarm)
90{ 90{
91 struct nv04_timer_priv *priv = (void *)ptimer; 91 struct nv04_timer_priv *priv = (void *)ptimer;