Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac5e43c9 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge branch 'drm-next-4.8' of git://people.freedesktop.org/~agd5f/linux into drm-next

A few more patches for amdgpu and radeon for 4.8.  The big change is
the additional power feature enablement for polaris that was pending
the 4.7 back merge.  The rest are mainly bug fixes and cleanups.

* 'drm-next-4.8' of git://people.freedesktop.org/~agd5f/linux: (59 commits)
  drm/amd/powerplay: remove enable_clock_power_gatings_tasks from initialize and resume events
  drm/amd/powerplay: move clockgating to after ungating power in pp for uvd/vce
  drm/amdgpu: add query device id and revision id into system info entry at CGS
  drm/amdgpu: add new definition in bif header
  drm/amd/powerplay: rename smum header guards
  drm/amdgpu: enable UVD context buffer for older HW
  drm/amdgpu: fix default UVD context size
  drm/amdgpu: fix incorrect type of info_id
  drm/amdgpu: make amdgpu_cgs_call_acpi_method as static
  drm/amdgpu: comment out unused defaults_staturn_pro static const structure to fix the build
  drm/amdgpu: enable UVD VM only on polaris
  drm/amdgpu: increase timeout of IB test
  drm/amdgpu: add destroy session when generate VCE destroy msg.
  drm/amd: fix deadlock of job_list_lock V2
  drm/amd: reset hw count when reset job
  drm/amdgpu: free handles after fini the context
  drm/ttm: partial revert "cleanup ttm_tt_(unbind|destroy)" v3
  drm/amdgpu: add a fence timeout for the IB tests v2
  drm/amdgpu: move UVD IB test into common code v2
  drm/amdgpu: use begin/end_use for VCE power/clock gating
  ...
parents e470f3a2 d4ccb71d
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -306,13 +306,16 @@ struct amdgpu_ring_funcs {
				uint32_t oa_base, uint32_t oa_size);
	/* testing functions */
	int (*test_ring)(struct amdgpu_ring *ring);
	int (*test_ib)(struct amdgpu_ring *ring);
	int (*test_ib)(struct amdgpu_ring *ring, long timeout);
	/* insert NOP packets */
	void (*insert_nop)(struct amdgpu_ring *ring, uint32_t count);
	/* pad the indirect buffer to the necessary number of dw */
	void (*pad_ib)(struct amdgpu_ring *ring, struct amdgpu_ib *ib);
	unsigned (*init_cond_exec)(struct amdgpu_ring *ring);
	void (*patch_cond_exec)(struct amdgpu_ring *ring, unsigned offset);
	/* note usage for clock and power gating */
	void (*begin_use)(struct amdgpu_ring *ring);
	void (*end_use)(struct amdgpu_ring *ring);
};

/*
@@ -772,7 +775,6 @@ struct amdgpu_ring {
	struct amdgpu_fence_driver	fence_drv;
	struct amd_gpu_scheduler	sched;

	spinlock_t              fence_lock;
	struct amdgpu_bo	*ring_obj;
	volatile uint32_t	*ring;
	unsigned		rptr_offs;
@@ -1679,6 +1681,7 @@ struct amdgpu_uvd {
	struct amdgpu_ring	ring;
	struct amdgpu_irq_src	irq;
	bool			address_64_bit;
	bool			use_ctx_buf;
	struct amd_sched_entity entity;
};

@@ -1700,6 +1703,7 @@ struct amdgpu_vce {
	struct drm_file		*filp[AMDGPU_MAX_VCE_HANDLES];
	uint32_t		img_size[AMDGPU_MAX_VCE_HANDLES];
	struct delayed_work	idle_work;
	struct mutex		idle_mutex;
	const struct firmware	*fw;	/* VCE firmware */
	struct amdgpu_ring	ring[AMDGPU_MAX_VCE_RINGS];
	struct amdgpu_irq_src	irq;
@@ -2242,7 +2246,7 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
#define amdgpu_vm_set_pte_pde(adev, ib, pe, addr, count, incr, flags) ((adev)->vm_manager.vm_pte_funcs->set_pte_pde((ib), (pe), (addr), (count), (incr), (flags)))
#define amdgpu_ring_parse_cs(r, p, ib) ((r)->funcs->parse_cs((p), (ib)))
#define amdgpu_ring_test_ring(r) (r)->funcs->test_ring((r))
#define amdgpu_ring_test_ib(r) (r)->funcs->test_ib((r))
#define amdgpu_ring_test_ib(r, t) (r)->funcs->test_ib((r), (t))
#define amdgpu_ring_get_rptr(r) (r)->funcs->get_rptr((r))
#define amdgpu_ring_get_wptr(r) (r)->funcs->get_wptr((r))
#define amdgpu_ring_set_wptr(r) (r)->funcs->set_wptr((r))
+8 −17
Original line number Diff line number Diff line
@@ -551,16 +551,11 @@ int amdgpu_atombios_get_clock_info(struct amdgpu_device *adev)
		    le16_to_cpu(firmware_info->info.usReferenceClock);
		ppll->reference_div = 0;

		if (crev < 2)
			ppll->pll_out_min =
				le16_to_cpu(firmware_info->info.usMinPixelClockPLL_Output);
		else
		ppll->pll_out_min =
			le32_to_cpu(firmware_info->info_12.ulMinPixelClockPLL_Output);
		ppll->pll_out_max =
		    le32_to_cpu(firmware_info->info.ulMaxPixelClockPLL_Output);

		if (crev >= 4) {
		ppll->lcd_pll_out_min =
			le16_to_cpu(firmware_info->info_14.usLcdMinPixelClockPLL_Output) * 100;
		if (ppll->lcd_pll_out_min == 0)
@@ -569,10 +564,6 @@ int amdgpu_atombios_get_clock_info(struct amdgpu_device *adev)
			le16_to_cpu(firmware_info->info_14.usLcdMaxPixelClockPLL_Output) * 100;
		if (ppll->lcd_pll_out_max == 0)
			ppll->lcd_pll_out_max = ppll->pll_out_max;
		} else {
			ppll->lcd_pll_out_min = ppll->pll_out_min;
			ppll->lcd_pll_out_max = ppll->pll_out_max;
		}

		if (ppll->pll_out_min == 0)
			ppll->pll_out_min = 64800;
+1 −1
Original line number Diff line number Diff line
@@ -539,7 +539,6 @@ static int amdgpu_atpx_get_client_id(struct pci_dev *pdev)
static const struct vga_switcheroo_handler amdgpu_atpx_handler = {
	.switchto = amdgpu_atpx_switchto,
	.power_state = amdgpu_atpx_power_state,
	.init = amdgpu_atpx_init,
	.get_client_id = amdgpu_atpx_get_client_id,
};

@@ -574,6 +573,7 @@ static bool amdgpu_atpx_detect(void)
		printk(KERN_INFO "vga_switcheroo: detected switching method %s handle\n",
		       acpi_method_name);
		amdgpu_atpx_priv.atpx_detected = true;
		amdgpu_atpx_init();
		return true;
	}
	return false;
+7 −7
Original line number Diff line number Diff line
@@ -352,22 +352,22 @@ bool amdgpu_get_bios(struct amdgpu_device *adev)
	uint16_t tmp, bios_header_start;

	r = amdgpu_atrm_get_bios(adev);
	if (r == false)
	if (!r)
		r = amdgpu_acpi_vfct_bios(adev);
	if (r == false)
	if (!r)
		r = igp_read_bios_from_vram(adev);
	if (r == false)
	if (!r)
		r = amdgpu_read_bios(adev);
	if (r == false) {
	if (!r) {
		r = amdgpu_read_bios_from_rom(adev);
	}
	if (r == false) {
	if (!r) {
		r = amdgpu_read_disabled_bios(adev);
	}
	if (r == false) {
	if (!r) {
		r = amdgpu_read_platform_bios(adev);
	}
	if (r == false || adev->bios == NULL) {
	if (!r || adev->bios == NULL) {
		DRM_ERROR("Unable to locate a BIOS ROM\n");
		adev->bios = NULL;
		return false;
+21 −17
Original line number Diff line number Diff line
@@ -830,6 +830,12 @@ static int amdgpu_cgs_query_system_info(struct cgs_device *cgs_device,
	case CGS_SYSTEM_INFO_PCIE_MLW:
		sys_info->value = adev->pm.pcie_mlw_mask;
		break;
	case CGS_SYSTEM_INFO_PCIE_DEV:
		sys_info->value = adev->pdev->device;
		break;
	case CGS_SYSTEM_INFO_PCIE_REV:
		sys_info->value = adev->pdev->revision;
		break;
	case CGS_SYSTEM_INFO_CG_FLAGS:
		sys_info->value = adev->cg_flags;
		break;
@@ -915,14 +921,12 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
	acpi_handle handle;
	struct acpi_object_list input;
	struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
	union acpi_object *params = NULL;
	union acpi_object *obj = NULL;
	union acpi_object *params, *obj;
	uint8_t name[5] = {'\0'};
	struct cgs_acpi_method_argument *argument = NULL;
	struct cgs_acpi_method_argument *argument;
	uint32_t i, count;
	acpi_status status;
	int result = 0;
	uint32_t func_no = 0xFFFFFFFF;
	int result;

	handle = ACPI_HANDLE(&adev->pdev->dev);
	if (!handle)
@@ -939,7 +943,6 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
		if (info->pinput_argument == NULL)
			return -EINVAL;
		argument = info->pinput_argument;
		func_no = argument->value;
		for (i = 0; i < info->input_count; i++) {
			if (((argument->type == ACPI_TYPE_STRING) ||
			     (argument->type == ACPI_TYPE_BUFFER)) &&
@@ -1008,7 +1011,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,

	if (ACPI_FAILURE(status)) {
		result = -EIO;
		goto error;
		goto free_input;
	}

	/* return the output info */
@@ -1018,7 +1021,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
		if ((obj->type != ACPI_TYPE_PACKAGE) ||
			(obj->package.count != count)) {
			result = -EIO;
			goto error;
			goto free_obj;
		}
		params = obj->package.elements;
	} else
@@ -1026,13 +1029,13 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,

	if (params == NULL) {
		result = -EIO;
		goto error;
		goto free_obj;
	}

	for (i = 0; i < count; i++) {
		if (argument->type != params->type) {
			result = -EIO;
			goto error;
			goto free_obj;
		}
		switch (params->type) {
		case ACPI_TYPE_INTEGER:
@@ -1042,7 +1045,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
			if ((params->string.length != argument->data_length) ||
				(params->string.pointer == NULL)) {
				result = -EIO;
				goto error;
				goto free_obj;
			}
			strncpy(argument->pointer,
				params->string.pointer,
@@ -1051,7 +1054,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
		case ACPI_TYPE_BUFFER:
			if (params->buffer.pointer == NULL) {
				result = -EIO;
				goto error;
				goto free_obj;
			}
			memcpy(argument->pointer,
				params->buffer.pointer,
@@ -1064,9 +1067,10 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
		params++;
	}

error:
	if (obj != NULL)
	result = 0;
free_obj:
	kfree(obj);
free_input:
	kfree((void *)input.pointer);
	return result;
}
@@ -1078,7 +1082,7 @@ static int amdgpu_cgs_acpi_eval_object(struct cgs_device *cgs_device,
}
#endif

int amdgpu_cgs_call_acpi_method(struct cgs_device *cgs_device,
static int amdgpu_cgs_call_acpi_method(struct cgs_device *cgs_device,
					uint32_t acpi_method,
					uint32_t acpi_function,
					void *pinput, void *poutput,
Loading