Merge tag 'v3.9-rc5' into drm-intel-next-queued
Daniel Vetter [Wed, 3 Apr 2013 09:25:32 +0000 (11:25 +0200)]
Backmerge Linux 3.9-rc5 since I want to merge a few dp clock cleanups
for -next, but they will conflict all over the place with

commit 9d1a455b0ca1c2c956b4d9ab212864a8695270f1
Author: Takashi Iwai <tiwai@suse.de>
Date:   Mon Mar 18 11:25:36 2013 +0100

    drm/i915: Use the fixed pixel clock for eDP in intel_dp_set_m_n()

from -fixes.

Conflicts:
drivers/gpu/drm/i915/intel_dp.c: Simply adjacent lines changed.
drivers/gpu/drm/i915/intel_panel.c: A field rename in -next
conflicts with a bugfix in -fixes. Take the version from
-fixes and apply the rename.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

1  2 
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem_execbuffer.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_panel.c
drivers/gpu/drm/i915/intel_pm.c

Simple merge
@@@ -121,8 -121,15 +121,13 @@@ MODULE_PARM_DESC(i915_enable_ppgtt
  unsigned int i915_preliminary_hw_support __read_mostly = 0;
  module_param_named(preliminary_hw_support, i915_preliminary_hw_support, int, 0600);
  MODULE_PARM_DESC(preliminary_hw_support,
 -              "Enable preliminary hardware support. "
 -              "Enable Haswell and ValleyView Support. "
 -              "(default: false)");
 +              "Enable preliminary hardware support. (default: false)");
  
+ int i915_disable_power_well __read_mostly = 0;
+ module_param_named(disable_power_well, i915_disable_power_well, int, 0600);
+ MODULE_PARM_DESC(disable_power_well,
+                "Disable the power well when possible (default: false)");
  static struct drm_driver driver;
  extern int intel_agp_enabled;
  
Simple merge
@@@ -730,9 -732,11 +730,11 @@@ validate_exec_list(struct drm_i915_gem_
                   int count)
  {
        int i;
+       int relocs_total = 0;
+       int relocs_max = INT_MAX / sizeof(struct drm_i915_gem_relocation_entry);
  
        for (i = 0; i < count; i++) {
 -              char __user *ptr = (char __user *)(uintptr_t)exec[i].relocs_ptr;
 +              char __user *ptr = to_user_ptr(exec[i].relocs_ptr);
                int length; /* limited by fault_in_pages_readable() */
  
                if (exec[i].flags & __EXEC_OBJECT_UNKNOWN_FLAGS)
@@@ -5810,15 -5842,10 +5815,10 @@@ static int intel_crtc_mode_set(struct d
        int pipe = intel_crtc->pipe;
        int ret;
  
-       if (IS_HASWELL(dev) && intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))
-               intel_crtc->cpu_transcoder = TRANSCODER_EDP;
-       else
-               intel_crtc->cpu_transcoder = pipe;
        drm_vblank_pre_modeset(dev, pipe);
  
 -      ret = dev_priv->display.crtc_mode_set(crtc, mode, adjusted_mode,
 -                                            x, y, fb);
 +      ret = dev_priv->display.crtc_mode_set(crtc, x, y, fb);
 +
        drm_vblank_post_modeset(dev, pipe);
  
        if (ret != 0)
@@@ -801,10 -850,10 +811,10 @@@ intel_dp_set_m_n(struct drm_crtc *crtc
         * the number of bytes_per_pixel post-LUT, which we always
         * set up for 8-bits of R/G/B, or 3 bytes total.
         */
 -      intel_link_compute_m_n(intel_crtc->bpp, lane_count,
 +      intel_link_compute_m_n(intel_crtc->config.pipe_bpp, lane_count,
-                              mode->clock, adjusted_mode->clock, &m_n);
+                              target_clock, adjusted_mode->clock, &m_n);
  
 -      if (IS_HASWELL(dev)) {
 +      if (HAS_DDI(dev)) {
                I915_WRITE(PIPE_DATA_M1(cpu_transcoder),
                           TU_SIZE(m_n.tu) | m_n.gmch_m);
                I915_WRITE(PIPE_DATA_N1(cpu_transcoder), m_n.gmch_n);
@@@ -321,16 -318,9 +321,13 @@@ void intel_panel_enable_backlight(struc
  {
        struct drm_i915_private *dev_priv = dev->dev_private;
  
 -      if (dev_priv->backlight_level == 0)
 -              dev_priv->backlight_level = intel_panel_get_max_backlight(dev);
 +      if (dev_priv->backlight.level == 0) {
 +              dev_priv->backlight.level = intel_panel_get_max_backlight(dev);
 +              if (dev_priv->backlight.device)
 +                      dev_priv->backlight.device->props.brightness =
 +                              dev_priv->backlight.level;
 +      }
  
-       dev_priv->backlight.enabled = true;
-       intel_panel_actually_set_backlight(dev, dev_priv->backlight.level);
        if (INTEL_INFO(dev)->gen >= 4) {
                uint32_t reg, tmp;
  
        }
  
  set_level:
-       /* Check the current backlight level and try to set again if it's zero.
-        * On some machines, BLC_PWM_CPU_CTL is cleared to zero automatically
-        * when BLC_PWM_CPU_CTL2 and BLC_PWM_PCH_CTL1 are written.
+       /* Call below after setting BLC_PWM_CPU_CTL2 and BLC_PWM_PCH_CTL1.
+        * BLC_PWM_CPU_CTL may be cleared to zero automatically when these
+        * registers are set.
         */
-       if (!intel_panel_get_backlight(dev))
-               intel_panel_actually_set_backlight(dev, dev_priv->backlight.level);
 -      dev_priv->backlight_enabled = true;
 -      intel_panel_actually_set_backlight(dev, dev_priv->backlight_level);
++      dev_priv->backlight.enabled = true;
++      intel_panel_actually_set_backlight(dev, dev_priv->backlight.level);
  }
  
  static void intel_panel_init_backlight(struct drm_device *dev)
@@@ -4090,9 -4076,12 +4090,12 @@@ void intel_set_power_well(struct drm_de
        bool is_enabled, enable_requested;
        uint32_t tmp;
  
 -      if (!IS_HASWELL(dev))
 +      if (!HAS_POWER_WELL(dev))
                return;
  
+       if (!i915_disable_power_well && !enable)
+               return;
        tmp = I915_READ(HSW_PWR_WELL_DRIVER);
        is_enabled = tmp & HSW_PWR_WELL_STATE;
        enable_requested = tmp & HSW_PWR_WELL_ENABLE;