Commit 08c4d7fc authored by Tvrtko Ursulin's avatar Tvrtko Ursulin

drm/i915: Introduce enableddisabled helper

Similar to existing yesno and onoff and use it throughout the code.
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1479385814-2358-2-git-send-email-tvrtko.ursulin@linux.intel.com
parent a74f8375
...@@ -1762,8 +1762,7 @@ static int i915_sr_status(struct seq_file *m, void *unused) ...@@ -1762,8 +1762,7 @@ static int i915_sr_status(struct seq_file *m, void *unused)
intel_display_power_put(dev_priv, POWER_DOMAIN_INIT); intel_display_power_put(dev_priv, POWER_DOMAIN_INIT);
intel_runtime_pm_put(dev_priv); intel_runtime_pm_put(dev_priv);
seq_printf(m, "self-refresh: %s\n", seq_printf(m, "self-refresh: %s\n", enableddisabled(sr_enabled));
sr_enabled ? "enabled" : "disabled");
return 0; return 0;
} }
......
...@@ -129,6 +129,11 @@ static inline const char *onoff(bool v) ...@@ -129,6 +129,11 @@ static inline const char *onoff(bool v)
return v ? "on" : "off"; return v ? "on" : "off";
} }
static inline const char *enableddisabled(bool v)
{
return v ? "enabled" : "disabled";
}
enum pipe { enum pipe {
INVALID_PIPE = -1, INVALID_PIPE = -1,
PIPE_A = 0, PIPE_A = 0,
......
...@@ -12783,7 +12783,7 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc, ...@@ -12783,7 +12783,7 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x, %s\n", DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x, %s\n",
pipe_config->pch_pfit.pos, pipe_config->pch_pfit.pos,
pipe_config->pch_pfit.size, pipe_config->pch_pfit.size,
pipe_config->pch_pfit.enabled ? "enabled" : "disabled"); enableddisabled(pipe_config->pch_pfit.enabled));
DRM_DEBUG_KMS("ips: %i, double wide: %i\n", DRM_DEBUG_KMS("ips: %i, double wide: %i\n",
pipe_config->ips_enabled, pipe_config->double_wide); pipe_config->ips_enabled, pipe_config->double_wide);
...@@ -16837,7 +16837,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) ...@@ -16837,7 +16837,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
DRM_DEBUG_KMS("[CRTC:%d:%s] hw state readout: %s\n", DRM_DEBUG_KMS("[CRTC:%d:%s] hw state readout: %s\n",
crtc->base.base.id, crtc->base.name, crtc->base.base.id, crtc->base.name,
crtc->active ? "enabled" : "disabled"); enableddisabled(crtc->active));
} }
for (i = 0; i < dev_priv->num_shared_dpll; i++) { for (i = 0; i < dev_priv->num_shared_dpll; i++) {
...@@ -16870,9 +16870,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) ...@@ -16870,9 +16870,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
} }
DRM_DEBUG_KMS("[ENCODER:%d:%s] hw state readout: %s, pipe %c\n", DRM_DEBUG_KMS("[ENCODER:%d:%s] hw state readout: %s, pipe %c\n",
encoder->base.base.id, encoder->base.base.id, encoder->base.name,
encoder->base.name, enableddisabled(encoder->base.crtc),
encoder->base.crtc ? "enabled" : "disabled",
pipe_name(pipe)); pipe_name(pipe));
} }
...@@ -16901,9 +16900,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev) ...@@ -16901,9 +16900,8 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
connector->base.encoder = NULL; connector->base.encoder = NULL;
} }
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] hw state readout: %s\n", DRM_DEBUG_KMS("[CONNECTOR:%d:%s] hw state readout: %s\n",
connector->base.base.id, connector->base.base.id, connector->base.name,
connector->base.name, enableddisabled(connector->base.encoder));
connector->base.encoder ? "enabled" : "disabled");
} }
for_each_intel_crtc(dev, crtc) { for_each_intel_crtc(dev, crtc) {
......
...@@ -774,9 +774,8 @@ struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id) ...@@ -774,9 +774,8 @@ struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id)
8); 8);
intel_dsi->clk_hs_to_lp_count += extra_byte_count; intel_dsi->clk_hs_to_lp_count += extra_byte_count;
DRM_DEBUG_KMS("Eot %s\n", intel_dsi->eotp_pkt ? "enabled" : "disabled"); DRM_DEBUG_KMS("Eot %s\n", enableddisabled(intel_dsi->eotp_pkt));
DRM_DEBUG_KMS("Clockstop %s\n", intel_dsi->clock_stop ? DRM_DEBUG_KMS("Clockstop %s\n", enableddisabled(!intel_dsi->clock_stop));
"disabled" : "enabled");
DRM_DEBUG_KMS("Mode %s\n", intel_dsi->operation_mode ? "command" : "video"); DRM_DEBUG_KMS("Mode %s\n", intel_dsi->operation_mode ? "command" : "video");
if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK) if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK)
DRM_DEBUG_KMS("Dual link: DSI_DUAL_LINK_FRONT_BACK\n"); DRM_DEBUG_KMS("Dual link: DSI_DUAL_LINK_FRONT_BACK\n");
...@@ -795,8 +794,7 @@ struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id) ...@@ -795,8 +794,7 @@ struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id)
DRM_DEBUG_KMS("LP to HS Clock Count 0x%x\n", intel_dsi->clk_lp_to_hs_count); DRM_DEBUG_KMS("LP to HS Clock Count 0x%x\n", intel_dsi->clk_lp_to_hs_count);
DRM_DEBUG_KMS("HS to LP Clock Count 0x%x\n", intel_dsi->clk_hs_to_lp_count); DRM_DEBUG_KMS("HS to LP Clock Count 0x%x\n", intel_dsi->clk_hs_to_lp_count);
DRM_DEBUG_KMS("BTA %s\n", DRM_DEBUG_KMS("BTA %s\n",
intel_dsi->video_frmt_cfg_bits & DISABLE_VIDEO_BTA ? enableddisabled(!(intel_dsi->video_frmt_cfg_bits & DISABLE_VIDEO_BTA)));
"disabled" : "enabled");
/* delays in VBT are in unit of 100us, so need to convert /* delays in VBT are in unit of 100us, so need to convert
* here in ms * here in ms
......
...@@ -1722,7 +1722,7 @@ int intel_panel_setup_backlight(struct drm_connector *connector, enum pipe pipe) ...@@ -1722,7 +1722,7 @@ int intel_panel_setup_backlight(struct drm_connector *connector, enum pipe pipe)
DRM_DEBUG_KMS("Connector %s backlight initialized, %s, brightness %u/%u\n", DRM_DEBUG_KMS("Connector %s backlight initialized, %s, brightness %u/%u\n",
connector->name, connector->name,
panel->backlight.enabled ? "enabled" : "disabled", enableddisabled(panel->backlight.enabled),
panel->backlight.level, panel->backlight.max); panel->backlight.level, panel->backlight.max);
return 0; return 0;
......
...@@ -347,8 +347,7 @@ void intel_set_memory_cxsr(struct drm_i915_private *dev_priv, bool enable) ...@@ -347,8 +347,7 @@ void intel_set_memory_cxsr(struct drm_i915_private *dev_priv, bool enable)
return; return;
} }
DRM_DEBUG_KMS("memory self-refresh is %s\n", DRM_DEBUG_KMS("memory self-refresh is %s\n", enableddisabled(enable));
enable ? "enabled" : "disabled");
} }
......
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