| 1 | /* |
| 2 | * Copyright 2012-15 Advanced Micro Devices, Inc. |
| 3 | * |
| 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | * copy of this software and associated documentation files (the "Software"), |
| 6 | * to deal in the Software without restriction, including without limitation |
| 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | * and/or sell copies of the Software, and to permit persons to whom the |
| 9 | * Software is furnished to do so, subject to the following conditions: |
| 10 | * |
| 11 | * The above copyright notice and this permission notice shall be included in |
| 12 | * all copies or substantial portions of the Software. |
| 13 | * |
| 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 | * OTHER DEALINGS IN THE SOFTWARE. |
| 21 | * |
| 22 | * Authors: AMD |
| 23 | * |
| 24 | */ |
| 25 | |
| 26 | #ifndef __DAL_LOGGER_TYPES_H__ |
| 27 | #define __DAL_LOGGER_TYPES_H__ |
| 28 | |
| 29 | #include "os_types.h" |
| 30 | |
| 31 | #define DC_LOG_ERROR(...) drm_err((DC_LOGGER)->dev, __VA_ARGS__) |
| 32 | #define DC_LOG_WARNING(...) drm_warn((DC_LOGGER)->dev, __VA_ARGS__) |
| 33 | #define DC_LOG_DEBUG(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) |
| 34 | #define DC_LOG_DC(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) |
| 35 | #define DC_LOG_INFO(...) drm_info((DC_LOGGER)->dev, __VA_ARGS__) |
| 36 | #define DC_LOG_SURFACE(...) pr_debug("[SURFACE]:"__VA_ARGS__) |
| 37 | #define DC_LOG_HW_HOTPLUG(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) |
| 38 | #define DC_LOG_HW_LINK_TRAINING(...) pr_debug("[HW_LINK_TRAINING]:"__VA_ARGS__) |
| 39 | #define DC_LOG_HW_RESUME_S3(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) |
| 40 | #define DC_LOG_HW_AUDIO(...) pr_debug("[HW_AUDIO]:"__VA_ARGS__) |
| 41 | #define DC_LOG_HW_HPD_IRQ(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) |
| 42 | #define DC_LOG_MST(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) |
| 43 | #define DC_LOG_SCALER(...) pr_debug("[SCALER]:"__VA_ARGS__) |
| 44 | #define DC_LOG_BIOS(...) pr_debug("[BIOS]:"__VA_ARGS__) |
| 45 | #define DC_LOG_BANDWIDTH_CALCS(...) pr_debug("[BANDWIDTH_CALCS]:"__VA_ARGS__) |
| 46 | #define DC_LOG_BANDWIDTH_VALIDATION(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) |
| 47 | #define DC_LOG_SYNC(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) |
| 48 | #define DC_LOG_BACKLIGHT(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) |
| 49 | #define DC_LOG_DETECTION_EDID_PARSER(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) |
| 50 | #define DC_LOG_DETECTION_DP_CAPS(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) |
| 51 | #define DC_LOG_DML(...) pr_debug("[DML]:"__VA_ARGS__) |
| 52 | #define DC_LOG_EVENT_MODE_SET(...) drm_dbg_kms((DC_LOGGER)->dev, __VA_ARGS__) |
| 53 | #define DC_LOG_EVENT_DETECTION(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) |
| 54 | #define DC_LOG_EVENT_LINK_TRAINING(...) \ |
| 55 | drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) |
| 56 | #define DC_LOG_EVENT_LINK_LOSS(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) |
| 57 | #define DC_LOG_IF_TRACE(...) pr_debug("[IF_TRACE]:"__VA_ARGS__) |
| 58 | #define DC_LOG_PERF_TRACE(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) |
| 59 | #define DC_LOG_RETIMER_REDRIVER(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) |
| 60 | #define DC_LOG_GAMMA(...) pr_debug("[GAMMA]:"__VA_ARGS__) |
| 61 | #define DC_LOG_ALL_GAMMA(...) pr_debug("[GAMMA]:"__VA_ARGS__) |
| 62 | #define DC_LOG_ALL_TF_CHANNELS(...) pr_debug("[GAMMA]:"__VA_ARGS__) |
| 63 | #define DC_LOG_DSC(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) |
| 64 | #define DC_LOG_SMU(...) pr_debug("[SMU_MSG]:"__VA_ARGS__) |
| 65 | #define DC_LOG_DWB(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) |
| 66 | #define DC_LOG_DP2(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) |
| 67 | #define DC_LOG_AUTO_DPM_TEST(...) pr_debug("[AutoDPMTest]: "__VA_ARGS__) |
| 68 | #define DC_LOG_IPS(...) pr_debug("[IPS]: "__VA_ARGS__) |
| 69 | #define DC_LOG_MALL(...) pr_debug("[MALL]:"__VA_ARGS__) |
| 70 | #define DC_LOG_REGISTER_READ(...) pr_debug("[REGISTER_READ]: "__VA_ARGS__) |
| 71 | #define DC_LOG_REGISTER_WRITE(...) pr_debug("[REGISTER_WRITE]: "__VA_ARGS__) |
| 72 | |
| 73 | struct dc_log_buffer_ctx { |
| 74 | char *buf; |
| 75 | size_t pos; |
| 76 | size_t size; |
| 77 | }; |
| 78 | |
| 79 | struct dal_logger { |
| 80 | struct drm_device *dev; |
| 81 | }; |
| 82 | |
| 83 | #endif /* __DAL_LOGGER_TYPES_H__ */ |
| 84 | |