Skip to content

Commit 3f670b7

Browse files
Rodrigo Siqueiraalexdeucher
authored andcommitted
drm/amd/display: Add clear DCC and Tiling callback for DCE
Introduce the DCC and Tiling reset callback to all DCE versions that can call it. Reviewed-by: Alvin Lee <alvin.lee2@amd.com> Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Roman Li <roman.li@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 2b04d04 commit 3f670b7

File tree

6 files changed

+9
-16
lines changed

6 files changed

+9
-16
lines changed

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

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -290,21 +290,7 @@ void dc_plane_force_dcc_and_tiling_disable(struct dc_plane_state *plane_state,
290290
if (!pipe_ctx)
291291
continue;
292292

293-
if (dc->ctx->dce_version >= DCE_VERSION_MAX) {
294-
if (dc->hwss.clear_surface_dcc_and_tiling)
295-
dc->hwss.clear_surface_dcc_and_tiling(pipe_ctx, plane_state, clear_tiling);
296-
} else {
297-
struct mem_input *mi = pipe_ctx->plane_res.mi;
298-
if (!mi)
299-
continue;
300-
/* if framebuffer is tiled, disable tiling */
301-
if (clear_tiling && mi->funcs->mem_input_clear_tiling)
302-
mi->funcs->mem_input_clear_tiling(mi);
303-
304-
/* force page flip to see the new content of the framebuffer */
305-
mi->funcs->mem_input_program_surface_flip_and_addr(mi,
306-
&plane_state->address,
307-
true);
308-
}
293+
if (dc->hwss.clear_surface_dcc_and_tiling)
294+
dc->hwss.clear_surface_dcc_and_tiling(pipe_ctx, plane_state, clear_tiling);
309295
}
310296
}

drivers/gpu/drm/amd/display/dc/dce60/dce60_hw_sequencer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,5 +428,6 @@ void dce60_hw_sequencer_construct(struct dc *dc)
428428
dc->hwss.pipe_control_lock = dce60_pipe_control_lock;
429429
dc->hwss.prepare_bandwidth = dce100_prepare_bandwidth;
430430
dc->hwss.optimize_bandwidth = dce100_optimize_bandwidth;
431+
dc->hwss.clear_surface_dcc_and_tiling = dce100_reset_surface_dcc_and_tiling;
431432
}
432433

drivers/gpu/drm/amd/display/dc/hwss/dce100/dce100_hwseq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ void dce100_hw_sequencer_construct(struct dc *dc)
138138
dc->hwseq->funcs.enable_display_power_gating = dce100_enable_display_power_gating;
139139
dc->hwss.prepare_bandwidth = dce100_prepare_bandwidth;
140140
dc->hwss.optimize_bandwidth = dce100_optimize_bandwidth;
141+
dc->hwss.clear_surface_dcc_and_tiling = dce100_reset_surface_dcc_and_tiling;
141142
}
142143

143144
/**

drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "dce110_hwseq.h"
3434
#include "dce110/dce110_timing_generator.h"
3535
#include "dce/dce_hwseq.h"
36+
#include "dce100/dce100_hwseq.h"
3637
#include "gpio_service_interface.h"
3738

3839
#include "dce110/dce110_compressor.h"
@@ -3332,6 +3333,7 @@ static const struct hw_sequencer_funcs dce110_funcs = {
33323333
.post_unlock_program_front_end = dce110_post_unlock_program_front_end,
33333334
.update_plane_addr = update_plane_addr,
33343335
.update_pending_status = dce110_update_pending_status,
3336+
.clear_surface_dcc_and_tiling = dce100_reset_surface_dcc_and_tiling,
33353337
.enable_accelerated_mode = dce110_enable_accelerated_mode,
33363338
.enable_timing_synchronization = dce110_enable_timing_synchronization,
33373339
.enable_per_frame_crtc_position_reset = dce110_enable_per_frame_crtc_position_reset,

drivers/gpu/drm/amd/display/dc/hwss/dce120/dce120_hwseq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "dce120_hwseq.h"
3030
#include "dce/dce_hwseq.h"
3131

32+
#include "dce100/dce100_hwseq.h"
3233
#include "dce110/dce110_hwseq.h"
3334

3435
#include "dce/dce_12_0_offset.h"
@@ -264,5 +265,6 @@ void dce120_hw_sequencer_construct(struct dc *dc)
264265
dce110_hw_sequencer_construct(dc);
265266
dc->hwseq->funcs.enable_display_power_gating = dce120_enable_display_power_gating;
266267
dc->hwss.update_dchub = dce120_update_dchub;
268+
dc->hwss.clear_surface_dcc_and_tiling = dce100_reset_surface_dcc_and_tiling;
267269
}
268270

drivers/gpu/drm/amd/display/dc/hwss/dce80/dce80_hwseq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,6 @@ void dce80_hw_sequencer_construct(struct dc *dc)
5050
dc->hwss.pipe_control_lock = dce_pipe_control_lock;
5151
dc->hwss.prepare_bandwidth = dce100_prepare_bandwidth;
5252
dc->hwss.optimize_bandwidth = dce100_optimize_bandwidth;
53+
dc->hwss.clear_surface_dcc_and_tiling = dce100_reset_surface_dcc_and_tiling;
5354
}
5455

0 commit comments

Comments
 (0)