Back to index

libdrm  2.4.37
radeon_cs_int.h
Go to the documentation of this file.
00001 
00002 #ifndef _RADEON_CS_INT_H_
00003 #define _RADEON_CS_INT_H_
00004 
00005 struct radeon_cs_space_check {
00006     struct radeon_bo_int *bo;
00007     uint32_t read_domains;
00008     uint32_t write_domain;
00009     uint32_t new_accounted;
00010 };
00011 
00012 struct radeon_cs_int {
00013     /* keep first two in same place */
00014     uint32_t                    *packets;    
00015     unsigned                    cdw;
00016     unsigned                    ndw;
00017     unsigned                    section_ndw;
00018     unsigned                    section_cdw;
00019     /* private members */
00020     struct radeon_cs_manager    *csm;
00021     void                        *relocs;
00022     unsigned                    crelocs;
00023     unsigned                    relocs_total_size;
00024     const char                  *section_file;
00025     const char                  *section_func;
00026     int                         section_line;
00027     struct radeon_cs_space_check bos[MAX_SPACE_BOS];
00028     int                         bo_count;
00029     void                        (*space_flush_fn)(void *);
00030     void                        *space_flush_data;
00031     uint32_t                    id;
00032 };
00033 
00034 /* cs functions */
00035 struct radeon_cs_funcs {
00036     struct radeon_cs_int *(*cs_create)(struct radeon_cs_manager *csm,
00037                                    uint32_t ndw);
00038     int (*cs_write_reloc)(struct radeon_cs_int *cs,
00039                           struct radeon_bo *bo,
00040                           uint32_t read_domain,
00041                           uint32_t write_domain,
00042                           uint32_t flags);
00043     int (*cs_begin)(struct radeon_cs_int *cs,
00044                     uint32_t ndw,
00045                   const char *file,
00046                   const char *func,
00047                   int line);
00048     int (*cs_end)(struct radeon_cs_int *cs,
00049                 const char *file, const char *func,
00050                 int line);
00051 
00052 
00053     int (*cs_emit)(struct radeon_cs_int *cs);
00054     int (*cs_destroy)(struct radeon_cs_int *cs);
00055     int (*cs_erase)(struct radeon_cs_int *cs);
00056     int (*cs_need_flush)(struct radeon_cs_int *cs);
00057     void (*cs_print)(struct radeon_cs_int *cs, FILE *file);
00058 };
00059 
00060 struct radeon_cs_manager {
00061     struct radeon_cs_funcs  *funcs;
00062     int                     fd;
00063     int32_t vram_limit, gart_limit;
00064     int32_t vram_write_used, gart_write_used;
00065     int32_t read_used;
00066 };
00067 #endif