drm/amd/display: Move dm_read_reg_func to dc_helper.
authorYongqiang Sun <yongqiang.sun@amd.com>
Thu, 28 Feb 2019 20:14:39 +0000 (15:14 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 21 Mar 2019 04:39:48 +0000 (23:39 -0500)
Move out of header to dc_helper.c, in preparation for future
implementations.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dc_helper.c
drivers/gpu/drm/amd/display/dc/dm_services.h

index 0872514480f4ac55b21491b59109e10ac2913e5b..5e6c5eff49cf7b78cf4bd51799859504f9a40571 100644 (file)
@@ -119,6 +119,24 @@ uint32_t generic_reg_set_ex(const struct dc_context *ctx,
        return reg_val;
 }
 
+uint32_t dm_read_reg_func(
+       const struct dc_context *ctx,
+       uint32_t address,
+       const char *func_name)
+{
+       uint32_t value;
+#ifdef DM_CHECK_ADDR_0
+       if (address == 0) {
+               DC_ERR("invalid register read; address = 0\n");
+               return 0;
+       }
+#endif
+       value = cgs_read_register(ctx->cgs_device, address);
+       trace_amdgpu_dc_rreg(&ctx->perf_trace->read_count, address, value);
+
+       return value;
+}
+
 uint32_t generic_reg_get(const struct dc_context *ctx, uint32_t addr,
                uint8_t shift, uint32_t mask, uint32_t *field_value)
 {
index b351d3dcf8b271f595eaf0d3900c3fad8f80ed05..b426ba02b793afc1dd69f00827fc5bbd415b1693 100644 (file)
@@ -52,30 +52,17 @@ irq_handler_idx dm_register_interrupt(
  * GPU registers access
  *
  */
-
+uint32_t dm_read_reg_func(
+       const struct dc_context *ctx,
+       uint32_t address,
+       const char *func_name);
 /* enable for debugging new code, this adds 50k to the driver size. */
 /* #define DM_CHECK_ADDR_0 */
 
 #define dm_read_reg(ctx, address)      \
                dm_read_reg_func(ctx, address, __func__)
 
-static inline uint32_t dm_read_reg_func(
-       const struct dc_context *ctx,
-       uint32_t address,
-       const char *func_name)
-{
-       uint32_t value;
-#ifdef DM_CHECK_ADDR_0
-       if (address == 0) {
-               DC_ERR("invalid register read; address = 0\n");
-               return 0;
-       }
-#endif
-       value = cgs_read_register(ctx->cgs_device, address);
-       trace_amdgpu_dc_rreg(&ctx->perf_trace->read_count, address, value);
 
-       return value;
-}
 
 #define dm_write_reg(ctx, address, value)      \
        dm_write_reg_func(ctx, address, value, __func__)