OSDN Git Service

Merge "drm_hwcomposer: Dump active composition plane/crtc/dimension info" into mnc...
[android-x86/external-drm_hwcomposer.git] / drmmode.cpp
index dce9803..abd3b32 100644 (file)
@@ -36,7 +36,6 @@ DrmMode::DrmMode(drmModeModeInfoPtr m)
       v_sync_end_(m->vsync_end),
       v_total_(m->vtotal),
       v_scan_(m->vscan),
-      v_refresh_(m->vrefresh),
       flags_(m->flags),
       type_(m->type),
       name_(m->name) {
@@ -55,7 +54,6 @@ DrmMode::DrmMode()
       v_sync_end_(0),
       v_total_(0),
       v_scan_(0),
-      v_refresh_(0),
       flags_(0),
       type_(0),
       name_("") {
@@ -70,7 +68,7 @@ bool DrmMode::operator==(const drmModeModeInfo &m) const {
          h_total_ == m.htotal && h_skew_ == m.hskew &&
          v_display_ == m.vdisplay && v_sync_start_ == m.vsync_start &&
          v_sync_end_ == m.vsync_end && v_total_ == m.vtotal &&
-         v_scan_ == m.vscan && v_refresh_ == m.vrefresh && flags_ == m.flags &&
+         v_scan_ == m.vscan && flags_ == m.flags &&
          type_ == m.type;
 }
 
@@ -86,7 +84,6 @@ void DrmMode::ToDrmModeModeInfo(drm_mode_modeinfo *m) const {
   m->vsync_end = v_sync_end_;
   m->vtotal = v_total_;
   m->vscan = v_scan_;
-  m->vrefresh = v_refresh_;
   m->flags = flags_;
   m->type = type_;
   strncpy(m->name, name_.c_str(), DRM_DISPLAY_MODE_LEN);
@@ -144,8 +141,8 @@ uint32_t DrmMode::v_scan() const {
   return v_scan_;
 }
 
-uint32_t DrmMode::v_refresh() const {
-  return v_refresh_;
+float DrmMode::v_refresh() const {
+  return clock_ / (float)(v_total_ * h_total_) * 1000.0f;
 }
 
 uint32_t DrmMode::flags() const {