Commit 4fd89226 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-intel-fixes-2017-05-18-1' of...

Merge tag 'drm-intel-fixes-2017-05-18-1' of git://anongit.freedesktop.org/git/drm-intel into drm-fixes

drm/i915 fixes for v4.12-rc2

* tag 'drm-intel-fixes-2017-05-18-1' of git://anongit.freedesktop.org/git/drm-intel:
  drm/i915: don't do allocate_va_range again on PIN_UPDATE
  drm/i915: Fix rawclk readout for g4x
  drm/i915: Fix runtime PM for LPE audio
  drm/i915/glk: Fix DSI "*ERROR* ULPS is still active" messages
  drm/i915/gvt: avoid unnecessary vgpu switch
  drm/i915/gvt: not to restore in-context mmio
  drm/i915/gvt: fix typo: "supporte" -> "support"
parents e6296126 2f720aac
...@@ -1244,7 +1244,7 @@ static int dma_ctrl_write(struct intel_vgpu *vgpu, unsigned int offset, ...@@ -1244,7 +1244,7 @@ static int dma_ctrl_write(struct intel_vgpu *vgpu, unsigned int offset,
mode = vgpu_vreg(vgpu, offset); mode = vgpu_vreg(vgpu, offset);
if (GFX_MODE_BIT_SET_IN_MASK(mode, START_DMA)) { if (GFX_MODE_BIT_SET_IN_MASK(mode, START_DMA)) {
WARN_ONCE(1, "VM(%d): iGVT-g doesn't supporte GuC\n", WARN_ONCE(1, "VM(%d): iGVT-g doesn't support GuC\n",
vgpu->id); vgpu->id);
return 0; return 0;
} }
......
...@@ -340,6 +340,9 @@ void intel_gvt_restore_render_mmio(struct intel_vgpu *vgpu, int ring_id) ...@@ -340,6 +340,9 @@ void intel_gvt_restore_render_mmio(struct intel_vgpu *vgpu, int ring_id)
} else } else
v = mmio->value; v = mmio->value;
if (mmio->in_context)
continue;
I915_WRITE(mmio->reg, v); I915_WRITE(mmio->reg, v);
POSTING_READ(mmio->reg); POSTING_READ(mmio->reg);
......
...@@ -129,9 +129,13 @@ static void try_to_schedule_next_vgpu(struct intel_gvt *gvt) ...@@ -129,9 +129,13 @@ static void try_to_schedule_next_vgpu(struct intel_gvt *gvt)
struct vgpu_sched_data *vgpu_data; struct vgpu_sched_data *vgpu_data;
ktime_t cur_time; ktime_t cur_time;
/* no target to schedule */ /* no need to schedule if next_vgpu is the same with current_vgpu,
if (!scheduler->next_vgpu) * let scheduler chose next_vgpu again by setting it to NULL.
*/
if (scheduler->next_vgpu == scheduler->current_vgpu) {
scheduler->next_vgpu = NULL;
return; return;
}
/* /*
* after the flag is set, workload dispatch thread will * after the flag is set, workload dispatch thread will
......
...@@ -195,9 +195,12 @@ static int ppgtt_bind_vma(struct i915_vma *vma, ...@@ -195,9 +195,12 @@ static int ppgtt_bind_vma(struct i915_vma *vma,
u32 pte_flags; u32 pte_flags;
int ret; int ret;
ret = vma->vm->allocate_va_range(vma->vm, vma->node.start, vma->size); if (!(vma->flags & I915_VMA_LOCAL_BIND)) {
ret = vma->vm->allocate_va_range(vma->vm, vma->node.start,
vma->size);
if (ret) if (ret)
return ret; return ret;
}
vma->pages = vma->obj->mm.pages; vma->pages = vma->obj->mm.pages;
...@@ -2306,7 +2309,8 @@ static int aliasing_gtt_bind_vma(struct i915_vma *vma, ...@@ -2306,7 +2309,8 @@ static int aliasing_gtt_bind_vma(struct i915_vma *vma,
if (flags & I915_VMA_LOCAL_BIND) { if (flags & I915_VMA_LOCAL_BIND) {
struct i915_hw_ppgtt *appgtt = i915->mm.aliasing_ppgtt; struct i915_hw_ppgtt *appgtt = i915->mm.aliasing_ppgtt;
if (appgtt->base.allocate_va_range) { if (!(vma->flags & I915_VMA_LOCAL_BIND) &&
appgtt->base.allocate_va_range) {
ret = appgtt->base.allocate_va_range(&appgtt->base, ret = appgtt->base.allocate_va_range(&appgtt->base,
vma->node.start, vma->node.start,
vma->node.size); vma->node.size);
......
...@@ -3051,10 +3051,14 @@ enum skl_disp_power_wells { ...@@ -3051,10 +3051,14 @@ enum skl_disp_power_wells {
#define CLKCFG_FSB_667 (3 << 0) /* hrawclk 166 */ #define CLKCFG_FSB_667 (3 << 0) /* hrawclk 166 */
#define CLKCFG_FSB_800 (2 << 0) /* hrawclk 200 */ #define CLKCFG_FSB_800 (2 << 0) /* hrawclk 200 */
#define CLKCFG_FSB_1067 (6 << 0) /* hrawclk 266 */ #define CLKCFG_FSB_1067 (6 << 0) /* hrawclk 266 */
#define CLKCFG_FSB_1067_ALT (0 << 0) /* hrawclk 266 */
#define CLKCFG_FSB_1333 (7 << 0) /* hrawclk 333 */ #define CLKCFG_FSB_1333 (7 << 0) /* hrawclk 333 */
/* Note, below two are guess */ /*
#define CLKCFG_FSB_1600 (4 << 0) /* hrawclk 400 */ * Note that on at least on ELK the below value is reported for both
#define CLKCFG_FSB_1600_ALT (0 << 0) /* hrawclk 400 */ * 333 and 400 MHz BIOS FSB setting, but given that the gmch datasheet
* lists only 200/266/333 MHz FSB as supported let's decode it as 333 MHz.
*/
#define CLKCFG_FSB_1333_ALT (4 << 0) /* hrawclk 333 */
#define CLKCFG_FSB_MASK (7 << 0) #define CLKCFG_FSB_MASK (7 << 0)
#define CLKCFG_MEM_533 (1 << 4) #define CLKCFG_MEM_533 (1 << 4)
#define CLKCFG_MEM_667 (2 << 4) #define CLKCFG_MEM_667 (2 << 4)
......
...@@ -1798,13 +1798,11 @@ static int g4x_hrawclk(struct drm_i915_private *dev_priv) ...@@ -1798,13 +1798,11 @@ static int g4x_hrawclk(struct drm_i915_private *dev_priv)
case CLKCFG_FSB_800: case CLKCFG_FSB_800:
return 200000; return 200000;
case CLKCFG_FSB_1067: case CLKCFG_FSB_1067:
case CLKCFG_FSB_1067_ALT:
return 266667; return 266667;
case CLKCFG_FSB_1333: case CLKCFG_FSB_1333:
case CLKCFG_FSB_1333_ALT:
return 333333; return 333333;
/* these two are just a guess; one of them might be right */
case CLKCFG_FSB_1600:
case CLKCFG_FSB_1600_ALT:
return 400000;
default: default:
return 133333; return 133333;
} }
......
...@@ -410,11 +410,10 @@ static void glk_dsi_device_ready(struct intel_encoder *encoder) ...@@ -410,11 +410,10 @@ static void glk_dsi_device_ready(struct intel_encoder *encoder)
val |= (ULPS_STATE_ENTER | DEVICE_READY); val |= (ULPS_STATE_ENTER | DEVICE_READY);
I915_WRITE(MIPI_DEVICE_READY(port), val); I915_WRITE(MIPI_DEVICE_READY(port), val);
/* Wait for ULPS Not active */ /* Wait for ULPS active */
if (intel_wait_for_register(dev_priv, if (intel_wait_for_register(dev_priv,
MIPI_CTRL(port), GLK_ULPS_NOT_ACTIVE, MIPI_CTRL(port), GLK_ULPS_NOT_ACTIVE, 0, 20))
GLK_ULPS_NOT_ACTIVE, 20)) DRM_ERROR("ULPS not active\n");
DRM_ERROR("ULPS is still active\n");
/* Exit ULPS */ /* Exit ULPS */
val = I915_READ(MIPI_DEVICE_READY(port)); val = I915_READ(MIPI_DEVICE_READY(port));
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/pm_runtime.h>
#include "i915_drv.h" #include "i915_drv.h"
#include <linux/delay.h> #include <linux/delay.h>
...@@ -121,6 +122,10 @@ lpe_audio_platdev_create(struct drm_i915_private *dev_priv) ...@@ -121,6 +122,10 @@ lpe_audio_platdev_create(struct drm_i915_private *dev_priv)
kfree(rsc); kfree(rsc);
pm_runtime_forbid(&platdev->dev);
pm_runtime_set_active(&platdev->dev);
pm_runtime_enable(&platdev->dev);
return platdev; return platdev;
err: err:
......
...@@ -1809,10 +1809,6 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev) ...@@ -1809,10 +1809,6 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev)
pdata->notify_pending = false; pdata->notify_pending = false;
spin_unlock_irq(&pdata->lpe_audio_slock); spin_unlock_irq(&pdata->lpe_audio_slock);
/* runtime PM isn't enabled as default, since it won't save much on
* BYT/CHT devices; user who want the runtime PM should adjust the
* power/ontrol and power/autosuspend_delay_ms sysfs entries instead
*/
pm_runtime_use_autosuspend(&pdev->dev); pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_mark_last_busy(&pdev->dev); pm_runtime_mark_last_busy(&pdev->dev);
pm_runtime_set_active(&pdev->dev); pm_runtime_set_active(&pdev->dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment