Commit 92b0730e authored by Michel Dänzer's avatar Michel Dänzer Committed by Alex Deucher
Browse files

Revert "drm/amdgpu: validate user pitch alignment"



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

Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 25ec429e
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -531,16 +531,6 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev,
	struct drm_gem_object *obj;
	struct amdgpu_framebuffer *amdgpu_fb;
	int ret;
	struct amdgpu_device *adev = dev->dev_private;
	int cpp = drm_format_plane_cpp(mode_cmd->pixel_format, 0);
	int pitch = mode_cmd->pitches[0] / cpp;

	pitch = amdgpu_align_pitch(adev, pitch, cpp, false);
	if (mode_cmd->pitches[0] != pitch) {
		DRM_DEBUG_KMS("Invalid pitch: expecting %d but got %d\n",
			      pitch, mode_cmd->pitches[0]);
		return ERR_PTR(-EINVAL);
	}

	obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
	if (obj ==  NULL) {