Skip to content

Commit b827224

Browse files
Rodrigo Siqueiraalexdeucher
authored andcommitted
drm/amd/display: Drop dc_commit_state in favor of dc_commit_streams
[Why & How] There are two functions responsible for handling the DC commit state: dc_commit_state and dc_commit_streams. Both have the same goal, but dc_commit_streams surpess dc_commit_state in terms of completeness. For this reason, maintaining these two functions makes maintainability unnecessarily complicated. This commit replaces the old dc_commit_state in favor of dc_commit_streams, and removes the old dc_commit_state. Reviewed-by: Harry Wentland <[email protected]> Acked-by: Qingqing Zhuo <[email protected]> Signed-off-by: Rodrigo Siqueira <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 2820433 commit b827224

File tree

3 files changed

+3
-54
lines changed

3 files changed

+3
-54
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,7 +2486,7 @@ static enum dc_status amdgpu_dm_commit_zero_streams(struct dc *dc)
24862486
goto fail;
24872487
}
24882488

2489-
res = dc_commit_state(dc, context);
2489+
res = dc_commit_streams(dc, context->streams, context->stream_count);
24902490

24912491
fail:
24922492
dc_release_state(context);
@@ -2745,7 +2745,7 @@ static int dm_resume(void *handle)
27452745
dc_enable_dmub_outbox(adev->dm.dc);
27462746
}
27472747

2748-
WARN_ON(!dc_commit_state(dm->dc, dc_state));
2748+
WARN_ON(!dc_commit_streams(dm->dc, dc_state->streams, dc_state->stream_count));
27492749

27502750
dm_gpureset_commit_state(dm->cached_dc_state, dm);
27512751

@@ -8482,7 +8482,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
84828482

84838483
dm_enable_per_frame_crtc_master_sync(dc_state);
84848484
mutex_lock(&dm->dc_lock);
8485-
WARN_ON(!dc_commit_state(dm->dc, dc_state));
8485+
WARN_ON(!dc_commit_streams(dm->dc, dc_state->streams, dc_state->stream_count));
84868486

84878487
/* Allow idle optimization when vblank count is 0 for display off */
84888488
if (dm->active_vblank_irq_count == 0)

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2061,53 +2061,6 @@ enum dc_status dc_commit_streams(struct dc *dc,
20612061
return res;
20622062
}
20632063

2064-
/* TODO: When the transition to the new commit sequence is done, remove this
2065-
* function in favor of dc_commit_streams. */
2066-
bool dc_commit_state(struct dc *dc, struct dc_state *context)
2067-
{
2068-
enum dc_status result = DC_ERROR_UNEXPECTED;
2069-
int i;
2070-
2071-
/* TODO: Since change commit sequence can have a huge impact,
2072-
* we decided to only enable it for DCN3x. However, as soon as
2073-
* we get more confident about this change we'll need to enable
2074-
* the new sequence for all ASICs. */
2075-
if (dc->ctx->dce_version >= DCN_VERSION_3_2) {
2076-
result = dc_commit_streams(dc, context->streams, context->stream_count);
2077-
return result == DC_OK;
2078-
}
2079-
2080-
if (!streams_changed(dc, context->streams, context->stream_count)) {
2081-
return DC_OK;
2082-
}
2083-
2084-
DC_LOG_DC("%s: %d streams\n",
2085-
__func__, context->stream_count);
2086-
2087-
for (i = 0; i < context->stream_count; i++) {
2088-
struct dc_stream_state *stream = context->streams[i];
2089-
2090-
dc_stream_log(dc, stream);
2091-
}
2092-
2093-
/*
2094-
* Previous validation was perfomred with fast_validation = true and
2095-
* the full DML state required for hardware programming was skipped.
2096-
*
2097-
* Re-validate here to calculate these parameters / watermarks.
2098-
*/
2099-
result = dc_validate_global_state(dc, context, false);
2100-
if (result != DC_OK) {
2101-
DC_LOG_ERROR("DC commit global validation failure: %s (%d)",
2102-
dc_status_to_str(result), result);
2103-
return result;
2104-
}
2105-
2106-
result = dc_commit_state_no_check(dc, context);
2107-
2108-
return (result == DC_OK);
2109-
}
2110-
21112064
bool dc_acquire_release_mpc_3dlut(
21122065
struct dc *dc, bool acquire,
21132066
struct dc_stream_state *stream,

drivers/gpu/drm/amd/display/dc/dc.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,10 +1360,6 @@ enum dc_status dc_commit_streams(struct dc *dc,
13601360
struct dc_stream_state *streams[],
13611361
uint8_t stream_count);
13621362

1363-
/* TODO: When the transition to the new commit sequence is done, remove this
1364-
* function in favor of dc_commit_streams. */
1365-
bool dc_commit_state(struct dc *dc, struct dc_state *context);
1366-
13671363
struct dc_state *dc_create_state(struct dc *dc);
13681364
struct dc_state *dc_copy_state(struct dc_state *src_ctx);
13691365
void dc_retain_state(struct dc_state *context);

0 commit comments

Comments
 (0)