Merge tag 'drm-misc-fixes-2017-11-13' of git://anongit.freedesktop.org/drm/drm-misc...
authorDave Airlie <airlied@redhat.com>
Mon, 13 Nov 2017 19:29:34 +0000 (05:29 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 13 Nov 2017 19:29:34 +0000 (05:29 +1000)
Driver Changes:
- qxl: Use a shadow bo as primary and blit to it to fix flicker (Gerd)
- rockchip: Convert psr spinlock to mutex (Emil)

Cc: Emil Renner Berthing <kernel@esmil.dk>
Cc: Gerd Hoffmann <kraxel@redhat.com>
* tag 'drm-misc-fixes-2017-11-13' of git://anongit.freedesktop.org/drm/drm-misc:
  drm/rockchip: analogix_dp: Use mutex rather than spinlock

1  2 
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c

index 4d3f6ad0abdde8e8dcc142d1e6c724cdb2136259,d8f72d87ef0819e2499d233d1f9c9b762a9b067e..93b7102dd008931ee0fbceb1f59e7f60fc292923
@@@ -72,7 -72,7 +72,7 @@@ struct rockchip_dp_device 
        struct reset_control     *rst;
  
        struct work_struct       psr_work;
-       spinlock_t               psr_lock;
+       struct mutex             psr_lock;
        unsigned int             psr_state;
  
        const struct rockchip_dp_chip_data *data;
  static void analogix_dp_psr_set(struct drm_encoder *encoder, bool enabled)
  {
        struct rockchip_dp_device *dp = to_dp(encoder);
-       unsigned long flags;
  
        if (!analogix_dp_psr_supported(dp->dev))
                return;
  
 -      dev_dbg(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit");
 +      DRM_DEV_DEBUG(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit");
  
-       spin_lock_irqsave(&dp->psr_lock, flags);
+       mutex_lock(&dp->psr_lock);
        if (enabled)
                dp->psr_state = EDP_VSC_PSR_STATE_ACTIVE;
        else
                dp->psr_state = ~EDP_VSC_PSR_STATE_ACTIVE;
  
        schedule_work(&dp->psr_work);
-       spin_unlock_irqrestore(&dp->psr_lock, flags);
+       mutex_unlock(&dp->psr_lock);
  }
  
  static void analogix_dp_psr_work(struct work_struct *work)
        struct rockchip_dp_device *dp =
                                container_of(work, typeof(*dp), psr_work);
        int ret;
-       unsigned long flags;
  
        ret = rockchip_drm_wait_vact_end(dp->encoder.crtc,
                                         PSR_WAIT_LINE_FLAG_TIMEOUT_MS);
        if (ret) {
 -              dev_err(dp->dev, "line flag interrupt did not arrive\n");
 +              DRM_DEV_ERROR(dp->dev, "line flag interrupt did not arrive\n");
                return;
        }
  
-       spin_lock_irqsave(&dp->psr_lock, flags);
+       mutex_lock(&dp->psr_lock);
        if (dp->psr_state == EDP_VSC_PSR_STATE_ACTIVE)
                analogix_dp_enable_psr(dp->dev);
        else
                analogix_dp_disable_psr(dp->dev);
-       spin_unlock_irqrestore(&dp->psr_lock, flags);
+       mutex_unlock(&dp->psr_lock);
  }
  
  static int rockchip_dp_pre_init(struct rockchip_dp_device *dp)
@@@ -140,13 -138,13 +138,13 @@@ static int rockchip_dp_poweron(struct a
  
        ret = clk_prepare_enable(dp->pclk);
        if (ret < 0) {
 -              dev_err(dp->dev, "failed to enable pclk %d\n", ret);
 +              DRM_DEV_ERROR(dp->dev, "failed to enable pclk %d\n", ret);
                return ret;
        }
  
        ret = rockchip_dp_pre_init(dp);
        if (ret < 0) {
 -              dev_err(dp->dev, "failed to dp pre init %d\n", ret);
 +              DRM_DEV_ERROR(dp->dev, "failed to dp pre init %d\n", ret);
                clk_disable_unprepare(dp->pclk);
                return ret;
        }
@@@ -211,17 -209,17 +209,17 @@@ static void rockchip_dp_drm_encoder_ena
        else
                val = dp->data->lcdsel_big;
  
 -      dev_dbg(dp->dev, "vop %s output to dp\n", (ret) ? "LIT" : "BIG");
 +      DRM_DEV_DEBUG(dp->dev, "vop %s output to dp\n", (ret) ? "LIT" : "BIG");
  
        ret = clk_prepare_enable(dp->grfclk);
        if (ret < 0) {
 -              dev_err(dp->dev, "failed to enable grfclk %d\n", ret);
 +              DRM_DEV_ERROR(dp->dev, "failed to enable grfclk %d\n", ret);
                return;
        }
  
        ret = regmap_write(dp->grf, dp->data->lcdsel_grf_reg, val);
        if (ret != 0)
 -              dev_err(dp->dev, "Could not write to GRF: %d\n", ret);
 +              DRM_DEV_ERROR(dp->dev, "Could not write to GRF: %d\n", ret);
  
        clk_disable_unprepare(dp->grfclk);
  }
@@@ -277,7 -275,7 +275,7 @@@ static int rockchip_dp_init(struct rock
  
        dp->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
        if (IS_ERR(dp->grf)) {
 -              dev_err(dev, "failed to get rockchip,grf property\n");
 +              DRM_DEV_ERROR(dev, "failed to get rockchip,grf property\n");
                return PTR_ERR(dp->grf);
        }
  
        } else if (PTR_ERR(dp->grfclk) == -EPROBE_DEFER) {
                return -EPROBE_DEFER;
        } else if (IS_ERR(dp->grfclk)) {
 -              dev_err(dev, "failed to get grf clock\n");
 +              DRM_DEV_ERROR(dev, "failed to get grf clock\n");
                return PTR_ERR(dp->grfclk);
        }
  
        dp->pclk = devm_clk_get(dev, "pclk");
        if (IS_ERR(dp->pclk)) {
 -              dev_err(dev, "failed to get pclk property\n");
 +              DRM_DEV_ERROR(dev, "failed to get pclk property\n");
                return PTR_ERR(dp->pclk);
        }
  
        dp->rst = devm_reset_control_get(dev, "dp");
        if (IS_ERR(dp->rst)) {
 -              dev_err(dev, "failed to get dp reset control\n");
 +              DRM_DEV_ERROR(dev, "failed to get dp reset control\n");
                return PTR_ERR(dp->rst);
        }
  
        ret = clk_prepare_enable(dp->pclk);
        if (ret < 0) {
 -              dev_err(dp->dev, "failed to enable pclk %d\n", ret);
 +              DRM_DEV_ERROR(dp->dev, "failed to enable pclk %d\n", ret);
                return ret;
        }
  
        ret = rockchip_dp_pre_init(dp);
        if (ret < 0) {
 -              dev_err(dp->dev, "failed to pre init %d\n", ret);
 +              DRM_DEV_ERROR(dp->dev, "failed to pre init %d\n", ret);
                clk_disable_unprepare(dp->pclk);
                return ret;
        }
@@@ -381,7 -379,7 +379,7 @@@ static int rockchip_dp_bind(struct devi
        dp->plat_data.power_off = rockchip_dp_powerdown;
        dp->plat_data.get_modes = rockchip_dp_get_modes;
  
-       spin_lock_init(&dp->psr_lock);
+       mutex_init(&dp->psr_lock);
        dp->psr_state = ~EDP_VSC_PSR_STATE_ACTIVE;
        INIT_WORK(&dp->psr_work, analogix_dp_psr_work);