[PATCH] drm/amdgpu: add more cases to DCE11 possible crtc mask setup

Michel Dänzer michel at daenzer.net
Fri Feb 10 06:47:20 UTC 2017


On 10/02/17 02:02 PM, Alex Deucher wrote:
> Add cases for asics with 3 and 5 crtcs.  Fixes an artificial
> limitation on asics with 3 or 5 crtcs.
> 
> Fixes:
> https://bugs.freedesktop.org/show_bug.cgi?id=99744
> 
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> Cc: stable at vger.kernel.org
> ---
>  drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> index 1cf1d9d..5b24e89 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> @@ -3737,9 +3737,15 @@ static void dce_v11_0_encoder_add(struct amdgpu_device *adev,
>  	default:
>  		encoder->possible_crtcs = 0x3;
>  		break;
> +	case 3:
> +		encoder->possible_crtcs = 0x7;
> +		break;
>  	case 4:
>  		encoder->possible_crtcs = 0xf;
>  		break;
> +	case 5:
> +		encoder->possible_crtcs = 0x1f;
> +		break;
>  	case 6:
>  		encoder->possible_crtcs = 0x3f;
>  		break;
> 

The switch statement could be simplified to something like:

	switch (adev->mode_info.num_crtc) {
        case 2:
        default:
                encoder->possible_crtcs = 0x3;
                break;
	case 1:
	case 3:
        case 4:
	case 5:
        case 6:
                encoder->possible_crtcs = (1 << adev->mode_info.num_crtc) - 1;
                break;
        }

Either way,

Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the amd-gfx mailing list