.. | .. |
---|
33 | 33 | |
---|
34 | 34 | #include "core_status.h" |
---|
35 | 35 | #include "core_types.h" |
---|
36 | | -#include "hw_sequencer.h" |
---|
37 | 36 | |
---|
38 | 37 | #include "resource.h" |
---|
39 | 38 | |
---|
.. | .. |
---|
115 | 114 | plane_state->clip_rect.height); |
---|
116 | 115 | |
---|
117 | 116 | SURFACE_TRACE( |
---|
118 | | - "plane_state->plane_size.grph.surface_size.x = %d;\n" |
---|
119 | | - "plane_state->plane_size.grph.surface_size.y = %d;\n" |
---|
120 | | - "plane_state->plane_size.grph.surface_size.width = %d;\n" |
---|
121 | | - "plane_state->plane_size.grph.surface_size.height = %d;\n" |
---|
122 | | - "plane_state->plane_size.grph.surface_pitch = %d;\n", |
---|
123 | | - plane_state->plane_size.grph.surface_size.x, |
---|
124 | | - plane_state->plane_size.grph.surface_size.y, |
---|
125 | | - plane_state->plane_size.grph.surface_size.width, |
---|
126 | | - plane_state->plane_size.grph.surface_size.height, |
---|
127 | | - plane_state->plane_size.grph.surface_pitch); |
---|
| 117 | + "plane_state->plane_size.surface_size.x = %d;\n" |
---|
| 118 | + "plane_state->plane_size.surface_size.y = %d;\n" |
---|
| 119 | + "plane_state->plane_size.surface_size.width = %d;\n" |
---|
| 120 | + "plane_state->plane_size.surface_size.height = %d;\n" |
---|
| 121 | + "plane_state->plane_size.surface_pitch = %d;\n", |
---|
| 122 | + plane_state->plane_size.surface_size.x, |
---|
| 123 | + plane_state->plane_size.surface_size.y, |
---|
| 124 | + plane_state->plane_size.surface_size.width, |
---|
| 125 | + plane_state->plane_size.surface_size.height, |
---|
| 126 | + plane_state->plane_size.surface_pitch); |
---|
128 | 127 | |
---|
129 | 128 | |
---|
130 | 129 | SURFACE_TRACE( |
---|
.. | .. |
---|
202 | 201 | SURFACE_TRACE( |
---|
203 | 202 | "plane_info->color_space = %d;\n" |
---|
204 | 203 | "plane_info->format = %d;\n" |
---|
205 | | - "plane_info->plane_size.grph.surface_pitch = %d;\n" |
---|
206 | | - "plane_info->plane_size.grph.surface_size.height = %d;\n" |
---|
207 | | - "plane_info->plane_size.grph.surface_size.width = %d;\n" |
---|
208 | | - "plane_info->plane_size.grph.surface_size.x = %d;\n" |
---|
209 | | - "plane_info->plane_size.grph.surface_size.y = %d;\n" |
---|
| 204 | + "plane_info->plane_size.surface_pitch = %d;\n" |
---|
| 205 | + "plane_info->plane_size.surface_size.height = %d;\n" |
---|
| 206 | + "plane_info->plane_size.surface_size.width = %d;\n" |
---|
| 207 | + "plane_info->plane_size.surface_size.x = %d;\n" |
---|
| 208 | + "plane_info->plane_size.surface_size.y = %d;\n" |
---|
210 | 209 | "plane_info->rotation = %d;\n" |
---|
211 | 210 | "plane_info->stereo_format = %d;\n", |
---|
212 | 211 | update->plane_info->color_space, |
---|
213 | 212 | update->plane_info->format, |
---|
214 | | - update->plane_info->plane_size.grph.surface_pitch, |
---|
215 | | - update->plane_info->plane_size.grph.surface_size.height, |
---|
216 | | - update->plane_info->plane_size.grph.surface_size.width, |
---|
217 | | - update->plane_info->plane_size.grph.surface_size.x, |
---|
218 | | - update->plane_info->plane_size.grph.surface_size.y, |
---|
| 213 | + update->plane_info->plane_size.surface_pitch, |
---|
| 214 | + update->plane_info->plane_size.surface_size.height, |
---|
| 215 | + update->plane_info->plane_size.surface_size.width, |
---|
| 216 | + update->plane_info->plane_size.surface_size.x, |
---|
| 217 | + update->plane_info->plane_size.surface_size.y, |
---|
219 | 218 | update->plane_info->rotation, |
---|
220 | 219 | update->plane_info->stereo_format); |
---|
221 | 220 | |
---|
.. | .. |
---|
310 | 309 | struct resource_context *res_ctx) |
---|
311 | 310 | { |
---|
312 | 311 | int i; |
---|
313 | | - struct dc *core_dc = dc; |
---|
314 | | - int h_pos[MAX_PIPES], v_pos[MAX_PIPES]; |
---|
| 312 | + int h_pos[MAX_PIPES] = {0}, v_pos[MAX_PIPES] = {0}; |
---|
315 | 313 | struct crtc_position position; |
---|
316 | | - unsigned int underlay_idx = core_dc->res_pool->underlay_pipe_index; |
---|
| 314 | + unsigned int underlay_idx = dc->res_pool->underlay_pipe_index; |
---|
317 | 315 | DC_LOGGER_INIT(dc->ctx->logger); |
---|
318 | 316 | |
---|
319 | 317 | |
---|
320 | | - for (i = 0; i < core_dc->res_pool->pipe_count; i++) { |
---|
| 318 | + for (i = 0; i < dc->res_pool->pipe_count; i++) { |
---|
321 | 319 | struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i]; |
---|
322 | 320 | /* get_position() returns CRTC vertical/horizontal counter |
---|
323 | 321 | * hence not applicable for underlay pipe |
---|
324 | 322 | */ |
---|
325 | | - if (pipe_ctx->stream == NULL |
---|
326 | | - || pipe_ctx->pipe_idx == underlay_idx) |
---|
| 323 | + if (pipe_ctx->stream == NULL || pipe_ctx->pipe_idx == underlay_idx) |
---|
327 | 324 | continue; |
---|
328 | 325 | |
---|
329 | 326 | pipe_ctx->stream_res.tg->funcs->get_position(pipe_ctx->stream_res.tg, &position); |
---|
330 | 327 | h_pos[i] = position.horizontal_count; |
---|
331 | 328 | v_pos[i] = position.vertical_count; |
---|
332 | 329 | } |
---|
333 | | - for (i = 0; i < core_dc->res_pool->pipe_count; i++) { |
---|
| 330 | + for (i = 0; i < dc->res_pool->pipe_count; i++) { |
---|
334 | 331 | struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i]; |
---|
335 | 332 | |
---|
336 | | - if (pipe_ctx->stream == NULL) |
---|
| 333 | + if (pipe_ctx->stream == NULL || pipe_ctx->pipe_idx == underlay_idx) |
---|
337 | 334 | continue; |
---|
338 | 335 | |
---|
339 | 336 | TIMING_TRACE("OTG_%d H_tot:%d V_tot:%d H_pos:%d V_pos:%d\n", |
---|
.. | .. |
---|
348 | 345 | struct dc *dc, |
---|
349 | 346 | struct dc_state *context) |
---|
350 | 347 | { |
---|
351 | | -#if defined(CONFIG_DRM_AMD_DC_DCN1_0) |
---|
| 348 | +#if defined(CONFIG_DRM_AMD_DC_DCN) |
---|
352 | 349 | DC_LOGGER_INIT(dc->ctx->logger); |
---|
353 | 350 | CLOCK_TRACE("Current: dispclk_khz:%d max_dppclk_khz:%d dcfclk_khz:%d\n" |
---|
354 | 351 | "dcfclk_deep_sleep_khz:%d fclk_khz:%d socclk_khz:%d\n", |
---|
355 | | - context->bw.dcn.clk.dispclk_khz, |
---|
356 | | - context->bw.dcn.clk.dppclk_khz, |
---|
357 | | - context->bw.dcn.clk.dcfclk_khz, |
---|
358 | | - context->bw.dcn.clk.dcfclk_deep_sleep_khz, |
---|
359 | | - context->bw.dcn.clk.fclk_khz, |
---|
360 | | - context->bw.dcn.clk.socclk_khz); |
---|
| 352 | + context->bw_ctx.bw.dcn.clk.dispclk_khz, |
---|
| 353 | + context->bw_ctx.bw.dcn.clk.dppclk_khz, |
---|
| 354 | + context->bw_ctx.bw.dcn.clk.dcfclk_khz, |
---|
| 355 | + context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz, |
---|
| 356 | + context->bw_ctx.bw.dcn.clk.fclk_khz, |
---|
| 357 | + context->bw_ctx.bw.dcn.clk.socclk_khz); |
---|
361 | 358 | CLOCK_TRACE("Calculated: dispclk_khz:%d max_dppclk_khz:%d dcfclk_khz:%d\n" |
---|
362 | 359 | "dcfclk_deep_sleep_khz:%d fclk_khz:%d socclk_khz:%d\n", |
---|
363 | | - context->bw.dcn.clk.dispclk_khz, |
---|
364 | | - context->bw.dcn.clk.dppclk_khz, |
---|
365 | | - context->bw.dcn.clk.dcfclk_khz, |
---|
366 | | - context->bw.dcn.clk.dcfclk_deep_sleep_khz, |
---|
367 | | - context->bw.dcn.clk.fclk_khz, |
---|
368 | | - context->bw.dcn.clk.socclk_khz); |
---|
| 360 | + context->bw_ctx.bw.dcn.clk.dispclk_khz, |
---|
| 361 | + context->bw_ctx.bw.dcn.clk.dppclk_khz, |
---|
| 362 | + context->bw_ctx.bw.dcn.clk.dcfclk_khz, |
---|
| 363 | + context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz, |
---|
| 364 | + context->bw_ctx.bw.dcn.clk.fclk_khz, |
---|
| 365 | + context->bw_ctx.bw.dcn.clk.socclk_khz); |
---|
369 | 366 | #endif |
---|
370 | 367 | } |
---|
| 368 | + |
---|
| 369 | +/** |
---|
| 370 | + * dc_status_to_str - convert dc_status to a human readable string |
---|
| 371 | + * @status: dc_status to be converted |
---|
| 372 | + * |
---|
| 373 | + * Return: |
---|
| 374 | + * A string describing the DC status. |
---|
| 375 | + */ |
---|
| 376 | +char *dc_status_to_str(enum dc_status status) |
---|
| 377 | +{ |
---|
| 378 | + switch (status) { |
---|
| 379 | + case DC_OK: |
---|
| 380 | + return "DC OK"; |
---|
| 381 | + case DC_NO_CONTROLLER_RESOURCE: |
---|
| 382 | + return "No controller resource"; |
---|
| 383 | + case DC_NO_STREAM_ENC_RESOURCE: |
---|
| 384 | + return "No stream encoder"; |
---|
| 385 | + case DC_NO_CLOCK_SOURCE_RESOURCE: |
---|
| 386 | + return "No clock source"; |
---|
| 387 | + case DC_FAIL_CONTROLLER_VALIDATE: |
---|
| 388 | + return "Controller validation failure"; |
---|
| 389 | + case DC_FAIL_ENC_VALIDATE: |
---|
| 390 | + return "Encoder validation failure"; |
---|
| 391 | + case DC_FAIL_ATTACH_SURFACES: |
---|
| 392 | + return "Surfaces attachment failure"; |
---|
| 393 | + case DC_FAIL_DETACH_SURFACES: |
---|
| 394 | + return "Surfaces detachment failure"; |
---|
| 395 | + case DC_FAIL_SURFACE_VALIDATE: |
---|
| 396 | + return "Surface validation failure"; |
---|
| 397 | + case DC_NO_DP_LINK_BANDWIDTH: |
---|
| 398 | + return "No DP link bandwidth"; |
---|
| 399 | + case DC_EXCEED_DONGLE_CAP: |
---|
| 400 | + return "Exceed dongle capability"; |
---|
| 401 | + case DC_SURFACE_PIXEL_FORMAT_UNSUPPORTED: |
---|
| 402 | + return "Unsupported pixel format"; |
---|
| 403 | + case DC_FAIL_BANDWIDTH_VALIDATE: |
---|
| 404 | + return "Bandwidth validation failure (BW and Watermark)"; |
---|
| 405 | + case DC_FAIL_SCALING: |
---|
| 406 | + return "Scaling failure"; |
---|
| 407 | + case DC_FAIL_DP_LINK_TRAINING: |
---|
| 408 | + return "DP link training failure"; |
---|
| 409 | + case DC_FAIL_DSC_VALIDATE: |
---|
| 410 | + return "DSC validation failure"; |
---|
| 411 | + case DC_NO_DSC_RESOURCE: |
---|
| 412 | + return "No DSC resource"; |
---|
| 413 | + case DC_FAIL_UNSUPPORTED_1: |
---|
| 414 | + return "Unsupported"; |
---|
| 415 | + case DC_FAIL_CLK_EXCEED_MAX: |
---|
| 416 | + return "Clk exceed max failure"; |
---|
| 417 | + case DC_FAIL_CLK_BELOW_MIN: |
---|
| 418 | + return "Fail clk below minimum"; |
---|
| 419 | + case DC_FAIL_CLK_BELOW_CFG_REQUIRED: |
---|
| 420 | + return "Fail clk below required CFG (hard_min in PPLIB)"; |
---|
| 421 | + case DC_ERROR_UNEXPECTED: |
---|
| 422 | + return "Unexpected error"; |
---|
| 423 | + } |
---|
| 424 | + |
---|
| 425 | + return "Unexpected status error"; |
---|
| 426 | +} |
---|