1 /* $NetBSD: amdgpu_dm_services.c,v 1.2 2021/12/18 23:45:00 riastradh Exp $ */
2
3 /*
4 * Copyright 2015 Advanced Micro Devices, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors: AMD
25 *
26 */
27
28 #include <sys/cdefs.h>
29 __KERNEL_RCSID(0, "$NetBSD: amdgpu_dm_services.c,v 1.2 2021/12/18 23:45:00 riastradh Exp $");
30
31 #include <linux/string.h>
32 #include <linux/acpi.h>
33
34 #include <drm/drm_probe_helper.h>
35 #include <drm/amdgpu_drm.h>
36 #include "dm_services.h"
37 #include "amdgpu.h"
38 #include "amdgpu_dm.h"
39 #include "amdgpu_dm_irq.h"
40 #include "amdgpu_pm.h"
41
42
43
dm_get_elapse_time_in_ns(struct dc_context * ctx,unsigned long long current_time_stamp,unsigned long long last_time_stamp)44 unsigned long long dm_get_elapse_time_in_ns(struct dc_context *ctx,
45 unsigned long long current_time_stamp,
46 unsigned long long last_time_stamp)
47 {
48 return current_time_stamp - last_time_stamp;
49 }
50
dm_perf_trace_timestamp(const char * func_name,unsigned int line)51 void dm_perf_trace_timestamp(const char *func_name, unsigned int line)
52 {
53 }
54
dm_write_persistent_data(struct dc_context * ctx,const struct dc_sink * sink,const char * module_name,const char * key_name,void * params,unsigned int size,struct persistent_data_flag * flag)55 bool dm_write_persistent_data(struct dc_context *ctx,
56 const struct dc_sink *sink,
57 const char *module_name,
58 const char *key_name,
59 void *params,
60 unsigned int size,
61 struct persistent_data_flag *flag)
62 {
63 /*TODO implement*/
64 return false;
65 }
66
dm_read_persistent_data(struct dc_context * ctx,const struct dc_sink * sink,const char * module_name,const char * key_name,void * params,unsigned int size,struct persistent_data_flag * flag)67 bool dm_read_persistent_data(struct dc_context *ctx,
68 const struct dc_sink *sink,
69 const char *module_name,
70 const char *key_name,
71 void *params,
72 unsigned int size,
73 struct persistent_data_flag *flag)
74 {
75 /*TODO implement*/
76 return false;
77 }
78
79 /**** power component interfaces ****/
80
81