Commit e81d4aaa authored by djkurtz@chromium.org's avatar djkurtz@chromium.org

SyncControlVSyncProvider: throttle messages when MSC=0

Most X DRI2 drivers return TRUE for GetSyncValues with a MSC value of 0
if they cannot deduce on which CRTC the Drawable is being displayed, or
that CRTC is currently disabled.

This can happen if the associated CRTC is powered off, or if its
framebuffer is being rotated, etc.  Once the driver is in this situation,
all MSC == 0 values will be returned until the CRTC can be found again.

Currently, we spam the log every time we receive msc==0, which fills up
the disk, makes the GPU log unusable, and causes lots of confusion when
devs are trying to debug other issues.  Instead, let's just log exactly
once every time this situation is detected.
Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>

BUG=231945
TEST=Manual on chromeos:
  # Enable some slowly updating page on each monitor, for example:
    http://www.24webclock.com/
  tail -F /var/log/chrome/chrome | grep glXGetSyncValuesOML &
  set_short_timeouts
  # Let the displays turn off (~35 seconds)
  => This message should be printed exactly once per attached display:
 glXGetSyncValuesOML should not return TRUE with a media stream counter of 0.
  # Turn displays back on (tap a key), and let them idle off again.
  => The same message should be printed exactly once per attached display.
R=marcheu@chromium.org
R=piman@chromium.org
R=backer@chromium.org

Review URL: https://codereview.chromium.org/126823006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243548 0039d316-1c4b-4281-b951-d872f2087c98
parent 65ebb75f
...@@ -24,7 +24,7 @@ const double kRelativeIntervalDifferenceThreshold = 0.05; ...@@ -24,7 +24,7 @@ const double kRelativeIntervalDifferenceThreshold = 0.05;
namespace gfx { namespace gfx {
SyncControlVSyncProvider::SyncControlVSyncProvider() SyncControlVSyncProvider::SyncControlVSyncProvider()
: VSyncProvider(), last_media_stream_counter_(0) { : VSyncProvider(), last_media_stream_counter_(0), invalid_msc_(false) {
// On platforms where we can't get an accurate reading on the refresh // On platforms where we can't get an accurate reading on the refresh
// rate we fall back to the assumption that we're displaying 60 frames // rate we fall back to the assumption that we're displaying 60 frames
// per second. // per second.
...@@ -54,9 +54,11 @@ void SyncControlVSyncProvider::GetVSyncParameters( ...@@ -54,9 +54,11 @@ void SyncControlVSyncProvider::GetVSyncParameters(
// Both Intel and Mali drivers will return TRUE for GetSyncValues // Both Intel and Mali drivers will return TRUE for GetSyncValues
// but a value of 0 for MSC if they cannot access the CRTC data structure // but a value of 0 for MSC if they cannot access the CRTC data structure
// associated with the surface. crbug.com/231945 // associated with the surface. crbug.com/231945
if (media_stream_counter == 0) { bool prev_invalid_msc = invalid_msc_;
LOG(ERROR) << "glXGetSyncValuesOML should not return TRUE with a " invalid_msc_ = (media_stream_counter == 0);
<< "media stream counter of 0."; if (invalid_msc_) {
LOG_IF(ERROR, !prev_invalid_msc) << "glXGetSyncValuesOML "
"should not return TRUE with a media stream counter of 0.";
return; return;
} }
......
...@@ -31,6 +31,7 @@ class SyncControlVSyncProvider : public VSyncProvider { ...@@ -31,6 +31,7 @@ class SyncControlVSyncProvider : public VSyncProvider {
base::TimeTicks last_timebase_; base::TimeTicks last_timebase_;
uint64 last_media_stream_counter_; uint64 last_media_stream_counter_;
base::TimeDelta last_good_interval_; base::TimeDelta last_good_interval_;
bool invalid_msc_;
// A short history of the last few computed intervals. // A short history of the last few computed intervals.
// We use this to filter out the noise in the computation resulting // We use this to filter out the noise in the computation resulting
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment