Merge tag 'drm-intel-fixes-2014-11-19' into drm-intel-next-queued
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / i915 / intel_display.c
index 7d58a64195d6050330851fe1264f74ac7407850c..6060b71d93015fb355cd3e058992af715d6b06e7 100644 (file)
@@ -4758,7 +4758,7 @@ static void vlv_update_cdclk(struct drm_device *dev)
         * BSpec erroneously claims we should aim for 4MHz, but
         * in fact 1MHz is the correct frequency.
         */
-       I915_WRITE(GMBUSFREQ_VLV, dev_priv->vlv_cdclk_freq);
+       I915_WRITE(GMBUSFREQ_VLV, DIV_ROUND_UP(dev_priv->vlv_cdclk_freq, 1000));
 }
 
 /* Adjust CDclk dividers to allow high res or save power if possible */
@@ -11469,6 +11469,7 @@ static int intel_crtc_set_config(struct drm_mode_set *set)
                                                   &prepare_pipes,
                                                   &disable_pipes);
        if (IS_ERR(pipe_config)) {
+               ret = PTR_ERR(pipe_config);
                goto fail;
        } else if (pipe_config) {
                if (to_intel_crtc(set->crtc)->new_config->has_audio !=
@@ -11764,8 +11765,8 @@ intel_commit_primary_plane(struct drm_plane *plane,
        struct drm_rect *src = &state->src;
 
        crtc->primary->fb = fb;
-       crtc->x = src->x1;
-       crtc->y = src->y1;
+       crtc->x = src->x1 >> 16;
+       crtc->y = src->y1 >> 16;
 
        intel_plane->crtc_x = state->orig_dst.x1;
        intel_plane->crtc_y = state->orig_dst.y1;
@@ -12449,7 +12450,7 @@ static void intel_setup_outputs(struct drm_device *dev)
        if (SUPPORTS_TV(dev))
                intel_tv_init(dev);
 
-       intel_edp_psr_init(dev);
+       intel_psr_init(dev);
 
        for_each_intel_encoder(dev, encoder) {
                encoder->base.possible_crtcs = encoder->crtc_mask;
@@ -12904,6 +12905,9 @@ static struct intel_quirk intel_quirks[] = {
        /* Acer C720 Chromebook (Core i3 4005U) */
        { 0x0a16, 0x1025, 0x0a11, quirk_backlight_present },
 
+       /* Apple Macbook 2,1 (Core 2 T7400) */
+       { 0x27a2, 0x8086, 0x7270, quirk_backlight_present },
+
        /* Toshiba CB35 Chromebook (Celeron 2955U) */
        { 0x0a06, 0x1179, 0x0a88, quirk_backlight_present },
 
@@ -13539,11 +13543,13 @@ void intel_modeset_cleanup(struct drm_device *dev)
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct drm_connector *connector;
 
+       intel_disable_gt_powersave(dev);
+
        intel_backlight_unregister(dev);
 
        /*
         * Interrupts and polling as the first thing to avoid creating havoc.
-        * Too much stuff here (turning of rps, connectors, ...) would
+        * Too much stuff here (turning of connectors, ...) would
         * experience fancy races otherwise.
         */
        intel_irq_uninstall(dev_priv);
@@ -13560,8 +13566,6 @@ void intel_modeset_cleanup(struct drm_device *dev)
 
        intel_disable_fbc(dev);
 
-       intel_disable_gt_powersave(dev);
-
        ironlake_teardown_rc6(dev);
 
        mutex_unlock(&dev->struct_mutex);