Commit f79a568a authored by Lucas De Marchi's avatar Lucas De Marchi

drm/i915: Use str_on_off()

Remove the local onoff() implementation and adopt the
str_on_off() from linux/string_helpers.h.
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220225234631.3725943-4-lucas.demarchi@intel.com
parent ff9fbe7c
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* DisplayPort support for G4x,ILK,SNB,IVB,VLV,CHV (HSW+ handled by the DDI code). * DisplayPort support for G4x,ILK,SNB,IVB,VLV,CHV (HSW+ handled by the DDI code).
*/ */
#include <linux/string_helpers.h>
#include "g4x_dp.h" #include "g4x_dp.h"
#include "intel_audio.h" #include "intel_audio.h"
#include "intel_backlight.h" #include "intel_backlight.h"
...@@ -192,7 +194,7 @@ static void assert_dp_port(struct intel_dp *intel_dp, bool state) ...@@ -192,7 +194,7 @@ static void assert_dp_port(struct intel_dp *intel_dp, bool state)
I915_STATE_WARN(cur_state != state, I915_STATE_WARN(cur_state != state,
"[ENCODER:%d:%s] state assertion failure (expected %s, current %s)\n", "[ENCODER:%d:%s] state assertion failure (expected %s, current %s)\n",
dig_port->base.base.base.id, dig_port->base.base.name, dig_port->base.base.base.id, dig_port->base.base.name,
onoff(state), onoff(cur_state)); str_on_off(state), str_on_off(cur_state));
} }
#define assert_dp_port_disabled(d) assert_dp_port((d), false) #define assert_dp_port_disabled(d) assert_dp_port((d), false)
...@@ -202,7 +204,7 @@ static void assert_edp_pll(struct drm_i915_private *dev_priv, bool state) ...@@ -202,7 +204,7 @@ static void assert_edp_pll(struct drm_i915_private *dev_priv, bool state)
I915_STATE_WARN(cur_state != state, I915_STATE_WARN(cur_state != state,
"eDP PLL state assertion failure (expected %s, current %s)\n", "eDP PLL state assertion failure (expected %s, current %s)\n",
onoff(state), onoff(cur_state)); str_on_off(state), str_on_off(cur_state));
} }
#define assert_edp_pll_enabled(d) assert_edp_pll((d), true) #define assert_edp_pll_enabled(d) assert_edp_pll((d), true)
#define assert_edp_pll_disabled(d) assert_edp_pll((d), false) #define assert_edp_pll_disabled(d) assert_edp_pll((d), false)
......
...@@ -401,7 +401,7 @@ static void wait_for_pipe_scanline_moving(struct intel_crtc *crtc, bool state) ...@@ -401,7 +401,7 @@ static void wait_for_pipe_scanline_moving(struct intel_crtc *crtc, bool state)
if (wait_for(pipe_scanline_is_moving(dev_priv, pipe) == state, 100)) if (wait_for(pipe_scanline_is_moving(dev_priv, pipe) == state, 100))
drm_err(&dev_priv->drm, drm_err(&dev_priv->drm,
"pipe %c scanline %s wait timed out\n", "pipe %c scanline %s wait timed out\n",
pipe_name(pipe), onoff(state)); pipe_name(pipe), str_on_off(state));
} }
static void intel_wait_for_pipe_scanline_stopped(struct intel_crtc *crtc) static void intel_wait_for_pipe_scanline_stopped(struct intel_crtc *crtc)
...@@ -457,7 +457,7 @@ void assert_transcoder(struct drm_i915_private *dev_priv, ...@@ -457,7 +457,7 @@ void assert_transcoder(struct drm_i915_private *dev_priv,
I915_STATE_WARN(cur_state != state, I915_STATE_WARN(cur_state != state,
"transcoder %s assertion failure (expected %s, current %s)\n", "transcoder %s assertion failure (expected %s, current %s)\n",
transcoder_name(cpu_transcoder), transcoder_name(cpu_transcoder),
onoff(state), onoff(cur_state)); str_on_off(state), str_on_off(cur_state));
} }
static void assert_plane(struct intel_plane *plane, bool state) static void assert_plane(struct intel_plane *plane, bool state)
...@@ -469,7 +469,8 @@ static void assert_plane(struct intel_plane *plane, bool state) ...@@ -469,7 +469,8 @@ static void assert_plane(struct intel_plane *plane, bool state)
I915_STATE_WARN(cur_state != state, I915_STATE_WARN(cur_state != state,
"%s assertion failure (expected %s, current %s)\n", "%s assertion failure (expected %s, current %s)\n",
plane->base.name, onoff(state), onoff(cur_state)); plane->base.name, str_on_off(state),
str_on_off(cur_state));
} }
#define assert_plane_enabled(p) assert_plane(p, true) #define assert_plane_enabled(p) assert_plane(p, true)
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#if !defined(__INTEL_DISPLAY_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ) #if !defined(__INTEL_DISPLAY_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ)
#define __INTEL_DISPLAY_TRACE_H__ #define __INTEL_DISPLAY_TRACE_H__
#include <linux/string_helpers.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
...@@ -161,7 +162,7 @@ TRACE_EVENT(intel_memory_cxsr, ...@@ -161,7 +162,7 @@ TRACE_EVENT(intel_memory_cxsr,
), ),
TP_printk("%s->%s, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u", TP_printk("%s->%s, pipe A: frame=%u, scanline=%u, pipe B: frame=%u, scanline=%u, pipe C: frame=%u, scanline=%u",
onoff(__entry->old), onoff(__entry->new), str_on_off(__entry->old), str_on_off(__entry->new),
__entry->frame[PIPE_A], __entry->scanline[PIPE_A], __entry->frame[PIPE_A], __entry->scanline[PIPE_A],
__entry->frame[PIPE_B], __entry->scanline[PIPE_B], __entry->frame[PIPE_B], __entry->scanline[PIPE_B],
__entry->frame[PIPE_C], __entry->scanline[PIPE_C]) __entry->frame[PIPE_C], __entry->scanline[PIPE_C])
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string_helpers.h>
#include "intel_crtc.h" #include "intel_crtc.h"
#include "intel_de.h" #include "intel_de.h"
...@@ -1945,7 +1946,7 @@ static void assert_pll(struct drm_i915_private *dev_priv, ...@@ -1945,7 +1946,7 @@ static void assert_pll(struct drm_i915_private *dev_priv,
cur_state = intel_de_read(dev_priv, DPLL(pipe)) & DPLL_VCO_ENABLE; cur_state = intel_de_read(dev_priv, DPLL(pipe)) & DPLL_VCO_ENABLE;
I915_STATE_WARN(cur_state != state, I915_STATE_WARN(cur_state != state,
"PLL state assertion failure (expected %s, current %s)\n", "PLL state assertion failure (expected %s, current %s)\n",
onoff(state), onoff(cur_state)); str_on_off(state), str_on_off(cur_state));
} }
void assert_pll_enabled(struct drm_i915_private *i915, enum pipe pipe) void assert_pll_enabled(struct drm_i915_private *i915, enum pipe pipe)
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
* DEALINGS IN THE SOFTWARE. * DEALINGS IN THE SOFTWARE.
*/ */
#include <linux/string_helpers.h>
#include "intel_de.h" #include "intel_de.h"
#include "intel_display_types.h" #include "intel_display_types.h"
#include "intel_dpio_phy.h" #include "intel_dpio_phy.h"
...@@ -178,13 +180,14 @@ void assert_shared_dpll(struct drm_i915_private *dev_priv, ...@@ -178,13 +180,14 @@ void assert_shared_dpll(struct drm_i915_private *dev_priv,
struct intel_dpll_hw_state hw_state; struct intel_dpll_hw_state hw_state;
if (drm_WARN(&dev_priv->drm, !pll, if (drm_WARN(&dev_priv->drm, !pll,
"asserting DPLL %s with no DPLL\n", onoff(state))) "asserting DPLL %s with no DPLL\n", str_on_off(state)))
return; return;
cur_state = intel_dpll_get_hw_state(dev_priv, pll, &hw_state); cur_state = intel_dpll_get_hw_state(dev_priv, pll, &hw_state);
I915_STATE_WARN(cur_state != state, I915_STATE_WARN(cur_state != state,
"%s assertion failure (expected %s, current %s)\n", "%s assertion failure (expected %s, current %s)\n",
pll->info->name, onoff(state), onoff(cur_state)); pll->info->name, str_on_off(state),
str_on_off(cur_state));
} }
static enum tc_port icl_pll_id_to_tc_port(enum intel_dpll_id id) static enum tc_port icl_pll_id_to_tc_port(enum intel_dpll_id id)
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
* Copyright © 2020 Intel Corporation * Copyright © 2020 Intel Corporation
*/ */
#include <linux/string_helpers.h>
#include "intel_atomic.h" #include "intel_atomic.h"
#include "intel_crtc.h" #include "intel_crtc.h"
#include "intel_ddi.h" #include "intel_ddi.h"
...@@ -34,7 +36,7 @@ static void assert_fdi_tx(struct drm_i915_private *dev_priv, ...@@ -34,7 +36,7 @@ static void assert_fdi_tx(struct drm_i915_private *dev_priv,
} }
I915_STATE_WARN(cur_state != state, I915_STATE_WARN(cur_state != state,
"FDI TX state assertion failure (expected %s, current %s)\n", "FDI TX state assertion failure (expected %s, current %s)\n",
onoff(state), onoff(cur_state)); str_on_off(state), str_on_off(cur_state));
} }
void assert_fdi_tx_enabled(struct drm_i915_private *i915, enum pipe pipe) void assert_fdi_tx_enabled(struct drm_i915_private *i915, enum pipe pipe)
...@@ -55,7 +57,7 @@ static void assert_fdi_rx(struct drm_i915_private *dev_priv, ...@@ -55,7 +57,7 @@ static void assert_fdi_rx(struct drm_i915_private *dev_priv,
cur_state = intel_de_read(dev_priv, FDI_RX_CTL(pipe)) & FDI_RX_ENABLE; cur_state = intel_de_read(dev_priv, FDI_RX_CTL(pipe)) & FDI_RX_ENABLE;
I915_STATE_WARN(cur_state != state, I915_STATE_WARN(cur_state != state,
"FDI RX state assertion failure (expected %s, current %s)\n", "FDI RX state assertion failure (expected %s, current %s)\n",
onoff(state), onoff(cur_state)); str_on_off(state), str_on_off(cur_state));
} }
void assert_fdi_rx_enabled(struct drm_i915_private *i915, enum pipe pipe) void assert_fdi_rx_enabled(struct drm_i915_private *i915, enum pipe pipe)
...@@ -93,7 +95,7 @@ static void assert_fdi_rx_pll(struct drm_i915_private *i915, ...@@ -93,7 +95,7 @@ static void assert_fdi_rx_pll(struct drm_i915_private *i915,
cur_state = intel_de_read(i915, FDI_RX_CTL(pipe)) & FDI_RX_PLL_ENABLE; cur_state = intel_de_read(i915, FDI_RX_CTL(pipe)) & FDI_RX_PLL_ENABLE;
I915_STATE_WARN(cur_state != state, I915_STATE_WARN(cur_state != state,
"FDI RX PLL assertion failure (expected %s, current %s)\n", "FDI RX PLL assertion failure (expected %s, current %s)\n",
onoff(state), onoff(cur_state)); str_on_off(state), str_on_off(cur_state));
} }
void assert_fdi_rx_pll_enabled(struct drm_i915_private *i915, enum pipe pipe) void assert_fdi_rx_pll_enabled(struct drm_i915_private *i915, enum pipe pipe)
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string_helpers.h>
#include "i915_drv.h" #include "i915_drv.h"
#include "intel_de.h" #include "intel_de.h"
...@@ -581,7 +582,7 @@ static void assert_dsi_pll(struct drm_i915_private *i915, bool state) ...@@ -581,7 +582,7 @@ static void assert_dsi_pll(struct drm_i915_private *i915, bool state)
I915_STATE_WARN(cur_state != state, I915_STATE_WARN(cur_state != state,
"DSI PLL state assertion failure (expected %s, current %s)\n", "DSI PLL state assertion failure (expected %s, current %s)\n",
onoff(state), onoff(cur_state)); str_on_off(state), str_on_off(cur_state));
} }
void assert_dsi_pll_enabled(struct drm_i915_private *i915) void assert_dsi_pll_enabled(struct drm_i915_private *i915)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
*/ */
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/string_helpers.h>
#include "i915_drv.h" #include "i915_drv.h"
#include "i915_reg.h" #include "i915_reg.h"
...@@ -430,8 +431,8 @@ static bool bxt_check_bios_rc6_setup(struct intel_rc6 *rc6) ...@@ -430,8 +431,8 @@ static bool bxt_check_bios_rc6_setup(struct intel_rc6 *rc6)
rc_sw_target >>= RC_SW_TARGET_STATE_SHIFT; rc_sw_target >>= RC_SW_TARGET_STATE_SHIFT;
drm_dbg(&i915->drm, "BIOS enabled RC states: " drm_dbg(&i915->drm, "BIOS enabled RC states: "
"HW_CTRL %s HW_RC6 %s SW_TARGET_STATE %x\n", "HW_CTRL %s HW_RC6 %s SW_TARGET_STATE %x\n",
onoff(rc_ctl & GEN6_RC_CTL_HW_ENABLE), str_on_off(rc_ctl & GEN6_RC_CTL_HW_ENABLE),
onoff(rc_ctl & GEN6_RC_CTL_RC6_ENABLE), str_on_off(rc_ctl & GEN6_RC_CTL_RC6_ENABLE),
rc_sw_target); rc_sw_target);
if (!(intel_uncore_read(uncore, RC6_LOCATION) & RC6_CTX_IN_DRAM)) { if (!(intel_uncore_read(uncore, RC6_LOCATION) & RC6_CTX_IN_DRAM)) {
......
...@@ -400,11 +400,6 @@ wait_remaining_ms_from_jiffies(unsigned long timestamp_jiffies, int to_wait_ms) ...@@ -400,11 +400,6 @@ wait_remaining_ms_from_jiffies(unsigned long timestamp_jiffies, int to_wait_ms)
#define MBps(x) KBps(1000 * (x)) #define MBps(x) KBps(1000 * (x))
#define GBps(x) ((u64)1000 * MBps((x))) #define GBps(x) ((u64)1000 * MBps((x)))
static inline const char *onoff(bool v)
{
return v ? "on" : "off";
}
void add_taint_for_CI(struct drm_i915_private *i915, unsigned int taint); void add_taint_for_CI(struct drm_i915_private *i915, unsigned int taint);
static inline void __add_taint_for_CI(unsigned int taint) static inline void __add_taint_for_CI(unsigned int taint)
{ {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* Copyright © 2020 Intel Corporation * Copyright © 2020 Intel Corporation
*/ */
#include <linux/string_helpers.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <drm/drm_print.h> #include <drm/drm_print.h>
...@@ -375,7 +376,7 @@ static void vlv_wait_for_gt_wells(struct drm_i915_private *dev_priv, ...@@ -375,7 +376,7 @@ static void vlv_wait_for_gt_wells(struct drm_i915_private *dev_priv,
if (vlv_wait_for_pw_status(dev_priv, mask, val)) if (vlv_wait_for_pw_status(dev_priv, mask, val))
drm_dbg(&dev_priv->drm, drm_dbg(&dev_priv->drm,
"timeout waiting for GT wells to go %s\n", "timeout waiting for GT wells to go %s\n",
onoff(wait_for_on)); str_on_off(wait_for_on));
} }
static void vlv_check_no_gt_access(struct drm_i915_private *i915) static void vlv_check_no_gt_access(struct drm_i915_private *i915)
......
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