Path: blob/master/drivers/gpu/drm/amd/display/include/logger_interface.h
26535 views
/*1* Copyright 2012-15 Advanced Micro Devices, Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*21* Authors: AMD22*23*/2425#ifndef __DAL_LOGGER_INTERFACE_H__26#define __DAL_LOGGER_INTERFACE_H__2728#include "logger_types.h"2930struct dc_context;31struct dc_link;32struct dc_surface_update;33struct resource_context;34struct dc_state;3536/*37*38* DAL logger functionality39*40*/4142void update_surface_trace(43struct dc *dc,44const struct dc_surface_update *updates,45int surface_count);4647void post_surface_trace(struct dc *dc);4849void context_clock_trace(50struct dc *dc,51struct dc_state *context);5253/* Any function which is empty or have incomplete implementation should be54* marked by this macro.55* Note that the message will be printed exactly once for every function56* it is used in order to avoid repeating of the same message. */5758#define DAL_LOGGER_NOT_IMPL(fmt, ...) \59do { \60static bool print_not_impl = true; \61if (print_not_impl == true) { \62print_not_impl = false; \63DRM_WARN("DAL_NOT_IMPL: " fmt, ##__VA_ARGS__); \64} \65} while (0)6667/******************************************************************************68* Convenience macros to save on typing.69*****************************************************************************/7071#define DC_ERROR(...) \72do { \73(void)(dc_ctx); \74DC_LOG_ERROR(__VA_ARGS__); \75} while (0)7677#define DC_SYNC_INFO(...) \78do { \79(void)(dc_ctx); \80DC_LOG_SYNC(__VA_ARGS__); \81} while (0)8283/* Connectivity log format:84* [time stamp] [drm] [Major_minor] [connector name] message.....85* eg:86* [ 26.590965] [drm] [Conn_LKTN] [DP-1] HBRx4 pass VS=0, PE=0^87* [ 26.881060] [drm] [Conn_Mode] [DP-1] {2560x1080, 2784x1111@185580Khz}^88*/8990#define CONN_DATA_DETECT(link, hex_data, hex_len, ...) \91do { \92(void)(link); \93DC_LOG_EVENT_DETECTION(__VA_ARGS__); \94} while (0)9596#define CONN_DATA_LINK_LOSS(link, hex_data, hex_len, ...) \97do { \98(void)(link); \99DC_LOG_EVENT_LINK_LOSS(__VA_ARGS__); \100} while (0)101102#define CONN_MSG_LT(link, ...) \103do { \104(void)(link); \105DC_LOG_EVENT_LINK_TRAINING(__VA_ARGS__); \106} while (0)107108#define CONN_MSG_MODE(link, ...) \109do { \110(void)(link); \111DC_LOG_EVENT_MODE_SET(__VA_ARGS__); \112} while (0)113114/*115* Display Test Next logging116*/117#define DTN_INFO_BEGIN() \118dm_dtn_log_begin(dc_ctx, log_ctx)119120#define DTN_INFO(msg, ...) \121dm_dtn_log_append_v(dc_ctx, log_ctx, msg, ##__VA_ARGS__)122123#define DTN_INFO_END() \124dm_dtn_log_end(dc_ctx, log_ctx)125126#define PERFORMANCE_TRACE_START() \127unsigned long long perf_trc_start_stmp = dm_get_timestamp(dc->ctx)128129#define PERFORMANCE_TRACE_END() \130do { \131unsigned long long perf_trc_end_stmp = dm_get_timestamp(dc->ctx); \132if (dc->debug.performance_trace) { \133DC_LOG_PERF_TRACE("%s duration: %lld ticks\n", __func__, \134perf_trc_end_stmp - perf_trc_start_stmp); \135} \136} while (0)137138#define DISPLAY_STATS_BEGIN(entry) (void)(entry)139140#define DISPLAY_STATS(msg, ...) DC_LOG_PERF_TRACE(msg, __VA_ARGS__)141142#define DISPLAY_STATS_END(entry) (void)(entry)143144#define LOG_GAMMA_WRITE(msg, ...)145146#endif /* __DAL_LOGGER_INTERFACE_H__ */147148149