Back to index

libdrm  2.4.37
radeon_cs.c
Go to the documentation of this file.
00001 
00002 #include <stdio.h>
00003 #include "radeon_cs.h"
00004 #include "radeon_cs_int.h"
00005 
00006 struct radeon_cs *radeon_cs_create(struct radeon_cs_manager *csm, uint32_t ndw)
00007 {
00008     struct radeon_cs_int *csi = csm->funcs->cs_create(csm, ndw);
00009     return (struct radeon_cs *)csi;
00010 }
00011 
00012 int radeon_cs_write_reloc(struct radeon_cs *cs,
00013                           struct radeon_bo *bo,
00014                           uint32_t read_domain,
00015                           uint32_t write_domain,
00016                           uint32_t flags)
00017 {
00018     struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
00019 
00020     return csi->csm->funcs->cs_write_reloc(csi,
00021                                            bo,
00022                                            read_domain,
00023                                            write_domain,
00024                                            flags);
00025 }
00026 
00027 int radeon_cs_begin(struct radeon_cs *cs,
00028                     uint32_t ndw,
00029                     const char *file,
00030                     const char *func,
00031                     int line)
00032 {
00033     struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
00034     return csi->csm->funcs->cs_begin(csi, ndw, file, func, line);
00035 }
00036 
00037 int radeon_cs_end(struct radeon_cs *cs,
00038                   const char *file,
00039                   const char *func,
00040                   int line)
00041 {
00042     struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
00043     return csi->csm->funcs->cs_end(csi, file, func, line);
00044 }
00045 
00046 int radeon_cs_emit(struct radeon_cs *cs)
00047 {
00048     struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
00049     return csi->csm->funcs->cs_emit(csi);
00050 }
00051 
00052 int radeon_cs_destroy(struct radeon_cs *cs)
00053 {
00054     struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
00055     return csi->csm->funcs->cs_destroy(csi);
00056 }
00057 
00058 int radeon_cs_erase(struct radeon_cs *cs)
00059 {
00060     struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
00061     return csi->csm->funcs->cs_erase(csi);
00062 }
00063 
00064 int radeon_cs_need_flush(struct radeon_cs *cs)
00065 {
00066     struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
00067     return csi->csm->funcs->cs_need_flush(csi);
00068 }
00069 
00070 void radeon_cs_print(struct radeon_cs *cs, FILE *file)
00071 {
00072     struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
00073     csi->csm->funcs->cs_print(csi, file);
00074 }
00075 
00076 void radeon_cs_set_limit(struct radeon_cs *cs, uint32_t domain, uint32_t limit)
00077 {
00078     struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
00079     if (domain == RADEON_GEM_DOMAIN_VRAM)
00080         csi->csm->vram_limit = limit;
00081     else
00082         csi->csm->gart_limit = limit;
00083 }
00084 
00085 void radeon_cs_space_set_flush(struct radeon_cs *cs, void (*fn)(void *), void *data)
00086 {
00087     struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
00088     csi->space_flush_fn = fn;
00089     csi->space_flush_data = data;
00090 }
00091 
00092 uint32_t radeon_cs_get_id(struct radeon_cs *cs)
00093 {
00094     struct radeon_cs_int *csi = (struct radeon_cs_int *)cs;
00095     return csi->id;
00096 }