forked from Minki/linux
drm/i915: Use str_enabled_disabled()
Remove the local enableddisabled() implementation and adopt the str_enabled_disabled() from linux/string_helpers.h. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220225234631.3725943-3-lucas.demarchi@intel.com
This commit is contained in:
parent
707c3a7d99
commit
ff9fbe7ce1
@ -5,6 +5,7 @@
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/pwm.h>
|
||||
#include <linux/string_helpers.h>
|
||||
|
||||
#include "intel_backlight.h"
|
||||
#include "intel_connector.h"
|
||||
@ -1633,7 +1634,7 @@ int intel_backlight_setup(struct intel_connector *connector, enum pipe pipe)
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"Connector %s backlight initialized, %s, brightness %u/%u\n",
|
||||
connector->base.name,
|
||||
enableddisabled(panel->backlight.enabled),
|
||||
str_enabled_disabled(panel->backlight.enabled),
|
||||
panel->backlight.level, panel->backlight.max);
|
||||
|
||||
return 0;
|
||||
|
@ -2981,8 +2981,8 @@ static void intel_panel_sanitize_ssc(struct drm_i915_private *dev_priv)
|
||||
if (dev_priv->vbt.lvds_use_ssc != bios_lvds_use_ssc) {
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"SSC %s by BIOS, overriding VBT which says %s\n",
|
||||
enableddisabled(bios_lvds_use_ssc),
|
||||
enableddisabled(dev_priv->vbt.lvds_use_ssc));
|
||||
str_enabled_disabled(bios_lvds_use_ssc),
|
||||
str_enabled_disabled(dev_priv->vbt.lvds_use_ssc));
|
||||
dev_priv->vbt.lvds_use_ssc = bios_lvds_use_ssc;
|
||||
}
|
||||
}
|
||||
@ -5324,7 +5324,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,
|
||||
pipe_config->bigjoiner_pipes);
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm, "splitter: %s, link count %d, overlap %d\n",
|
||||
enableddisabled(pipe_config->splitter.enable),
|
||||
str_enabled_disabled(pipe_config->splitter.enable),
|
||||
pipe_config->splitter.link_count,
|
||||
pipe_config->splitter.pixel_overlap);
|
||||
|
||||
@ -5412,7 +5412,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"pch pfit: " DRM_RECT_FMT ", %s, force thru: %s\n",
|
||||
DRM_RECT_ARG(&pipe_config->pch_pfit.dst),
|
||||
enableddisabled(pipe_config->pch_pfit.enabled),
|
||||
str_enabled_disabled(pipe_config->pch_pfit.enabled),
|
||||
str_yes_no(pipe_config->pch_pfit.force_thru));
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm, "ips: %i, double wide: %i\n",
|
||||
@ -10068,7 +10068,7 @@ static void readout_plane_state(struct drm_i915_private *dev_priv)
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"[PLANE:%d:%s] hw state readout: %s, pipe %c\n",
|
||||
plane->base.base.id, plane->base.name,
|
||||
enableddisabled(visible), pipe_name(pipe));
|
||||
str_enabled_disabled(visible), pipe_name(pipe));
|
||||
}
|
||||
|
||||
for_each_intel_crtc(&dev_priv->drm, crtc) {
|
||||
@ -10114,7 +10114,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"[CRTC:%d:%s] hw state readout: %s\n",
|
||||
crtc->base.base.id, crtc->base.name,
|
||||
enableddisabled(crtc_state->hw.active));
|
||||
str_enabled_disabled(crtc_state->hw.active));
|
||||
}
|
||||
|
||||
cdclk_state->active_pipes = dbuf_state->active_pipes = active_pipes;
|
||||
@ -10158,7 +10158,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"[ENCODER:%d:%s] hw state readout: %s, pipe %c\n",
|
||||
encoder->base.base.id, encoder->base.name,
|
||||
enableddisabled(encoder->base.crtc),
|
||||
str_enabled_disabled(encoder->base.crtc),
|
||||
pipe_name(pipe));
|
||||
}
|
||||
|
||||
@ -10196,7 +10196,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
|
||||
drm_dbg_kms(&dev_priv->drm,
|
||||
"[CONNECTOR:%d:%s] hw state readout: %s\n",
|
||||
connector->base.base.id, connector->base.name,
|
||||
enableddisabled(connector->base.encoder));
|
||||
str_enabled_disabled(connector->base.encoder));
|
||||
}
|
||||
drm_connector_list_iter_end(&conn_iter);
|
||||
|
||||
|
@ -95,7 +95,7 @@ static int i915_sr_status(struct seq_file *m, void *unused)
|
||||
|
||||
intel_display_power_put(dev_priv, POWER_DOMAIN_INIT, wakeref);
|
||||
|
||||
seq_printf(m, "self-refresh: %s\n", enableddisabled(sr_enabled));
|
||||
seq_printf(m, "self-refresh: %s\n", str_enabled_disabled(sr_enabled));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -297,7 +297,7 @@ static int intel_psr_status(struct seq_file *m, struct intel_dp *intel_dp)
|
||||
enabled = val & EDP_PSR_ENABLE;
|
||||
}
|
||||
seq_printf(m, "Source PSR ctl: %s [0x%08x]\n",
|
||||
enableddisabled(enabled), val);
|
||||
str_enabled_disabled(enabled), val);
|
||||
psr_source_status(intel_dp, m);
|
||||
seq_printf(m, "Busy frontbuffer bits: 0x%08x\n",
|
||||
psr->busy_frontbuffer_bits);
|
||||
@ -344,7 +344,7 @@ static int intel_psr_status(struct seq_file *m, struct intel_dp *intel_dp)
|
||||
}
|
||||
|
||||
seq_printf(m, "PSR2 selective fetch: %s\n",
|
||||
enableddisabled(psr->psr2_sel_fetch_enabled));
|
||||
str_enabled_disabled(psr->psr2_sel_fetch_enabled));
|
||||
}
|
||||
|
||||
unlock:
|
||||
@ -1269,7 +1269,7 @@ static int i915_lpsp_status(struct seq_file *m, void *unused)
|
||||
return 0;
|
||||
}
|
||||
|
||||
seq_printf(m, "LPSP: %s\n", enableddisabled(lpsp_enabled));
|
||||
seq_printf(m, "LPSP: %s\n", str_enabled_disabled(lpsp_enabled));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
#include <linux/pinctrl/machine.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string_helpers.h>
|
||||
|
||||
#include <asm/unaligned.h>
|
||||
|
||||
@ -686,9 +687,9 @@ void intel_dsi_log_params(struct intel_dsi *intel_dsi)
|
||||
intel_dsi->burst_mode_ratio);
|
||||
drm_dbg_kms(&i915->drm, "Reset timer %d\n", intel_dsi->rst_timer_val);
|
||||
drm_dbg_kms(&i915->drm, "Eot %s\n",
|
||||
enableddisabled(intel_dsi->eotp_pkt));
|
||||
str_enabled_disabled(intel_dsi->eotp_pkt));
|
||||
drm_dbg_kms(&i915->drm, "Clockstop %s\n",
|
||||
enableddisabled(!intel_dsi->clock_stop));
|
||||
str_enabled_disabled(!intel_dsi->clock_stop));
|
||||
drm_dbg_kms(&i915->drm, "Mode %s\n",
|
||||
intel_dsi->operation_mode ? "command" : "video");
|
||||
if (intel_dsi->dual_link == DSI_DUAL_LINK_FRONT_BACK)
|
||||
@ -715,7 +716,7 @@ void intel_dsi_log_params(struct intel_dsi *intel_dsi)
|
||||
drm_dbg_kms(&i915->drm, "HS to LP Clock Count 0x%x\n",
|
||||
intel_dsi->clk_hs_to_lp_count);
|
||||
drm_dbg_kms(&i915->drm, "BTA %s\n",
|
||||
enableddisabled(!(intel_dsi->video_frmt_cfg_bits & DISABLE_VIDEO_BTA)));
|
||||
str_enabled_disabled(!(intel_dsi->video_frmt_cfg_bits & DISABLE_VIDEO_BTA)));
|
||||
}
|
||||
|
||||
bool intel_dsi_vbt_init(struct intel_dsi *intel_dsi, u16 panel_id)
|
||||
|
@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/string_helpers.h>
|
||||
#include <trace/events/dma_fence.h>
|
||||
#include <uapi/linux/sched/types.h>
|
||||
|
||||
@ -512,7 +513,7 @@ void intel_engine_print_breadcrumbs(struct intel_engine_cs *engine,
|
||||
if (!b)
|
||||
return;
|
||||
|
||||
drm_printf(p, "IRQ: %s\n", enableddisabled(b->irq_armed));
|
||||
drm_printf(p, "IRQ: %s\n", str_enabled_disabled(b->irq_armed));
|
||||
if (!list_empty(&b->signalers))
|
||||
print_signals(b, p);
|
||||
}
|
||||
|
@ -1633,7 +1633,7 @@ static void intel_engine_print_registers(struct intel_engine_cs *engine,
|
||||
|
||||
drm_printf(m, "\tExeclist tasklet queued? %s (%s), preempt? %s, timeslice? %s\n",
|
||||
str_yes_no(test_bit(TASKLET_STATE_SCHED, &engine->sched_engine->tasklet.state)),
|
||||
enableddisabled(!atomic_read(&engine->sched_engine->tasklet.count)),
|
||||
str_enabled_disabled(!atomic_read(&engine->sched_engine->tasklet.count)),
|
||||
repr_timer(&engine->execlists.preempt),
|
||||
repr_timer(&engine->execlists.timer));
|
||||
|
||||
|
@ -1203,7 +1203,7 @@ void intel_guc_ct_event_handler(struct intel_guc_ct *ct)
|
||||
void intel_guc_ct_print_info(struct intel_guc_ct *ct,
|
||||
struct drm_printer *p)
|
||||
{
|
||||
drm_printf(p, "CT %s\n", enableddisabled(ct->enabled));
|
||||
drm_printf(p, "CT %s\n", str_enabled_disabled(ct->enabled));
|
||||
|
||||
if (!ct->enabled)
|
||||
return;
|
||||
|
@ -477,7 +477,7 @@ int intel_guc_log_create(struct intel_guc_log *log)
|
||||
|
||||
log->level = __get_default_log_level(log);
|
||||
DRM_DEBUG_DRIVER("guc_log_level=%d (%s, verbose:%s, verbosity:%d)\n",
|
||||
log->level, enableddisabled(log->level),
|
||||
log->level, str_enabled_disabled(log->level),
|
||||
str_yes_no(GUC_LOG_LEVEL_IS_VERBOSE(log->level)),
|
||||
GUC_LOG_LEVEL_TO_VERBOSITY(log->level));
|
||||
|
||||
|
@ -66,7 +66,7 @@ static int __guc_rc_control(struct intel_guc *guc, bool enable)
|
||||
}
|
||||
|
||||
drm_info(>->i915->drm, "GuC RC: %s\n",
|
||||
enableddisabled(enable));
|
||||
str_enabled_disabled(enable));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -524,9 +524,9 @@ static int __uc_init_hw(struct intel_uc *uc)
|
||||
}
|
||||
|
||||
drm_info(&i915->drm, "GuC submission %s\n",
|
||||
enableddisabled(intel_uc_uses_guc_submission(uc)));
|
||||
str_enabled_disabled(intel_uc_uses_guc_submission(uc)));
|
||||
drm_info(&i915->drm, "GuC SLPC %s\n",
|
||||
enableddisabled(intel_uc_uses_guc_slpc(uc)));
|
||||
str_enabled_disabled(intel_uc_uses_guc_slpc(uc)));
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -491,7 +491,7 @@ static int i915_runtime_pm_status(struct seq_file *m, void *unused)
|
||||
seq_puts(m, "Runtime power management not supported\n");
|
||||
|
||||
seq_printf(m, "Runtime power status: %s\n",
|
||||
enableddisabled(!dev_priv->power_domains.init_wakeref));
|
||||
str_enabled_disabled(!dev_priv->power_domains.init_wakeref));
|
||||
|
||||
seq_printf(m, "GPU idle: %s\n", str_yes_no(!to_gt(dev_priv)->awake));
|
||||
seq_printf(m, "IRQs disabled: %s\n",
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/pnp.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string_helpers.h>
|
||||
#include <linux/vga_switcheroo.h>
|
||||
#include <linux/vt.h>
|
||||
|
||||
@ -752,7 +753,8 @@ static void i915_driver_unregister(struct drm_i915_private *dev_priv)
|
||||
void
|
||||
i915_print_iommu_status(struct drm_i915_private *i915, struct drm_printer *p)
|
||||
{
|
||||
drm_printf(p, "iommu: %s\n", enableddisabled(intel_vtd_active(i915)));
|
||||
drm_printf(p, "iommu: %s\n",
|
||||
str_enabled_disabled(intel_vtd_active(i915)));
|
||||
}
|
||||
|
||||
static void i915_welcome_messages(struct drm_i915_private *dev_priv)
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <linux/list.h>
|
||||
#include <linux/overflow.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/string_helpers.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/sched/clock.h>
|
||||
@ -404,11 +405,6 @@ static inline const char *onoff(bool v)
|
||||
return v ? "on" : "off";
|
||||
}
|
||||
|
||||
static inline const char *enableddisabled(bool v)
|
||||
{
|
||||
return v ? "enabled" : "disabled";
|
||||
}
|
||||
|
||||
void add_taint_for_CI(struct drm_i915_private *i915, unsigned int taint);
|
||||
static inline void __add_taint_for_CI(unsigned int taint)
|
||||
{
|
||||
|
@ -419,8 +419,8 @@ static bool _intel_set_memory_cxsr(struct drm_i915_private *dev_priv, bool enabl
|
||||
trace_intel_memory_cxsr(dev_priv, was_enabled, enable);
|
||||
|
||||
drm_dbg_kms(&dev_priv->drm, "memory self-refresh is %s (was %s)\n",
|
||||
enableddisabled(enable),
|
||||
enableddisabled(was_enabled));
|
||||
str_enabled_disabled(enable),
|
||||
str_enabled_disabled(was_enabled));
|
||||
|
||||
return was_enabled;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user