blob: 47cb9de98fb9aa32edae1c9ad95176f4a7d12546 [file] [log] [blame]
David Herrmanne7b960702014-07-24 12:10:04 +02001#ifndef __DRM_LEGACY_H__
2#define __DRM_LEGACY_H__
3
4/*
5 * Copyright (c) 2014 David Herrmann <dh.herrmann@gmail.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */
25
David Herrmann9fc5cde2014-08-29 12:12:28 +020026/*
27 * This file contains legacy interfaces that modern drm drivers
28 * should no longer be using. They cannot be removed as legacy
29 * drivers use them, and removing them are API breaks.
30 */
David Herrmanne7b960702014-07-24 12:10:04 +020031struct drm_device;
32struct drm_file;
33
34/*
35 * Generic DRM Contexts
36 */
37
38#define DRM_KERNEL_CONTEXT 0
39#define DRM_RESERVED_CONTEXTS 1
40
41int drm_legacy_ctxbitmap_init(struct drm_device *dev);
42void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev);
43void drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle);
44void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file);
45
46int drm_legacy_resctx(struct drm_device *d, void *v, struct drm_file *f);
47int drm_legacy_addctx(struct drm_device *d, void *v, struct drm_file *f);
48int drm_legacy_getctx(struct drm_device *d, void *v, struct drm_file *f);
49int drm_legacy_switchctx(struct drm_device *d, void *v, struct drm_file *f);
50int drm_legacy_newctx(struct drm_device *d, void *v, struct drm_file *f);
51int drm_legacy_rmctx(struct drm_device *d, void *v, struct drm_file *f);
52
53int drm_legacy_setsareactx(struct drm_device *d, void *v, struct drm_file *f);
54int drm_legacy_getsareactx(struct drm_device *d, void *v, struct drm_file *f);
55
David Herrmann9fc5cde2014-08-29 12:12:28 +020056/*
57 * Generic Buffer Management
58 */
59
60#define DRM_MAP_HASH_OFFSET 0x10000000
61
62int drm_legacy_addmap_ioctl(struct drm_device *d, void *v, struct drm_file *f);
63int drm_legacy_rmmap_ioctl(struct drm_device *d, void *v, struct drm_file *f);
64int drm_legacy_addbufs(struct drm_device *d, void *v, struct drm_file *f);
65int drm_legacy_infobufs(struct drm_device *d, void *v, struct drm_file *f);
66int drm_legacy_markbufs(struct drm_device *d, void *v, struct drm_file *f);
67int drm_legacy_freebufs(struct drm_device *d, void *v, struct drm_file *f);
68int drm_legacy_mapbufs(struct drm_device *d, void *v, struct drm_file *f);
69int drm_legacy_dma_ioctl(struct drm_device *d, void *v, struct drm_file *f);
70
David Herrmanne7b960702014-07-24 12:10:04 +020071#endif /* __DRM_LEGACY_H__ */