Skip to content

Commit 214993e

Browse files
Mikita Lipskialexdeucher
authored andcommitted
drm/amd/display: introduce mpo detection flags
[why] We want to know if new crtc state is enabling MPO configuration before enabling it. [how] Detect if both primary and overlay planes are enabled on the same CRTC. Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 46a7438 commit 214993e

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10761,6 +10761,8 @@ static int dm_update_plane_state(struct dc *dc,
1076110761

1076210762
dm_new_plane_state->dc_state = dc_new_plane_state;
1076310763

10764+
dm_new_crtc_state->mpo_requested |= (plane->type == DRM_PLANE_TYPE_OVERLAY);
10765+
1076410766
/* Tell DC to do a full surface update every time there
1076510767
* is a plane change. Inefficient, but works for now.
1076610768
*/
@@ -10913,7 +10915,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
1091310915
enum dc_status status;
1091410916
int ret, i;
1091510917
bool lock_and_validation_needed = false;
10916-
struct dm_crtc_state *dm_old_crtc_state;
10918+
struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state;
1091710919
#if defined(CONFIG_DRM_AMD_DC_DCN)
1091810920
struct dsc_mst_fairness_vars vars[MAX_PIPES];
1091910921
struct drm_dp_mst_topology_state *mst_state;
@@ -11095,6 +11097,12 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
1109511097
goto fail;
1109611098
}
1109711099

11100+
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
11101+
dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
11102+
if (dm_new_crtc_state->mpo_requested)
11103+
DRM_DEBUG_DRIVER("MPO enablement requested on crtc:[%p]\n", crtc);
11104+
}
11105+
1109811106
/* Check cursor planes scaling */
1109911107
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
1110011108
ret = dm_check_crtc_cursor(state, crtc, new_crtc_state);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,8 @@ struct dm_crtc_state {
626626
bool cm_has_degamma;
627627
bool cm_is_degamma_srgb;
628628

629+
bool mpo_requested;
630+
629631
int update_type;
630632
int active_planes;
631633

0 commit comments

Comments
 (0)