From: Stephen Rothwell Date: Thu, 19 Sep 2013 01:36:34 +0000 (+1000) Subject: Merge remote-tracking branch 'drm-intel/for-linux-next' X-Git-Tag: next-20130919~37 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6ef61178251d376213ebd7fb1986e273d37805d5;p=karo-tx-linux.git Merge remote-tracking branch 'drm-intel/for-linux-next' Conflicts: drivers/gpu/drm/i915/i915_gem.c drivers/gpu/drm/i915/intel_drv.h --- 6ef61178251d376213ebd7fb1986e273d37805d5 diff --cc drivers/gpu/drm/i915/i915_gem.c index df9253d890ee,d00d24f7a976..749d8ec6d6c9 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@@ -4886,61 -4912,3 +4940,37 @@@ unsigned long i915_gem_obj_size(struct return 0; } + +static unsigned long +i915_gem_inactive_scan(struct shrinker *shrinker, struct shrink_control *sc) +{ + struct drm_i915_private *dev_priv = + container_of(shrinker, + struct drm_i915_private, + mm.inactive_shrinker); + struct drm_device *dev = dev_priv->dev; + int nr_to_scan = sc->nr_to_scan; + unsigned long freed; + bool unlock = true; + + if (!mutex_trylock(&dev->struct_mutex)) { + if (!mutex_is_locked_by(&dev->struct_mutex, current)) + return 0; + + if (dev_priv->mm.shrinker_no_lock_stealing) + return 0; + + unlock = false; + } + + freed = i915_gem_purge(dev_priv, nr_to_scan); + if (freed < nr_to_scan) + freed += __i915_gem_shrink(dev_priv, nr_to_scan, + false); + if (freed < nr_to_scan) + freed += i915_gem_shrink_all(dev_priv); + + if (unlock) + mutex_unlock(&dev->struct_mutex); + return freed; +} - - struct i915_vma *i915_gem_obj_to_vma(struct drm_i915_gem_object *obj, - struct i915_address_space *vm) - { - struct i915_vma *vma; - list_for_each_entry(vma, &obj->vma_list, vma_link) - if (vma->vm == vm) - return vma; - - return NULL; - } - - struct i915_vma * - i915_gem_obj_lookup_or_create_vma(struct drm_i915_gem_object *obj, - struct i915_address_space *vm) - { - struct i915_vma *vma; - - vma = i915_gem_obj_to_vma(obj, vm); - if (!vma) - vma = i915_gem_vma_create(obj, vm); - - return vma; - } diff --cc drivers/gpu/drm/i915/intel_display.c index 0d7c4f634bb9,4dd6561cb7c8..bb3bcc74b8bc --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@@ -8206,11 -8359,11 +8360,12 @@@ static void intel_dump_pipe_config(stru pipe_config->gmch_pfit.control, pipe_config->gmch_pfit.pgm_ratios, pipe_config->gmch_pfit.lvds_border_bits); - DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x\n", + DRM_DEBUG_KMS("pch pfit: pos: 0x%08x, size: 0x%08x, %s\n", pipe_config->pch_pfit.pos, - pipe_config->pch_pfit.size); + pipe_config->pch_pfit.size, + pipe_config->pch_pfit.enabled ? "enabled" : "disabled"); DRM_DEBUG_KMS("ips: %i\n", pipe_config->ips_enabled); + DRM_DEBUG_KMS("double wide: %i\n", pipe_config->double_wide); } static bool check_encoder_cloning(struct drm_crtc *crtc) diff --cc drivers/gpu/drm/i915/intel_drv.h index 28cae80495e2,b85354f9440b..9d0c9aea65db --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@@ -793,6 -814,13 +815,14 @@@ extern void hsw_pc8_disable_interrupts( extern void hsw_pc8_restore_interrupts(struct drm_device *dev); extern void intel_aux_display_runtime_get(struct drm_i915_private *dev_priv); extern void intel_aux_display_runtime_put(struct drm_i915_private *dev_priv); +extern void i915_disable_vga_mem(struct drm_device *dev); + extern void intel_dp_get_m_n(struct intel_crtc *crtc, + struct intel_crtc_config *pipe_config); + extern int intel_dotclock_calculate(int link_freq, + const struct intel_link_m_n *m_n); + extern void ironlake_check_encoder_dotclock(const struct intel_crtc_config *pipe_config, + int dotclock); + + extern bool intel_crtc_active(struct drm_crtc *crtc); #endif /* __INTEL_DRV_H__ */ diff --cc drivers/gpu/drm/i915/intel_dvo.c index 7fa7df546c1e,fe65c7270f06..ff86c366218c --- a/drivers/gpu/drm/i915/intel_dvo.c +++ b/drivers/gpu/drm/i915/intel_dvo.c @@@ -263,15 -265,8 +265,10 @@@ static bool intel_dvo_compute_config(st C(vtotal); C(clock); #undef C + + drm_mode_set_crtcinfo(adjusted_mode, 0); } - if (intel_dvo->dev.dev_ops->mode_fixup) - return intel_dvo->dev.dev_ops->mode_fixup(&intel_dvo->dev, - &pipe_config->requested_mode, - adjusted_mode); - return true; } diff --cc drivers/gpu/drm/i915/intel_opregion.c index 119771ff46ab,fd3062a2a421..2acf5cae20e4 --- a/drivers/gpu/drm/i915/intel_opregion.c +++ b/drivers/gpu/drm/i915/intel_opregion.c @@@ -170,10 -403,10 +403,10 @@@ static u32 asle_set_backlight(struct dr bclp &= ASLE_BCLP_MSK; if (bclp > 255) - return ASLE_BACKLIGHT_FAILED; + return ASLC_BACKLIGHT_FAILED; intel_panel_set_backlight(dev, bclp, 255); - iowrite32((bclp*0x64)/0xff | ASLE_CBLV_VALID, &asle->cblv); + iowrite32(DIV_ROUND_UP(bclp * 100, 255) | ASLE_CBLV_VALID, &asle->cblv); return 0; } diff --cc drivers/gpu/drm/i915/intel_pm.c index dd176b7296c1,fe19ba3360a7..db12c18e8040 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@@ -2103,12 -2117,12 +2117,12 @@@ static uint32_t ilk_pipe_pixel_rate(str /* We only use IF-ID interlacing. If we ever use PF-ID we'll need to * adjust the pixel_rate here. */ - pfit_size = intel_crtc->config.pch_pfit.size; - if (pfit_size) { + if (intel_crtc->config.pch_pfit.enabled) { uint64_t pipe_w, pipe_h, pfit_w, pfit_h; + uint32_t pfit_size = intel_crtc->config.pch_pfit.size; - pipe_w = intel_crtc->config.requested_mode.hdisplay; - pipe_h = intel_crtc->config.requested_mode.vdisplay; + pipe_w = intel_crtc->config.pipe_src_w; + pipe_h = intel_crtc->config.pipe_src_h; pfit_w = (pfit_size >> 16) & 0xFFFF; pfit_h = pfit_size & 0xFFFF; if (pipe_w < pfit_w)