diff options
| author | Qingqing Zhuo <qingqing.zhuo@amd.com> | 2021-04-14 19:14:14 -0400 | 
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2021-04-15 16:32:45 -0400 | 
| commit | fe180178390b264ffab631eca85e97430ad77d16 (patch) | |
| tree | 217144e08ca11be7007a16218bc26a9f88afa3fa /drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | |
| parent | 2b60818258dca9391109fdaa4d79f77a489bf1a6 (diff) | |
Revert "Revert "drm/amdgpu: Ensure that the modifier requested is supported by plane.""
This reverts commit 55fa622fe635bfc3f2587d784f6facc30f8fdf12.
The regression caused by the original patch has been
cleared, thus introduce back the change.
Signed-off-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_display.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 13 | 
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 9a2f811450ed..2e622c1675d7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c @@ -908,6 +908,19 @@ int amdgpu_display_gem_fb_verify_and_init(  					 &amdgpu_fb_funcs);  	if (ret)  		goto err; +	/* Verify that the modifier is supported. */ +	if (!drm_any_plane_has_format(dev, mode_cmd->pixel_format, +				      mode_cmd->modifier[0])) { +		struct drm_format_name_buf format_name; +		drm_dbg_kms(dev, +			    "unsupported pixel format %s / modifier 0x%llx\n", +			    drm_get_format_name(mode_cmd->pixel_format, +						&format_name), +			    mode_cmd->modifier[0]); + +		ret = -EINVAL; +		goto err; +	}  	ret = amdgpu_display_framebuffer_init(dev, rfb, mode_cmd, obj);  	if (ret)  | 
