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

Commit 74e16974 authored by Dave Airlie's avatar Dave Airlie
Browse files

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

More drm-next bits for radeon.  Just bug fixes.

* 'drm-next-3.9' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: properly validate the atpx interface
  drm/radeon: switch get_gpu_clock() to a callback (v2)
  drm/radeon: add a asic callback to get the xclk
  drm/radeon: Avoid NULL pointer dereference from atom_index_iio() allocation failure
  drm/radeon: remove overzealous warning in hdmi handling
  drm/radeon: fix multi-head power profile stability on BTC+ asics
parents e9f211ad 43a23aa4
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -1238,6 +1238,8 @@ static int atom_iio_len[] = { 1, 2, 3, 3, 3, 3, 4, 4, 4, 3 };
static void atom_index_iio(struct atom_context *ctx, int base)
static void atom_index_iio(struct atom_context *ctx, int base)
{
{
	ctx->iio = kzalloc(2 * 256, GFP_KERNEL);
	ctx->iio = kzalloc(2 * 256, GFP_KERNEL);
	if (!ctx->iio)
		return;
	while (CU8(base) == ATOM_IIO_START) {
	while (CU8(base) == ATOM_IIO_START) {
		ctx->iio[CU8(base + 1)] = base + 2;
		ctx->iio[CU8(base + 1)] = base + 2;
		base += 2;
		base += 2;
@@ -1287,6 +1289,10 @@ struct atom_context *atom_parse(struct card_info *card, void *bios)
	ctx->cmd_table = CU16(base + ATOM_ROM_CMD_PTR);
	ctx->cmd_table = CU16(base + ATOM_ROM_CMD_PTR);
	ctx->data_table = CU16(base + ATOM_ROM_DATA_PTR);
	ctx->data_table = CU16(base + ATOM_ROM_DATA_PTR);
	atom_index_iio(ctx, CU16(ctx->data_table + ATOM_DATA_IIO_PTR) + 4);
	atom_index_iio(ctx, CU16(ctx->data_table + ATOM_DATA_IIO_PTR) + 4);
	if (!ctx->iio) {
		atom_destroy(ctx);
		return NULL;
	}


	str = CSTR(CU16(base + ATOM_ROM_MSG_PTR));
	str = CSTR(CU16(base + ATOM_ROM_MSG_PTR));
	while (*str && ((*str == '\n') || (*str == '\r')))
	while (*str && ((*str == '\n') || (*str == '\r')))
@@ -1335,7 +1341,6 @@ int atom_asic_init(struct atom_context *ctx)


void atom_destroy(struct atom_context *ctx)
void atom_destroy(struct atom_context *ctx)
{
{
	if (ctx->iio)
	kfree(ctx->iio);
	kfree(ctx->iio);
	kfree(ctx);
	kfree(ctx);
}
}
+13 −0
Original line number Original line Diff line number Diff line
@@ -403,6 +403,19 @@ void evergreen_pm_misc(struct radeon_device *rdev)
			rdev->pm.current_vddc = voltage->voltage;
			rdev->pm.current_vddc = voltage->voltage;
			DRM_DEBUG("Setting: vddc: %d\n", voltage->voltage);
			DRM_DEBUG("Setting: vddc: %d\n", voltage->voltage);
		}
		}

		/* starting with BTC, there is one state that is used for both
		 * MH and SH.  Difference is that we always use the high clock index for
		 * mclk and vddci.
		 */
		if ((rdev->pm.pm_method == PM_METHOD_PROFILE) &&
		    (rdev->family >= CHIP_BARTS) &&
		    rdev->pm.active_crtc_count &&
		    ((rdev->pm.profile_index == PM_PROFILE_MID_MH_IDX) ||
		     (rdev->pm.profile_index == PM_PROFILE_LOW_MH_IDX)))
			voltage = &rdev->pm.power_state[req_ps_idx].
				clock_info[rdev->pm.profiles[PM_PROFILE_HIGH_MH_IDX].dpms_on_cm_idx].voltage;

		/* 0xff01 is a flag rather then an actual voltage */
		/* 0xff01 is a flag rather then an actual voltage */
		if (voltage->vddci == 0xff01)
		if (voltage->vddci == 0xff01)
			return;
			return;
+15 −2
Original line number Original line Diff line number Diff line
@@ -109,6 +109,19 @@ void r600_fini(struct radeon_device *rdev);
void r600_irq_disable(struct radeon_device *rdev);
void r600_irq_disable(struct radeon_device *rdev);
static void r600_pcie_gen2_enable(struct radeon_device *rdev);
static void r600_pcie_gen2_enable(struct radeon_device *rdev);


/**
 * r600_get_xclk - get the xclk
 *
 * @rdev: radeon_device pointer
 *
 * Returns the reference clock used by the gfx engine
 * (r6xx, IGPs, APUs).
 */
u32 r600_get_xclk(struct radeon_device *rdev)
{
	return rdev->clock.spll.reference_freq;
}

/* get temperature in millidegrees */
/* get temperature in millidegrees */
int rv6xx_get_temp(struct radeon_device *rdev)
int rv6xx_get_temp(struct radeon_device *rdev)
{
{
@@ -4448,14 +4461,14 @@ static void r600_pcie_gen2_enable(struct radeon_device *rdev)
}
}


/**
/**
 * r600_get_gpu_clock - return GPU clock counter snapshot
 * r600_get_gpu_clock_counter - return GPU clock counter snapshot
 *
 *
 * @rdev: radeon_device pointer
 * @rdev: radeon_device pointer
 *
 *
 * Fetches a GPU clock counter snapshot (R6xx-cayman).
 * Fetches a GPU clock counter snapshot (R6xx-cayman).
 * Returns the 64 bit clock counter snapshot.
 * Returns the 64 bit clock counter snapshot.
 */
 */
uint64_t r600_get_gpu_clock(struct radeon_device *rdev)
uint64_t r600_get_gpu_clock_counter(struct radeon_device *rdev)
{
{
	uint64_t clock;
	uint64_t clock;


+0 −1
Original line number Original line Diff line number Diff line
@@ -544,7 +544,6 @@ void r600_hdmi_disable(struct drm_encoder *encoder)


	/* Called for ATOM_ENCODER_MODE_HDMI only */
	/* Called for ATOM_ENCODER_MODE_HDMI only */
	if (!dig || !dig->afmt) {
	if (!dig || !dig->afmt) {
		WARN_ON(1);
		return;
		return;
	}
	}
	if (!dig->afmt->enabled)
	if (!dig->afmt->enabled)
+6 −0
Original line number Original line Diff line number Diff line
@@ -1178,6 +1178,10 @@ struct radeon_asic {
	bool (*gui_idle)(struct radeon_device *rdev);
	bool (*gui_idle)(struct radeon_device *rdev);
	/* wait for mc_idle */
	/* wait for mc_idle */
	int (*mc_wait_for_idle)(struct radeon_device *rdev);
	int (*mc_wait_for_idle)(struct radeon_device *rdev);
	/* get the reference clock */
	u32 (*get_xclk)(struct radeon_device *rdev);
	/* get the gpu clock counter */
	uint64_t (*get_gpu_clock_counter)(struct radeon_device *rdev);
	/* gart */
	/* gart */
	struct {
	struct {
		void (*tlb_flush)(struct radeon_device *rdev);
		void (*tlb_flush)(struct radeon_device *rdev);
@@ -1859,6 +1863,8 @@ void radeon_ring_write(struct radeon_ring *ring, uint32_t v);
#define radeon_post_page_flip(rdev, crtc) (rdev)->asic->pflip.post_page_flip((rdev), (crtc))
#define radeon_post_page_flip(rdev, crtc) (rdev)->asic->pflip.post_page_flip((rdev), (crtc))
#define radeon_wait_for_vblank(rdev, crtc) (rdev)->asic->display.wait_for_vblank((rdev), (crtc))
#define radeon_wait_for_vblank(rdev, crtc) (rdev)->asic->display.wait_for_vblank((rdev), (crtc))
#define radeon_mc_wait_for_idle(rdev) (rdev)->asic->mc_wait_for_idle((rdev))
#define radeon_mc_wait_for_idle(rdev) (rdev)->asic->mc_wait_for_idle((rdev))
#define radeon_get_xclk(rdev) (rdev)->asic->get_xclk((rdev))
#define radeon_get_gpu_clock_counter(rdev) (rdev)->asic->get_gpu_clock_counter((rdev))


/* Common functions */
/* Common functions */
/* AGP */
/* AGP */
Loading