private unsafe static ModeCrtc *GetCrtc(int fd, ModeEncoder *encoder) { ModeCrtc *crtc = (ModeCrtc *)Drm.ModeGetCrtc(fd, encoder->crtc_id); if (crtc != null) { Debug.Print("[KMS] CRTC {0} found for encoder {1}", encoder->crtc_id, encoder->encoder_id); } else { Debug.Print("[KMS] Failed to find crtc {0} for encoder {1}", encoder->crtc_id, encoder->encoder_id); } return(crtc); }
private unsafe static bool QueryDisplay(int fd, ModeConnector *c, out LinuxDisplay display) { display = null; // Find corresponding encoder ModeEncoder *encoder = GetEncoder(fd, c); if (encoder == null) { return(false); } ModeCrtc *crtc = GetCrtc(fd, encoder); if (crtc == null) { return(false); } display = new LinuxDisplay(fd, (IntPtr)c, (IntPtr)encoder, (IntPtr)crtc); return(true); }