14562236bSHarry Wentland /*
24562236bSHarry Wentland * Copyright 2015 Advanced Micro Devices, Inc.
34562236bSHarry Wentland *
44562236bSHarry Wentland * Permission is hereby granted, free of charge, to any person obtaining a
54562236bSHarry Wentland * copy of this software and associated documentation files (the "Software"),
64562236bSHarry Wentland * to deal in the Software without restriction, including without limitation
74562236bSHarry Wentland * the rights to use, copy, modify, merge, publish, distribute, sublicense,
84562236bSHarry Wentland * and/or sell copies of the Software, and to permit persons to whom the
94562236bSHarry Wentland * Software is furnished to do so, subject to the following conditions:
104562236bSHarry Wentland *
114562236bSHarry Wentland * The above copyright notice and this permission notice shall be included in
124562236bSHarry Wentland * all copies or substantial portions of the Software.
134562236bSHarry Wentland *
144562236bSHarry Wentland * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
154562236bSHarry Wentland * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
164562236bSHarry Wentland * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
174562236bSHarry Wentland * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
184562236bSHarry Wentland * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
194562236bSHarry Wentland * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
204562236bSHarry Wentland * OTHER DEALINGS IN THE SOFTWARE.
214562236bSHarry Wentland *
224562236bSHarry Wentland * Authors: AMD
234562236bSHarry Wentland *
244562236bSHarry Wentland */
254562236bSHarry Wentland
264562236bSHarry Wentland #include <linux/string.h>
274562236bSHarry Wentland #include <linux/acpi.h>
284562236bSHarry Wentland
29fcd70cd3SDaniel Vetter #include <drm/drm_probe_helper.h>
304562236bSHarry Wentland #include <drm/amdgpu_drm.h>
314562236bSHarry Wentland #include "dm_services.h"
324562236bSHarry Wentland #include "amdgpu.h"
334562236bSHarry Wentland #include "amdgpu_dm.h"
344562236bSHarry Wentland #include "amdgpu_dm_irq.h"
354562236bSHarry Wentland #include "amdgpu_pm.h"
369d83722dSRodrigo Siqueira #include "amdgpu_dm_trace.h"
3792276a06SMikita Lipski
389d83722dSRodrigo Siqueira unsigned long long
dm_get_elapse_time_in_ns(struct dc_context * ctx,unsigned long long current_time_stamp,unsigned long long last_time_stamp)399d83722dSRodrigo Siqueira dm_get_elapse_time_in_ns(struct dc_context *ctx,
4078d5d04dSCharlene Liu unsigned long long current_time_stamp,
4178d5d04dSCharlene Liu unsigned long long last_time_stamp)
4278d5d04dSCharlene Liu {
4378d5d04dSCharlene Liu return current_time_stamp - last_time_stamp;
4478d5d04dSCharlene Liu }
4578d5d04dSCharlene Liu
dm_perf_trace_timestamp(const char * func_name,unsigned int line,struct dc_context * ctx)469d83722dSRodrigo Siqueira void dm_perf_trace_timestamp(const char *func_name, unsigned int line, struct dc_context *ctx)
47dce46c53STony Cheng {
489d83722dSRodrigo Siqueira trace_amdgpu_dc_performance(ctx->perf_trace->read_count,
499d83722dSRodrigo Siqueira ctx->perf_trace->write_count,
509d83722dSRodrigo Siqueira &ctx->perf_trace->last_entry_read,
519d83722dSRodrigo Siqueira &ctx->perf_trace->last_entry_write,
529d83722dSRodrigo Siqueira func_name, line);
53dce46c53STony Cheng }
54dce46c53STony Cheng
dm_trace_smu_msg(uint32_t msg_id,uint32_t param_in,struct dc_context * ctx)55*beb9764aSGeorge Shen void dm_trace_smu_msg(uint32_t msg_id, uint32_t param_in, struct dc_context *ctx)
56*beb9764aSGeorge Shen {
57*beb9764aSGeorge Shen }
58*beb9764aSGeorge Shen
dm_trace_smu_delay(uint32_t delay,struct dc_context * ctx)59*beb9764aSGeorge Shen void dm_trace_smu_delay(uint32_t delay, struct dc_context *ctx)
60*beb9764aSGeorge Shen {
61*beb9764aSGeorge Shen }
62*beb9764aSGeorge Shen
634562236bSHarry Wentland /**** power component interfaces ****/
64