Commit cc51bbc7 authored by Mario Limonciello's avatar Mario Limonciello Committed by Alex Deucher
Browse files

drm/amd: Use drm_*() macros instead of DRM_*() for amdgpu_cs



Some of the IOCTL messages can be called for different GPUs and it might
not be obvious which one called them from a problem.  Using the drm_*()
macros the correct device will be shown in the messages.

Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Link: https://lore.kernel.org/r/20250715212420.2254925-1-superm1@kernel.org


Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 130c7ed8
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -396,7 +396,7 @@ static int amdgpu_cs_p2_ib(struct amdgpu_cs_parser *p,
			   chunk_ib->ib_bytes : 0,
			   AMDGPU_IB_POOL_DELAYED, ib);
	if (r) {
		DRM_ERROR("Failed to get ib !\n");
		drm_err(adev_to_drm(p->adev), "Failed to get ib !\n");
		return r;
	}

@@ -468,7 +468,7 @@ static int amdgpu_syncobj_lookup_and_add(struct amdgpu_cs_parser *p,

	r = drm_syncobj_find_fence(p->filp, handle, point, flags, &fence);
	if (r) {
		DRM_ERROR("syncobj %u failed to find fence @ %llu (%d)!\n",
		drm_err(adev_to_drm(p->adev), "syncobj %u failed to find fence @ %llu (%d)!\n",
			  handle, point, r);
		return r;
	}
@@ -902,7 +902,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
					 sizeof(struct page *),
					 GFP_KERNEL);
		if (!e->user_pages) {
			DRM_ERROR("kvmalloc_array failure\n");
			drm_err(adev_to_drm(p->adev), "kvmalloc_array failure\n");
			r = -ENOMEM;
			goto out_free_user_pages;
		}
@@ -983,7 +983,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
	r = amdgpu_vm_validate(p->adev, &fpriv->vm, NULL,
			       amdgpu_cs_bo_validate, p);
	if (r) {
		DRM_ERROR("amdgpu_vm_validate() failed.\n");
		drm_err(adev_to_drm(p->adev), "amdgpu_vm_validate() failed.\n");
		goto out_free_user_pages;
	}

@@ -1061,13 +1061,13 @@ static int amdgpu_cs_patch_ibs(struct amdgpu_cs_parser *p,
		va_start = ib->gpu_addr & AMDGPU_GMC_HOLE_MASK;
		r = amdgpu_cs_find_mapping(p, va_start, &aobj, &m);
		if (r) {
			DRM_ERROR("IB va_start is invalid\n");
			drm_err(adev_to_drm(p->adev), "IB va_start is invalid\n");
			return r;
		}

		if ((va_start + ib->length_dw * 4) >
		    (m->last + 1) * AMDGPU_GPU_PAGE_SIZE) {
			DRM_ERROR("IB va_start+ib_bytes is invalid\n");
			drm_err(adev_to_drm(p->adev), "IB va_start+ib_bytes is invalid\n");
			return -EINVAL;
		}

@@ -1235,7 +1235,7 @@ static int amdgpu_cs_sync_rings(struct amdgpu_cs_parser *p)
	r = amdgpu_ctx_wait_prev_fence(p->ctx, p->entities[p->gang_leader_idx]);
	if (r) {
		if (r != -ERESTARTSYS)
			DRM_ERROR("amdgpu_ctx_wait_prev_fence failed.\n");
			drm_err(adev_to_drm(p->adev), "amdgpu_ctx_wait_prev_fence failed.\n");
		return r;
	}

@@ -1448,7 +1448,7 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)

	r = amdgpu_cs_parser_init(&parser, adev, filp, data);
	if (r) {
		DRM_ERROR_RATELIMITED("Failed to initialize parser %d!\n", r);
		drm_err_ratelimited(dev, "Failed to initialize parser %d!\n", r);
		return r;
	}

@@ -1463,9 +1463,9 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
	r = amdgpu_cs_parser_bos(&parser, data);
	if (r) {
		if (r == -ENOMEM)
			DRM_ERROR("Not enough memory for command submission!\n");
			drm_err(dev, "Not enough memory for command submission!\n");
		else if (r != -ERESTARTSYS && r != -EAGAIN)
			DRM_DEBUG("Failed to process the buffer list %d!\n", r);
			drm_dbg(dev, "Failed to process the buffer list %d!\n", r);
		goto error_fini;
	}