2 * Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Axel Dörfler, axeld@pinc-software.de
10 #include "accelerant.h"
11 #include "intel_extreme.h"
18 //#define TRACE_MEMORY
20 # define TRACE(x...) _sPrintf("intel_extreme accelerant:" x)
25 #define ERROR(x...) _sPrintf("intel_extreme accelerant: " x)
26 #define CALLED(x...) TRACE("CALLED %s\n", __PRETTY_FUNCTION__)
30 intel_free_memory(addr_t base
)
35 intel_free_graphics_memory freeMemory
;
36 freeMemory
.magic
= INTEL_PRIVATE_DATA_MAGIC
;
37 freeMemory
.buffer_base
= base
;
39 ioctl(gInfo
->device
, INTEL_FREE_GRAPHICS_MEMORY
, &freeMemory
,
45 intel_allocate_memory(size_t size
, uint32 flags
, addr_t
&base
)
47 intel_allocate_graphics_memory allocMemory
;
48 allocMemory
.magic
= INTEL_PRIVATE_DATA_MAGIC
;
49 allocMemory
.size
= size
;
50 allocMemory
.alignment
= 0;
51 allocMemory
.flags
= flags
;
53 if (ioctl(gInfo
->device
, INTEL_ALLOCATE_GRAPHICS_MEMORY
, &allocMemory
,
54 sizeof(allocMemory
)) < 0)
57 base
= allocMemory
.buffer_base
;