aboutsummaryrefslogtreecommitdiff
path: root/radeon/radeon_cs_int.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-12-17 14:11:55 +1000
committerDave Airlie <airlied@redhat.com>2009-12-21 08:05:16 +1000
commit125994ab30d4f0f126c62fa741ec62a52d69d7a8 (patch)
treee641a13ec8e32c2322ebe1f1480581d58ad815e8 /radeon/radeon_cs_int.h
parentf1660c249198b5cc14ebbb75107da7bcb6972033 (diff)
radeon: straighten out the API insanity.
as Michel pointed out we are exposing too much info for these object for this to be maintainable going forward. This patch set minimises the exposed parts of the radeon_bo and radeon_cs objects to the piece necessary for ddx/mesa to operate at a decent speed. The major problem is mesa contains a legacy BO/CS managers which we still need to expose functionality to, and we really cannot change the API until we can drop the non-KMS codepaths. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'radeon/radeon_cs_int.h')
-rw-r--r--radeon/radeon_cs_int.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/radeon/radeon_cs_int.h b/radeon/radeon_cs_int.h
new file mode 100644
index 00000000..8ba76bf9
--- /dev/null
+++ b/radeon/radeon_cs_int.h
@@ -0,0 +1,66 @@
+
+#ifndef _RADEON_CS_INT_H_
+#define _RADEON_CS_INT_H_
+
+struct radeon_cs_space_check {
+ struct radeon_bo_int *bo;
+ uint32_t read_domains;
+ uint32_t write_domain;
+ uint32_t new_accounted;
+};
+
+struct radeon_cs_int {
+ /* keep first two in same place */
+ uint32_t *packets;
+ unsigned cdw;
+ unsigned ndw;
+ unsigned section_ndw;
+ unsigned section_cdw;
+ /* private members */
+ struct radeon_cs_manager *csm;
+ void *relocs;
+ unsigned crelocs;
+ unsigned relocs_total_size;
+ const char *section_file;
+ const char *section_func;
+ int section_line;
+ struct radeon_cs_space_check bos[MAX_SPACE_BOS];
+ int bo_count;
+ void (*space_flush_fn)(void *);
+ void *space_flush_data;
+};
+
+/* cs functions */
+struct radeon_cs_funcs {
+ struct radeon_cs_int *(*cs_create)(struct radeon_cs_manager *csm,
+ uint32_t ndw);
+ int (*cs_write_reloc)(struct radeon_cs_int *cs,
+ struct radeon_bo *bo,
+ uint32_t read_domain,
+ uint32_t write_domain,
+ uint32_t flags);
+ int (*cs_begin)(struct radeon_cs_int *cs,
+ uint32_t ndw,
+ const char *file,
+ const char *func,
+ int line);
+ int (*cs_end)(struct radeon_cs_int *cs,
+ const char *file, const char *func,
+ int line);
+
+
+ int (*cs_emit)(struct radeon_cs_int *cs);
+ int (*cs_destroy)(struct radeon_cs_int *cs);
+ int (*cs_erase)(struct radeon_cs_int *cs);
+ int (*cs_need_flush)(struct radeon_cs_int *cs);
+ void (*cs_print)(struct radeon_cs_int *cs, FILE *file);
+};
+
+struct radeon_cs_manager {
+ struct radeon_cs_funcs *funcs;
+ int fd;
+ int32_t vram_limit, gart_limit;
+ int32_t vram_write_used, gart_write_used;
+ int32_t read_used;
+};
+#endif