diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-20 17:01:00 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-20 17:01:00 +0000 |
commit | 3735c232ae077e0e14d6884b014be95f12a06f4a (patch) | |
tree | 559477fd8d70673ba46253136b3a715dcf3ddf81 /chromeos/display | |
parent | 938347ece4d16876669c78acebd58d3053191ef5 (diff) | |
download | chromium_src-3735c232ae077e0e14d6884b014be95f12a06f4a.zip chromium_src-3735c232ae077e0e14d6884b014be95f12a06f4a.tar.gz chromium_src-3735c232ae077e0e14d6884b014be95f12a06f4a.tar.bz2 |
chromeos: Minor improvements to OutputConfigurator logging.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/15320004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/display')
-rw-r--r-- | chromeos/display/output_configurator.cc | 23 | ||||
-rw-r--r-- | chromeos/display/real_output_configurator_delegate.cc | 34 |
2 files changed, 39 insertions, 18 deletions
diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc index fab354e..44c4053 100644 --- a/chromeos/display/output_configurator.cc +++ b/chromeos/display/output_configurator.cc @@ -39,6 +39,24 @@ std::string DisplayPowerStateToString(DisplayPowerState state) { } } +// Returns a string describing |state|. +std::string OutputStateToString(OutputState state) { + switch (state) { + case STATE_INVALID: + return "INVALID"; + case STATE_HEADLESS: + return "HEADLESS"; + case STATE_SINGLE: + return "SINGLE"; + case STATE_DUAL_MIRROR: + return "DUAL_MIRROR"; + case STATE_DUAL_EXTENDED: + return "DUAL_EXTENDED"; + } + NOTREACHED() << "Unknown state " << state; + return "INVALID"; +} + // Returns the number of outputs in |outputs| that should be turned on, per // |state|. If |output_power| is non-NULL, it is updated to contain the // on/off state of each corresponding entry in |outputs|. @@ -232,6 +250,7 @@ bool OutputConfigurator::SetDisplayMode(OutputState new_state) { if (!configure_display_) return false; + VLOG(1) << "SetDisplayMode: state=" << OutputStateToString(new_state); if (output_state_ == new_state) return true; @@ -347,8 +366,8 @@ bool OutputConfigurator::EnterState( const std::vector<OutputSnapshot>& outputs) { std::vector<bool> output_power; int num_on_outputs = GetOutputPower(outputs, power_state, &output_power); - VLOG(1) << "EnterState: output=" << output_state - << ", power=" << power_state; + VLOG(1) << "EnterState: output=" << OutputStateToString(output_state) + << " power=" << DisplayPowerStateToString(power_state); switch (output_state) { case STATE_HEADLESS: if (outputs.size() != 0) { diff --git a/chromeos/display/real_output_configurator_delegate.cc b/chromeos/display/real_output_configurator_delegate.cc index a0bb007..30a8494 100644 --- a/chromeos/display/real_output_configurator_delegate.cc +++ b/chromeos/display/real_output_configurator_delegate.cc @@ -150,10 +150,10 @@ RealOutputConfiguratorDelegate::GetOutputs() { IsOutputAspectPreservingScaling(this_id); to_populate.touch_device_id = None; - VLOG(1) << "Found display #" << outputs.size() - << " with output " << to_populate.output - << " crtc " << to_populate.crtc - << " current mode " << to_populate.current_mode; + VLOG(2) << "Found display " << outputs.size() << ":" + << " output=" << to_populate.output + << " crtc=" << to_populate.crtc + << " current_mode=" << to_populate.current_mode; outputs.push_back(to_populate); } else { XRRFreeOutputInfo(output_info); @@ -235,12 +235,12 @@ bool RealOutputConfiguratorDelegate::GetModeDetails(RRMode mode, void RealOutputConfiguratorDelegate::ConfigureCrtc( OutputConfigurator::CrtcConfig* config) { - VLOG(1) << "ConfigureCrtc crtc: " << config->crtc - << ", mode " << config->mode - << ", output " << config->output - << ", x " << config->x - << ", y " << config->y; CHECK(screen_) << "Server not grabbed"; + VLOG(1) << "ConfigureCrtc: crtc=" << config->crtc + << " mode=" << config->mode + << " output=" << config->output + << " x=" << config->x + << " y=" << config->y; RROutput* outputs = NULL; int num_outputs = 0; @@ -268,8 +268,8 @@ void RealOutputConfiguratorDelegate::CreateFrameBuffer( CHECK(screen_) << "Server not grabbed"; int current_width = DisplayWidth(display_, DefaultScreen(display_)); int current_height = DisplayHeight(display_, DefaultScreen(display_)); - VLOG(1) << "CreateFrameBuffer " << width << " x " << height - << " (current=" << current_width << " x " << current_height << ")"; + VLOG(1) << "CreateFrameBuffer: new=" << width << "x" << height + << " current=" << current_width << "x" << current_height; if (width == current_width && height == current_height) return; @@ -282,10 +282,12 @@ void RealOutputConfiguratorDelegate::CreateFrameBuffer( void RealOutputConfiguratorDelegate::ConfigureCTM( int touch_device_id, const OutputConfigurator::CoordinateTransformation& ctm) { - int ndevices; + VLOG(1) << "ConfigureCTM: id=" << touch_device_id + << " scale=" << ctm.x_scale << "x" << ctm.y_scale + << " offset=(" << ctm.x_offset << ", " << ctm.y_offset << ")"; + int ndevices = 0; XIDeviceInfo* info = XIQueryDevice(display_, touch_device_id, &ndevices); - Atom prop = XInternAtom( - display_, "Coordinate Transformation Matrix", False); + Atom prop = XInternAtom(display_, "Coordinate Transformation Matrix", False); Atom float_atom = XInternAtom(display_, "FLOAT", False); if (ndevices == 1 && prop != None && float_atom != None) { Atom type; @@ -550,7 +552,7 @@ void RealOutputConfiguratorDelegate::GetTouchscreens( std::abs(native_mode_height - height) <= 1.0) { (*outputs)[k].touch_device_id = info[i].deviceid; - VLOG(1) << "Found touchscreen for output #" << k + VLOG(2) << "Found touchscreen for output #" << k << " id " << (*outputs)[k].touch_device_id << " width " << width << " height " << height; @@ -558,7 +560,7 @@ void RealOutputConfiguratorDelegate::GetTouchscreens( } } - VLOG_IF(1, k == outputs->size()) + VLOG_IF(2, k == outputs->size()) << "No matching output - ignoring touchscreen" << " id " << info[i].deviceid << " width " << width |