diff options
author | Dave Airlie <airlied@redhat.com> | 2015-07-10 01:58:43 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-07-10 01:58:43 -0400 |
commit | 59e7a16d60ffead64d1407bf8915b8b2078ba870 (patch) | |
tree | be177b98f8be500908f365f064f5bbbd46145a5a | |
parent | 008b3f1f1c3e79c0bff03ca3a0c2dff3d81213c8 (diff) | |
parent | 52613921b31d8573a212a4b0854b390a18d9849c (diff) |
Merge tag 'drm-intel-fixes-2015-07-09' of git://anongit.freedesktop.org/drm-intel into drm-fixes
Pile of fixes for either 4.2 issues or cc: stable. This should fix the 2nd
kind of WARNING Linus's been seeing, please ask him to scream if that's
not the case.
* tag 'drm-intel-fixes-2015-07-09' of git://anongit.freedesktop.org/drm-intel:
Revert "drm/i915: Allocate context objects from stolen"
drm/i915: Declare the swizzling unknown for L-shaped configurations
drm/i915: Use crtc_state->active in primary check_plane func
drm/i915: Check crtc->active in intel_crtc_disable_planes
drm/i915: Restore all GGTT VMAs on resume
drm/i915/chv: fix HW readout of the port PLL fractional divider
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.c | 23 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_tiling.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 12 |
4 files changed, 37 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 8867818b1401..d65cbe6afb92 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c | |||
@@ -157,9 +157,7 @@ i915_gem_alloc_context_obj(struct drm_device *dev, size_t size) | |||
157 | struct drm_i915_gem_object *obj; | 157 | struct drm_i915_gem_object *obj; |
158 | int ret; | 158 | int ret; |
159 | 159 | ||
160 | obj = i915_gem_object_create_stolen(dev, size); | 160 | obj = i915_gem_alloc_object(dev, size); |
161 | if (obj == NULL) | ||
162 | obj = i915_gem_alloc_object(dev, size); | ||
163 | if (obj == NULL) | 161 | if (obj == NULL) |
164 | return ERR_PTR(-ENOMEM); | 162 | return ERR_PTR(-ENOMEM); |
165 | 163 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 9daa2883ac18..dcc6a88c560e 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -2546,6 +2546,8 @@ void i915_gem_restore_gtt_mappings(struct drm_device *dev) | |||
2546 | struct drm_i915_private *dev_priv = dev->dev_private; | 2546 | struct drm_i915_private *dev_priv = dev->dev_private; |
2547 | struct drm_i915_gem_object *obj; | 2547 | struct drm_i915_gem_object *obj; |
2548 | struct i915_address_space *vm; | 2548 | struct i915_address_space *vm; |
2549 | struct i915_vma *vma; | ||
2550 | bool flush; | ||
2549 | 2551 | ||
2550 | i915_check_and_clear_faults(dev); | 2552 | i915_check_and_clear_faults(dev); |
2551 | 2553 | ||
@@ -2555,16 +2557,23 @@ void i915_gem_restore_gtt_mappings(struct drm_device *dev) | |||
2555 | dev_priv->gtt.base.total, | 2557 | dev_priv->gtt.base.total, |
2556 | true); | 2558 | true); |
2557 | 2559 | ||
2560 | /* Cache flush objects bound into GGTT and rebind them. */ | ||
2561 | vm = &dev_priv->gtt.base; | ||
2558 | list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) { | 2562 | list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) { |
2559 | struct i915_vma *vma = i915_gem_obj_to_vma(obj, | 2563 | flush = false; |
2560 | &dev_priv->gtt.base); | 2564 | list_for_each_entry(vma, &obj->vma_list, vma_link) { |
2561 | if (!vma) | 2565 | if (vma->vm != vm) |
2562 | continue; | 2566 | continue; |
2563 | 2567 | ||
2564 | i915_gem_clflush_object(obj, obj->pin_display); | 2568 | WARN_ON(i915_vma_bind(vma, obj->cache_level, |
2565 | WARN_ON(i915_vma_bind(vma, obj->cache_level, PIN_UPDATE)); | 2569 | PIN_UPDATE)); |
2566 | } | ||
2567 | 2570 | ||
2571 | flush = true; | ||
2572 | } | ||
2573 | |||
2574 | if (flush) | ||
2575 | i915_gem_clflush_object(obj, obj->pin_display); | ||
2576 | } | ||
2568 | 2577 | ||
2569 | if (INTEL_INFO(dev)->gen >= 8) { | 2578 | if (INTEL_INFO(dev)->gen >= 8) { |
2570 | if (IS_CHERRYVIEW(dev) || IS_BROXTON(dev)) | 2579 | if (IS_CHERRYVIEW(dev) || IS_BROXTON(dev)) |
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index 633bd1fcab69..d61e74a08f82 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c | |||
@@ -183,8 +183,18 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev) | |||
183 | if (IS_GEN4(dev)) { | 183 | if (IS_GEN4(dev)) { |
184 | uint32_t ddc2 = I915_READ(DCC2); | 184 | uint32_t ddc2 = I915_READ(DCC2); |
185 | 185 | ||
186 | if (!(ddc2 & DCC2_MODIFIED_ENHANCED_DISABLE)) | 186 | if (!(ddc2 & DCC2_MODIFIED_ENHANCED_DISABLE)) { |
187 | /* Since the swizzling may vary within an | ||
188 | * object, we have no idea what the swizzling | ||
189 | * is for any page in particular. Thus we | ||
190 | * cannot migrate tiled pages using the GPU, | ||
191 | * nor can we tell userspace what the exact | ||
192 | * swizzling is for any object. | ||
193 | */ | ||
187 | dev_priv->quirks |= QUIRK_PIN_SWIZZLED_PAGES; | 194 | dev_priv->quirks |= QUIRK_PIN_SWIZZLED_PAGES; |
195 | swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN; | ||
196 | swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN; | ||
197 | } | ||
188 | } | 198 | } |
189 | 199 | ||
190 | if (dcc == 0xffffffff) { | 200 | if (dcc == 0xffffffff) { |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 1b61f9810387..ba9321998a41 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4854,6 +4854,9 @@ static void intel_crtc_disable_planes(struct drm_crtc *crtc) | |||
4854 | struct intel_plane *intel_plane; | 4854 | struct intel_plane *intel_plane; |
4855 | int pipe = intel_crtc->pipe; | 4855 | int pipe = intel_crtc->pipe; |
4856 | 4856 | ||
4857 | if (!intel_crtc->active) | ||
4858 | return; | ||
4859 | |||
4857 | intel_crtc_wait_for_pending_flips(crtc); | 4860 | intel_crtc_wait_for_pending_flips(crtc); |
4858 | 4861 | ||
4859 | intel_pre_disable_primary(crtc); | 4862 | intel_pre_disable_primary(crtc); |
@@ -7887,7 +7890,7 @@ static void chv_crtc_clock_get(struct intel_crtc *crtc, | |||
7887 | int pipe = pipe_config->cpu_transcoder; | 7890 | int pipe = pipe_config->cpu_transcoder; |
7888 | enum dpio_channel port = vlv_pipe_to_channel(pipe); | 7891 | enum dpio_channel port = vlv_pipe_to_channel(pipe); |
7889 | intel_clock_t clock; | 7892 | intel_clock_t clock; |
7890 | u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2; | 7893 | u32 cmn_dw13, pll_dw0, pll_dw1, pll_dw2, pll_dw3; |
7891 | int refclk = 100000; | 7894 | int refclk = 100000; |
7892 | 7895 | ||
7893 | mutex_lock(&dev_priv->sb_lock); | 7896 | mutex_lock(&dev_priv->sb_lock); |
@@ -7895,10 +7898,13 @@ static void chv_crtc_clock_get(struct intel_crtc *crtc, | |||
7895 | pll_dw0 = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW0(port)); | 7898 | pll_dw0 = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW0(port)); |
7896 | pll_dw1 = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW1(port)); | 7899 | pll_dw1 = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW1(port)); |
7897 | pll_dw2 = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW2(port)); | 7900 | pll_dw2 = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW2(port)); |
7901 | pll_dw3 = vlv_dpio_read(dev_priv, pipe, CHV_PLL_DW3(port)); | ||
7898 | mutex_unlock(&dev_priv->sb_lock); | 7902 | mutex_unlock(&dev_priv->sb_lock); |
7899 | 7903 | ||
7900 | clock.m1 = (pll_dw1 & 0x7) == DPIO_CHV_M1_DIV_BY_2 ? 2 : 0; | 7904 | clock.m1 = (pll_dw1 & 0x7) == DPIO_CHV_M1_DIV_BY_2 ? 2 : 0; |
7901 | clock.m2 = ((pll_dw0 & 0xff) << 22) | (pll_dw2 & 0x3fffff); | 7905 | clock.m2 = (pll_dw0 & 0xff) << 22; |
7906 | if (pll_dw3 & DPIO_CHV_FRAC_DIV_EN) | ||
7907 | clock.m2 |= pll_dw2 & 0x3fffff; | ||
7902 | clock.n = (pll_dw1 >> DPIO_CHV_N_DIV_SHIFT) & 0xf; | 7908 | clock.n = (pll_dw1 >> DPIO_CHV_N_DIV_SHIFT) & 0xf; |
7903 | clock.p1 = (cmn_dw13 >> DPIO_CHV_P1_DIV_SHIFT) & 0x7; | 7909 | clock.p1 = (cmn_dw13 >> DPIO_CHV_P1_DIV_SHIFT) & 0x7; |
7904 | clock.p2 = (cmn_dw13 >> DPIO_CHV_P2_DIV_SHIFT) & 0x1f; | 7910 | clock.p2 = (cmn_dw13 >> DPIO_CHV_P2_DIV_SHIFT) & 0x1f; |
@@ -13270,7 +13276,7 @@ intel_check_primary_plane(struct drm_plane *plane, | |||
13270 | if (ret) | 13276 | if (ret) |
13271 | return ret; | 13277 | return ret; |
13272 | 13278 | ||
13273 | if (intel_crtc->active) { | 13279 | if (crtc_state->base.active) { |
13274 | struct intel_plane_state *old_state = | 13280 | struct intel_plane_state *old_state = |
13275 | to_intel_plane_state(plane->state); | 13281 | to_intel_plane_state(plane->state); |
13276 | 13282 | ||