aboutsummaryrefslogtreecommitdiffstats
path: root/radeon
diff options
context:
space:
mode:
Diffstat (limited to 'radeon')
-rw-r--r--radeon/Makefile.am1
-rw-r--r--radeon/radeon_bo.c46
-rw-r--r--radeon/radeon_bo_gem.c24
-rw-r--r--radeon/radeon_cs.c50
-rw-r--r--radeon/radeon_cs_gem.c8
-rw-r--r--radeon/radeon_cs_space.c18
-rw-r--r--radeon/radeon_surface.c20
7 files changed, 98 insertions, 69 deletions
diff --git a/radeon/Makefile.am b/radeon/Makefile.am
index a8cd1003..c9695739 100644
--- a/radeon/Makefile.am
+++ b/radeon/Makefile.am
@@ -24,6 +24,7 @@
24 24
25AM_CFLAGS = \ 25AM_CFLAGS = \
26 $(WARN_CFLAGS) \ 26 $(WARN_CFLAGS) \
27 $(VISIBILITY_CFLAGS) \
27 -I$(top_srcdir) \ 28 -I$(top_srcdir) \
28 -I$(top_srcdir)/radeon \ 29 -I$(top_srcdir)/radeon \
29 $(PTHREADSTUBS_CFLAGS) \ 30 $(PTHREADSTUBS_CFLAGS) \
diff --git a/radeon/radeon_bo.c b/radeon/radeon_bo.c
index 6a0f8e79..865e3f7e 100644
--- a/radeon/radeon_bo.c
+++ b/radeon/radeon_bo.c
@@ -29,10 +29,14 @@
29 * Dave Airlie 29 * Dave Airlie
30 * Jérôme Glisse <glisse@freedesktop.org> 30 * Jérôme Glisse <glisse@freedesktop.org>
31 */ 31 */
32#ifdef HAVE_CONFIG_H
33#include <config.h>
34#endif
35#include <libdrm.h>
32#include <radeon_bo.h> 36#include <radeon_bo.h>
33#include <radeon_bo_int.h> 37#include <radeon_bo_int.h>
34 38
35void radeon_bo_debug(struct radeon_bo *bo, const char *op) 39drm_public void radeon_bo_debug(struct radeon_bo *bo, const char *op)
36{ 40{
37 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 41 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
38 42
@@ -40,26 +44,23 @@ void radeon_bo_debug(struct radeon_bo *bo, const char *op)
40 op, bo, bo->handle, boi->size, boi->cref); 44 op, bo, bo->handle, boi->size, boi->cref);
41} 45}
42 46
43struct radeon_bo *radeon_bo_open(struct radeon_bo_manager *bom, 47drm_public struct radeon_bo *
44 uint32_t handle, 48radeon_bo_open(struct radeon_bo_manager *bom, uint32_t handle, uint32_t size,
45 uint32_t size, 49 uint32_t alignment, uint32_t domains, uint32_t flags)
46 uint32_t alignment,
47 uint32_t domains,
48 uint32_t flags)
49{ 50{
50 struct radeon_bo *bo; 51 struct radeon_bo *bo;
51 bo = bom->funcs->bo_open(bom, handle, size, alignment, domains, flags); 52 bo = bom->funcs->bo_open(bom, handle, size, alignment, domains, flags);
52 return bo; 53 return bo;
53} 54}
54 55
55void radeon_bo_ref(struct radeon_bo *bo) 56drm_public void radeon_bo_ref(struct radeon_bo *bo)
56{ 57{
57 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 58 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
58 boi->cref++; 59 boi->cref++;
59 boi->bom->funcs->bo_ref(boi); 60 boi->bom->funcs->bo_ref(boi);
60} 61}
61 62
62struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo) 63drm_public struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo)
63{ 64{
64 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 65 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
65 if (bo == NULL) 66 if (bo == NULL)
@@ -69,19 +70,19 @@ struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo)
69 return boi->bom->funcs->bo_unref(boi); 70 return boi->bom->funcs->bo_unref(boi);
70} 71}
71 72
72int radeon_bo_map(struct radeon_bo *bo, int write) 73drm_public int radeon_bo_map(struct radeon_bo *bo, int write)
73{ 74{
74 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 75 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
75 return boi->bom->funcs->bo_map(boi, write); 76 return boi->bom->funcs->bo_map(boi, write);
76} 77}
77 78
78int radeon_bo_unmap(struct radeon_bo *bo) 79drm_public int radeon_bo_unmap(struct radeon_bo *bo)
79{ 80{
80 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 81 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
81 return boi->bom->funcs->bo_unmap(boi); 82 return boi->bom->funcs->bo_unmap(boi);
82} 83}
83 84
84int radeon_bo_wait(struct radeon_bo *bo) 85drm_public int radeon_bo_wait(struct radeon_bo *bo)
85{ 86{
86 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 87 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
87 if (!boi->bom->funcs->bo_wait) 88 if (!boi->bom->funcs->bo_wait)
@@ -89,27 +90,29 @@ int radeon_bo_wait(struct radeon_bo *bo)
89 return boi->bom->funcs->bo_wait(boi); 90 return boi->bom->funcs->bo_wait(boi);
90} 91}
91 92
92int radeon_bo_is_busy(struct radeon_bo *bo, uint32_t *domain) 93drm_public int radeon_bo_is_busy(struct radeon_bo *bo, uint32_t *domain)
93{ 94{
94 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 95 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
95 return boi->bom->funcs->bo_is_busy(boi, domain); 96 return boi->bom->funcs->bo_is_busy(boi, domain);
96} 97}
97 98
98int radeon_bo_set_tiling(struct radeon_bo *bo, 99drm_public int
99 uint32_t tiling_flags, uint32_t pitch) 100radeon_bo_set_tiling(struct radeon_bo *bo,
101 uint32_t tiling_flags, uint32_t pitch)
100{ 102{
101 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 103 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
102 return boi->bom->funcs->bo_set_tiling(boi, tiling_flags, pitch); 104 return boi->bom->funcs->bo_set_tiling(boi, tiling_flags, pitch);
103} 105}
104 106
105int radeon_bo_get_tiling(struct radeon_bo *bo, 107drm_public int
106 uint32_t *tiling_flags, uint32_t *pitch) 108radeon_bo_get_tiling(struct radeon_bo *bo,
109 uint32_t *tiling_flags, uint32_t *pitch)
107{ 110{
108 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 111 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
109 return boi->bom->funcs->bo_get_tiling(boi, tiling_flags, pitch); 112 return boi->bom->funcs->bo_get_tiling(boi, tiling_flags, pitch);
110} 113}
111 114
112int radeon_bo_is_static(struct radeon_bo *bo) 115drm_public int radeon_bo_is_static(struct radeon_bo *bo)
113{ 116{
114 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 117 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
115 if (boi->bom->funcs->bo_is_static) 118 if (boi->bom->funcs->bo_is_static)
@@ -117,18 +120,19 @@ int radeon_bo_is_static(struct radeon_bo *bo)
117 return 0; 120 return 0;
118} 121}
119 122
120int radeon_bo_is_referenced_by_cs(struct radeon_bo *bo, struct radeon_cs *cs) 123drm_public int
124radeon_bo_is_referenced_by_cs(struct radeon_bo *bo, struct radeon_cs *cs)
121{ 125{
122 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 126 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
123 return boi->cref > 1; 127 return boi->cref > 1;
124} 128}
125 129
126uint32_t radeon_bo_get_handle(struct radeon_bo *bo) 130drm_public uint32_t radeon_bo_get_handle(struct radeon_bo *bo)
127{ 131{
128 return bo->handle; 132 return bo->handle;
129} 133}
130 134
131uint32_t radeon_bo_get_src_domain(struct radeon_bo *bo) 135drm_public uint32_t radeon_bo_get_src_domain(struct radeon_bo *bo)
132{ 136{
133 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 137 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
134 uint32_t src_domain; 138 uint32_t src_domain;
diff --git a/radeon/radeon_bo_gem.c b/radeon/radeon_bo_gem.c
index 4ea405ff..251ec1b5 100644
--- a/radeon/radeon_bo_gem.c
+++ b/radeon/radeon_bo_gem.c
@@ -38,6 +38,7 @@
38#include <string.h> 38#include <string.h>
39#include <sys/mman.h> 39#include <sys/mman.h>
40#include <errno.h> 40#include <errno.h>
41#include "libdrm.h"
41#include "xf86drm.h" 42#include "xf86drm.h"
42#include "xf86atomic.h" 43#include "xf86atomic.h"
43#include "drm.h" 44#include "drm.h"
@@ -283,7 +284,7 @@ static struct radeon_bo_funcs bo_gem_funcs = {
283 bo_is_busy, 284 bo_is_busy,
284}; 285};
285 286
286struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd) 287drm_public struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd)
287{ 288{
288 struct bo_manager_gem *bomg; 289 struct bo_manager_gem *bomg;
289 290
@@ -296,7 +297,7 @@ struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd)
296 return (struct radeon_bo_manager*)bomg; 297 return (struct radeon_bo_manager*)bomg;
297} 298}
298 299
299void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom) 300drm_public void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom)
300{ 301{
301 struct bo_manager_gem *bomg = (struct bo_manager_gem*)bom; 302 struct bo_manager_gem *bomg = (struct bo_manager_gem*)bom;
302 303
@@ -306,19 +307,22 @@ void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom)
306 free(bomg); 307 free(bomg);
307} 308}
308 309
309uint32_t radeon_gem_name_bo(struct radeon_bo *bo) 310drm_public uint32_t
311radeon_gem_name_bo(struct radeon_bo *bo)
310{ 312{
311 struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; 313 struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo;
312 return bo_gem->name; 314 return bo_gem->name;
313} 315}
314 316
315void *radeon_gem_get_reloc_in_cs(struct radeon_bo *bo) 317drm_public void *
318radeon_gem_get_reloc_in_cs(struct radeon_bo *bo)
316{ 319{
317 struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; 320 struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo;
318 return &bo_gem->reloc_in_cs; 321 return &bo_gem->reloc_in_cs;
319} 322}
320 323
321int radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name) 324drm_public int
325radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name)
322{ 326{
323 struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; 327 struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo;
324 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 328 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
@@ -339,7 +343,8 @@ int radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name)
339 return 0; 343 return 0;
340} 344}
341 345
342int radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain) 346drm_public int
347radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain)
343{ 348{
344 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 349 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
345 struct drm_radeon_gem_set_domain args; 350 struct drm_radeon_gem_set_domain args;
@@ -356,7 +361,7 @@ int radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t
356 return r; 361 return r;
357} 362}
358 363
359int radeon_gem_prime_share_bo(struct radeon_bo *bo, int *handle) 364drm_public int radeon_gem_prime_share_bo(struct radeon_bo *bo, int *handle)
360{ 365{
361 struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo; 366 struct radeon_bo_gem *bo_gem = (struct radeon_bo_gem*)bo;
362 int ret; 367 int ret;
@@ -365,9 +370,8 @@ int radeon_gem_prime_share_bo(struct radeon_bo *bo, int *handle)
365 return ret; 370 return ret;
366} 371}
367 372
368struct radeon_bo *radeon_gem_bo_open_prime(struct radeon_bo_manager *bom, 373drm_public struct radeon_bo *
369 int fd_handle, 374radeon_gem_bo_open_prime(struct radeon_bo_manager *bom, int fd_handle, uint32_t size)
370 uint32_t size)
371{ 375{
372 struct radeon_bo_gem *bo; 376 struct radeon_bo_gem *bo;
373 int r; 377 int r;
diff --git a/radeon/radeon_cs.c b/radeon/radeon_cs.c
index d0e922be..fe5bbcec 100644
--- a/radeon/radeon_cs.c
+++ b/radeon/radeon_cs.c
@@ -1,19 +1,22 @@
1 1#ifdef HAVE_CONFIG_H
2#include <config.h>
3#endif
4#include "libdrm.h"
2#include <stdio.h> 5#include <stdio.h>
3#include "radeon_cs.h" 6#include "radeon_cs.h"
4#include "radeon_cs_int.h" 7#include "radeon_cs_int.h"
5 8
6struct radeon_cs *radeon_cs_create(struct radeon_cs_manager *csm, uint32_t ndw) 9drm_public struct radeon_cs *
10radeon_cs_create(struct radeon_cs_manager *csm, uint32_t ndw)
7{ 11{
8 struct radeon_cs_int *csi = csm->funcs->cs_create(csm, ndw); 12 struct radeon_cs_int *csi = csm->funcs->cs_create(csm, ndw);
9 return (struct radeon_cs *)csi; 13 return (struct radeon_cs *)csi;
10} 14}
11 15
12int radeon_cs_write_reloc(struct radeon_cs *cs, 16drm_public int
13 struct radeon_bo *bo, 17radeon_cs_write_reloc(struct radeon_cs *cs, struct radeon_bo *bo,
14 uint32_t read_domain, 18 uint32_t read_domain, uint32_t write_domain,
15 uint32_t write_domain, 19 uint32_t flags)
16 uint32_t flags)
17{ 20{
18 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 21 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
19 22
@@ -24,56 +27,54 @@ int radeon_cs_write_reloc(struct radeon_cs *cs,
24 flags); 27 flags);
25} 28}
26 29
27int radeon_cs_begin(struct radeon_cs *cs, 30drm_public int
28 uint32_t ndw, 31radeon_cs_begin(struct radeon_cs *cs, uint32_t ndw,
29 const char *file, 32 const char *file, const char *func, int line)
30 const char *func,
31 int line)
32{ 33{
33 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 34 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
34 return csi->csm->funcs->cs_begin(csi, ndw, file, func, line); 35 return csi->csm->funcs->cs_begin(csi, ndw, file, func, line);
35} 36}
36 37
37int radeon_cs_end(struct radeon_cs *cs, 38drm_public int
38 const char *file, 39radeon_cs_end(struct radeon_cs *cs,
39 const char *func, 40 const char *file, const char *func, int line)
40 int line)
41{ 41{
42 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 42 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
43 return csi->csm->funcs->cs_end(csi, file, func, line); 43 return csi->csm->funcs->cs_end(csi, file, func, line);
44} 44}
45 45
46int radeon_cs_emit(struct radeon_cs *cs) 46drm_public int radeon_cs_emit(struct radeon_cs *cs)
47{ 47{
48 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 48 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
49 return csi->csm->funcs->cs_emit(csi); 49 return csi->csm->funcs->cs_emit(csi);
50} 50}
51 51
52int radeon_cs_destroy(struct radeon_cs *cs) 52drm_public int radeon_cs_destroy(struct radeon_cs *cs)
53{ 53{
54 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 54 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
55 return csi->csm->funcs->cs_destroy(csi); 55 return csi->csm->funcs->cs_destroy(csi);
56} 56}
57 57
58int radeon_cs_erase(struct radeon_cs *cs) 58drm_public int radeon_cs_erase(struct radeon_cs *cs)
59{ 59{
60 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 60 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
61 return csi->csm->funcs->cs_erase(csi); 61 return csi->csm->funcs->cs_erase(csi);
62} 62}
63 63
64int radeon_cs_need_flush(struct radeon_cs *cs) 64drm_public int radeon_cs_need_flush(struct radeon_cs *cs)
65{ 65{
66 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 66 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
67 return csi->csm->funcs->cs_need_flush(csi); 67 return csi->csm->funcs->cs_need_flush(csi);
68} 68}
69 69
70void radeon_cs_print(struct radeon_cs *cs, FILE *file) 70drm_public void radeon_cs_print(struct radeon_cs *cs, FILE *file)
71{ 71{
72 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 72 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
73 csi->csm->funcs->cs_print(csi, file); 73 csi->csm->funcs->cs_print(csi, file);
74} 74}
75 75
76void radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit) 76drm_public void
77radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit)
77{ 78{
78 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 79 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
79 if (domain == RADEON_GEM_DOMAIN_VRAM) 80 if (domain == RADEON_GEM_DOMAIN_VRAM)
@@ -82,14 +83,15 @@ void radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit)
82 csi->csm->gart_limit = limit; 83 csi->csm->gart_limit = limit;
83} 84}
84 85
85void radeon_cs_space_set_flush(struct radeon_cs *cs, void (*fn)(void *), void *data) 86drm_public void radeon_cs_space_set_flush(struct radeon_cs *cs,
87 void (*fn)(void *), void *data)
86{ 88{
87 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 89 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
88 csi->space_flush_fn = fn; 90 csi->space_flush_fn = fn;
89 csi->space_flush_data = data; 91 csi->space_flush_data = data;
90} 92}
91 93
92uint32_t radeon_cs_get_id(struct radeon_cs *cs) 94drm_public uint32_t radeon_cs_get_id(struct radeon_cs *cs)
93{ 95{
94 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 96 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
95 return csi->id; 97 return csi->id;
diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c
index b87c6b13..2020e1ae 100644
--- a/radeon/radeon_cs_gem.c
+++ b/radeon/radeon_cs_gem.c
@@ -29,6 +29,9 @@
29 * Nicolai Haehnle <prefect_@gmx.net> 29 * Nicolai Haehnle <prefect_@gmx.net>
30 * Jérôme Glisse <glisse@freedesktop.org> 30 * Jérôme Glisse <glisse@freedesktop.org>
31 */ 31 */
32#ifdef HAVE_CONFIG_H
33#include "config.h"
34#endif
32#include <assert.h> 35#include <assert.h>
33#include <errno.h> 36#include <errno.h>
34#include <stdlib.h> 37#include <stdlib.h>
@@ -42,6 +45,7 @@
42#include "radeon_cs_gem.h" 45#include "radeon_cs_gem.h"
43#include "radeon_bo_gem.h" 46#include "radeon_bo_gem.h"
44#include "drm.h" 47#include "drm.h"
48#include "libdrm.h"
45#include "xf86drm.h" 49#include "xf86drm.h"
46#include "xf86atomic.h" 50#include "xf86atomic.h"
47#include "radeon_drm.h" 51#include "radeon_drm.h"
@@ -533,7 +537,7 @@ static int radeon_get_device_id(int fd, uint32_t *device_id)
533 return r; 537 return r;
534} 538}
535 539
536struct radeon_cs_manager *radeon_cs_manager_gem_ctor(int fd) 540drm_public struct radeon_cs_manager *radeon_cs_manager_gem_ctor(int fd)
537{ 541{
538 struct radeon_cs_manager_gem *csm; 542 struct radeon_cs_manager_gem *csm;
539 543
@@ -547,7 +551,7 @@ struct radeon_cs_manager *radeon_cs_manager_gem_ctor(int fd)
547 return &csm->base; 551 return &csm->base;
548} 552}
549 553
550void radeon_cs_manager_gem_dtor(struct radeon_cs_manager *csm) 554drm_public void radeon_cs_manager_gem_dtor(struct radeon_cs_manager *csm)
551{ 555{
552 free(csm); 556 free(csm);
553} 557}
diff --git a/radeon/radeon_cs_space.c b/radeon/radeon_cs_space.c
index be047a7b..cca650bf 100644
--- a/radeon/radeon_cs_space.c
+++ b/radeon/radeon_cs_space.c
@@ -25,9 +25,13 @@
25 */ 25 */
26/* 26/*
27 */ 27 */
28#ifdef HAVE_CONFIG_H
29#include <config.h>
30#endif
28#include <assert.h> 31#include <assert.h>
29#include <errno.h> 32#include <errno.h>
30#include <stdlib.h> 33#include <stdlib.h>
34#include "libdrm.h"
31#include "radeon_cs.h" 35#include "radeon_cs.h"
32#include "radeon_bo_int.h" 36#include "radeon_bo_int.h"
33#include "radeon_cs_int.h" 37#include "radeon_cs_int.h"
@@ -161,7 +165,9 @@ static int radeon_cs_do_space_check(struct radeon_cs_int *cs, struct radeon_cs_s
161 return RADEON_CS_SPACE_OK; 165 return RADEON_CS_SPACE_OK;
162} 166}
163 167
164void radeon_cs_space_add_persistent_bo(struct radeon_cs *cs, struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain) 168drm_public void
169radeon_cs_space_add_persistent_bo(struct radeon_cs *cs, struct radeon_bo *bo,
170 uint32_t read_domains, uint32_t write_domain)
165{ 171{
166 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 172 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
167 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 173 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
@@ -203,9 +209,9 @@ again:
203 return 0; 209 return 0;
204} 210}
205 211
206int radeon_cs_space_check_with_bo(struct radeon_cs *cs, 212drm_public int
207 struct radeon_bo *bo, 213radeon_cs_space_check_with_bo(struct radeon_cs *cs, struct radeon_bo *bo,
208 uint32_t read_domains, uint32_t write_domain) 214 uint32_t read_domains, uint32_t write_domain)
209{ 215{
210 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 216 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
211 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo; 217 struct radeon_bo_int *boi = (struct radeon_bo_int *)bo;
@@ -224,13 +230,13 @@ int radeon_cs_space_check_with_bo(struct radeon_cs *cs,
224 return ret; 230 return ret;
225} 231}
226 232
227int radeon_cs_space_check(struct radeon_cs *cs) 233drm_public int radeon_cs_space_check(struct radeon_cs *cs)
228{ 234{
229 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 235 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
230 return radeon_cs_check_space_internal(csi, NULL); 236 return radeon_cs_check_space_internal(csi, NULL);
231} 237}
232 238
233void radeon_cs_space_reset_bos(struct radeon_cs *cs) 239drm_public void radeon_cs_space_reset_bos(struct radeon_cs *cs)
234{ 240{
235 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs; 241 struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
236 int i; 242 int i;
diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
index 8a1fe7df..e056ed42 100644
--- a/radeon/radeon_surface.c
+++ b/radeon/radeon_surface.c
@@ -26,6 +26,9 @@
26 * Authors: 26 * Authors:
27 * Jérôme Glisse <jglisse@redhat.com> 27 * Jérôme Glisse <jglisse@redhat.com>
28 */ 28 */
29#ifdef HAVE_CONFIG_H
30#include <config.h>
31#endif
29#include <stdbool.h> 32#include <stdbool.h>
30#include <assert.h> 33#include <assert.h>
31#include <errno.h> 34#include <errno.h>
@@ -35,6 +38,7 @@
35#include <sys/mman.h> 38#include <sys/mman.h>
36#include <sys/ioctl.h> 39#include <sys/ioctl.h>
37#include "drm.h" 40#include "drm.h"
41#include "libdrm.h"
38#include "xf86drm.h" 42#include "xf86drm.h"
39#include "radeon_drm.h" 43#include "radeon_drm.h"
40#include "radeon_surface.h" 44#include "radeon_surface.h"
@@ -2395,7 +2399,8 @@ static int cik_surface_best(struct radeon_surface_manager *surf_man,
2395/* =========================================================================== 2399/* ===========================================================================
2396 * public API 2400 * public API
2397 */ 2401 */
2398struct radeon_surface_manager *radeon_surface_manager_new(int fd) 2402drm_public struct radeon_surface_manager *
2403radeon_surface_manager_new(int fd)
2399{ 2404{
2400 struct radeon_surface_manager *surf_man; 2405 struct radeon_surface_manager *surf_man;
2401 2406
@@ -2443,7 +2448,8 @@ out_err:
2443 return NULL; 2448 return NULL;
2444} 2449}
2445 2450
2446void radeon_surface_manager_free(struct radeon_surface_manager *surf_man) 2451drm_public void
2452radeon_surface_manager_free(struct radeon_surface_manager *surf_man)
2447{ 2453{
2448 free(surf_man); 2454 free(surf_man);
2449} 2455}
@@ -2515,8 +2521,9 @@ static int radeon_surface_sanity(struct radeon_surface_manager *surf_man,
2515 return 0; 2521 return 0;
2516} 2522}
2517 2523
2518int radeon_surface_init(struct radeon_surface_manager *surf_man, 2524drm_public int
2519 struct radeon_surface *surf) 2525radeon_surface_init(struct radeon_surface_manager *surf_man,
2526 struct radeon_surface *surf)
2520{ 2527{
2521 unsigned mode, type; 2528 unsigned mode, type;
2522 int r; 2529 int r;
@@ -2531,8 +2538,9 @@ int radeon_surface_init(struct radeon_surface_manager *surf_man,
2531 return surf_man->surface_init(surf_man, surf); 2538 return surf_man->surface_init(surf_man, surf);
2532} 2539}
2533 2540
2534int radeon_surface_best(struct radeon_surface_manager *surf_man, 2541drm_public int
2535 struct radeon_surface *surf) 2542radeon_surface_best(struct radeon_surface_manager *surf_man,
2543 struct radeon_surface *surf)
2536{ 2544{
2537 unsigned mode, type; 2545 unsigned mode, type;
2538 int r; 2546 int r;