display.h 808 B

1234567891011121314151617181920212223242526
  1. #ifndef __DISPLAY_H__
  2. #define __DISPLAY_H__
  3. #include <stdint.h>
  4. typedef struct Display Display;
  5. Display *display_create(const char *drm_dev);
  6. void display_destroy(Display *disp);
  7. int display_init(Display *disp, int width, int height);
  8. int display_commit(Display *disp, int fd, int stride);
  9. /* Force the connector output color format used at the next first modeset.
  10. * 0=auto, 1=RGB, 2=YCbCr444, 3=YCbCr422, 4=YCbCr420. */
  11. int display_set_color_format(int fmt);
  12. int display_get_width(Display *disp);
  13. int display_get_height(Display *disp);
  14. /* Poll the DRM connector state. Returns 1 when the monitor is gone (signal
  15. * lost, e.g. an HDMI switch pointing elsewhere), 0 while connected, -1 on
  16. * error. Cheap (one GetConnector), safe to call each frame. */
  17. int display_signal_lost(Display *disp);
  18. #endif