Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 88 lines (77 sloc) 2.79 kb
0bf7ad6 @koriakin Start VRAM allocator
koriakin authored
1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright 2010 PathScale Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27 #ifndef __PSCNV_VRAM_H__
28 #define __PSCNV_VRAM_H__
3fc53e1 @koriakin vram: Nuke PSCNV_VO_* flags, use PSCNV_GEM_* instead.
koriakin authored
29 #include "pscnv_drm.h"
802ae32 @koriakin vram: Switch to new memory manager.
koriakin authored
30 #include "pscnv_mm.h"
0bf7ad6 @koriakin Start VRAM allocator
koriakin authored
31
3375d31 @koriakin vram: Split to pscnv_vram and pscnv_mem, vo -> bo everywhere.
koriakin authored
32 #define PSCNV_MEM_PAGE_SIZE 0x1000
0bf7ad6 @koriakin Start VRAM allocator
koriakin authored
33
34 /* A VRAM object of any kind. */
3375d31 @koriakin vram: Split to pscnv_vram and pscnv_mem, vo -> bo everywhere.
koriakin authored
35 struct pscnv_bo {
0bf7ad6 @koriakin Start VRAM allocator
koriakin authored
36 struct drm_device *dev;
37 /* size. Always a multiple of page size. */
38 uint64_t size;
39 /* misc flags, see below. */
40 int flags;
41 int tile_flags;
42 /* cookie: free-form 32-bit number displayed in debug info. */
43 uint32_t cookie;
21a56ab @koriakin vram: Add more debugging.
koriakin authored
44 /* only used for debug */
45 int serial;
2e0babb @koriakin vram: Add start field for contig VOs as a convenience.
koriakin authored
46 /* only for contig blocks. same info as start of first [and only]
47 * region, but more convenient to access */
48 uint64_t start;
d559d1c @koriakin Add GEM interface for object allocation.
koriakin authored
49 /* the following used for GEM objects only */
50 uint32_t user[8];
51 struct drm_gem_object *gem;
8246241 @koriakin vm: Switch to new memory manager.
koriakin authored
52 struct pscnv_mm_node *map1;
53 struct pscnv_mm_node *map3;
802ae32 @koriakin vram: Switch to new memory manager.
koriakin authored
54 /* VRAM only: the first mm node */
55 struct pscnv_mm_node *mmnode;
288de7c @koriakin sysram: Add alloc+free.
koriakin authored
56 /* SYSRaM only: list of pages */
57 struct page **pages;
68c855d @koriakin sysram: Actually map pages to PCI space.
koriakin authored
58 dma_addr_t *dmapages;
9b94ad5 @mlankhorst get compile working on freebsd
mlankhorst authored
59 /* CHAN only, pointer to a channel (FreeBSD doesn't allow overriding mmap) */
60 struct pscnv_chan *chan;
0bf7ad6 @koriakin Start VRAM allocator
koriakin authored
61 };
a8214d8 @koriakin WIP
koriakin authored
62 #define PSCNV_GEM_NOUSER 0x10
0bf7ad6 @koriakin Start VRAM allocator
koriakin authored
63
f5121a8 @koriakin Add vram abstraction, pscnv_vram.c -> nv50_vram.c
koriakin authored
64 struct pscnv_vram_engine {
65 void (*takedown) (struct drm_device *);
66 int (*alloc) (struct pscnv_bo *);
67 int (*free) (struct pscnv_bo *);
9a44ae4 @koriakin Add tiled sysram support.
koriakin authored
68 int (*sysram_tiling_ok) (struct pscnv_bo *);
f5121a8 @koriakin Add vram abstraction, pscnv_vram.c -> nv50_vram.c
koriakin authored
69 };
70
3375d31 @koriakin vram: Split to pscnv_vram and pscnv_mem, vo -> bo everywhere.
koriakin authored
71 extern int pscnv_mem_init(struct drm_device *);
f5121a8 @koriakin Add vram abstraction, pscnv_vram.c -> nv50_vram.c
koriakin authored
72 extern void pscnv_mem_takedown(struct drm_device *);
3375d31 @koriakin vram: Split to pscnv_vram and pscnv_mem, vo -> bo everywhere.
koriakin authored
73 extern struct pscnv_bo *pscnv_mem_alloc(struct drm_device *,
74 uint64_t size, int flags, int tile_flags, uint32_t cookie);
75 extern int pscnv_mem_free(struct pscnv_bo *);
76
f5121a8 @koriakin Add vram abstraction, pscnv_vram.c -> nv50_vram.c
koriakin authored
77 extern int pscnv_vram_free(struct pscnv_bo *bo);
78 extern void pscnv_vram_takedown(struct drm_device *dev);
79
80 extern int nv50_vram_init(struct drm_device *);
baf85a1 @koriakin vram: Add NVC0 support.
koriakin authored
81 extern int nvc0_vram_init(struct drm_device *);
3375d31 @koriakin vram: Split to pscnv_vram and pscnv_mem, vo -> bo everywhere.
koriakin authored
82
83 extern int pscnv_sysram_alloc(struct pscnv_bo *);
84 extern int pscnv_sysram_free(struct pscnv_bo *);
123eb5c @koriakin sysram: Add mmap support.
koriakin authored
85 extern int pscnv_sysram_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
0bf7ad6 @koriakin Start VRAM allocator
koriakin authored
86
87 #endif
Something went wrong with that request. Please try again.