[03/15] drm/amdgpu: validate mst topology in atomic check
diff mbox series

Message ID 12913419239b363a0c20c0c013b2dc3cfd4effb6.1568833906.git.mikita.lipski@amd.com
State New
Headers show
Series
  • DSC MST support for AMDGPU
Related show

Commit Message

Lipski, Mikita Sept. 18, 2019, 8:26 p.m. UTC
From: Mikita Lipski <mikita.lipski@amd.com>

[why]
Validate mst topology and the number of VCPI slots available
for a new state. Fail if topology has no more bandwidth for
a new state.
[how]
Pass the atomic state to drm_dp_mst_atomic_check to verify
if the new topology is possible.

Cc: Lyude Paul <lyude@redhat.com>
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Lyude Paul Sept. 19, 2019, 11:40 p.m. UTC | #1
This also needs to be squashed into the previous two patches. There's no point
in using drm_dp_atomic_find_vcpi_slots() or drm_dp_atomic_release_vcpi_slots()
without drm_dp_mst_atomic_check(), since the VCPI allocations setup by the two
functions aren't validated until then.

On Wed, 2019-09-18 at 16:26 -0400, mikita.lipski@amd.com wrote:
> From: Mikita Lipski <mikita.lipski@amd.com>
> 
> [why]
> Validate mst topology and the number of VCPI slots available
> for a new state. Fail if topology has no more bandwidth for
> a new state.
> [how]
> Pass the atomic state to drm_dp_mst_atomic_check to verify
> if the new topology is possible.
> 
> Cc: Lyude Paul <lyude@redhat.com>
> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index d700b962d338..39c239a08633 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -7485,6 +7485,11 @@ static int amdgpu_dm_atomic_check(struct drm_device
> *dev,
>  	if (ret)
>  		goto fail;
>  
> +	/* Perform validation of MST topology in the state*/
> +	ret = drm_dp_mst_atomic_check(state);
> +	if (ret)
> +		goto fail;
> +
>  	if (state->legacy_cursor_update) {
>  		/*
>  		 * This is a fast cursor update coming from the plane update

Patch
diff mbox series

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index d700b962d338..39c239a08633 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -7485,6 +7485,11 @@  static int amdgpu_dm_atomic_check(struct drm_device *dev,
 	if (ret)
 		goto fail;
 
+	/* Perform validation of MST topology in the state*/
+	ret = drm_dp_mst_atomic_check(state);
+	if (ret)
+		goto fail;
+
 	if (state->legacy_cursor_update) {
 		/*
 		 * This is a fast cursor update coming from the plane update