aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-10-21 01:23:16 -0400
committerBen Skeggs <bskeggs@redhat.com>2014-12-02 00:43:57 -0500
commit868e34f784dc265421184a77135f2b5175aa4e3a (patch)
tree082bca1c5a554b048df335512a8c1fd8a22f3947 /drivers/gpu/drm/nouveau
parentf67a8ff5339314f6fee8e332ebc862eb097df723 (diff)
drm/nouveau/core: remove some dead code that got forgotten
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/core/core/handle.c113
-rw-r--r--drivers/gpu/drm/nouveau/core/include/core/handle.h5
-rw-r--r--drivers/gpu/drm/nouveau/core/include/core/object.h17
3 files changed, 0 insertions, 135 deletions
diff --git a/drivers/gpu/drm/nouveau/core/core/handle.c b/drivers/gpu/drm/nouveau/core/core/handle.c
index a490b805d7e3..13f816cb08bd 100644
--- a/drivers/gpu/drm/nouveau/core/core/handle.c
+++ b/drivers/gpu/drm/nouveau/core/core/handle.c
@@ -222,116 +222,3 @@ nouveau_handle_put(struct nouveau_handle *handle)
222 if (handle) 222 if (handle)
223 nouveau_namedb_put(handle); 223 nouveau_namedb_put(handle);
224} 224}
225
226int
227nouveau_handle_new(struct nouveau_object *client, u32 _parent, u32 _handle,
228 u16 _oclass, void *data, u32 size,
229 struct nouveau_object **pobject)
230{
231 struct nouveau_object *parent = NULL;
232 struct nouveau_object *engctx = NULL;
233 struct nouveau_object *object = NULL;
234 struct nouveau_object *engine;
235 struct nouveau_oclass *oclass;
236 struct nouveau_handle *handle;
237 int ret;
238
239 /* lookup parent object and ensure it *is* a parent */
240 parent = nouveau_handle_ref(client, _parent);
241 if (!parent) {
242 nv_error(client, "parent 0x%08x not found\n", _parent);
243 return -ENOENT;
244 }
245
246 if (!nv_iclass(parent, NV_PARENT_CLASS)) {
247 nv_error(parent, "cannot have children\n");
248 ret = -EINVAL;
249 goto fail_class;
250 }
251
252 /* check that parent supports the requested subclass */
253 ret = nouveau_parent_sclass(parent, _oclass, &engine, &oclass);
254 if (ret) {
255 nv_debug(parent, "illegal class 0x%04x\n", _oclass);
256 goto fail_class;
257 }
258
259 /* make sure engine init has been completed *before* any objects
260 * it controls are created - the constructors may depend on
261 * state calculated at init (ie. default context construction)
262 */
263 if (engine) {
264 ret = nouveau_object_inc(engine);
265 if (ret)
266 goto fail_class;
267 }
268
269 /* if engine requires it, create a context object to insert
270 * between the parent and its children (eg. PGRAPH context)
271 */
272 if (engine && nv_engine(engine)->cclass) {
273 ret = nouveau_object_ctor(parent, engine,
274 nv_engine(engine)->cclass,
275 data, size, &engctx);
276 if (ret)
277 goto fail_engctx;
278 } else {
279 nouveau_object_ref(parent, &engctx);
280 }
281
282 /* finally, create new object and bind it to its handle */
283 ret = nouveau_object_ctor(engctx, engine, oclass, data, size, &object);
284 *pobject = object;
285 if (ret)
286 goto fail_ctor;
287
288 ret = nouveau_object_inc(object);
289 if (ret)
290 goto fail_init;
291
292 ret = nouveau_handle_create(parent, _parent, _handle, object, &handle);
293 if (ret)
294 goto fail_handle;
295
296 ret = nouveau_handle_init(handle);
297 if (ret)
298 nouveau_handle_destroy(handle);
299
300fail_handle:
301 nouveau_object_dec(object, false);
302fail_init:
303 nouveau_object_ref(NULL, &object);
304fail_ctor:
305 nouveau_object_ref(NULL, &engctx);
306fail_engctx:
307 if (engine)
308 nouveau_object_dec(engine, false);
309fail_class:
310 nouveau_object_ref(NULL, &parent);
311 return ret;
312}
313
314int
315nouveau_handle_del(struct nouveau_object *client, u32 _parent, u32 _handle)
316{
317 struct nouveau_object *parent = NULL;
318 struct nouveau_object *namedb = NULL;
319 struct nouveau_handle *handle = NULL;
320
321 parent = nouveau_handle_ref(client, _parent);
322 if (!parent)
323 return -ENOENT;
324
325 namedb = nv_pclass(parent, NV_NAMEDB_CLASS);
326 if (namedb) {
327 handle = nouveau_namedb_get(nv_namedb(namedb), _handle);
328 if (handle) {
329 nouveau_namedb_put(handle);
330 nouveau_handle_fini(handle, false);
331 nouveau_handle_destroy(handle);
332 }
333 }
334
335 nouveau_object_ref(NULL, &parent);
336 return handle ? 0 : -EINVAL;
337}
diff --git a/drivers/gpu/drm/nouveau/core/include/core/handle.h b/drivers/gpu/drm/nouveau/core/include/core/handle.h
index ceb67d770875..d22a59138a9b 100644
--- a/drivers/gpu/drm/nouveau/core/include/core/handle.h
+++ b/drivers/gpu/drm/nouveau/core/include/core/handle.h
@@ -23,11 +23,6 @@ void nouveau_handle_destroy(struct nouveau_handle *);
23int nouveau_handle_init(struct nouveau_handle *); 23int nouveau_handle_init(struct nouveau_handle *);
24int nouveau_handle_fini(struct nouveau_handle *, bool suspend); 24int nouveau_handle_fini(struct nouveau_handle *, bool suspend);
25 25
26int nouveau_handle_new(struct nouveau_object *, u32 parent, u32 handle,
27 u16 oclass, void *data, u32 size,
28 struct nouveau_object **);
29int nouveau_handle_del(struct nouveau_object *, u32 parent, u32 handle);
30
31struct nouveau_object * 26struct nouveau_object *
32nouveau_handle_ref(struct nouveau_object *, u32 name); 27nouveau_handle_ref(struct nouveau_object *, u32 name);
33 28
diff --git a/drivers/gpu/drm/nouveau/core/include/core/object.h b/drivers/gpu/drm/nouveau/core/include/core/object.h
index d7039482d6fd..2e2afa502c99 100644
--- a/drivers/gpu/drm/nouveau/core/include/core/object.h
+++ b/drivers/gpu/drm/nouveau/core/include/core/object.h
@@ -203,21 +203,4 @@ nv_memcmp(void *obj, u32 addr, const char *str, u32 len)
203 return 0; 203 return 0;
204} 204}
205 205
206#include <core/handle.h>
207
208static inline int
209nouveau_object_new(struct nouveau_object *client, u32 parent, u32 handle,
210 u16 oclass, void *data, u32 size,
211 struct nouveau_object **pobject)
212{
213 return nouveau_handle_new(client, parent, handle, oclass,
214 data, size, pobject);
215}
216
217static inline int
218nouveau_object_del(struct nouveau_object *client, u32 parent, u32 handle)
219{
220 return nouveau_handle_del(client, parent, handle);
221}
222
223#endif 206#endif