aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-08-14 19:29:35 -0400
committerDave Airlie <airlied@redhat.com>2014-08-14 19:29:35 -0400
commit83d45f234d7c20feefe9c4417e157948c97f511c (patch)
tree294b2a999fb15a229fef98343f3a07eae4a8098c
parent899552d6e84babd24611fd36ac7051068cb1eb2d (diff)
parent4898ac046d24894d7b2a5a96a1cff4e095844323 (diff)
Merge branch 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes
A couple of thinkos from the -next merge, some random fixes from a coverity scan, fix for (at least) GK106 accidentally using non-existent vram on some board configurations, and better behaviour of the instmem allocations if vmalloc space runs out. * 'linux-3.17' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/nouveau/platform: fix compilation error drm/nouveau/gk20a: add LTC device drm/nouveau: warn if we fail to re-pin fb on resume drm/nouveau/nvif: fix dac load detect method definition drm/gf100-/gr: fix -ENOSPC detection when allocating zbc table entries drm/nouveau/nvif: return null pointers on failure, in addition to ret != 0 drm/nouveau/ltc: fix tag base address getting truncated if above 4GiB drm/nvc0-/fb/ram: fix use of non-existant ram if partitions aren't uniform drm/nouveau/bar: behave better if ioremap failed drm/nouveau/kms: nouveau_fbcon_accel_fini can be static drm/nouveau: kill unused variable warning if !__OS_HAS_AGP drm/nouveau/nvif: fix a number of notify thinkos
-rw-r--r--drivers/gpu/drm/nouveau/core/core/client.c4
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/device/nve0.c1
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c6
-rw-r--r--drivers/gpu/drm/nouveau/core/include/core/client.h2
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/bar/base.c14
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c4
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.c3
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_display.c4
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fbcon.c4
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_platform.c3
-rw-r--r--drivers/gpu/drm/nouveau/nvif/class.h4
-rw-r--r--drivers/gpu/drm/nouveau/nvif/notify.c29
-rw-r--r--drivers/gpu/drm/nouveau/nvif/object.c4
14 files changed, 57 insertions, 27 deletions
diff --git a/drivers/gpu/drm/nouveau/core/core/client.c b/drivers/gpu/drm/nouveau/core/core/client.c
index 10598dede9e9..68bf06768123 100644
--- a/drivers/gpu/drm/nouveau/core/core/client.c
+++ b/drivers/gpu/drm/nouveau/core/core/client.c
@@ -132,12 +132,12 @@ nvkm_client_notify_new(struct nouveau_client *client,
132 if (ret == 0) { 132 if (ret == 0) {
133 client->notify[index] = notify; 133 client->notify[index] = notify;
134 notify->client = client; 134 notify->client = client;
135 return 0; 135 return index;
136 } 136 }
137 } 137 }
138 138
139 kfree(notify); 139 kfree(notify);
140 return 0; 140 return ret;
141} 141}
142 142
143static int 143static int
diff --git a/drivers/gpu/drm/nouveau/core/engine/device/nve0.c b/drivers/gpu/drm/nouveau/core/engine/device/nve0.c
index 54ec53bc6252..cdf9147f32a1 100644
--- a/drivers/gpu/drm/nouveau/core/engine/device/nve0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/device/nve0.c
@@ -163,6 +163,7 @@ nve0_identify(struct nouveau_device *device)
163 device->oclass[NVDEV_SUBDEV_BUS ] = nvc0_bus_oclass; 163 device->oclass[NVDEV_SUBDEV_BUS ] = nvc0_bus_oclass;
164 device->oclass[NVDEV_SUBDEV_TIMER ] = &gk20a_timer_oclass; 164 device->oclass[NVDEV_SUBDEV_TIMER ] = &gk20a_timer_oclass;
165 device->oclass[NVDEV_SUBDEV_FB ] = gk20a_fb_oclass; 165 device->oclass[NVDEV_SUBDEV_FB ] = gk20a_fb_oclass;
166 device->oclass[NVDEV_SUBDEV_LTC ] = gk104_ltc_oclass;
166 device->oclass[NVDEV_SUBDEV_IBUS ] = &gk20a_ibus_oclass; 167 device->oclass[NVDEV_SUBDEV_IBUS ] = &gk20a_ibus_oclass;
167 device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass; 168 device->oclass[NVDEV_SUBDEV_INSTMEM] = nv50_instmem_oclass;
168 device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass; 169 device->oclass[NVDEV_SUBDEV_VM ] = &nvc0_vmmgr_oclass;
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
index db19191176fa..30fd1dc64f93 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
@@ -68,6 +68,9 @@ nvc0_graph_zbc_color_get(struct nvc0_graph_priv *priv, int format,
68 } 68 }
69 } 69 }
70 70
71 if (zbc < 0)
72 return zbc;
73
71 memcpy(priv->zbc_color[zbc].ds, ds, sizeof(priv->zbc_color[zbc].ds)); 74 memcpy(priv->zbc_color[zbc].ds, ds, sizeof(priv->zbc_color[zbc].ds));
72 memcpy(priv->zbc_color[zbc].l2, l2, sizeof(priv->zbc_color[zbc].l2)); 75 memcpy(priv->zbc_color[zbc].l2, l2, sizeof(priv->zbc_color[zbc].l2));
73 priv->zbc_color[zbc].format = format; 76 priv->zbc_color[zbc].format = format;
@@ -109,6 +112,9 @@ nvc0_graph_zbc_depth_get(struct nvc0_graph_priv *priv, int format,
109 } 112 }
110 } 113 }
111 114
115 if (zbc < 0)
116 return zbc;
117
112 priv->zbc_depth[zbc].format = format; 118 priv->zbc_depth[zbc].format = format;
113 priv->zbc_depth[zbc].ds = ds; 119 priv->zbc_depth[zbc].ds = ds;
114 priv->zbc_depth[zbc].l2 = l2; 120 priv->zbc_depth[zbc].l2 = l2;
diff --git a/drivers/gpu/drm/nouveau/core/include/core/client.h b/drivers/gpu/drm/nouveau/core/include/core/client.h
index 4fc6ab12382d..1794a05205d8 100644
--- a/drivers/gpu/drm/nouveau/core/include/core/client.h
+++ b/drivers/gpu/drm/nouveau/core/include/core/client.h
@@ -14,7 +14,7 @@ struct nouveau_client {
14 void *data; 14 void *data;
15 15
16 int (*ntfy)(const void *, u32, const void *, u32); 16 int (*ntfy)(const void *, u32, const void *, u32);
17 struct nvkm_client_notify *notify[8]; 17 struct nvkm_client_notify *notify[16];
18}; 18};
19 19
20static inline struct nouveau_client * 20static inline struct nouveau_client *
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bar/base.c b/drivers/gpu/drm/nouveau/core/subdev/bar/base.c
index 73b1ed20c8d5..8bcbdf39cfb2 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/bar/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/bar/base.c
@@ -99,8 +99,13 @@ nouveau_bar_alloc(struct nouveau_bar *bar, struct nouveau_object *parent,
99 struct nouveau_mem *mem, struct nouveau_object **pobject) 99 struct nouveau_mem *mem, struct nouveau_object **pobject)
100{ 100{
101 struct nouveau_object *engine = nv_object(bar); 101 struct nouveau_object *engine = nv_object(bar);
102 return nouveau_object_ctor(parent, engine, &nouveau_barobj_oclass, 102 int ret = -ENOMEM;
103 mem, 0, pobject); 103 if (bar->iomem) {
104 ret = nouveau_object_ctor(parent, engine,
105 &nouveau_barobj_oclass,
106 mem, 0, pobject);
107 }
108 return ret;
104} 109}
105 110
106int 111int
@@ -118,9 +123,12 @@ nouveau_bar_create_(struct nouveau_object *parent,
118 if (ret) 123 if (ret)
119 return ret; 124 return ret;
120 125
121 if (nv_device_resource_len(device, 3) != 0) 126 if (nv_device_resource_len(device, 3) != 0) {
122 bar->iomem = ioremap(nv_device_resource_start(device, 3), 127 bar->iomem = ioremap(nv_device_resource_start(device, 3),
123 nv_device_resource_len(device, 3)); 128 nv_device_resource_len(device, 3));
129 if (!bar->iomem)
130 nv_warn(bar, "PRAMIN ioremap failed\n");
131 }
124 132
125 return 0; 133 return 0;
126} 134}
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
index 946518572346..2b284b192763 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
@@ -554,13 +554,13 @@ nvc0_ram_create_(struct nouveau_object *parent, struct nouveau_object *engine,
554 } else { 554 } else {
555 /* otherwise, address lowest common amount from 0GiB */ 555 /* otherwise, address lowest common amount from 0GiB */
556 ret = nouveau_mm_init(&pfb->vram, rsvd_head, 556 ret = nouveau_mm_init(&pfb->vram, rsvd_head,
557 (bsize << 8) * parts, 1); 557 (bsize << 8) * parts - rsvd_head, 1);
558 if (ret) 558 if (ret)
559 return ret; 559 return ret;
560 560
561 /* and the rest starting from (8GiB + common_size) */ 561 /* and the rest starting from (8GiB + common_size) */
562 offset = (0x0200000000ULL >> 12) + (bsize << 8); 562 offset = (0x0200000000ULL >> 12) + (bsize << 8);
563 length = (ram->size >> 12) - (bsize << 8) - rsvd_tail; 563 length = (ram->size >> 12) - ((bsize * parts) << 8) - rsvd_tail;
564 564
565 ret = nouveau_mm_init(&pfb->vram, offset, length, 0); 565 ret = nouveau_mm_init(&pfb->vram, offset, length, 0);
566 if (ret) 566 if (ret)
diff --git a/drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c b/drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c
index 9e00a1ede120..b54b582e72c4 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/ltc/gf100.c
@@ -156,7 +156,7 @@ gf100_ltc_init_tag_ram(struct nouveau_fb *pfb, struct nvkm_ltc_priv *priv)
156 if (ret) { 156 if (ret) {
157 priv->num_tags = 0; 157 priv->num_tags = 0;
158 } else { 158 } else {
159 u64 tag_base = (priv->tag_ram->offset << 12) + tag_margin; 159 u64 tag_base = ((u64)priv->tag_ram->offset << 12) + tag_margin;
160 160
161 tag_base += tag_align - 1; 161 tag_base += tag_align - 1;
162 ret = do_div(tag_base, tag_align); 162 ret = do_div(tag_base, tag_align);
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index da5d631aa5b9..01da508625f2 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/