Commit 059fe829 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'drm-fixes-2020-12-11' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "Last week of fixes, just amdgpu and i915 collections. We had a i915
  regression reported by HJ Lu reported this morning, and this contains
  a fix for that he has tested.

  There are a fair few other fixes, but they are spread across the two
  drivers, and all fairly self contained.

  amdgpu:
   - Fan fix for CI asics
   - Fix a warning in possible_crtcs
   - Build fix for when debugfs is disabled
   - Display overflow fix
   - Display watermark fixes for Renoir
   - SDMA 5.2 fix
   - Stolen vga memory regression fix
   - Power profile fixes
   - Fix a regression from removal of GEM and PRIME callbacks

  amdkfd:
   - Fix a memory leak in dmabuf import

  i915:
   - rc7 regression fix for modesetting
   - vdsc/dp slice fixes
   - gen9 mocs entries fix
   - preemption timeout fix
   - unsigned compare against 0 fix
   - selftest fix
   - submission error propogatig fix
   - request flow suspend fix"

* tag 'drm-fixes-2020-12-11' of git://anongit.freedesktop.org/drm/drm:
  drm/i915/display: Go softly softly on initial modeset failure
  drm/amd/pm: typo fix (CUSTOM -> COMPUTE)
  drm/amdgpu: Initialise drm_gem_object_funcs for imported BOs
  drm/amdgpu: fix size calculation with stolen vga memory
  drm/amd/pm: update smu10.h WORKLOAD_PPLIB setting for raven
  drm/amdkfd: Fix leak in dmabuf import
  drm/amdgpu: fix sdma instance fw version and feature version init
  drm/amd/display: Add wm table for Renoir
  drm/amd/display: Prevent bandwidth overflow
  drm/amdgpu: fix debugfs creation/removal, again
  drm/amdgpu/disply: set num_crtc earlier
  drm/amdgpu/powerplay: parse fan table for CI asics
  drm/i915/gt: Declare gen9 has 64 mocs entries!
  drm/i915/display/dp: Compute the correct slice count for VDSC on DP
  drm/i915: fix size_t greater or equal to zero comparison
  drm/i915/gt: Cancel the preemption timeout on responding to it
  drm/i915/gt: Ignore repeated attempts to suspend request flow across reset
  drm/i915/gem: Propagate error from cancelled submit due to context closure
  drm/i915/gem: Check the correct variable in selftest
parents 33dc9614 b1f195fc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -459,6 +459,7 @@ amdgpu_dma_buf_create_obj(struct drm_device *dev, struct dma_buf *dma_buf)
	struct amdgpu_device *adev = drm_to_adev(dev);
	struct amdgpu_bo *bo;
	struct amdgpu_bo_param bp;
	struct drm_gem_object *gobj;
	int ret;

	memset(&bp, 0, sizeof(bp));
@@ -469,17 +470,20 @@ amdgpu_dma_buf_create_obj(struct drm_device *dev, struct dma_buf *dma_buf)
	bp.type = ttm_bo_type_sg;
	bp.resv = resv;
	dma_resv_lock(resv, NULL);
	ret = amdgpu_bo_create(adev, &bp, &bo);
	ret = amdgpu_gem_object_create(adev, dma_buf->size, PAGE_SIZE,
			AMDGPU_GEM_DOMAIN_CPU,
			0, ttm_bo_type_sg, resv, &gobj);
	if (ret)
		goto error;

	bo = gem_to_amdgpu_bo(gobj);
	bo->allowed_domains = AMDGPU_GEM_DOMAIN_GTT;
	bo->preferred_domains = AMDGPU_GEM_DOMAIN_GTT;
	if (dma_buf->ops != &amdgpu_dmabuf_ops)
		bo->prime_shared_count = 1;

	dma_resv_unlock(resv);
	return &bo->tbo.base;
	return gobj;

error:
	dma_resv_unlock(resv);
+23 −18
Original line number Diff line number Diff line
@@ -66,26 +66,12 @@ int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size,
	bp.type = type;
	bp.resv = resv;
	bp.preferred_domain = initial_domain;
retry:
	bp.flags = flags;
	bp.domain = initial_domain;
	r = amdgpu_bo_create(adev, &bp, &bo);
	if (r) {
		if (r != -ERESTARTSYS) {
			if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) {
				flags &= ~AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
				goto retry;
			}

			if (initial_domain == AMDGPU_GEM_DOMAIN_VRAM) {
				initial_domain |= AMDGPU_GEM_DOMAIN_GTT;
				goto retry;
			}
			DRM_DEBUG("Failed to allocate GEM object (%ld, %d, %u, %d)\n",
				  size, initial_domain, alignment, r);
		}
	if (r)
		return r;
	}

	*obj = &bo->tbo.base;

	return 0;
@@ -225,7 +211,7 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
	uint64_t size = args->in.bo_size;
	struct dma_resv *resv = NULL;
	struct drm_gem_object *gobj;
	uint32_t handle;
	uint32_t handle, initial_domain;
	int r;

	/* reject invalid gem flags */
@@ -269,9 +255,28 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
		resv = vm->root.base.bo->tbo.base.resv;
	}

retry:
	initial_domain = (u32)(0xffffffff & args->in.domains);
	r = amdgpu_gem_object_create(adev, size, args->in.alignment,
				     (u32)(0xffffffff & args->in.domains),
				     initial_domain,
				     flags, ttm_bo_type_device, resv, &gobj);
	if (r) {
		if (r != -ERESTARTSYS) {
			if (flags & AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED) {
				flags &= ~AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
				goto retry;
			}

			if (initial_domain == AMDGPU_GEM_DOMAIN_VRAM) {
				initial_domain |= AMDGPU_GEM_DOMAIN_GTT;
				goto retry;
			}
			DRM_DEBUG("Failed to allocate GEM object (%llu, %d, %llu, %d)\n",
				  size, initial_domain, args->in.alignment, r);
		}
		return r;
	}

	if (flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID) {
		if (!r) {
			struct amdgpu_bo *abo = gem_to_amdgpu_bo(gobj);
+3 −0
Original line number Diff line number Diff line
@@ -499,6 +499,9 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
	else
		size = amdgpu_gmc_get_vbios_fb_size(adev);

	if (adev->mman.keep_stolen_vga_memory)
		size = max(size, (unsigned)AMDGPU_VBIOS_VGA_ALLOCATION);

	/* set to 0 if the pre-OS buffer uses up most of vram */
	if ((adev->gmc.real_vram_size - size) < (8 * 1024 * 1024))
		size = 0;
+5 −8
Original line number Diff line number Diff line
@@ -1172,7 +1172,7 @@ static void amdgpu_ras_debugfs_create_ctrl_node(struct amdgpu_device *adev)
			con->dir, &con->disable_ras_err_cnt_harvest);
}

void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
static void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
		struct ras_fs_if *head)
{
	struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
@@ -1194,7 +1194,6 @@ void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,

void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev)
{
#if defined(CONFIG_DEBUG_FS)
	struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
	struct ras_manager *obj;
	struct ras_fs_if fs_info;
@@ -1203,7 +1202,7 @@ void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev)
	 * it won't be called in resume path, no need to check
	 * suspend and gpu reset status
	 */
	if (!con)
	if (!IS_ENABLED(CONFIG_DEBUG_FS) || !con)
		return;

	amdgpu_ras_debugfs_create_ctrl_node(adev);
@@ -1217,10 +1216,9 @@ void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev)
			amdgpu_ras_debugfs_create(adev, &fs_info);
		}
	}
#endif
}

void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev,
static void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev,
		struct ras_common_if *head)
{
	struct ras_manager *obj = amdgpu_ras_find_obj(adev, head);
@@ -1234,7 +1232,6 @@ void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev,

static void amdgpu_ras_debugfs_remove_all(struct amdgpu_device *adev)
{
#if defined(CONFIG_DEBUG_FS)
	struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
	struct ras_manager *obj, *tmp;

@@ -1243,7 +1240,6 @@ static void amdgpu_ras_debugfs_remove_all(struct amdgpu_device *adev)
	}

	con->dir = NULL;
#endif
}
/* debugfs end */

@@ -1291,6 +1287,7 @@ static int amdgpu_ras_fs_init(struct amdgpu_device *adev)

static int amdgpu_ras_fs_fini(struct amdgpu_device *adev)
{
	if (IS_ENABLED(CONFIG_DEBUG_FS))
		amdgpu_ras_debugfs_remove_all(adev);
	amdgpu_ras_sysfs_remove_all(adev);
	return 0;
+0 −6
Original line number Diff line number Diff line
@@ -607,14 +607,8 @@ int amdgpu_ras_sysfs_create(struct amdgpu_device *adev,
int amdgpu_ras_sysfs_remove(struct amdgpu_device *adev,
		struct ras_common_if *head);

void amdgpu_ras_debugfs_create(struct amdgpu_device *adev,
		struct ras_fs_if *head);

void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev);

void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev,
		struct ras_common_if *head);

int amdgpu_ras_error_query(struct amdgpu_device *adev,
		struct ras_query_if *info);

Loading