Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202442
b: refs/heads/master
c: 0385e52
h: refs/heads/master
v: v3
  • Loading branch information
Jesse Barnes authored and Matthew Garrett committed Aug 3, 2010
1 parent 067ab61 commit 21653cb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa7ffc01d254c91a36bf854d57a14049c6134c72
refs/heads/master: 0385e5210c83b13fe685c54b6063655f80bce3ee
30 changes: 17 additions & 13 deletions trunk/drivers/platform/x86/intel_ips.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,10 @@ static void ips_disable_cpu_turbo(struct ips_driver *ips)
*/
static bool ips_gpu_busy(struct ips_driver *ips)
{
return false;
if (!ips->gpu_turbo_enabled)
return false;

return ips->gpu_busy();
}

/**
Expand Down Expand Up @@ -627,7 +630,7 @@ static bool cpu_exceeded(struct ips_driver *ips, int cpu)
avg = cpu ? ips->ctv2_avg_temp : ips->ctv1_avg_temp;
if (avg > (ips->limits->core_temp_limit * 100))
ret = true;
if (ips->cpu_avg_power > ips->core_power_limit)
if (ips->cpu_avg_power > ips->core_power_limit * 100)
ret = true;
spin_unlock_irqrestore(&ips->turbo_status_lock, flags);

Expand All @@ -652,6 +655,8 @@ static bool mch_exceeded(struct ips_driver *ips)
spin_lock_irqsave(&ips->turbo_status_lock, flags);
if (ips->mch_avg_temp > (ips->limits->mch_temp_limit * 100))
ret = true;
if (ips->mch_avg_power > ips->mch_power_limit)
ret = true;
spin_unlock_irqrestore(&ips->turbo_status_lock, flags);

return ret;
Expand Down Expand Up @@ -747,7 +752,7 @@ static int ips_adjust(void *data)
ips_disable_gpu_turbo(ips);

/* We're outside our comfort zone, crank them down */
if (!mcp_exceeded(ips)) {
if (mcp_exceeded(ips)) {
ips_cpu_lower(ips);
ips_gpu_lower(ips);
goto sleep;
Expand Down Expand Up @@ -808,8 +813,7 @@ static u16 read_mgtv(struct ips_driver *ips)

ret = ((val * slope + 0x40) >> 7) + offset;


return ret;
return 0; /* MCH temp reporting buggy */
}

static u16 read_ptv(struct ips_driver *ips)
Expand Down Expand Up @@ -1471,14 +1475,6 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id)
if (trc & TRC_CORE2_EN)
ips->second_cpu = true;

if (!ips_get_i915_syms(ips)) {
dev_err(&dev->dev, "failed to get i915 symbols, graphics turbo disabled\n");
ips->gpu_turbo_enabled = false;
} else {
dev_dbg(&dev->dev, "graphics turbo enabled\n");
ips->gpu_turbo_enabled = true;
}

update_turbo_limits(ips);
dev_dbg(&dev->dev, "max cpu power clamp: %dW\n",
ips->mcp_power_limit / 10);
Expand All @@ -1488,6 +1484,14 @@ static int ips_probe(struct pci_dev *dev, const struct pci_device_id *id)
if (thm_readl(THM_PSC) & PSP_PBRT)
ips->poll_turbo_status = true;

if (!ips_get_i915_syms(ips)) {
dev_err(&dev->dev, "failed to get i915 symbols, graphics turbo disabled\n");
ips->gpu_turbo_enabled = false;
} else {
dev_dbg(&dev->dev, "graphics turbo enabled\n");
ips->gpu_turbo_enabled = true;
}

/*
* Check PLATFORM_INFO MSR to make sure this chip is
* turbo capable.
Expand Down

0 comments on commit 21653cb

Please sign in to comment.