1 #include <xf86drm.h>
2 #include <xf86drmMode.h>
4 #include <kms++/kms++.h>
5 #include "helpers.h"
7 using namespace std;
9 namespace kms
10 {
12 unique_ptr<Blob> Videomode::to_blob(Card& card) const
13 {
14 drmModeModeInfo drm_mode = video_mode_to_drm_mode(*this);
16 return unique_ptr<Blob>(new Blob(card, &drm_mode, sizeof(drm_mode)));
17 }
19 bool Videomode::interlace() const
20 {
21 return flags & DRM_MODE_FLAG_INTERLACE;
22 }
24 float Videomode::calculated_vrefresh() const
25 {
26 return (clock * 1000.0) / (htotal * vtotal) * (interlace() ? 2 : 1);
27 }
29 }