]> Git Repo - linux.git/commitdiff
Merge drm/drm-next into drm-intel-next
authorRodrigo Vivi <[email protected]>
Wed, 26 May 2021 13:40:54 +0000 (09:40 -0400)
committerRodrigo Vivi <[email protected]>
Wed, 26 May 2021 13:40:54 +0000 (09:40 -0400)
Getting in sync with -rc2

Signed-off-by: Rodrigo Vivi <[email protected]>
1  2 
drivers/gpu/drm/i915/display/intel_atomic.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_dp_link_training.c
drivers/gpu/drm/i915/i915_drv.c

index ca2aa7bae309912eedc371a67bd7ad770ff9c4e3,88f424020a5fa856e2372583847d0ebbf6be7ccd..b4e7ac51aa31d5d21c6fee27b0247c73cdfa36b5
@@@ -109,16 -109,6 +109,6 @@@ int intel_digital_connector_atomic_set_
        return -EINVAL;
  }
  
- static bool blob_equal(const struct drm_property_blob *a,
-                      const struct drm_property_blob *b)
- {
-       if (a && b)
-               return a->length == b->length &&
-                       !memcmp(a->data, b->data, a->length);
-       return !a == !b;
- }
  int intel_digital_connector_atomic_check(struct drm_connector *conn,
                                         struct drm_atomic_state *state)
  {
            new_conn_state->base.picture_aspect_ratio != old_conn_state->base.picture_aspect_ratio ||
            new_conn_state->base.content_type != old_conn_state->base.content_type ||
            new_conn_state->base.scaling_mode != old_conn_state->base.scaling_mode ||
-           !blob_equal(new_conn_state->base.hdr_output_metadata,
-                       old_conn_state->base.hdr_output_metadata))
+           !drm_connector_atomic_hdr_metadata_equal(old_state, new_state))
                crtc_state->mode_changed = true;
  
        return 0;
@@@ -198,26 -187,6 +187,26 @@@ intel_connector_needs_modeset(struct in
                                                                            new_conn_state->crtc)));
  }
  
 +/**
 + * intel_any_crtc_needs_modeset - check if any CRTC needs a modeset
 + * @state: the atomic state corresponding to this modeset
 + *
 + * Returns true if any CRTC in @state needs a modeset.
 + */
 +bool intel_any_crtc_needs_modeset(struct intel_atomic_state *state)
 +{
 +      struct intel_crtc *crtc;
 +      struct intel_crtc_state *crtc_state;
 +      int i;
 +
 +      for_each_new_intel_crtc_in_state(state, crtc, crtc_state, i) {
 +              if (intel_crtc_needs_modeset(crtc_state))
 +                      return true;
 +      }
 +
 +      return false;
 +}
 +
  struct intel_digital_connector_state *
  intel_atomic_get_digital_connector_state(struct intel_atomic_state *state,
                                         struct intel_connector *connector)
index 2bf713b68a074c8b1cabbcabc7de62283477254f,384ff0bb6e19448d84e808cf4a7ecedc60e11bf9..890030e544ca7f063d0df9fb4a228e7c61f83e29
@@@ -79,9 -79,9 +79,9 @@@
  #include "intel_cdclk.h"
  #include "intel_color.h"
  #include "intel_crtc.h"
 -#include "intel_csr.h"
  #include "intel_de.h"
  #include "intel_display_types.h"
 +#include "intel_dmc.h"
  #include "intel_dp_link_training.h"
  #include "intel_fbc.h"
  #include "intel_fdi.h"
@@@ -3675,9 -3675,7 +3675,9 @@@ bool intel_phy_is_combo(struct drm_i915
  
  bool intel_phy_is_tc(struct drm_i915_private *dev_priv, enum phy phy)
  {
 -      if (IS_TIGERLAKE(dev_priv))
 +      if (IS_ALDERLAKE_P(dev_priv))
 +              return phy >= PHY_F && phy <= PHY_I;
 +      else if (IS_TIGERLAKE(dev_priv))
                return phy >= PHY_D && phy <= PHY_I;
        else if (IS_ICELAKE(dev_priv))
                return phy >= PHY_C && phy <= PHY_F;
@@@ -5716,12 -5714,8 +5716,12 @@@ static void hsw_set_pipeconf(const stru
  static void bdw_set_pipemisc(const struct intel_crtc_state *crtc_state)
  {
        struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 +      const struct intel_crtc_scaler_state *scaler_state =
 +              &crtc_state->scaler_state;
 +
        struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
        u32 val = 0;
 +      int i;
  
        switch (crtc_state->pipe_bpp) {
        case 18:
        if (DISPLAY_VER(dev_priv) >= 12)
                val |= PIPEMISC_PIXEL_ROUNDING_TRUNC;
  
 +      if (IS_ALDERLAKE_P(dev_priv)) {
 +              bool scaler_in_use = false;
 +
 +              for (i = 0; i < crtc->num_scalers; i++) {
 +                      if (!scaler_state->scalers[i].in_use)
 +                              continue;
 +
 +                      scaler_in_use = true;
 +                      break;
 +              }
 +
 +              intel_de_rmw(dev_priv, PIPE_MISC2(crtc->pipe),
 +                           PIPE_MISC2_UNDERRUN_BUBBLE_COUNTER_MASK,
 +                           scaler_in_use ? PIPE_MISC2_BUBBLE_COUNTER_SCALER_EN :
 +                           PIPE_MISC2_BUBBLE_COUNTER_SCALER_DIS);
 +      }
 +
        intel_de_write(dev_priv, PIPEMISC(crtc->pipe), val);
  }
  
@@@ -8773,38 -8750,6 +8773,38 @@@ static void verify_wm_state(struct inte
                                hw_wm_level->lines);
                }
  
 +              hw_wm_level = &hw->wm.planes[plane->id].sagv.wm0;
 +              sw_wm_level = &sw_wm->planes[plane->id].sagv.wm0;
 +
 +              if (HAS_HW_SAGV_WM(dev_priv) &&
 +                  !skl_wm_level_equals(hw_wm_level, sw_wm_level)) {
 +                      drm_err(&dev_priv->drm,
 +                              "[PLANE:%d:%s] mismatch in SAGV WM (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n",
 +                              plane->base.base.id, plane->base.name,
 +                              sw_wm_level->enable,
 +                              sw_wm_level->blocks,
 +                              sw_wm_level->lines,
 +                              hw_wm_level->enable,
 +                              hw_wm_level->blocks,
 +                              hw_wm_level->lines);
 +              }
 +
 +              hw_wm_level = &hw->wm.planes[plane->id].sagv.trans_wm;
 +              sw_wm_level = &sw_wm->planes[plane->id].sagv.trans_wm;
 +
 +              if (HAS_HW_SAGV_WM(dev_priv) &&
 +                  !skl_wm_level_equals(hw_wm_level, sw_wm_level)) {
 +                      drm_err(&dev_priv->drm,
 +                              "[PLANE:%d:%s] mismatch in SAGV trans WM (expected e=%d b=%u l=%u, got e=%d b=%u l=%u)\n",
 +                              plane->base.base.id, plane->base.name,
 +                              sw_wm_level->enable,
 +                              sw_wm_level->blocks,
 +                              sw_wm_level->lines,
 +                              hw_wm_level->enable,
 +                              hw_wm_level->blocks,
 +                              hw_wm_level->lines);
 +              }
 +
                /* DDB */
                hw_ddb_entry = &hw->ddb_y[plane->id];
                sw_ddb_entry = &new_crtc_state->wm.skl.plane_ddb_y[plane->id];
@@@ -9978,9 -9923,6 +9978,9 @@@ static int intel_atomic_check(struct dr
        if (ret)
                goto fail;
  
 +      if (intel_any_crtc_needs_modeset(state))
 +              any_ms = true;
 +
        if (any_ms) {
                ret = intel_modeset_checks(state);
                if (ret)
@@@ -11277,14 -11219,7 +11277,14 @@@ static void intel_setup_outputs(struct 
        if (!HAS_DISPLAY(dev_priv))
                return;
  
 -      if (IS_ALDERLAKE_S(dev_priv)) {
 +      if (IS_ALDERLAKE_P(dev_priv)) {
 +              intel_ddi_init(dev_priv, PORT_A);
 +              intel_ddi_init(dev_priv, PORT_B);
 +              intel_ddi_init(dev_priv, PORT_TC1);
 +              intel_ddi_init(dev_priv, PORT_TC2);
 +              intel_ddi_init(dev_priv, PORT_TC3);
 +              intel_ddi_init(dev_priv, PORT_TC4);
 +      } else if (IS_ALDERLAKE_S(dev_priv)) {
                intel_ddi_init(dev_priv, PORT_A);
                intel_ddi_init(dev_priv, PORT_TC1);
                intel_ddi_init(dev_priv, PORT_TC2);
@@@ -12164,8 -12099,6 +12164,6 @@@ static void intel_mode_config_init(stru
        mode_config->preferred_depth = 24;
        mode_config->prefer_shadow = 1;
  
-       mode_config->allow_fb_modifiers = true;
        mode_config->funcs = &intel_mode_funcs;
  
        mode_config->async_page_flip = has_async_flips(i915);
@@@ -12250,7 -12183,7 +12248,7 @@@ int intel_modeset_init_noirq(struct drm
        if (!HAS_DISPLAY(i915))
                return 0;
  
 -      intel_csr_ucode_init(i915);
 +      intel_dmc_ucode_init(i915);
  
        i915->modeset_wq = alloc_ordered_workqueue("i915_modeset", 0);
        i915->flip_wq = alloc_workqueue("i915_flip", WQ_HIGHPRI |
  
        ret = intel_cdclk_init(i915);
        if (ret)
 -              goto cleanup_vga_client_pw_domain_csr;
 +              goto cleanup_vga_client_pw_domain_dmc;
  
        ret = intel_dbuf_init(i915);
        if (ret)
 -              goto cleanup_vga_client_pw_domain_csr;
 +              goto cleanup_vga_client_pw_domain_dmc;
  
        ret = intel_bw_init(i915);
        if (ret)
 -              goto cleanup_vga_client_pw_domain_csr;
 +              goto cleanup_vga_client_pw_domain_dmc;
  
        init_llist_head(&i915->atomic_helper.free_list);
        INIT_WORK(&i915->atomic_helper.free_work,
  
        return 0;
  
 -cleanup_vga_client_pw_domain_csr:
 -      intel_csr_ucode_fini(i915);
 +cleanup_vga_client_pw_domain_dmc:
 +      intel_dmc_ucode_fini(i915);
        intel_power_domains_driver_remove(i915);
        intel_vga_unregister(i915);
  cleanup_bios:
@@@ -13362,7 -13295,7 +13360,7 @@@ void intel_modeset_driver_remove_noirq(
  /* part #3: call after gem init */
  void intel_modeset_driver_remove_nogem(struct drm_i915_private *i915)
  {
 -      intel_csr_ucode_fini(i915);
 +      intel_dmc_ucode_fini(i915);
  
        intel_power_domains_driver_remove(i915);
  
index 8c8d5e41bca8acc78ee1a22be7ed484c6188cd87,6bf6f1ec13ed8c55d77d3eb192b79f8513f63145..08bceae40aa8ddd9e5ae588cf1ebd15c76f92ad0
@@@ -128,13 -128,49 +128,13 @@@ intel_dp_set_lttpr_transparent_mode(str
        return drm_dp_dpcd_write(&intel_dp->aux, DP_PHY_REPEATER_MODE, &val, 1) == 1;
  }
  
 -/**
 - * intel_dp_init_lttpr_and_dprx_caps - detect LTTPR and DPRX caps, init the LTTPR link training mode
 - * @intel_dp: Intel DP struct
 - *
 - * Read the LTTPR common and DPRX capabilities and switch to non-transparent
 - * link training mode if any is detected and read the PHY capabilities for all
 - * detected LTTPRs. In case of an LTTPR detection error or if the number of
 - * LTTPRs is more than is supported (8), fall back to the no-LTTPR,
 - * transparent mode link training mode.
 - *
 - * Returns:
 - *   >0  if LTTPRs were detected and the non-transparent LT mode was set. The
 - *       DPRX capabilities are read out.
 - *    0  if no LTTPRs or more than 8 LTTPRs were detected or in case of a
 - *       detection failure and the transparent LT mode was set. The DPRX
 - *       capabilities are read out.
 - *   <0  Reading out the DPRX capabilities failed.
 - */
 -int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp)
 +static int intel_dp_init_lttpr(struct intel_dp *intel_dp)
  {
        int lttpr_count;
 -      bool ret;
        int i;
  
 -      ret = intel_dp_read_lttpr_common_caps(intel_dp);
 -
 -      /* The DPTX shall read the DPRX caps after LTTPR detection. */
 -      if (drm_dp_read_dpcd_caps(&intel_dp->aux, intel_dp->dpcd)) {
 -              intel_dp_reset_lttpr_common_caps(intel_dp);
 -              return -EIO;
 -      }
 -
 -      if (!ret)
 -              return 0;
 -
 -      /*
 -       * The 0xF0000-0xF02FF range is only valid if the DPCD revision is
 -       * at least 1.4.
 -       */
 -      if (intel_dp->dpcd[DP_DPCD_REV] < 0x14) {
 -              intel_dp_reset_lttpr_common_caps(intel_dp);
 +      if (!intel_dp_read_lttpr_common_caps(intel_dp))
                return 0;
 -      }
  
        lttpr_count = drm_dp_lttpr_count(intel_dp->lttpr_common_caps);
        /*
  
        return lttpr_count;
  }
 +
 +/**
 + * intel_dp_init_lttpr_and_dprx_caps - detect LTTPR and DPRX caps, init the LTTPR link training mode
 + * @intel_dp: Intel DP struct
 + *
 + * Read the LTTPR common and DPRX capabilities and switch to non-transparent
 + * link training mode if any is detected and read the PHY capabilities for all
 + * detected LTTPRs. In case of an LTTPR detection error or if the number of
 + * LTTPRs is more than is supported (8), fall back to the no-LTTPR,
 + * transparent mode link training mode.
 + *
 + * Returns:
 + *   >0  if LTTPRs were detected and the non-transparent LT mode was set. The
 + *       DPRX capabilities are read out.
 + *    0  if no LTTPRs or more than 8 LTTPRs were detected or in case of a
 + *       detection failure and the transparent LT mode was set. The DPRX
 + *       capabilities are read out.
 + *   <0  Reading out the DPRX capabilities failed.
 + */
 +int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp)
 +{
 +      int lttpr_count = intel_dp_init_lttpr(intel_dp);
 +
 +      /* The DPTX shall read the DPRX caps after LTTPR detection. */
 +      if (drm_dp_read_dpcd_caps(&intel_dp->aux, intel_dp->dpcd)) {
 +              intel_dp_reset_lttpr_common_caps(intel_dp);
 +              return -EIO;
 +      }
 +
 +      return lttpr_count;
 +}
  EXPORT_SYMBOL(intel_dp_init_lttpr_and_dprx_caps);
  
  static u8 dp_voltage_max(u8 preemph)
@@@ -508,7 -513,7 +508,7 @@@ static void intel_dp_link_training_cloc
                                                        enum drm_dp_phy dp_phy)
  {
        if (dp_phy == DP_PHY_DPRX)
-               drm_dp_link_train_clock_recovery_delay(intel_dp->dpcd);
+               drm_dp_link_train_clock_recovery_delay(&intel_dp->aux, intel_dp->dpcd);
        else
                drm_dp_lttpr_link_train_clock_recovery_delay();
  }
@@@ -660,11 -665,11 +660,11 @@@ intel_dp_link_training_channel_equaliza
                                                  enum drm_dp_phy dp_phy)
  {
        if (dp_phy == DP_PHY_DPRX) {
-               drm_dp_link_train_channel_eq_delay(intel_dp->dpcd);
+               drm_dp_link_train_channel_eq_delay(&intel_dp->aux, intel_dp->dpcd);
        } else {
                const u8 *phy_caps = intel_dp_lttpr_phy_caps(intel_dp, dp_phy);
  
-               drm_dp_lttpr_link_train_channel_eq_delay(phy_caps);
+               drm_dp_lttpr_link_train_channel_eq_delay(&intel_dp->aux, phy_caps);
        }
  }
  
index a820611d1196efa62da2ebe9a293fb54692b288b,db513f93f0f5d841f0b6f36e1e2f686cf1212f9a..22688ed4b1c3bd02f6dce8fd11f9ac521d97af79
@@@ -39,6 -39,7 +39,7 @@@
  #include <linux/vga_switcheroo.h>
  #include <linux/vt.h>
  
+ #include <drm/drm_aperture.h>
  #include <drm/drm_atomic_helper.h>
  #include <drm/drm_ioctl.h>
  #include <drm/drm_irq.h>
@@@ -48,7 -49,7 +49,7 @@@
  #include "display/intel_acpi.h"
  #include "display/intel_bw.h"
  #include "display/intel_cdclk.h"
 -#include "display/intel_csr.h"
 +#include "display/intel_dmc.h"
  #include "display/intel_display_types.h"
  #include "display/intel_dp.h"
  #include "display/intel_fbdev.h"
@@@ -553,7 -554,7 +554,7 @@@ static int i915_driver_hw_probe(struct 
        if (ret)
                goto err_perf;
  
-       ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, "inteldrmfb");
+       ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, "inteldrmfb");
        if (ret)
                goto err_ggtt;
  
@@@ -757,7 -758,6 +758,6 @@@ i915_driver_create(struct pci_dev *pdev
        if (IS_ERR(i915))
                return i915;
  
-       i915->drm.pdev = pdev;
        pci_set_drvdata(pdev, i915);
  
        /* Device parameters start as a copy of module parameters. */
@@@ -1043,7 -1043,7 +1043,7 @@@ void i915_driver_shutdown(struct drm_i9
        intel_suspend_encoders(i915);
        intel_shutdown_encoders(i915);
  
 -      intel_csr_ucode_suspend(i915);
 +      intel_dmc_ucode_suspend(i915);
  
        /*
         * The only requirement is to reboot with display DC states disabled,
@@@ -1124,7 -1124,7 +1124,7 @@@ static int i915_drm_suspend(struct drm_
  
        dev_priv->suspend_count++;
  
 -      intel_csr_ucode_suspend(dev_priv);
 +      intel_dmc_ucode_suspend(dev_priv);
  
        enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
  
@@@ -1226,7 -1226,7 +1226,7 @@@ static int i915_drm_resume(struct drm_d
  
        i915_ggtt_resume(&dev_priv->ggtt);
  
 -      intel_csr_ucode_resume(dev_priv);
 +      intel_dmc_ucode_resume(dev_priv);
  
        i915_restore_display(dev_priv);
        intel_pps_unlock_regs_wa(dev_priv);
This page took 0.181833 seconds and 4 git commands to generate.