hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef __BO_H_INCLUDED__
#define __BO_H_INCLUDED__
 
#include <stdint.h>
 
#undef USE_ATOMIC_API
struct sp_dev;
 
struct sp_bo {
  struct sp_dev* dev;
 
  uint32_t width;
  uint32_t height;
  uint32_t depth;
  uint32_t bpp;
  uint32_t format;
  uint32_t flags;
 
  uint32_t fb_id;
  uint32_t handle;
  void* map_addr;
  uint32_t pitch;
  uint32_t size;
};
 
int add_fb_sp_bo(struct sp_bo* bo, uint32_t format);
struct sp_bo* create_sp_bo(struct sp_dev* dev, uint32_t width, uint32_t height,
                           uint32_t depth, uint32_t bpp, uint32_t format, uint32_t flags);
 
void fill_bo(struct sp_bo* bo, uint8_t a, uint8_t r, uint8_t g, uint8_t b);
void draw_rect(struct sp_bo* bo, uint32_t x, uint32_t y, uint32_t width,
               uint32_t height, uint8_t a, uint8_t r, uint8_t g, uint8_t b);
 
void free_sp_bo(struct sp_bo* bo);
 
#endif /* __BO_H_INCLUDED__ */