Instead of always calculating the vrefresh from clock + resolution,
use vrefresh from the mode if its provided.
Bug:
25319209
Test: Tested on smaug, refresh reports 60Hz
Change-Id: I963ccb153d1856f5e45e4a1aa6fbd20b105d4a84
Signed-off-by: Sean Paul <seanpaul@chromium.org>
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) {
v_sync_end_(0),
v_total_(0),
v_scan_(0),
+ v_refresh_(0),
flags_(0),
type_(0),
name_("") {
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);
}
float DrmMode::v_refresh() const {
- return clock_ / (float)(v_total_ * h_total_) * 1000.0f;
+ return v_refresh_ ? v_refresh_ * 1.0f :
+ clock_ / (float)(v_total_ * h_total_) * 1000.0f;
}
uint32_t DrmMode::flags() const {
uint32_t v_sync_end_;
uint32_t v_total_;
uint32_t v_scan_;
+ uint32_t v_refresh_;
uint32_t flags_;
uint32_t type_;