Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: switch DC over to the new DRM logging macros

For multi-GPU systems it is difficult to tell which GPU a particular
message is being printed for and that is undesirable because it
complicates debugging efforts. Also, the new macros allow us to enable
logging for particular parts of the codebase more selectively (since we
no longer need to throw everything at DRM_DEBUG_KMS()). So, for the
reasons outlined above we should switch to the new macros.

We can accomplish this by using the existing DC_LOGGER code to pass
around the relevant `struct drm_device` which will be fed to the new
macros in logger_types.h. Also, we must get rid of all instances of the
DC_LOG_.*() functions that are currently in amdgpu_dm since we don't use
the DC logger there and we can simply refer to the macros directly
there instead.

Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Hamza Mahfooz and committed by
Alex Deucher
5d72e247 a73d4e88

+236 -225
+37 -29
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 413 413 struct amdgpu_crtc *amdgpu_crtc; 414 414 struct common_irq_params *irq_params = interrupt_params; 415 415 struct amdgpu_device *adev = irq_params->adev; 416 + struct drm_device *dev = adev_to_drm(adev); 416 417 unsigned long flags; 417 418 struct drm_pending_vblank_event *e; 418 419 u32 vpos, hpos, v_blank_start, v_blank_end; ··· 424 423 /* IRQ could occur when in initial stage */ 425 424 /* TODO work and BO cleanup */ 426 425 if (amdgpu_crtc == NULL) { 427 - DC_LOG_PFLIP("CRTC is null, returning.\n"); 426 + drm_dbg_state(dev, "CRTC is null, returning.\n"); 428 427 return; 429 428 } 430 429 431 430 spin_lock_irqsave(&adev_to_drm(adev)->event_lock, flags); 432 431 433 432 if (amdgpu_crtc->pflip_status != AMDGPU_FLIP_SUBMITTED) { 434 - DC_LOG_PFLIP("amdgpu_crtc->pflip_status = %d !=AMDGPU_FLIP_SUBMITTED(%d) on crtc:%d[%p]\n", 435 - amdgpu_crtc->pflip_status, 436 - AMDGPU_FLIP_SUBMITTED, 437 - amdgpu_crtc->crtc_id, 438 - amdgpu_crtc); 433 + drm_dbg_state(dev, 434 + "amdgpu_crtc->pflip_status = %d != AMDGPU_FLIP_SUBMITTED(%d) on crtc:%d[%p]\n", 435 + amdgpu_crtc->pflip_status, AMDGPU_FLIP_SUBMITTED, 436 + amdgpu_crtc->crtc_id, amdgpu_crtc); 439 437 spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); 440 438 return; 441 439 } ··· 500 500 amdgpu_crtc->pflip_status = AMDGPU_FLIP_NONE; 501 501 spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags); 502 502 503 - DC_LOG_PFLIP("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_NONE, vrr[%d]-fp %d\n", 504 - amdgpu_crtc->crtc_id, amdgpu_crtc, 505 - vrr_active, (int) !e); 503 + drm_dbg_state(dev, 504 + "crtc:%d[%p], pflip_stat:AMDGPU_FLIP_NONE, vrr[%d]-fp %d\n", 505 + amdgpu_crtc->crtc_id, amdgpu_crtc, vrr_active, (int)!e); 506 506 } 507 507 508 508 static void dm_vupdate_high_irq(void *interrupt_params) ··· 532 532 atomic64_set(&irq_params->previous_timestamp, vblank->time); 533 533 } 534 534 535 - DC_LOG_VBLANK("crtc:%d, vupdate-vrr:%d\n", 536 - acrtc->crtc_id, 537 - vrr_active); 535 + drm_dbg_vbl(drm_dev, 536 + "crtc:%d, vupdate-vrr:%d\n", acrtc->crtc_id, 537 + vrr_active); 538 538 539 539 /* Core vblank handling is done here after end of front-porch in 540 540 * vrr mode, as vblank timestamping will give valid results ··· 585 585 586 586 vrr_active = amdgpu_dm_crtc_vrr_active_irq(acrtc); 587 587 588 - DC_LOG_VBLANK("crtc:%d, vupdate-vrr:%d, planes:%d\n", acrtc->crtc_id, 589 - vrr_active, acrtc->dm_irq_params.active_planes); 588 + drm_dbg_vbl(adev_to_drm(adev), 589 + "crtc:%d, vupdate-vrr:%d, planes:%d\n", acrtc->crtc_id, 590 + vrr_active, acrtc->dm_irq_params.active_planes); 590 591 591 592 /** 592 593 * Core vblank handling at start of front-porch is only possible ··· 2701 2700 struct display_sink_capability sink_caps = { 0 }; 2702 2701 enum dc_edid_status edid_status; 2703 2702 struct dc_context *dc_ctx = link->ctx; 2703 + struct drm_device *dev = adev_to_drm(dc_ctx->driver_context); 2704 2704 struct dc_sink *sink = NULL; 2705 2705 struct dc_sink *prev_sink = NULL; 2706 2706 ··· 2751 2749 } 2752 2750 2753 2751 default: 2754 - DC_ERROR("Invalid connector type! signal:%d\n", 2752 + drm_err(dev, "Invalid connector type! signal:%d\n", 2755 2753 link->connector_signal); 2756 2754 return; 2757 2755 } ··· 2761 2759 2762 2760 sink = dc_sink_create(&sink_init_data); 2763 2761 if (!sink) { 2764 - DC_ERROR("Failed to create sink!\n"); 2762 + drm_err(dev, "Failed to create sink!\n"); 2765 2763 return; 2766 2764 } 2767 2765 ··· 2774 2772 sink); 2775 2773 2776 2774 if (edid_status != EDID_OK) 2777 - DC_ERROR("Failed to read EDID"); 2775 + drm_err(dev, "Failed to read EDID\n"); 2778 2776 2779 2777 } 2780 2778 ··· 2793 2791 bundle = kzalloc(sizeof(*bundle), GFP_KERNEL); 2794 2792 2795 2793 if (!bundle) { 2796 - dm_error("Failed to allocate update bundle\n"); 2794 + drm_err(dm->ddev, "Failed to allocate update bundle\n"); 2797 2795 goto cleanup; 2798 2796 } 2799 2797 ··· 3245 3243 aconnector->timing_requested = 3246 3244 kzalloc(sizeof(struct dc_crtc_timing), GFP_KERNEL); 3247 3245 if (!aconnector->timing_requested) 3248 - dm_error("failed to create aconnector->requested_timing\n"); 3246 + drm_err(dev, 3247 + "failed to create aconnector->requested_timing\n"); 3249 3248 } 3250 3249 3251 3250 drm_connector_update_edid_property(connector, aconnector->edid); ··· 6162 6159 requested_bpc); 6163 6160 6164 6161 if (aconnector->timing_changed) { 6165 - DC_LOG_DEBUG("%s: overriding timing for automated test, bpc %d, changing to %d\n", 6166 - __func__, 6167 - stream->timing.display_color_depth, 6168 - aconnector->timing_requested->display_color_depth); 6162 + drm_dbg(aconnector->base.dev, 6163 + "overriding timing for automated test, bpc %d, changing to %d\n", 6164 + stream->timing.display_color_depth, 6165 + aconnector->timing_requested->display_color_depth); 6169 6166 stream->timing = *aconnector->timing_requested; 6170 6167 } 6171 6168 ··· 7885 7882 /* Mark this event as consumed */ 7886 7883 acrtc->base.state->event = NULL; 7887 7884 7888 - DC_LOG_PFLIP("crtc:%d, pflip_stat:AMDGPU_FLIP_SUBMITTED\n", 7889 - acrtc->crtc_id); 7885 + drm_dbg_state(acrtc->base.dev, 7886 + "crtc:%d, pflip_stat:AMDGPU_FLIP_SUBMITTED\n", 7887 + acrtc->crtc_id); 7890 7888 } 7891 7889 7892 7890 static void update_freesync_state_on_stream( ··· 8130 8126 bundle = kzalloc(sizeof(*bundle), GFP_KERNEL); 8131 8127 8132 8128 if (!bundle) { 8133 - dm_error("Failed to allocate update bundle\n"); 8129 + drm_err(dev, "Failed to allocate update bundle\n"); 8134 8130 goto cleanup; 8135 8131 } 8136 8132 ··· 8718 8714 status = dc_stream_get_status_from_state(dc_state, 8719 8715 dm_new_crtc_state->stream); 8720 8716 if (!status) 8721 - DC_ERR("got no status for stream %p on acrtc%p\n", dm_new_crtc_state->stream, acrtc); 8717 + drm_err(dev, 8718 + "got no status for stream %p on acrtc%p\n", 8719 + dm_new_crtc_state->stream, acrtc); 8722 8720 else 8723 8721 acrtc->otg_inst = status->primary_otg_inst; 8724 8722 } ··· 10908 10902 { 10909 10903 #ifdef DM_CHECK_ADDR_0 10910 10904 if (address == 0) { 10911 - DC_ERR("invalid register write. address = 0"); 10905 + drm_err(adev_to_drm(ctx->driver_context), 10906 + "invalid register write. address = 0"); 10912 10907 return; 10913 10908 } 10914 10909 #endif ··· 10923 10916 u32 value; 10924 10917 #ifdef DM_CHECK_ADDR_0 10925 10918 if (address == 0) { 10926 - DC_ERR("invalid register read; address = 0\n"); 10919 + drm_err(adev_to_drm(ctx->driver_context), 10920 + "invalid register read; address = 0\n"); 10927 10921 return 0; 10928 10922 } 10929 10923 #endif
+40 -29
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
··· 535 535 struct amdgpu_dm_connector *aconnector = link->priv; 536 536 537 537 if (!aconnector) { 538 - DC_LOG_DC("Failed to find connector for link!\n"); 538 + drm_dbg_dp(aconnector->base.dev, 539 + "Failed to find connector for link!\n"); 539 540 return false; 540 541 } 541 542 ··· 658 657 drm_dp_dpcd_read(aux, SYNAPTICS_RC_DATA, data, length); 659 658 } 660 659 661 - DC_LOG_DC("%s: success = %d\n", __func__, success); 660 + drm_dbg_dp(aux->drm_dev, "success = %d\n", success); 662 661 663 662 return success; 664 663 } ··· 667 666 { 668 667 unsigned char data[16] = {0}; 669 668 670 - DC_LOG_DC("Start %s\n", __func__); 669 + drm_dbg_dp(aux->drm_dev, "Start\n"); 671 670 672 671 // Step 2 673 672 data[0] = 'P'; ··· 725 724 if (!execute_synaptics_rc_command(aux, true, 0x02, 0, 0, NULL)) 726 725 return; 727 726 728 - DC_LOG_DC("Done %s\n", __func__); 727 + drm_dbg_dp(aux->drm_dev, "Done\n"); 729 728 } 730 729 731 730 /* MST Dock */ ··· 738 737 { 739 738 uint8_t ret = 0; 740 739 741 - DC_LOG_DC("Configure DSC to non-virtual dpcd synaptics\n"); 740 + drm_dbg_dp(aux->drm_dev, 741 + "Configure DSC to non-virtual dpcd synaptics\n"); 742 742 743 743 if (enable) { 744 744 /* When DSC is enabled on previous boot and reboot with the hub, ··· 777 775 static const uint8_t DSC_DECODING = 0x01; 778 776 static const uint8_t DSC_PASSTHROUGH = 0x02; 779 777 780 - struct amdgpu_dm_connector *aconnector; 778 + struct amdgpu_dm_connector *aconnector = 779 + (struct amdgpu_dm_connector *)stream->dm_stream_context; 780 + struct drm_device *dev = aconnector->base.dev; 781 781 struct drm_dp_mst_port *port; 782 782 uint8_t enable_dsc = enable ? DSC_DECODING : DSC_DISABLE; 783 783 uint8_t enable_passthrough = enable ? DSC_PASSTHROUGH : DSC_DISABLE; ··· 789 785 return false; 790 786 791 787 if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) { 792 - aconnector = (struct amdgpu_dm_connector *)stream->dm_stream_context; 793 - 794 788 if (!aconnector->dsc_aux) 795 789 return false; 796 790 ··· 805 803 ret = drm_dp_dpcd_write(port->passthrough_aux, 806 804 DP_DSC_ENABLE, 807 805 &enable_passthrough, 1); 808 - DC_LOG_DC("Sent DSC pass-through enable to virtual dpcd port, ret = %u\n", 809 - ret); 806 + drm_dbg_dp(dev, 807 + "Sent DSC pass-through enable to virtual dpcd port, ret = %u\n", 808 + ret); 810 809 } 811 810 812 811 ret = drm_dp_dpcd_write(aconnector->dsc_aux, 813 812 DP_DSC_ENABLE, &enable_dsc, 1); 814 - DC_LOG_DC("Sent DSC decoding enable to %s port, ret = %u\n", 815 - (port->passthrough_aux) ? "remote RX" : 816 - "virtual dpcd", 817 - ret); 813 + drm_dbg_dp(dev, 814 + "Sent DSC decoding enable to %s port, ret = %u\n", 815 + (port->passthrough_aux) ? "remote RX" : 816 + "virtual dpcd", 817 + ret); 818 818 } else { 819 819 ret = drm_dp_dpcd_write(aconnector->dsc_aux, 820 820 DP_DSC_ENABLE, &enable_dsc, 1); 821 - DC_LOG_DC("Sent DSC decoding disable to %s port, ret = %u\n", 822 - (port->passthrough_aux) ? "remote RX" : 823 - "virtual dpcd", 824 - ret); 821 + drm_dbg_dp(dev, 822 + "Sent DSC decoding disable to %s port, ret = %u\n", 823 + (port->passthrough_aux) ? "remote RX" : 824 + "virtual dpcd", 825 + ret); 825 826 826 827 if (port->passthrough_aux) { 827 828 ret = drm_dp_dpcd_write(port->passthrough_aux, 828 829 DP_DSC_ENABLE, 829 830 &enable_passthrough, 1); 830 - DC_LOG_DC("Sent DSC pass-through disable to virtual dpcd port, ret = %u\n", 831 - ret); 831 + drm_dbg_dp(dev, 832 + "Sent DSC pass-through disable to virtual dpcd port, ret = %u\n", 833 + ret); 832 834 } 833 835 } 834 836 } ··· 840 834 if (stream->signal == SIGNAL_TYPE_DISPLAY_PORT || stream->signal == SIGNAL_TYPE_EDP) { 841 835 if (stream->sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_NONE) { 842 836 ret = dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1); 843 - DC_LOG_DC("Send DSC %s to SST RX\n", enable_dsc ? "enable" : "disable"); 837 + drm_dbg_dp(dev, 838 + "Send DSC %s to SST RX\n", 839 + enable_dsc ? "enable" : "disable"); 844 840 } else if (stream->sink->link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER) { 845 841 ret = dm_helpers_dp_write_dpcd(ctx, stream->link, DP_DSC_ENABLE, &enable_dsc, 1); 846 - DC_LOG_DC("Send DSC %s to DP-HDMI PCON\n", enable_dsc ? "enable" : "disable"); 842 + drm_dbg_dp(dev, 843 + "Send DSC %s to DP-HDMI PCON\n", 844 + enable_dsc ? "enable" : "disable"); 847 845 } 848 846 } 849 847 ··· 1116 1106 struct pipe_ctx *pipes = link->dc->current_state->res_ctx.pipe_ctx; 1117 1107 struct pipe_ctx *pipe_ctx = NULL; 1118 1108 struct amdgpu_dm_connector *aconnector = link->priv; 1109 + struct drm_device *dev = aconnector->base.dev; 1119 1110 int i; 1120 1111 1121 1112 for (i = 0; i < MAX_PIPES; i++) { ··· 1194 1183 && pipe_ctx->stream->timing.display_color_depth != requestColorDepth) 1195 1184 || (requestPixelEncoding != PIXEL_ENCODING_UNDEFINED 1196 1185 && pipe_ctx->stream->timing.pixel_encoding != requestPixelEncoding)) { 1197 - DC_LOG_DEBUG("%s: original bpc %d pix encoding %d, changing to %d %d\n", 1198 - __func__, 1199 - pipe_ctx->stream->timing.display_color_depth, 1200 - pipe_ctx->stream->timing.pixel_encoding, 1201 - requestColorDepth, 1202 - requestPixelEncoding); 1186 + drm_dbg(dev, 1187 + "original bpc %d pix encoding %d, changing to %d %d\n", 1188 + pipe_ctx->stream->timing.display_color_depth, 1189 + pipe_ctx->stream->timing.pixel_encoding, 1190 + requestColorDepth, 1191 + requestPixelEncoding); 1203 1192 pipe_ctx->stream->timing.display_color_depth = requestColorDepth; 1204 1193 pipe_ctx->stream->timing.pixel_encoding = requestPixelEncoding; 1205 1194 ··· 1210 1199 if (aconnector->timing_requested) 1211 1200 *aconnector->timing_requested = pipe_ctx->stream->timing; 1212 1201 else 1213 - DC_LOG_ERROR("%s: timing storage failed\n", __func__); 1202 + drm_err(dev, "timing storage failed\n"); 1214 1203 1215 1204 } 1216 1205
+14 -8
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
··· 173 173 if (dc_link->sink_count) 174 174 dc_link_remove_remote_sink(dc_link, dc_sink); 175 175 176 - DC_LOG_MST("DM_MST: remove remote sink 0x%p, %d remaining\n", 177 - dc_sink, dc_link->sink_count); 176 + drm_dbg_dp(connector->dev, 177 + "DM_MST: remove remote sink 0x%p, %d remaining\n", 178 + dc_sink, dc_link->sink_count); 178 179 179 180 dc_sink_release(dc_sink); 180 181 aconnector->dc_sink = NULL; ··· 326 325 return 0; 327 326 } 328 327 329 - DC_LOG_MST("DM_MST: add remote sink 0x%p, %d remaining\n", 330 - dc_sink, aconnector->dc_link->sink_count); 328 + drm_dbg_dp(connector->dev, 329 + "DM_MST: add remote sink 0x%p, %d remaining\n", 330 + dc_sink, 331 + aconnector->dc_link->sink_count); 331 332 332 333 dc_sink->priv = aconnector; 333 334 aconnector->dc_sink = dc_sink; ··· 364 361 return 0; 365 362 } 366 363 367 - DC_LOG_MST("DM_MST: add remote sink 0x%p, %d remaining\n", 368 - dc_sink, aconnector->dc_link->sink_count); 364 + drm_dbg_dp(connector->dev, 365 + "DM_MST: add remote sink 0x%p, %d remaining\n", 366 + dc_sink, aconnector->dc_link->sink_count); 369 367 370 368 dc_sink->priv = aconnector; 371 369 /* dc_link_add_remote_sink returns a new reference */ ··· 485 481 if (aconnector->dc_link->sink_count) 486 482 dc_link_remove_remote_sink(aconnector->dc_link, aconnector->dc_sink); 487 483 488 - DC_LOG_MST("DM_MST: remove remote sink 0x%p, %d remaining\n", 489 - aconnector->dc_link, aconnector->dc_link->sink_count); 484 + drm_dbg_dp(connector->dev, 485 + "DM_MST: remove remote sink 0x%p, %d remaining\n", 486 + aconnector->dc_link, 487 + aconnector->dc_link->sink_count); 490 488 491 489 dc_sink_release(aconnector->dc_sink); 492 490 aconnector->dc_sink = NULL;
+3 -5
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
··· 1237 1237 if (!plane->state->fb && !old_plane_state->fb) 1238 1238 return; 1239 1239 1240 - DC_LOG_CURSOR("%s: crtc_id=%d with size %d to %d\n", 1241 - __func__, 1242 - amdgpu_crtc->crtc_id, 1243 - plane->state->crtc_w, 1244 - plane->state->crtc_h); 1240 + drm_dbg_atomic(plane->dev, "crtc_id=%d with size %d to %d\n", 1241 + amdgpu_crtc->crtc_id, plane->state->crtc_w, 1242 + plane->state->crtc_h); 1245 1243 1246 1244 ret = get_cursor_position(plane, crtc, &position); 1247 1245 if (ret)
+3
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c
··· 2746 2746 struct board_layout_info *board_layout_info) 2747 2747 { 2748 2748 unsigned int i; 2749 + struct bios_parser *bp; 2749 2750 enum bp_result record_result; 2750 2751 2751 2752 const unsigned int slot_index_to_vbios_id[MAX_BOARD_SLOTS] = { ··· 2754 2753 GENERICOBJECT_BRACKET_LAYOUT_ENUM_ID2, 2755 2754 0, 0 2756 2755 }; 2756 + 2757 + bp = BP_FROM_DCB(dcb); 2757 2758 2758 2759 if (board_layout_info == NULL) { 2759 2760 DC_LOG_DETECTION_EDID_PARSER("Invalid board_layout_info\n");
-2
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn201/dcn201_clk_mgr.c
··· 59 59 60 60 #define CTX \ 61 61 clk_mgr->base.ctx 62 - #define DC_LOGGER \ 63 - clk_mgr->base.ctx->logger 64 62 65 63 static const struct clk_mgr_registers clk_mgr_regs = { 66 64 CLK_COMMON_REG_LIST_DCN_201()
+12
drivers/gpu/drm/amd/display/dc/core/dc.c
··· 24 24 25 25 #include "dm_services.h" 26 26 27 + #include "amdgpu.h" 28 + 27 29 #include "dc.h" 28 30 29 31 #include "core_status.h" ··· 830 828 if (dc->ctx->created_bios) 831 829 dal_bios_parser_destroy(&dc->ctx->dc_bios); 832 830 831 + kfree(dc->ctx->logger); 833 832 dc_perf_trace_destroy(&dc->ctx->perf_trace); 834 833 835 834 kfree(dc->ctx); ··· 874 871 dc_ctx->clk_reg_offsets = init_params->clk_reg_offsets; 875 872 876 873 /* Create logger */ 874 + dc_ctx->logger = kmalloc(sizeof(*dc_ctx->logger), GFP_KERNEL); 875 + 876 + if (!dc_ctx->logger) { 877 + kfree(dc_ctx); 878 + return false; 879 + } 880 + 881 + dc_ctx->logger->dev = adev_to_drm(init_params->driver); 882 + dc->dml.logger = dc_ctx->logger; 877 883 878 884 dc_ctx->dce_version = resource_parse_asic_id(init_params->asic_id); 879 885
+2
drivers/gpu/drm/amd/display/dc/core/dc_debug.c
··· 36 36 37 37 #include "resource.h" 38 38 39 + #define DC_LOGGER \ 40 + dc->ctx->logger 39 41 #define DC_LOGGER_INIT(logger) 40 42 41 43
+2
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
··· 82 82 */ 83 83 #define VISUAL_CONFIRM_DPP_OFFSET_DENO 240 84 84 85 + #define DC_LOGGER \ 86 + dc->ctx->logger 85 87 #define DC_LOGGER_INIT(logger) 86 88 87 89 #define UNABLE_TO_SPLIT -1
+13 -13
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
··· 80 80 } 81 81 } 82 82 83 - void dc_dmub_srv_clear_inbox0_ack(struct dc_dmub_srv *dmub_srv) 83 + void dc_dmub_srv_clear_inbox0_ack(struct dc_dmub_srv *dc_dmub_srv) 84 84 { 85 - struct dmub_srv *dmub = dmub_srv->dmub; 86 - struct dc_context *dc_ctx = dmub_srv->ctx; 85 + struct dmub_srv *dmub = dc_dmub_srv->dmub; 86 + struct dc_context *dc_ctx = dc_dmub_srv->ctx; 87 87 enum dmub_status status = DMUB_STATUS_OK; 88 88 89 89 status = dmub_srv_clear_inbox0_ack(dmub); 90 90 if (status != DMUB_STATUS_OK) { 91 91 DC_ERROR("Error clearing INBOX0 ack: status=%d\n", status); 92 - dc_dmub_srv_log_diagnostic_data(dmub_srv); 92 + dc_dmub_srv_log_diagnostic_data(dc_dmub_srv); 93 93 } 94 94 } 95 95 96 - void dc_dmub_srv_wait_for_inbox0_ack(struct dc_dmub_srv *dmub_srv) 96 + void dc_dmub_srv_wait_for_inbox0_ack(struct dc_dmub_srv *dc_dmub_srv) 97 97 { 98 - struct dmub_srv *dmub = dmub_srv->dmub; 99 - struct dc_context *dc_ctx = dmub_srv->ctx; 98 + struct dmub_srv *dmub = dc_dmub_srv->dmub; 99 + struct dc_context *dc_ctx = dc_dmub_srv->ctx; 100 100 enum dmub_status status = DMUB_STATUS_OK; 101 101 102 102 status = dmub_srv_wait_for_inbox0_ack(dmub, 100000); 103 103 if (status != DMUB_STATUS_OK) { 104 104 DC_ERROR("Error waiting for INBOX0 HW Lock Ack\n"); 105 - dc_dmub_srv_log_diagnostic_data(dmub_srv); 105 + dc_dmub_srv_log_diagnostic_data(dc_dmub_srv); 106 106 } 107 107 } 108 108 109 - void dc_dmub_srv_send_inbox0_cmd(struct dc_dmub_srv *dmub_srv, 110 - union dmub_inbox0_data_register data) 109 + void dc_dmub_srv_send_inbox0_cmd(struct dc_dmub_srv *dc_dmub_srv, 110 + union dmub_inbox0_data_register data) 111 111 { 112 - struct dmub_srv *dmub = dmub_srv->dmub; 113 - struct dc_context *dc_ctx = dmub_srv->ctx; 112 + struct dmub_srv *dmub = dc_dmub_srv->dmub; 113 + struct dc_context *dc_ctx = dc_dmub_srv->ctx; 114 114 enum dmub_status status = DMUB_STATUS_OK; 115 115 116 116 status = dmub_srv_send_inbox0_cmd(dmub, data); 117 117 if (status != DMUB_STATUS_OK) { 118 118 DC_ERROR("Error sending INBOX0 cmd\n"); 119 - dc_dmub_srv_log_diagnostic_data(dmub_srv); 119 + dc_dmub_srv_log_diagnostic_data(dc_dmub_srv); 120 120 } 121 121 } 122 122
+3
drivers/gpu/drm/amd/display/dc/dc_helper.c
··· 36 36 #include "dc_dmub_srv.h" 37 37 #include "reg_helper.h" 38 38 39 + #define DC_LOGGER \ 40 + ctx->logger 41 + 39 42 static inline void submit_dmub_read_modify_write( 40 43 struct dc_reg_helper_state *offload, 41 44 const struct dc_context *ctx)
+1
drivers/gpu/drm/amd/display/dc/dc_types.h
··· 773 773 struct dc *dc; 774 774 775 775 void *driver_context; /* e.g. amdgpu_device */ 776 + struct dal_logger *logger; 776 777 struct dc_perf_trace *perf_trace; 777 778 void *cgs_device; 778 779
+5 -1
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c
··· 44 44 #define CTX \ 45 45 clk_src->base.ctx 46 46 47 - #define DC_LOGGER_INIT() 47 + #define DC_LOGGER \ 48 + calc_pll_cs->ctx->logger 49 + #define DC_LOGGER_INIT() \ 50 + struct calc_pll_clock_source *calc_pll_cs = &clk_src->calc_pll 48 51 49 52 #undef FN 50 53 #define FN(reg_name, field_name) \ ··· 1258 1255 struct pll_settings *pll_settings) 1259 1256 { 1260 1257 unsigned long long actual_pix_clk_100Hz = pix_clk_params ? pix_clk_params->requested_pix_clk_100hz : 0; 1258 + struct dce110_clk_src *clk_src = TO_DCE110_CLK_SRC(cs); 1261 1259 1262 1260 DC_LOGGER_INIT(); 1263 1261
+7 -2
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
··· 82 82 #define CTX \ 83 83 hws->ctx 84 84 85 - #define DC_LOGGER_INIT() 85 + #define DC_LOGGER \ 86 + ctx->logger 87 + #define DC_LOGGER_INIT() \ 88 + struct dc_context *ctx = dc->ctx 86 89 87 90 #define REG(reg)\ 88 91 hws->regs->reg ··· 2460 2457 struct dc_context *dc_ctx, 2461 2458 struct timing_generator *tg) 2462 2459 { 2460 + struct dc_context *ctx = dc_ctx; 2463 2461 bool rc = false; 2464 2462 2465 2463 /* To avoid endless loop we wait at most ··· 2504 2500 struct dc_context *dc_ctx = dc->ctx; 2505 2501 struct dcp_gsl_params gsl_params = { 0 }; 2506 2502 int i; 2503 + DC_LOGGER_INIT(); 2507 2504 2508 2505 DC_SYNC_INFO("GSL: Setting-up...\n"); 2509 2506 ··· 2550 2545 struct dc_context *dc_ctx = dc->ctx; 2551 2546 struct dcp_gsl_params gsl_params = { 0 }; 2552 2547 int i; 2548 + DC_LOGGER_INIT(); 2553 2549 2554 2550 gsl_params.gsl_group = 0; 2555 2551 gsl_params.gsl_master = 0; ··· 2696 2690 unsigned int i; 2697 2691 struct dce_hwseq *hws = dc->hwseq; 2698 2692 2699 - DC_LOGGER_INIT(); 2700 2693 memset(&tbl_entry, 0, sizeof(tbl_entry)); 2701 2694 2702 2695 memset(&adjust, 0, sizeof(adjust));
+14 -4
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
··· 57 57 #include "dce/dmub_outbox.h" 58 58 #include "link.h" 59 59 60 - #define DC_LOGGER_INIT(logger) 60 + #define DC_LOGGER \ 61 + dc_logger 62 + #define DC_LOGGER_INIT(logger) \ 63 + struct dal_logger *dc_logger = logger 61 64 62 65 #define CTX \ 63 66 hws->ctx ··· 1811 1808 // DC_LOG_ALL_TF_POINTS logs all channels of the tf 1812 1809 int i = 0; 1813 1810 1814 - DC_LOGGER_INIT(ctx->logger); 1815 1811 DC_LOG_GAMMA("Gamma Correction TF"); 1816 1812 DC_LOG_ALL_GAMMA("Logging all tf points..."); 1817 1813 DC_LOG_ALL_TF_CHANNELS("Logging all channels..."); ··· 1992 1990 { 1993 1991 bool rc = false; 1994 1992 1993 + DC_LOGGER_INIT(dc_ctx->logger); 1994 + 1995 1995 /* To avoid endless loop we wait at most 1996 1996 * frames_to_wait_on_triggered_reset frames for the reset to occur. */ 1997 1997 const uint32_t frames_to_wait_on_triggered_reset = 10; ··· 2121 2117 uint32_t dp_ref_clk_100hz = 2122 2118 dc->res_pool->dp_clock_source->ctx->dc->clk_mgr->dprefclk_khz*10; 2123 2119 2120 + DC_LOGGER_INIT(dc_ctx->logger); 2121 + 2124 2122 hw_crtc_timing = kcalloc(MAX_PIPES, sizeof(*hw_crtc_timing), GFP_KERNEL); 2125 2123 if (!hw_crtc_timing) 2126 2124 return master; ··· 2206 2200 struct timing_generator *tg; 2207 2201 int i, width, height, master; 2208 2202 2203 + DC_LOGGER_INIT(dc_ctx->logger); 2204 + 2209 2205 for (i = 1; i < group_size; i++) { 2210 2206 opp = grouped_pipes[i]->stream_res.opp; 2211 2207 tg = grouped_pipes[i]->stream_res.tg; ··· 2270 2262 struct output_pixel_processor *opp; 2271 2263 struct timing_generator *tg; 2272 2264 int i, width, height; 2265 + 2266 + DC_LOGGER_INIT(dc_ctx->logger); 2273 2267 2274 2268 DC_SYNC_INFO("Setting up OTG reset trigger\n"); 2275 2269 ··· 2349 2339 { 2350 2340 struct dc_context *dc_ctx = dc->ctx; 2351 2341 int i; 2342 + 2343 + DC_LOGGER_INIT(dc_ctx->logger); 2352 2344 2353 2345 DC_SYNC_INFO("Setting up\n"); 2354 2346 for (i = 0; i < group_size; i++) ··· 3005 2993 struct dc_state *context) 3006 2994 { 3007 2995 int i; 3008 - 3009 - DC_LOGGER_INIT(dc->ctx->logger); 3010 2996 3011 2997 for (i = 0; i < dc->res_pool->pipe_count; i++) { 3012 2998 struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
+2
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c
··· 30 30 #include "reg_helper.h" 31 31 #include "basics/conversion.h" 32 32 33 + #define DC_LOGGER \ 34 + ctx->logger 33 35 #define DC_LOGGER_INIT(logger) 34 36 35 37 #define REG(reg)\
+4 -3
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c
··· 56 56 #include "link_hwss.h" 57 57 #include "link.h" 58 58 59 - #define DC_LOGGER_INIT(logger) 59 + #define DC_LOGGER \ 60 + dc_logger 61 + #define DC_LOGGER_INIT(logger) \ 62 + struct dal_logger *dc_logger = logger 60 63 61 64 #define CTX \ 62 65 hws->ctx ··· 1997 1994 const unsigned int TIMEOUT_FOR_PIPE_ENABLE_US = 100000; 1998 1995 unsigned int polling_interval_us = 1; 1999 1996 struct dce_hwseq *hwseq = dc->hwseq; 2000 - 2001 - DC_LOGGER_INIT(dc->ctx->logger); 2002 1997 2003 1998 for (i = 0; i < dc->res_pool->pipe_count; i++) 2004 1999 if (context->res_ctx.pipe_ctx[i].update_flags.bits.disable)
+3
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_vmid.c
··· 38 38 #define FN(reg_name, field_name) \ 39 39 vmid->shifts->field_name, vmid->masks->field_name 40 40 41 + #define DC_LOGGER \ 42 + CTX->logger 43 + 41 44 static void dcn20_wait_for_vmid_ready(struct dcn20_vmid *vmid) 42 45 { 43 46 /* According the hardware spec, we need to poll for the lowest
+2
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c
··· 31 31 32 32 #include "dc_dmub_srv.h" 33 33 34 + #define DC_LOGGER \ 35 + ctx->logger 34 36 #define DC_LOGGER_INIT(logger) 35 37 36 38 #define REG(reg)\
+2
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
··· 91 91 #include "amdgpu_socbb.h" 92 92 #include "dc_dmub_srv.h" 93 93 94 + #define DC_LOGGER \ 95 + dc->ctx->logger 94 96 #define DC_LOGGER_INIT(logger) 95 97 96 98 enum dcn30_clk_src_array_id {
+2
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c
··· 92 92 #define TO_DCN301_RES_POOL(pool)\ 93 93 container_of(pool, struct dcn301_resource_pool, base) 94 94 95 + #define DC_LOGGER \ 96 + dc->ctx->logger 95 97 #define DC_LOGGER_INIT(logger) 96 98 97 99 enum dcn301_clk_src_array_id {
+2
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c
··· 74 74 #include "nbio/nbio_7_4_offset.h" 75 75 #include "amdgpu_socbb.h" 76 76 77 + #define DC_LOGGER \ 78 + dc->ctx->logger 77 79 #define DC_LOGGER_INIT(logger) 78 80 79 81 static const struct dc_debug_options debug_defaults_drv = {
+2
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
··· 56 56 57 57 #include "dml/dcn303/dcn303_fpu.h" 58 58 59 + #define DC_LOGGER \ 60 + dc->ctx->logger 59 61 #define DC_LOGGER_INIT(logger) 60 62 61 63
+2
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c
··· 104 104 105 105 #include "link_enc_cfg.h" 106 106 107 + #define DC_LOGGER \ 108 + dc->ctx->logger 107 109 #define DC_LOGGER_INIT(logger) 108 110 109 111 enum dcn31_clk_src_array_id {
+1 -1
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c
··· 62 62 #define REG(reg)\ 63 63 hws->regs->reg 64 64 #define DC_LOGGER \ 65 - dc->ctx->logger 65 + stream->ctx->logger 66 66 67 67 68 68 #undef FN
+2
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
··· 118 118 #define regBIF_BX2_BIOS_SCRATCH_6 0x003e 119 119 #define regBIF_BX2_BIOS_SCRATCH_6_BASE_IDX 1 120 120 121 + #define DC_LOGGER \ 122 + dc->ctx->logger 121 123 #define DC_LOGGER_INIT(logger) 122 124 123 125 enum dcn31_clk_src_array_id {
+1 -1
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
··· 58 58 #define REG(reg)\ 59 59 hws->regs->reg 60 60 #define DC_LOGGER \ 61 - dc->ctx->logger 61 + stream->ctx->logger 62 62 63 63 64 64 #undef FN
+5 -2
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_hwseq.c
··· 55 55 #include "dcn31/dcn31_hwseq.h" 56 56 #include "dcn20/dcn20_hwseq.h" 57 57 58 - #define DC_LOGGER_INIT(logger) 58 + #define DC_LOGGER_INIT(logger) \ 59 + struct dal_logger *dc_logger = logger 59 60 60 61 #define CTX \ 61 62 hws->ctx 62 63 #define REG(reg)\ 63 64 hws->regs->reg 64 65 #define DC_LOGGER \ 65 - dc->ctx->logger 66 + dc_logger 66 67 67 68 68 69 #undef FN ··· 341 340 struct dc_stream_state *stream = pipe_ctx->stream; 342 341 struct pipe_ctx *odm_pipe; 343 342 int opp_cnt = 1; 343 + 344 + DC_LOGGER_INIT(stream->ctx->logger); 344 345 345 346 ASSERT(dsc); 346 347 for (odm_pipe = pipe_ctx->next_odm_pipe; odm_pipe; odm_pipe = odm_pipe->next_odm_pipe)
+2
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
··· 34 34 #include "link.h" 35 35 #include "dcn20_fpu.h" 36 36 37 + #define DC_LOGGER \ 38 + dc->ctx->logger 37 39 #define DC_LOGGER_INIT(logger) 38 40 39 41 #ifndef MAX
+1 -1
drivers/gpu/drm/amd/display/dc/inc/hw/clk_mgr_internal.h
··· 73 73 clk_mgr->base.ctx 74 74 75 75 #define DC_LOGGER \ 76 - clk_mgr->base.ctx->logger 76 + dc->ctx->logger 77 77 78 78 79 79
+1
drivers/gpu/drm/amd/display/dc/os_types.h
··· 37 37 #include <asm/byteorder.h> 38 38 39 39 #include <drm/display/drm_dp_helper.h> 40 + #include <drm/drm_device.h> 40 41 #include <drm/drm_print.h> 41 42 42 43 #include "cgs_common.h"
+25 -119
drivers/gpu/drm/amd/display/include/logger_types.h
··· 28 28 29 29 #include "os_types.h" 30 30 31 - #define MAX_NAME_LEN 32 32 - 33 - #define DC_LOG_ERROR(...) DRM_ERROR(__VA_ARGS__) 34 - #define DC_LOG_WARNING(...) DRM_WARN(__VA_ARGS__) 35 - #define DC_LOG_DEBUG(...) DRM_DEBUG_KMS(__VA_ARGS__) 36 - #define DC_LOG_DC(...) DRM_DEBUG_KMS(__VA_ARGS__) 37 - #define DC_LOG_DTN(...) DRM_DEBUG_KMS(__VA_ARGS__) 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__) 38 35 #define DC_LOG_SURFACE(...) pr_debug("[SURFACE]:"__VA_ARGS__) 39 - #define DC_LOG_CURSOR(...) pr_debug("[CURSOR]:"__VA_ARGS__) 40 - #define DC_LOG_PFLIP(...) pr_debug("[PFLIP]:"__VA_ARGS__) 41 - #define DC_LOG_VBLANK(...) pr_debug("[VBLANK]:"__VA_ARGS__) 42 - #define DC_LOG_HW_HOTPLUG(...) DRM_DEBUG_KMS(__VA_ARGS__) 36 + #define DC_LOG_HW_HOTPLUG(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) 43 37 #define DC_LOG_HW_LINK_TRAINING(...) pr_debug("[HW_LINK_TRAINING]:"__VA_ARGS__) 44 - #define DC_LOG_HW_SET_MODE(...) DRM_DEBUG_KMS(__VA_ARGS__) 45 - #define DC_LOG_HW_RESUME_S3(...) DRM_DEBUG_KMS(__VA_ARGS__) 38 + #define DC_LOG_HW_RESUME_S3(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) 46 39 #define DC_LOG_HW_AUDIO(...) pr_debug("[HW_AUDIO]:"__VA_ARGS__) 47 - #define DC_LOG_HW_HPD_IRQ(...) DRM_DEBUG_KMS(__VA_ARGS__) 48 - #define DC_LOG_MST(...) DRM_DEBUG_KMS(__VA_ARGS__) 40 + #define DC_LOG_HW_HPD_IRQ(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) 41 + #define DC_LOG_MST(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) 49 42 #define DC_LOG_SCALER(...) pr_debug("[SCALER]:"__VA_ARGS__) 50 43 #define DC_LOG_BIOS(...) pr_debug("[BIOS]:"__VA_ARGS__) 51 44 #define DC_LOG_BANDWIDTH_CALCS(...) pr_debug("[BANDWIDTH_CALCS]:"__VA_ARGS__) 52 - #define DC_LOG_BANDWIDTH_VALIDATION(...) DRM_DEBUG_KMS(__VA_ARGS__) 53 - #define DC_LOG_I2C_AUX(...) DRM_DEBUG_KMS(__VA_ARGS__) 54 - #define DC_LOG_SYNC(...) DRM_DEBUG_KMS(__VA_ARGS__) 55 - #define DC_LOG_BACKLIGHT(...) DRM_DEBUG_KMS(__VA_ARGS__) 56 - #define DC_LOG_FEATURE_OVERRIDE(...) DRM_DEBUG_KMS(__VA_ARGS__) 57 - #define DC_LOG_DETECTION_EDID_PARSER(...) DRM_DEBUG_KMS(__VA_ARGS__) 58 - #define DC_LOG_DETECTION_DP_CAPS(...) DRM_DEBUG_KMS(__VA_ARGS__) 59 - #define DC_LOG_RESOURCE(...) DRM_DEBUG_KMS(__VA_ARGS__) 45 + #define DC_LOG_BANDWIDTH_VALIDATION(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) 46 + #define DC_LOG_SYNC(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) 47 + #define DC_LOG_BACKLIGHT(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) 48 + #define DC_LOG_DETECTION_EDID_PARSER(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) 49 + #define DC_LOG_DETECTION_DP_CAPS(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) 60 50 #define DC_LOG_DML(...) pr_debug("[DML]:"__VA_ARGS__) 61 - #define DC_LOG_EVENT_MODE_SET(...) DRM_DEBUG_KMS(__VA_ARGS__) 62 - #define DC_LOG_EVENT_DETECTION(...) DRM_DEBUG_KMS(__VA_ARGS__) 63 - #define DC_LOG_EVENT_LINK_TRAINING(...) DRM_DEBUG_KMS(__VA_ARGS__) 64 - #define DC_LOG_EVENT_LINK_LOSS(...) DRM_DEBUG_KMS(__VA_ARGS__) 65 - #define DC_LOG_EVENT_UNDERFLOW(...) DRM_DEBUG_KMS(__VA_ARGS__) 51 + #define DC_LOG_EVENT_MODE_SET(...) drm_dbg_kms((DC_LOGGER)->dev, __VA_ARGS__) 52 + #define DC_LOG_EVENT_DETECTION(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) 53 + #define DC_LOG_EVENT_LINK_TRAINING(...) \ 54 + drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) 55 + #define DC_LOG_EVENT_LINK_LOSS(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) 66 56 #define DC_LOG_IF_TRACE(...) pr_debug("[IF_TRACE]:"__VA_ARGS__) 67 - #define DC_LOG_PERF_TRACE(...) DRM_DEBUG_KMS(__VA_ARGS__) 68 - #define DC_LOG_RETIMER_REDRIVER(...) DRM_DEBUG_KMS(__VA_ARGS__) 57 + #define DC_LOG_PERF_TRACE(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) 58 + #define DC_LOG_RETIMER_REDRIVER(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) 69 59 #define DC_LOG_GAMMA(...) pr_debug("[GAMMA]:"__VA_ARGS__) 70 60 #define DC_LOG_ALL_GAMMA(...) pr_debug("[GAMMA]:"__VA_ARGS__) 71 61 #define DC_LOG_ALL_TF_CHANNELS(...) pr_debug("[GAMMA]:"__VA_ARGS__) 72 - #define DC_LOG_DSC(...) DRM_DEBUG_KMS(__VA_ARGS__) 62 + #define DC_LOG_DSC(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) 73 63 #define DC_LOG_SMU(...) pr_debug("[SMU_MSG]:"__VA_ARGS__) 74 - #define DC_LOG_DWB(...) DRM_DEBUG_KMS(__VA_ARGS__) 75 - #define DC_LOG_DP2(...) DRM_DEBUG_KMS(__VA_ARGS__) 64 + #define DC_LOG_DWB(...) drm_dbg((DC_LOGGER)->dev, __VA_ARGS__) 65 + #define DC_LOG_DP2(...) drm_dbg_dp((DC_LOGGER)->dev, __VA_ARGS__) 76 66 #define DC_LOG_AUTO_DPM_TEST(...) pr_debug("[AutoDPMTest]: "__VA_ARGS__) 77 - 78 - struct dal_logger; 79 67 80 68 struct dc_log_buffer_ctx { 81 69 char *buf; ··· 71 83 size_t size; 72 84 }; 73 85 74 - enum dc_log_type { 75 - LOG_ERROR = 0, 76 - LOG_WARNING, 77 - LOG_DEBUG, 78 - LOG_DC, 79 - LOG_DTN, 80 - LOG_SURFACE, 81 - LOG_HW_HOTPLUG, 82 - LOG_HW_LINK_TRAINING, 83 - LOG_HW_SET_MODE, 84 - LOG_HW_RESUME_S3, 85 - LOG_HW_AUDIO, 86 - LOG_HW_HPD_IRQ, 87 - LOG_MST, 88 - LOG_SCALER, 89 - LOG_BIOS, 90 - LOG_BANDWIDTH_CALCS, 91 - LOG_BANDWIDTH_VALIDATION, 92 - LOG_I2C_AUX, 93 - LOG_SYNC, 94 - LOG_BACKLIGHT, 95 - LOG_FEATURE_OVERRIDE, 96 - LOG_DETECTION_EDID_PARSER, 97 - LOG_DETECTION_DP_CAPS, 98 - LOG_RESOURCE, 99 - LOG_DML, 100 - LOG_EVENT_MODE_SET, 101 - LOG_EVENT_DETECTION, 102 - LOG_EVENT_LINK_TRAINING, 103 - LOG_EVENT_LINK_LOSS, 104 - LOG_EVENT_UNDERFLOW, 105 - LOG_IF_TRACE, 106 - LOG_PERF_TRACE, 107 - LOG_DISPLAYSTATS, 108 - LOG_HDMI_RETIMER_REDRIVER, 109 - LOG_DSC, 110 - LOG_SMU_MSG, 111 - LOG_DC2RESERVED4, 112 - LOG_DC2RESERVED5, 113 - LOG_DWB, 114 - LOG_GAMMA_DEBUG, 115 - LOG_MAX_HW_POINTS, 116 - LOG_ALL_TF_CHANNELS, 117 - LOG_SAMPLE_1DLUT, 118 - LOG_DP2, 119 - LOG_DC2RESERVED12, 120 - LOG_AUTO_DPM_TEST, 86 + struct dal_logger { 87 + struct drm_device *dev; 121 88 }; 122 - 123 - #define DC_MIN_LOG_MASK ((1 << LOG_ERROR) | \ 124 - (1 << LOG_DETECTION_EDID_PARSER)) 125 - 126 - #define DC_DEFAULT_LOG_MASK ((1ULL << LOG_ERROR) | \ 127 - (1ULL << LOG_WARNING) | \ 128 - (1ULL << LOG_EVENT_MODE_SET) | \ 129 - (1ULL << LOG_EVENT_DETECTION) | \ 130 - (1ULL << LOG_EVENT_LINK_TRAINING) | \ 131 - (1ULL << LOG_EVENT_LINK_LOSS) | \ 132 - (1ULL << LOG_EVENT_UNDERFLOW) | \ 133 - (1ULL << LOG_RESOURCE) | \ 134 - (1ULL << LOG_FEATURE_OVERRIDE) | \ 135 - (1ULL << LOG_DETECTION_EDID_PARSER) | \ 136 - (1ULL << LOG_DC) | \ 137 - (1ULL << LOG_HW_HOTPLUG) | \ 138 - (1ULL << LOG_HW_SET_MODE) | \ 139 - (1ULL << LOG_HW_RESUME_S3) | \ 140 - (1ULL << LOG_HW_HPD_IRQ) | \ 141 - (1ULL << LOG_SYNC) | \ 142 - (1ULL << LOG_BANDWIDTH_VALIDATION) | \ 143 - (1ULL << LOG_MST) | \ 144 - (1ULL << LOG_DETECTION_DP_CAPS) | \ 145 - (1ULL << LOG_BACKLIGHT)) | \ 146 - (1ULL << LOG_I2C_AUX) | \ 147 - (1ULL << LOG_IF_TRACE) | \ 148 - (1ULL << LOG_HDMI_FRL) | \ 149 - (1ULL << LOG_SCALER) | \ 150 - (1ULL << LOG_DTN) | \ 151 - (1ULL << LOG_AUTO_DPM_TEST)/* | \ 152 - (1ULL << LOG_DEBUG) | \ 153 - (1ULL << LOG_BIOS) | \ 154 - (1ULL << LOG_SURFACE) | \ 155 - (1ULL << LOG_DML) | \ 156 - (1ULL << LOG_HW_LINK_TRAINING) | \ 157 - (1ULL << LOG_HW_AUDIO)| \ 158 - (1ULL << LOG_BANDWIDTH_CALCS)*/ 159 89 160 90 #endif /* __DAL_LOGGER_TYPES_H__ */