Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Revert "drm/amdgpu: validate user pitch alignment"

The check turned out to be too strict in some cases.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Michel Dänzer and committed by
Alex Deucher
92b0730e 25ec429e

-10
-10
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
··· 531 531 struct drm_gem_object *obj; 532 532 struct amdgpu_framebuffer *amdgpu_fb; 533 533 int ret; 534 - struct amdgpu_device *adev = dev->dev_private; 535 - int cpp = drm_format_plane_cpp(mode_cmd->pixel_format, 0); 536 - int pitch = mode_cmd->pitches[0] / cpp; 537 - 538 - pitch = amdgpu_align_pitch(adev, pitch, cpp, false); 539 - if (mode_cmd->pitches[0] != pitch) { 540 - DRM_DEBUG_KMS("Invalid pitch: expecting %d but got %d\n", 541 - pitch, mode_cmd->pitches[0]); 542 - return ERR_PTR(-EINVAL); 543 - } 544 534 545 535 obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]); 546 536 if (obj == NULL) {