David Herrmann | e7b96070 | 2014-07-24 12:10:04 +0200 | [diff] [blame] | 1 | #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 Herrmann | 9fc5cde | 2014-08-29 12:12:28 +0200 | [diff] [blame] | 26 | /* |
| 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 Herrmann | cc5ea59 | 2014-08-29 12:12:32 +0200 | [diff] [blame] | 31 | #include <linux/list.h> |
| 32 | |
| 33 | struct agp_memory; |
David Herrmann | e7b96070 | 2014-07-24 12:10:04 +0200 | [diff] [blame] | 34 | struct drm_device; |
| 35 | struct drm_file; |
| 36 | |
| 37 | /* |
| 38 | * Generic DRM Contexts |
| 39 | */ |
| 40 | |
| 41 | #define DRM_KERNEL_CONTEXT 0 |
| 42 | #define DRM_RESERVED_CONTEXTS 1 |
| 43 | |
| 44 | int drm_legacy_ctxbitmap_init(struct drm_device *dev); |
| 45 | void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev); |
| 46 | void drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle); |
| 47 | void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file); |
| 48 | |
| 49 | int drm_legacy_resctx(struct drm_device *d, void *v, struct drm_file *f); |
| 50 | int drm_legacy_addctx(struct drm_device *d, void *v, struct drm_file *f); |
| 51 | int drm_legacy_getctx(struct drm_device *d, void *v, struct drm_file *f); |
| 52 | int drm_legacy_switchctx(struct drm_device *d, void *v, struct drm_file *f); |
| 53 | int drm_legacy_newctx(struct drm_device *d, void *v, struct drm_file *f); |
| 54 | int drm_legacy_rmctx(struct drm_device *d, void *v, struct drm_file *f); |
| 55 | |
| 56 | int drm_legacy_setsareactx(struct drm_device *d, void *v, struct drm_file *f); |
| 57 | int drm_legacy_getsareactx(struct drm_device *d, void *v, struct drm_file *f); |
| 58 | |
David Herrmann | 9fc5cde | 2014-08-29 12:12:28 +0200 | [diff] [blame] | 59 | /* |
| 60 | * Generic Buffer Management |
| 61 | */ |
| 62 | |
| 63 | #define DRM_MAP_HASH_OFFSET 0x10000000 |
| 64 | |
| 65 | int drm_legacy_addmap_ioctl(struct drm_device *d, void *v, struct drm_file *f); |
| 66 | int drm_legacy_rmmap_ioctl(struct drm_device *d, void *v, struct drm_file *f); |
| 67 | int drm_legacy_addbufs(struct drm_device *d, void *v, struct drm_file *f); |
| 68 | int drm_legacy_infobufs(struct drm_device *d, void *v, struct drm_file *f); |
| 69 | int drm_legacy_markbufs(struct drm_device *d, void *v, struct drm_file *f); |
| 70 | int drm_legacy_freebufs(struct drm_device *d, void *v, struct drm_file *f); |
| 71 | int drm_legacy_mapbufs(struct drm_device *d, void *v, struct drm_file *f); |
| 72 | int drm_legacy_dma_ioctl(struct drm_device *d, void *v, struct drm_file *f); |
| 73 | |
David Herrmann | cc5ea59 | 2014-08-29 12:12:32 +0200 | [diff] [blame] | 74 | /* |
| 75 | * AGP Support |
| 76 | */ |
| 77 | |
| 78 | struct drm_agp_mem { |
| 79 | unsigned long handle; |
| 80 | struct agp_memory *memory; |
| 81 | unsigned long bound; |
| 82 | int pages; |
| 83 | struct list_head head; |
| 84 | }; |
| 85 | |
David Herrmann | bb6d822 | 2014-08-29 12:12:46 +0200 | [diff] [blame^] | 86 | /* |
| 87 | * Generic Userspace Locking-API |
| 88 | */ |
| 89 | |
| 90 | int drm_legacy_i_have_hw_lock(struct drm_device *d, struct drm_file *f); |
| 91 | int drm_legacy_lock(struct drm_device *d, void *v, struct drm_file *f); |
| 92 | int drm_legacy_unlock(struct drm_device *d, void *v, struct drm_file *f); |
| 93 | int drm_legacy_lock_free(struct drm_lock_data *lock, unsigned int ctx); |
| 94 | |
David Herrmann | e7b96070 | 2014-07-24 12:10:04 +0200 | [diff] [blame] | 95 | #endif /* __DRM_LEGACY_H__ */ |