]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: drop a bunch of superfluous inlines
authorJani Nikula <jani.nikula@intel.com>
Mon, 20 Apr 2020 14:04:38 +0000 (17:04 +0300)
committerJani Nikula <jani.nikula@intel.com>
Tue, 21 Apr 2020 06:31:37 +0000 (09:31 +0300)
Remove a number of inlines from .c files, and let the compiler decide
what's best. There's more to do, but need to start somewhere, and need
to start setting the example.

Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200420140438.14672-2-jani.nikula@intel.com
14 files changed:
drivers/gpu/drm/i915/display/icl_dsi.c
drivers/gpu/drm/i915/display/intel_ddi.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_display_power.c
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_dsb.c
drivers/gpu/drm/i915/display/intel_dsi_vbt.c
drivers/gpu/drm/i915/display/intel_gmbus.c
drivers/gpu/drm/i915/display/intel_hdcp.c
drivers/gpu/drm/i915/display/intel_hdmi.c
drivers/gpu/drm/i915/display/intel_panel.c
drivers/gpu/drm/i915/intel_pm.c
drivers/gpu/drm/i915/intel_sideband.c
drivers/gpu/drm/i915/intel_wopcm.c

index 99a25c0bb08f3a6d6543530ae31c4f6f58cf1e6f..a8d2daa214e61cd132335ad7676fd069285ecacd 100644 (file)
 #include "intel_panel.h"
 #include "intel_vdsc.h"
 
-static inline int header_credits_available(struct drm_i915_private *dev_priv,
-                                          enum transcoder dsi_trans)
+static int header_credits_available(struct drm_i915_private *dev_priv,
+                                   enum transcoder dsi_trans)
 {
        return (intel_de_read(dev_priv, DSI_CMD_TXCTL(dsi_trans)) & FREE_HEADER_CREDIT_MASK)
                >> FREE_HEADER_CREDIT_SHIFT;
 }
 
-static inline int payload_credits_available(struct drm_i915_private *dev_priv,
-                                           enum transcoder dsi_trans)
+static int payload_credits_available(struct drm_i915_private *dev_priv,
+                                    enum transcoder dsi_trans)
 {
        return (intel_de_read(dev_priv, DSI_CMD_TXCTL(dsi_trans)) & FREE_PLOAD_CREDIT_MASK)
                >> FREE_PLOAD_CREDIT_SHIFT;
index 74bc489e6dd68b4b2ab752dd0652e46b1a27afdb..e6e963f7fdf9323a304f11d60094ceb4a4e4e62f 100644 (file)
@@ -1908,7 +1908,7 @@ bool intel_ddi_get_hw_state(struct intel_encoder *encoder,
        return true;
 }
 
-static inline enum intel_display_power_domain
+static enum intel_display_power_domain
 intel_ddi_main_link_aux_domain(struct intel_digital_port *dig_port)
 {
        /* CNL+ HW requires corresponding AUX IOs to be powered up for PSR with
@@ -2693,9 +2693,8 @@ u32 ddi_signal_levels(struct intel_dp *intel_dp)
        return DDI_BUF_TRANS_SELECT(level);
 }
 
-static inline
-u32 icl_dpclka_cfgcr0_clk_off(struct drm_i915_private *dev_priv,
-                             enum phy phy)
+static u32 icl_dpclka_cfgcr0_clk_off(struct drm_i915_private *dev_priv,
+                                    enum phy phy)
 {
        if (intel_phy_is_combo(dev_priv, phy)) {
                return ICL_DPCLKA_CFGCR0_DDI_CLK_OFF(phy);
index 74449f67acc22bf23135e9f940d545132d7b5751..3cfedeaf084606071fc00105e7115ccf94dab13a 100644 (file)
@@ -238,9 +238,9 @@ static void intel_update_czclk(struct drm_i915_private *dev_priv)
                dev_priv->czclk_freq);
 }
 
-static inline u32 /* units of 100MHz */
-intel_fdi_link_freq(struct drm_i915_private *dev_priv,
-                   const struct intel_crtc_state *pipe_config)
+/* units of 100MHz */
+static u32 intel_fdi_link_freq(struct drm_i915_private *dev_priv,
+                              const struct intel_crtc_state *pipe_config)
 {
        if (HAS_DDI(dev_priv))
                return pipe_config->port_clock; /* SPLL */
@@ -8134,7 +8134,7 @@ static void intel_panel_sanitize_ssc(struct drm_i915_private *dev_priv)
        }
 }
 
-static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
+static bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
 {
        if (i915_modparams.panel_use_ssc >= 0)
                return i915_modparams.panel_use_ssc != 0;
@@ -12827,7 +12827,7 @@ static void intel_dump_crtc_timings(struct drm_i915_private *i915,
                    mode->type, mode->flags);
 }
 
-static inline void
+static void
 intel_dump_m_n_config(const struct intel_crtc_state *pipe_config,
                      const char *id, unsigned int lane_count,
                      const struct intel_link_m_n *m_n)
index 2293de009f56268d1d619c60adf00a8ef69efba1..721e9ba96d34b8a449e3668a2611b0c4fea654ec 100644 (file)
@@ -4515,9 +4515,8 @@ static void intel_power_domains_sync_hw(struct drm_i915_private *dev_priv)
        mutex_unlock(&power_domains->lock);
 }
 
-static inline
-bool intel_dbuf_slice_set(struct drm_i915_private *dev_priv,
-                         i915_reg_t reg, bool enable)
+static bool intel_dbuf_slice_set(struct drm_i915_private *dev_priv,
+                                i915_reg_t reg, bool enable)
 {
        u32 val, status;
 
index ec1157858ac5bb28025648a9c6f755323d142a1e..66f8a9d1503d51e982ea086ee82e615d20cdd06d 100644 (file)
@@ -6895,9 +6895,9 @@ static const struct hdcp2_dp_msg_data hdcp2_dp_msg_data[] = {
          0, 0 },
 };
 
-static inline
-int intel_dp_hdcp2_read_rx_status(struct intel_digital_port *intel_dig_port,
-                                 u8 *rx_status)
+static int
+intel_dp_hdcp2_read_rx_status(struct intel_digital_port *intel_dig_port,
+                             u8 *rx_status)
 {
        struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
        ssize_t ret;
index d7a6bf2277df4e56599d0b1420a1a593c0559e63..29fec6a92d1732dc38b6f00f15cbbd2a5b6e8dc7 100644 (file)
@@ -34,7 +34,7 @@
 #define DSB_BYTE_EN_SHIFT              20
 #define DSB_REG_VALUE_MASK             0xfffff
 
-static inline bool is_dsb_busy(struct intel_dsb *dsb)
+static bool is_dsb_busy(struct intel_dsb *dsb)
 {
        struct intel_crtc *crtc = container_of(dsb, typeof(*crtc), dsb);
        struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
@@ -43,7 +43,7 @@ static inline bool is_dsb_busy(struct intel_dsb *dsb)
        return DSB_STATUS & intel_de_read(dev_priv, DSB_CTRL(pipe, dsb->id));
 }
 
-static inline bool intel_dsb_enable_engine(struct intel_dsb *dsb)
+static bool intel_dsb_enable_engine(struct intel_dsb *dsb)
 {
        struct intel_crtc *crtc = container_of(dsb, typeof(*crtc), dsb);
        struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
@@ -63,7 +63,7 @@ static inline bool intel_dsb_enable_engine(struct intel_dsb *dsb)
        return true;
 }
 
-static inline bool intel_dsb_disable_engine(struct intel_dsb *dsb)
+static bool intel_dsb_disable_engine(struct intel_dsb *dsb)
 {
        struct intel_crtc *crtc = container_of(dsb, typeof(*crtc), dsb);
        struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
index 3c9c05478a03d10bf7bd33395c5e1277b436a285..eed037ec0b297f0ec250a6e38dca10d636e6e57d 100644 (file)
@@ -121,7 +121,7 @@ struct i2c_adapter_lookup {
 #define  ICL_GPIO_DDPA_CTRLCLK_2       8
 #define  ICL_GPIO_DDPA_CTRLDATA_2      9
 
-static inline enum port intel_dsi_seq_port_to_port(u8 port)
+static enum port intel_dsi_seq_port_to_port(u8 port)
 {
        return port ? PORT_C : PORT_A;
 }
index 1fd3a5a6296b136f2cab3bf776a4b8ec1e4b3e20..a8d119b6b45c8eab2862c569dbbe57df5c638f1f 100644 (file)
@@ -379,8 +379,7 @@ gmbus_wait_idle(struct drm_i915_private *dev_priv)
        return ret;
 }
 
-static inline
-unsigned int gmbus_max_xfer_size(struct drm_i915_private *dev_priv)
+static unsigned int gmbus_max_xfer_size(struct drm_i915_private *dev_priv)
 {
        return INTEL_GEN(dev_priv) >= 9 ? GEN9_GMBUS_BYTE_COUNT_MAX :
               GMBUS_BYTE_COUNT_MAX;
index d3ad10653b2e0cb6091c2cd41b2130462f6e2c98..2cbc4619b4ce6d3175f05572fafcc4b491f2b7f3 100644 (file)
@@ -109,18 +109,16 @@ bool intel_hdcp2_capable(struct intel_connector *connector)
        return capable;
 }
 
-static inline
-bool intel_hdcp_in_use(struct drm_i915_private *dev_priv,
-                      enum transcoder cpu_transcoder, enum port port)
+static bool intel_hdcp_in_use(struct drm_i915_private *dev_priv,
+                             enum transcoder cpu_transcoder, enum port port)
 {
        return intel_de_read(dev_priv,
                             HDCP_STATUS(dev_priv, cpu_transcoder, port)) &
               HDCP_STATUS_ENC;
 }
 
-static inline
-bool intel_hdcp2_in_use(struct drm_i915_private *dev_priv,
-                       enum transcoder cpu_transcoder, enum port port)
+static bool intel_hdcp2_in_use(struct drm_i915_private *dev_priv,
+                              enum transcoder cpu_transcoder, enum port port)
 {
        return intel_de_read(dev_priv,
                             HDCP2_STATUS(dev_priv, cpu_transcoder, port)) &
@@ -853,8 +851,7 @@ static int _intel_hdcp_enable(struct intel_connector *connector)
        return ret;
 }
 
-static inline
-struct intel_connector *intel_hdcp_to_connector(struct intel_hdcp *hdcp)
+static struct intel_connector *intel_hdcp_to_connector(struct intel_hdcp *hdcp)
 {
        return container_of(hdcp, struct intel_connector, hdcp);
 }
@@ -1856,8 +1853,7 @@ static const struct component_ops i915_hdcp_component_ops = {
        .unbind = i915_hdcp_component_unbind,
 };
 
-static inline
-enum mei_fw_ddi intel_get_mei_fw_ddi_index(enum port port)
+static enum mei_fw_ddi intel_get_mei_fw_ddi_index(enum port port)
 {
        switch (port) {
        case PORT_A:
@@ -1869,8 +1865,7 @@ enum mei_fw_ddi intel_get_mei_fw_ddi_index(enum port port)
        }
 }
 
-static inline
-enum mei_fw_tc intel_get_mei_fw_tc(enum transcoder cpu_transcoder)
+static enum mei_fw_tc intel_get_mei_fw_tc(enum transcoder cpu_transcoder)
 {
        switch (cpu_transcoder) {
        case TRANSCODER_A ... TRANSCODER_D:
@@ -1880,8 +1875,8 @@ enum mei_fw_tc intel_get_mei_fw_tc(enum transcoder cpu_transcoder)
        }
 }
 
-static inline int initialize_hdcp_port_data(struct intel_connector *connector,
-                                           const struct intel_hdcp_shim *shim)
+static int initialize_hdcp_port_data(struct intel_connector *connector,
+                                    const struct intel_hdcp_shim *shim)
 {
        struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
        struct intel_hdcp *hdcp = &connector->hdcp;
index 54412f79f0c592ed371ff8f09a39fa3b8fe85093..cdf9dedca36b160dfffa7a85cbba100d61229c39 100644 (file)
@@ -1614,10 +1614,10 @@ static int get_hdcp2_msg_timeout(u8 msg_id, bool is_paired)
        return -EINVAL;
 }
 
-static inline
-int hdcp2_detect_msg_availability(struct intel_digital_port *intel_dig_port,
-                                 u8 msg_id, bool *msg_ready,
-                                 ssize_t *msg_sz)
+static int
+hdcp2_detect_msg_availability(struct intel_digital_port *intel_dig_port,
+                             u8 msg_id, bool *msg_ready,
+                             ssize_t *msg_sz)
 {
        struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
        u8 rx_status[HDCP_2_2_HDMI_RXSTATUS_LEN];
index 08bfecfbe681ae256f9c0484c2d4b0bbeea88380..bcd2cc1aba90f0e29e229af61a03482bb923f1b8 100644 (file)
@@ -287,7 +287,7 @@ centre_vertically(struct drm_display_mode *adjusted_mode,
        adjusted_mode->crtc_vsync_end = adjusted_mode->crtc_vsync_start + sync_width;
 }
 
-static inline u32 panel_fitter_scaling(u32 source, u32 target)
+static u32 panel_fitter_scaling(u32 source, u32 target)
 {
        /*
         * Floating point operation is not supported. So the FACTOR
@@ -484,8 +484,8 @@ static u32 scale(u32 source_val,
 }
 
 /* Scale user_level in range [0..user_max] to [hw_min..hw_max]. */
-static inline u32 scale_user_to_hw(struct intel_connector *connector,
-                                  u32 user_level, u32 user_max)
+static u32 scale_user_to_hw(struct intel_connector *connector,
+                           u32 user_level, u32 user_max)
 {
        struct intel_panel *panel = &connector->panel;
 
@@ -495,8 +495,8 @@ static inline u32 scale_user_to_hw(struct intel_connector *connector,
 
 /* Scale user_level in range [0..user_max] to [0..hw_max], clamping the result
  * to [hw_min..hw_max]. */
-static inline u32 clamp_user_to_hw(struct intel_connector *connector,
-                                  u32 user_level, u32 user_max)
+static u32 clamp_user_to_hw(struct intel_connector *connector,
+                           u32 user_level, u32 user_max)
 {
        struct intel_panel *panel = &connector->panel;
        u32 hw_level;
@@ -508,8 +508,8 @@ static inline u32 clamp_user_to_hw(struct intel_connector *connector,
 }
 
 /* Scale hw_level in range [hw_min..hw_max] to [0..user_max]. */
-static inline u32 scale_hw_to_user(struct intel_connector *connector,
-                                  u32 hw_level, u32 user_max)
+static u32 scale_hw_to_user(struct intel_connector *connector,
+                           u32 hw_level, u32 user_max)
 {
        struct intel_panel *panel = &connector->panel;
 
index d54833a1578f9632c0b989ae33c15a03f73cc002..6f40bfee730466995609381adf1c7c022de03228 100644 (file)
@@ -5455,8 +5455,8 @@ static bool skl_plane_wm_equals(struct drm_i915_private *dev_priv,
        return skl_wm_level_equals(&wm1->trans_wm, &wm2->trans_wm);
 }
 
-static inline bool skl_ddb_entries_overlap(const struct skl_ddb_entry *a,
-                                          const struct skl_ddb_entry *b)
+static bool skl_ddb_entries_overlap(const struct skl_ddb_entry *a,
+                                   const struct skl_ddb_entry *b)
 {
        return a->start < b->end && b->start < a->end;
 }
@@ -5907,8 +5907,7 @@ static void ilk_optimize_watermarks(struct intel_atomic_state *state,
        mutex_unlock(&dev_priv->wm.wm_mutex);
 }
 
-static inline void skl_wm_level_from_reg_val(u32 val,
-                                            struct skl_wm_level *level)
+static void skl_wm_level_from_reg_val(u32 val, struct skl_wm_level *level)
 {
        level->plane_en = val & PLANE_WM_EN;
        level->ignore_lines = val & PLANE_WM_IGNORE_LINES;
index 3f13baaef0581d43469c278368785de3ad359670..14daf6af68547af6cdc25dbc11f032cb754426f1 100644 (file)
@@ -336,7 +336,7 @@ void intel_sbi_write(struct drm_i915_private *i915, u16 reg, u32 value,
        intel_sbi_rw(i915, reg, destination, &value, false);
 }
 
-static inline int gen6_check_mailbox_status(u32 mbox)
+static int gen6_check_mailbox_status(u32 mbox)
 {
        switch (mbox & GEN6_PCODE_ERROR_MASK) {
        case GEN6_PCODE_SUCCESS:
@@ -356,7 +356,7 @@ static inline int gen6_check_mailbox_status(u32 mbox)
        }
 }
 
-static inline int gen7_check_mailbox_status(u32 mbox)
+static int gen7_check_mailbox_status(u32 mbox)
 {
        switch (mbox & GEN6_PCODE_ERROR_MASK) {
        case GEN6_PCODE_SUCCESS:
index 2186386a45c8afd9ac0a245db35d9172abd428d2..6942487c14a987603b4ac2076b41e78922d3010d 100644 (file)
@@ -89,7 +89,7 @@ void intel_wopcm_init_early(struct intel_wopcm *wopcm)
        drm_dbg(&i915->drm, "WOPCM: %uK\n", wopcm->size / 1024);
 }
 
-static inline u32 context_reserved_size(struct drm_i915_private *i915)
+static u32 context_reserved_size(struct drm_i915_private *i915)
 {
        if (IS_GEN9_LP(i915))
                return BXT_WOPCM_RC6_CTX_RESERVED;
@@ -99,8 +99,8 @@ static inline u32 context_reserved_size(struct drm_i915_private *i915)
                return 0;
 }
 
-static inline bool gen9_check_dword_gap(struct drm_i915_private *i915,
-                                       u32 guc_wopcm_base, u32 guc_wopcm_size)
+static bool gen9_check_dword_gap(struct drm_i915_private *i915,
+                                u32 guc_wopcm_base, u32 guc_wopcm_size)
 {
        u32 offset;
 
@@ -122,8 +122,8 @@ static inline bool gen9_check_dword_gap(struct drm_i915_private *i915,
        return true;
 }
 
-static inline bool gen9_check_huc_fw_fits(struct drm_i915_private *i915,
-                                         u32 guc_wopcm_size, u32 huc_fw_size)
+static bool gen9_check_huc_fw_fits(struct drm_i915_private *i915,
+                                  u32 guc_wopcm_size, u32 huc_fw_size)
 {
        /*
         * On Gen9 & CNL A0, hardware requires the total available GuC WOPCM
@@ -141,9 +141,9 @@ static inline bool gen9_check_huc_fw_fits(struct drm_i915_private *i915,
        return true;
 }
 
-static inline bool check_hw_restrictions(struct drm_i915_private *i915,
-                                        u32 guc_wopcm_base, u32 guc_wopcm_size,
-                                        u32 huc_fw_size)
+static bool check_hw_restrictions(struct drm_i915_private *i915,
+                                 u32 guc_wopcm_base, u32 guc_wopcm_size,
+                                 u32 huc_fw_size)
 {
        if (IS_GEN(i915, 9) && !gen9_check_dword_gap(i915, guc_wopcm_base,
                                                     guc_wopcm_size))
@@ -157,9 +157,9 @@ static inline bool check_hw_restrictions(struct drm_i915_private *i915,
        return true;
 }
 
-static inline bool __check_layout(struct drm_i915_private *i915, u32 wopcm_size,
-                                 u32 guc_wopcm_base, u32 guc_wopcm_size,
-                                 u32 guc_fw_size, u32 huc_fw_size)
+static bool __check_layout(struct drm_i915_private *i915, u32 wopcm_size,
+                          u32 guc_wopcm_base, u32 guc_wopcm_size,
+                          u32 guc_fw_size, u32 huc_fw_size)
 {
        const u32 ctx_rsvd = context_reserved_size(i915);
        u32 size;