rename the directory
[AROS.git] / workbench / devs / monitors / IntelGMA / aros_winsys.h
blob538a90a99d22086b526aa0d4d4c0817ae12e6cf5
1 /*
2 Copyright © 2011, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #ifndef INTEL_AROS_WINSYS_H
7 #define INTEL_AROS_WINSYS_H
9 #include <proto/alib.h>
10 #include <proto/exec.h>
11 #include <exec/types.h>
12 #include <exec/lists.h>
13 #include <exec/nodes.h>
15 #include "i915/i915_batchbuffer.h"
16 #include "hidd/gallium.h"
18 #define MAGIC 0x12345678
19 #define RELOC_MAGIC 0x87654321
20 #define MAGIC_WARNING(b) if(b->magic != MAGIC ){ bug("[GMA winsys] %s: Bad MAGIC in buffer %p\n",__func__,b);};
21 #define IF_BAD_MAGIC(b) MAGIC_WARNING(b);if(b->magic != MAGIC )
23 #define MAX_RELOCS 1024
25 struct aros_winsys
27 struct i915_winsys base;
28 struct pipe_screen *pscreen;
29 size_t max_batch_size;
32 static INLINE struct aros_winsys *
33 aros_winsys(struct i915_winsys *iws)
35 return (struct aros_winsys *)iws;
38 struct reloc
40 struct i915_winsys_buffer *buf;
41 enum i915_winsys_buffer_usage usage;
42 ULONG offset;
43 uint32_t *ptr;
46 struct aros_batchbuffer
48 struct i915_winsys_batchbuffer base;
49 size_t actual_size;
50 APTR allocated_map;
51 ULONG allocated_size;
52 struct reloc relocs[MAX_RELOCS];
53 APTR gfxmap;
56 static INLINE struct aros_batchbuffer *
57 aros_batchbuffer(struct i915_winsys_batchbuffer *batch)
59 return (struct aros_batchbuffer *)batch;
62 struct i915_winsys_buffer {
63 struct Node bnode;
64 ULONG magic;
65 APTR map;
66 ULONG size;
67 void *ptr;
68 ULONG stride;
69 APTR allocated_map;
70 ULONG allocated_size;
71 ULONG status_index;
72 ULONG flush_num;
75 struct aros_winsys *winsys_create();
76 boolean buffer_is_busy(struct i915_winsys *iws,struct i915_winsys_buffer *buf);
77 void destroy_unused_buffers();
78 #endif