Commit a414cd70 authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher
Browse files

drm/amdgpu: cleanup amdgpu_cs_ioctl to make code logicality clear

parent a08d8c92
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -1054,28 +1054,28 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
	r = amdgpu_cs_parser_init(&parser, data);
	if (r) {
		DRM_ERROR("Failed to initialize parser !\n");
		amdgpu_cs_parser_fini(&parser, r, false);
		r = amdgpu_cs_handle_lockup(adev, r);
		return r;
		goto out;
	}

	r = amdgpu_cs_parser_bos(&parser, data);
	if (r) {
		if (r == -ENOMEM)
			DRM_ERROR("Not enough memory for command submission!\n");
	else if (r && r != -ERESTARTSYS)
		else if (r != -ERESTARTSYS)
			DRM_ERROR("Failed to process the buffer list %d!\n", r);
	else if (!r) {
		goto out;
	}

	reserved_buffers = true;
	r = amdgpu_cs_ib_fill(adev, &parser);
	}
	if (r)
		goto out;

	if (!r) {
	r = amdgpu_cs_dependencies(adev, &parser);
		if (r)
	if (r) {
		DRM_ERROR("Failed in the dependencies handling %d!\n", r);
	}

	if (r)
		goto out;
	}

	for (i = 0; i < parser.job->num_ibs; i++)
		trace_amdgpu_cs(&parser, i);