]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/gpu/drm/drm_legacy.h
drm/i915: Apply the g4x TLB miss w/a to SR watermarks as well
[mirror_ubuntu-bionic-kernel.git] / drivers / gpu / drm / drm_legacy.h
CommitLineData
e7b96070
DH
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
9fc5cde7
DH
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 */
cc5ea594 31#include <linux/list.h>
4f03b1fc 32#include <drm/drm_legacy.h>
cc5ea594
DH
33
34struct agp_memory;
e7b96070
DH
35struct drm_device;
36struct drm_file;
37
38/*
39 * Generic DRM Contexts
40 */
41
42#define DRM_KERNEL_CONTEXT 0
43#define DRM_RESERVED_CONTEXTS 1
44
ba6976c1 45void drm_legacy_ctxbitmap_init(struct drm_device *dev);
e7b96070
DH
46void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev);
47void drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle);
48void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file);
49
50int drm_legacy_resctx(struct drm_device *d, void *v, struct drm_file *f);
51int drm_legacy_addctx(struct drm_device *d, void *v, struct drm_file *f);
52int drm_legacy_getctx(struct drm_device *d, void *v, struct drm_file *f);
53int drm_legacy_switchctx(struct drm_device *d, void *v, struct drm_file *f);
54int drm_legacy_newctx(struct drm_device *d, void *v, struct drm_file *f);
55int drm_legacy_rmctx(struct drm_device *d, void *v, struct drm_file *f);
56
57int drm_legacy_setsareactx(struct drm_device *d, void *v, struct drm_file *f);
58int drm_legacy_getsareactx(struct drm_device *d, void *v, struct drm_file *f);
59
9fc5cde7
DH
60/*
61 * Generic Buffer Management
62 */
63
64#define DRM_MAP_HASH_OFFSET 0x10000000
65
ec1f52ef
DV
66int drm_legacy_getmap_ioctl(struct drm_device *dev, void *data,
67 struct drm_file *file_priv);
9fc5cde7
DH
68int drm_legacy_addmap_ioctl(struct drm_device *d, void *v, struct drm_file *f);
69int drm_legacy_rmmap_ioctl(struct drm_device *d, void *v, struct drm_file *f);
70int drm_legacy_addbufs(struct drm_device *d, void *v, struct drm_file *f);
71int drm_legacy_infobufs(struct drm_device *d, void *v, struct drm_file *f);
72int drm_legacy_markbufs(struct drm_device *d, void *v, struct drm_file *f);
73int drm_legacy_freebufs(struct drm_device *d, void *v, struct drm_file *f);
74int drm_legacy_mapbufs(struct drm_device *d, void *v, struct drm_file *f);
75int drm_legacy_dma_ioctl(struct drm_device *d, void *v, struct drm_file *f);
76
99c48e1e 77#ifdef CONFIG_DRM_VM
a677f4cc 78void drm_legacy_vma_flush(struct drm_device *d);
99c48e1e
BG
79#else
80static inline void drm_legacy_vma_flush(struct drm_device *d)
81{
82 /* do nothing */
83}
84#endif
a677f4cc 85
cc5ea594
DH
86/*
87 * AGP Support
88 */
89
90struct drm_agp_mem {
91 unsigned long handle;
92 struct agp_memory *memory;
93 unsigned long bound;
94 int pages;
95 struct list_head head;
96};
97
1a75a222 98/* drm_lock.c */
bb6d822e
DH
99int drm_legacy_lock(struct drm_device *d, void *v, struct drm_file *f);
100int drm_legacy_unlock(struct drm_device *d, void *v, struct drm_file *f);
1a75a222 101void drm_legacy_lock_release(struct drm_device *dev, struct file *filp);
bb6d822e 102
a266162a
DV
103/* DMA support */
104int drm_legacy_dma_setup(struct drm_device *dev);
105void drm_legacy_dma_takedown(struct drm_device *dev);
106void drm_legacy_free_buffer(struct drm_device *dev,
107 struct drm_buf * buf);
108void drm_legacy_reclaim_buffers(struct drm_device *dev,
109 struct drm_file *filp);
110
9ec4e2ff
DV
111/* Scatter Gather Support */
112void drm_legacy_sg_cleanup(struct drm_device *dev);
113int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
114 struct drm_file *file_priv);
115int drm_legacy_sg_free(struct drm_device *dev, void *data,
116 struct drm_file *file_priv);
117
e7b96070 118#endif /* __DRM_LEGACY_H__ */