1 #ifndef __DEV_H_INCLUDED__ 2 #define __DEV_H_INCLUDED__ 3 4 #include <stdint.h> 5 #include <xf86drmMode.h> 6 7 struct sp_bo; 8 struct sp_dev; 9 10 struct sp_plane { 11 struct sp_dev* dev; 12 drmModePlanePtr plane; 13 struct sp_bo* bo; 14 int in_use; 15 uint32_t format; 16 17 /* Property ID's */ 18 uint32_t crtc_pid; 19 uint32_t fb_pid; 20 uint32_t zpos_pid; 21 uint32_t crtc_x_pid; 22 uint32_t crtc_y_pid; 23 uint32_t crtc_w_pid; 24 uint32_t crtc_h_pid; 25 uint32_t src_x_pid; 26 uint32_t src_y_pid; 27 uint32_t src_w_pid; 28 uint32_t src_h_pid; 29 }; 30 31 struct sp_crtc { 32 drmModeCrtcPtr crtc; 33 int pipe; 34 int num_planes; 35 struct sp_bo* scanout; 36 }; 37 38 struct sp_dev { 39 int fd; 40 41 int num_connectors; 42 drmModeConnectorPtr* connectors; 43 44 int num_encoders; 45 drmModeEncoderPtr* encoders; 46 47 int num_crtcs; 48 struct sp_crtc* crtcs; 49 50 int num_planes; 51 struct sp_plane* planes; 52 }; 53 54 int is_supported_format(struct sp_plane* plane, uint32_t format); 55 struct sp_dev* create_sp_dev(void); 56 void destroy_sp_dev(struct sp_dev* dev); 57 58 #endif /* __DEV_H_INCLUDED__ */ 59