]> Git Repo - linux.git/commitdiff
Merge remote-tracking branch 'drm-misc/drm-misc-next' into msm-next
authorRob Clark <[email protected]>
Sun, 10 Dec 2023 18:07:54 +0000 (10:07 -0800)
committerRob Clark <[email protected]>
Sun, 10 Dec 2023 18:07:54 +0000 (10:07 -0800)
Backmerge drm-misc-next to pick up some dependencies for drm/msm
patches, in particular:

https://patchwork.freedesktop.org/patch/570219/?series=127251&rev=1
https://patchwork.freedesktop.org/series/123411/

Signed-off-by: Rob Clark <[email protected]>
1  2 
drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_8_0_sc8280xp.h
drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c
drivers/gpu/drm/msm/dp/dp_display.c
drivers/gpu/drm/msm/dp/dp_drm.c
drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_gem_submit.c

index 8b5c5031e2d92f39939c84afbc82b7453902214b,4c0528794e7a7ef7eb05f69ebce8a94db64ce863..0d143e390eca964b1c81f835d0904a2079b0b941
@@@ -10,6 -10,7 +10,6 @@@
  static const struct dpu_caps sc8280xp_dpu_caps = {
        .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
        .max_mixer_blendstages = 11,
 -      .qseed_type = DPU_SSPP_SCALER_QSEED4,
        .has_src_split = true,
        .has_dim_layer = true,
        .has_idle_pc = true,
@@@ -74,32 -75,32 +74,32 @@@ static const struct dpu_sspp_cfg sc8280
        {
                .name = "sspp_0", .id = SSPP_VIG0,
                .base = 0x4000, .len = 0x2ac,
 -              .features = VIG_SC7180_MASK,
 -              .sblk = &sm8250_vig_sblk_0,
 +              .features = VIG_SDM845_MASK,
 +              .sblk = &dpu_vig_sblk_qseed3_3_0,
                .xin_id = 0,
                .type = SSPP_TYPE_VIG,
                .clk_ctrl = DPU_CLK_CTRL_VIG0,
        }, {
                .name = "sspp_1", .id = SSPP_VIG1,
                .base = 0x6000, .len = 0x2ac,
 -              .features = VIG_SC7180_MASK,
 -              .sblk = &sm8250_vig_sblk_1,
 +              .features = VIG_SDM845_MASK,
 +              .sblk = &dpu_vig_sblk_qseed3_3_0,
                .xin_id = 4,
                .type = SSPP_TYPE_VIG,
                .clk_ctrl = DPU_CLK_CTRL_VIG1,
        }, {
                .name = "sspp_2", .id = SSPP_VIG2,
                .base = 0x8000, .len = 0x2ac,
 -              .features = VIG_SC7180_MASK,
 -              .sblk = &sm8250_vig_sblk_2,
 +              .features = VIG_SDM845_MASK,
 +              .sblk = &dpu_vig_sblk_qseed3_3_0,
                .xin_id = 8,
                .type = SSPP_TYPE_VIG,
                .clk_ctrl = DPU_CLK_CTRL_VIG2,
        }, {
                .name = "sspp_3", .id = SSPP_VIG3,
                .base = 0xa000, .len = 0x2ac,
 -              .features = VIG_SC7180_MASK,
 -              .sblk = &sm8250_vig_sblk_3,
 +              .features = VIG_SDM845_MASK,
 +              .sblk = &dpu_vig_sblk_qseed3_3_0,
                .xin_id = 12,
                .type = SSPP_TYPE_VIG,
                .clk_ctrl = DPU_CLK_CTRL_VIG3,
                .name = "sspp_8", .id = SSPP_DMA0,
                .base = 0x24000, .len = 0x2ac,
                .features = DMA_SDM845_MASK,
 -              .sblk = &sdm845_dma_sblk_0,
 +              .sblk = &dpu_dma_sblk,
                .xin_id = 1,
                .type = SSPP_TYPE_DMA,
                .clk_ctrl = DPU_CLK_CTRL_DMA0,
                .name = "sspp_9", .id = SSPP_DMA1,
                .base = 0x26000, .len = 0x2ac,
                .features = DMA_SDM845_MASK,
 -              .sblk = &sdm845_dma_sblk_1,
 +              .sblk = &dpu_dma_sblk,
                .xin_id = 5,
                .type = SSPP_TYPE_DMA,
                .clk_ctrl = DPU_CLK_CTRL_DMA1,
                .name = "sspp_10", .id = SSPP_DMA2,
                .base = 0x28000, .len = 0x2ac,
                .features = DMA_CURSOR_SDM845_MASK,
 -              .sblk = &sdm845_dma_sblk_2,
 +              .sblk = &dpu_dma_sblk,
                .xin_id = 9,
                .type = SSPP_TYPE_DMA,
                .clk_ctrl = DPU_CLK_CTRL_DMA2,
                .name = "sspp_11", .id = SSPP_DMA3,
                .base = 0x2a000, .len = 0x2ac,
                .features = DMA_CURSOR_SDM845_MASK,
 -              .sblk = &sdm845_dma_sblk_3,
 +              .sblk = &dpu_dma_sblk,
                .xin_id = 13,
                .type = SSPP_TYPE_DMA,
                .clk_ctrl = DPU_CLK_CTRL_DMA3,
@@@ -405,6 -406,7 +405,7 @@@ static const struct dpu_perf_cfg sc8280
        .min_llcc_ib = 0,
        .min_dram_ib = 800000,
        .danger_lut_tbl = {0xf, 0xffff, 0x0},
+       .safe_lut_tbl = {0xfe00, 0xfe00, 0xffff},
        .qos_lut_tbl = {
                {.nentry = ARRAY_SIZE(sc8180x_qos_linear),
                .entries = sc8180x_qos_linear
index 48f447f4e18334631c17c40123e60a975468da5e,ec933d597e20cfc1eed66439f69a2297f46f1b9a..0827634664aef03c9de66c16050a2f1e684efaa9
@@@ -209,6 -209,13 +209,6 @@@ static void mdp5_kms_destroy(struct msm
  {
        struct mdp5_kms *mdp5_kms = to_mdp5_kms(to_mdp_kms(kms));
        struct msm_gem_address_space *aspace = kms->aspace;
 -      int i;
 -
 -      for (i = 0; i < mdp5_kms->num_hwmixers; i++)
 -              mdp5_mixer_destroy(mdp5_kms->hwmixers[i]);
 -
 -      for (i = 0; i < mdp5_kms->num_hwpipes; i++)
 -              mdp5_pipe_destroy(mdp5_kms->hwpipes[i]);
  
        if (aspace) {
                aspace->mmu->funcs->detach(aspace->mmu);
@@@ -616,6 -623,18 +616,6 @@@ fail
  
  static void mdp5_destroy(struct mdp5_kms *mdp5_kms)
  {
 -      int i;
 -
 -      if (mdp5_kms->ctlm)
 -              mdp5_ctlm_destroy(mdp5_kms->ctlm);
 -      if (mdp5_kms->smp)
 -              mdp5_smp_destroy(mdp5_kms->smp);
 -      if (mdp5_kms->cfg)
 -              mdp5_cfg_destroy(mdp5_kms->cfg);
 -
 -      for (i = 0; i < mdp5_kms->num_intfs; i++)
 -              kfree(mdp5_kms->intfs[i]);
 -
        if (mdp5_kms->rpm_enabled)
                pm_runtime_disable(&mdp5_kms->pdev->dev);
  
@@@ -633,7 -652,7 +633,7 @@@ static int construct_pipes(struct mdp5_
        for (i = 0; i < cnt; i++) {
                struct mdp5_hw_pipe *hwpipe;
  
 -              hwpipe = mdp5_pipe_init(pipes[i], offsets[i], caps);
 +              hwpipe = mdp5_pipe_init(dev, pipes[i], offsets[i], caps);
                if (IS_ERR(hwpipe)) {
                        ret = PTR_ERR(hwpipe);
                        DRM_DEV_ERROR(dev->dev, "failed to construct pipe for %s (%d)\n",
@@@ -705,7 -724,7 +705,7 @@@ static int hwmixer_init(struct mdp5_km
        for (i = 0; i < hw_cfg->lm.count; i++) {
                struct mdp5_hw_mixer *mixer;
  
 -              mixer = mdp5_mixer_init(&hw_cfg->lm.instances[i]);
 +              mixer = mdp5_mixer_init(dev, &hw_cfg->lm.instances[i]);
                if (IS_ERR(mixer)) {
                        ret = PTR_ERR(mixer);
                        DRM_DEV_ERROR(dev->dev, "failed to construct LM%d (%d)\n",
@@@ -736,7 -755,7 +736,7 @@@ static int interface_init(struct mdp5_k
                if (intf_types[i] == INTF_DISABLED)
                        continue;
  
 -              intf = kzalloc(sizeof(*intf), GFP_KERNEL);
 +              intf = devm_kzalloc(dev->dev, sizeof(*intf), GFP_KERNEL);
                if (!intf) {
                        DRM_DEV_ERROR(dev->dev, "failed to construct INTF%d\n", i);
                        return -ENOMEM;
@@@ -825,8 -844,7 +825,7 @@@ static int mdp5_init(struct platform_de
  
        return 0;
  fail:
-       if (mdp5_kms)
-               mdp5_destroy(mdp5_kms);
+       mdp5_destroy(mdp5_kms);
        return ret;
  }
  
index f8a9e8403c264476da2bb30de7cc6ec1e0057da4,1b88fb52726f244b28a95c6c8133bb0a864cc3a9..0405ff08d7622208c66ee4a786cad14963abc5ce
@@@ -49,11 -49,13 +49,11 @@@ enum 
        ST_CONNECTED,
        ST_DISCONNECT_PENDING,
        ST_DISPLAY_OFF,
 -      ST_SUSPENDED,
  };
  
  enum {
        EV_NO_EVENT,
        /* hpd events */
 -      EV_HPD_INIT_SETUP,
        EV_HPD_PLUG_INT,
        EV_IRQ_HPD_INT,
        EV_HPD_UNPLUG_INT,
@@@ -168,11 -170,6 +168,11 @@@ static const struct msm_dp_desc sm8350_
        {}
  };
  
 +static const struct msm_dp_desc sm8650_dp_descs[] = {
 +      { .io_start = 0x0af54000, .id = MSM_DP_CONTROLLER_0, .connector_type = DRM_MODE_CONNECTOR_DisplayPort },
 +      {}
 +};
 +
  static const struct of_device_id dp_dt_match[] = {
        { .compatible = "qcom,sc7180-dp", .data = &sc7180_dp_descs },
        { .compatible = "qcom,sc7280-dp", .data = &sc7280_dp_descs },
        { .compatible = "qcom,sc8280xp-edp", .data = &sc8280xp_edp_descs },
        { .compatible = "qcom,sdm845-dp", .data = &sc7180_dp_descs },
        { .compatible = "qcom,sm8350-dp", .data = &sm8350_dp_descs },
 +      { .compatible = "qcom,sm8650-dp", .data = &sm8650_dp_descs },
        {}
  };
  
@@@ -279,6 -275,11 +279,6 @@@ static int dp_display_bind(struct devic
        dp->dp_display.drm_dev = drm;
        priv->dp[dp->id] = &dp->dp_display;
  
 -      rc = dp->parser->parse(dp->parser);
 -      if (rc) {
 -              DRM_ERROR("device tree parsing failed\n");
 -              goto end;
 -      }
  
  
        dp->drm_dev = drm;
                goto end;
        }
  
 -      rc = dp_power_client_init(dp->power);
 -      if (rc) {
 -              DRM_ERROR("Power client create failed\n");
 -              goto end;
 -      }
  
        rc = dp_register_audio_driver(dev, dp->audio);
        if (rc) {
@@@ -313,10 -319,15 +313,10 @@@ static void dp_display_unbind(struct de
        struct dp_display_private *dp = dev_get_dp_display_private(dev);
        struct msm_drm_private *priv = dev_get_drvdata(master);
  
 -      /* disable all HPD interrupts */
 -      if (dp->core_initialized)
 -              dp_catalog_hpd_config_intr(dp->catalog, DP_DP_HPD_INT_MASK, false);
 -
        kthread_stop(dp->ev_tsk);
  
        of_dp_aux_depopulate_bus(dp->aux);
  
 -      dp_power_client_deinit(dp->power);
        dp_unregister_audio_driver(dev, dp->audio);
        dp_aux_unregister(dp->aux);
        dp->drm_dev = NULL;
@@@ -329,24 -340,43 +329,26 @@@ static const struct component_ops dp_di
        .unbind = dp_display_unbind,
  };
  
 -static void dp_display_send_hpd_event(struct msm_dp *dp_display)
 -{
 -      struct dp_display_private *dp;
 -      struct drm_connector *connector;
 -
 -      dp = container_of(dp_display, struct dp_display_private, dp_display);
 -
 -      connector = dp->dp_display.connector;
 -      drm_helper_hpd_irq_event(connector->dev);
 -}
 -
 -
  static int dp_display_send_hpd_notification(struct dp_display_private *dp,
                                            bool hpd)
  {
 -      if ((hpd && dp->dp_display.is_connected) ||
 -                      (!hpd && !dp->dp_display.is_connected)) {
 -              drm_dbg_dp(dp->drm_dev, "HPD already %s\n",
 -                              (hpd ? "on" : "off"));
 -              return 0;
 -      }
 +      struct drm_bridge *bridge = dp->dp_display.bridge;
  
        /* reset video pattern flag on disconnect */
        if (!hpd) {
                dp->panel->video_test = false;
-               drm_dp_set_subconnector_property(dp->dp_display.connector,
-                                                connector_status_disconnected,
-                                                dp->panel->dpcd, dp->panel->downstream_ports);
+               if (!dp->dp_display.is_edp)
+                       drm_dp_set_subconnector_property(dp->dp_display.connector,
+                                                        connector_status_disconnected,
+                                                        dp->panel->dpcd,
+                                                        dp->panel->downstream_ports);
        }
  
 -      dp->dp_display.is_connected = hpd;
 +      dp->dp_display.link_ready = hpd;
  
        drm_dbg_dp(dp->drm_dev, "type=%d hpd=%d\n",
                        dp->dp_display.connector_type, hpd);
 -      dp_display_send_hpd_event(&dp->dp_display);
 +      drm_bridge_hpd_notify(bridge, dp->dp_display.link_ready);
  
        return 0;
  }
@@@ -368,8 -398,11 +370,11 @@@ static int dp_display_process_hpd_high(
  
        dp_link_process_request(dp->link);
  
-       drm_dp_set_subconnector_property(dp->dp_display.connector, connector_status_connected,
-                                        dp->panel->dpcd, dp->panel->downstream_ports);
+       if (!dp->dp_display.is_edp)
+               drm_dp_set_subconnector_property(dp->dp_display.connector,
+                                                connector_status_connected,
+                                                dp->panel->dpcd,
+                                                dp->panel->downstream_ports);
  
        edid = dp->panel->edid;
  
@@@ -542,7 -575,6 +547,7 @@@ static int dp_hpd_plug_handle(struct dp
  {
        u32 state;
        int ret;
 +      struct platform_device *pdev = dp->dp_display.pdev;
  
        mutex_lock(&dp->event_mutex);
  
        drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n",
                        dp->dp_display.connector_type, state);
  
 -      if (state == ST_DISPLAY_OFF || state == ST_SUSPENDED) {
 +      if (state == ST_DISPLAY_OFF) {
                mutex_unlock(&dp->event_mutex);
                return 0;
        }
                return 0;
        }
  
 -      ret = dp_display_usbpd_configure_cb(&dp->dp_display.pdev->dev);
 +      ret = pm_runtime_resume_and_get(&pdev->dev);
 +      if (ret) {
 +              DRM_ERROR("failed to pm_runtime_resume\n");
 +              mutex_unlock(&dp->event_mutex);
 +              return ret;
 +      }
 +
 +      ret = dp_display_usbpd_configure_cb(&pdev->dev);
        if (ret) {      /* link train failed */
                dp->hpd_state = ST_DISCONNECTED;
        } else {
@@@ -606,7 -631,6 +611,7 @@@ static void dp_display_handle_plugged_c
  static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data)
  {
        u32 state;
 +      struct platform_device *pdev = dp->dp_display.pdev;
  
        mutex_lock(&dp->event_mutex);
  
                        dp->dp_display.connector_type, state);
  
        /* uevent will complete disconnection part */
 +      pm_runtime_put_sync(&pdev->dev);
        mutex_unlock(&dp->event_mutex);
        return 0;
  }
@@@ -673,7 -696,7 +678,7 @@@ static int dp_irq_hpd_handle(struct dp_
        drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n",
                        dp->dp_display.connector_type, state);
  
 -      if (state == ST_DISPLAY_OFF || state == ST_SUSPENDED) {
 +      if (state == ST_DISPLAY_OFF) {
                mutex_unlock(&dp->event_mutex);
                return 0;
        }
  
  static void dp_display_deinit_sub_modules(struct dp_display_private *dp)
  {
 -      dp_debug_put(dp->debug);
        dp_audio_put(dp->audio);
        dp_panel_put(dp->panel);
        dp_aux_put(dp->aux);
@@@ -894,7 -918,7 +899,7 @@@ int dp_display_set_plugged_cb(struct ms
  
        dp_display->plugged_cb = fn;
        dp_display->codec_dev = codec_dev;
 -      plugged = dp_display->is_connected;
 +      plugged = dp_display->link_ready;
        dp_display_handle_plugged_change(dp_display, plugged);
  
        return 0;
@@@ -1084,6 -1108,9 +1089,6 @@@ static int hpd_event_thread(void *data
                spin_unlock_irqrestore(&dp_priv->event_lock, flag);
  
                switch (todo->event_id) {
 -              case EV_HPD_INIT_SETUP:
 -                      dp_display_host_init(dp_priv);
 -                      break;
                case EV_HPD_PLUG_INT:
                        dp_hpd_plug_handle(dp_priv, todo->data);
                        break;
@@@ -1162,21 -1189,27 +1167,21 @@@ static irqreturn_t dp_display_irq_handl
        return ret;
  }
  
 -int dp_display_request_irq(struct msm_dp *dp_display)
 +static int dp_display_request_irq(struct dp_display_private *dp)
  {
        int rc = 0;
 -      struct dp_display_private *dp;
 -
 -      if (!dp_display) {
 -              DRM_ERROR("invalid input\n");
 -              return -EINVAL;
 -      }
 +      struct platform_device *pdev = dp->dp_display.pdev;
  
 -      dp = container_of(dp_display, struct dp_display_private, dp_display);
 -
 -      dp->irq = irq_of_parse_and_map(dp->dp_display.pdev->dev.of_node, 0);
 -      if (!dp->irq) {
 +      dp->irq = platform_get_irq(pdev, 0);
 +      if (dp->irq < 0) {
                DRM_ERROR("failed to get irq\n");
 -              return -EINVAL;
 +              return dp->irq;
        }
  
 -      rc = devm_request_irq(dp_display->drm_dev->dev, dp->irq,
 -                      dp_display_irq_handler,
 -                      IRQF_TRIGGER_HIGH, "dp_display_isr", dp);
 +      rc = devm_request_irq(&pdev->dev, dp->irq, dp_display_irq_handler,
 +                            IRQF_TRIGGER_HIGH|IRQF_NO_AUTOEN,
 +                            "dp_display_isr", dp);
 +
        if (rc < 0) {
                DRM_ERROR("failed to request IRQ%u: %d\n",
                                dp->irq, rc);
@@@ -1205,17 -1238,6 +1210,17 @@@ static const struct msm_dp_desc *dp_dis
        return NULL;
  }
  
 +static int dp_auxbus_done_probe(struct drm_dp_aux *aux)
 +{
 +      int rc;
 +
 +      rc = component_add(aux->dev, &dp_display_comp_ops);
 +      if (rc)
 +              DRM_ERROR("eDP component add failed, rc=%d\n", rc);
 +
 +      return rc;
 +}
 +
  static int dp_display_probe(struct platform_device *pdev)
  {
        int rc = 0;
                return -EPROBE_DEFER;
        }
  
 +      rc = dp->parser->parse(dp->parser);
 +      if (rc) {
 +              DRM_ERROR("device tree parsing failed\n");
 +              goto err;
 +      }
 +
 +      rc = dp_power_client_init(dp->power);
 +      if (rc) {
 +              DRM_ERROR("Power client create failed\n");
 +              goto err;
 +      }
 +
        /* setup event q */
        mutex_init(&dp->event_mutex);
        init_waitqueue_head(&dp->event_q);
  
        platform_set_drvdata(pdev, &dp->dp_display);
  
 -      rc = component_add(&pdev->dev, &dp_display_comp_ops);
 -      if (rc) {
 -              DRM_ERROR("component add failed, rc=%d\n", rc);
 -              dp_display_deinit_sub_modules(dp);
 +      rc = devm_pm_runtime_enable(&pdev->dev);
 +      if (rc)
 +              goto err;
 +
 +      rc = dp_display_request_irq(dp);
 +      if (rc)
 +              goto err;
 +
 +      if (dp->dp_display.is_edp) {
 +              rc = devm_of_dp_aux_populate_bus(dp->aux, dp_auxbus_done_probe);
 +              if (rc) {
 +                      DRM_ERROR("eDP auxbus population failed, rc=%d\n", rc);
 +                      goto err;
 +              }
 +      } else {
 +              rc = component_add(&pdev->dev, &dp_display_comp_ops);
 +              if (rc) {
 +                      DRM_ERROR("component add failed, rc=%d\n", rc);
 +                      goto err;
 +              }
        }
  
        return rc;
 +
 +err:
 +      dp_display_deinit_sub_modules(dp);
 +      return rc;
  }
  
  static void dp_display_remove(struct platform_device *pdev)
  
        component_del(&pdev->dev, &dp_display_comp_ops);
        dp_display_deinit_sub_modules(dp);
 -
        platform_set_drvdata(pdev, NULL);
  }
  
 -static int dp_pm_resume(struct device *dev)
 +static int dp_pm_runtime_suspend(struct device *dev)
  {
 -      struct platform_device *pdev = to_platform_device(dev);
 -      struct msm_dp *dp_display = platform_get_drvdata(pdev);
 -      struct dp_display_private *dp;
 -      int sink_count = 0;
 -
 -      dp = container_of(dp_display, struct dp_display_private, dp_display);
 -
 -      mutex_lock(&dp->event_mutex);
 -
 -      drm_dbg_dp(dp->drm_dev,
 -              "Before, type=%d core_inited=%d phy_inited=%d power_on=%d\n",
 -              dp->dp_display.connector_type, dp->core_initialized,
 -              dp->phy_initialized, dp_display->power_on);
 -
 -      /* start from disconnected state */
 -      dp->hpd_state = ST_DISCONNECTED;
 -
 -      /* turn on dp ctrl/phy */
 -      dp_display_host_init(dp);
 -
 -      if (dp_display->is_edp)
 -              dp_catalog_ctrl_hpd_enable(dp->catalog);
 +      struct dp_display_private *dp = dev_get_dp_display_private(dev);
  
 -      if (dp_catalog_link_is_connected(dp->catalog)) {
 -              /*
 -               * set sink to normal operation mode -- D0
 -               * before dpcd read
 -               */
 -              dp_display_host_phy_init(dp);
 -              dp_link_psm_config(dp->link, &dp->panel->link_info, false);
 -              sink_count = drm_dp_read_sink_count(dp->aux);
 -              if (sink_count < 0)
 -                      sink_count = 0;
 +      disable_irq(dp->irq);
  
 +      if (dp->dp_display.is_edp) {
                dp_display_host_phy_exit(dp);
 +              dp_catalog_ctrl_hpd_disable(dp->catalog);
        }
 -
 -      dp->link->sink_count = sink_count;
 -      /*
 -       * can not declared display is connected unless
 -       * HDMI cable is plugged in and sink_count of
 -       * dongle become 1
 -       * also only signal audio when disconnected
 -       */
 -      if (dp->link->sink_count) {
 -              dp->dp_display.is_connected = true;
 -      } else {
 -              dp->dp_display.is_connected = false;
 -              dp_display_handle_plugged_change(dp_display, false);
 -      }
 -
 -      drm_dbg_dp(dp->drm_dev,
 -              "After, type=%d sink=%d conn=%d core_init=%d phy_init=%d power=%d\n",
 -              dp->dp_display.connector_type, dp->link->sink_count,
 -              dp->dp_display.is_connected, dp->core_initialized,
 -              dp->phy_initialized, dp_display->power_on);
 -
 -      mutex_unlock(&dp->event_mutex);
 +      dp_display_host_deinit(dp);
  
        return 0;
  }
  
 -static int dp_pm_suspend(struct device *dev)
 +static int dp_pm_runtime_resume(struct device *dev)
  {
 -      struct platform_device *pdev = to_platform_device(dev);
 -      struct msm_dp *dp_display = platform_get_drvdata(pdev);
 -      struct dp_display_private *dp;
 -
 -      dp = container_of(dp_display, struct dp_display_private, dp_display);
 -
 -      mutex_lock(&dp->event_mutex);
 -
 -      drm_dbg_dp(dp->drm_dev,
 -              "Before, type=%d core_inited=%d  phy_inited=%d power_on=%d\n",
 -              dp->dp_display.connector_type, dp->core_initialized,
 -              dp->phy_initialized, dp_display->power_on);
 -
 -      /* mainlink enabled */
 -      if (dp_power_clk_status(dp->power, DP_CTRL_PM))
 -              dp_ctrl_off_link_stream(dp->ctrl);
 -
 -      dp_display_host_phy_exit(dp);
 -
 -      /* host_init will be called at pm_resume */
 -      dp_display_host_deinit(dp);
 -
 -      dp->hpd_state = ST_SUSPENDED;
 -
 -      drm_dbg_dp(dp->drm_dev,
 -              "After, type=%d core_inited=%d phy_inited=%d power_on=%d\n",
 -              dp->dp_display.connector_type, dp->core_initialized,
 -              dp->phy_initialized, dp_display->power_on);
 +      struct dp_display_private *dp = dev_get_dp_display_private(dev);
  
 -      mutex_unlock(&dp->event_mutex);
 +      /*
 +       * for eDP, host cotroller, HPD block and PHY are enabled here
 +       * but with HPD irq disabled
 +       *
 +       * for DP, only host controller is enabled here.
 +       * HPD block is enabled at dp_bridge_hpd_enable()
 +       * PHY will be enabled at plugin handler later
 +       */
 +      dp_display_host_init(dp);
 +      if (dp->dp_display.is_edp) {
 +              dp_catalog_ctrl_hpd_enable(dp->catalog);
 +              dp_display_host_phy_init(dp);
 +      }
  
 +      enable_irq(dp->irq);
        return 0;
  }
  
  static const struct dev_pm_ops dp_pm_ops = {
 -      .suspend = dp_pm_suspend,
 -      .resume =  dp_pm_resume,
 +      SET_RUNTIME_PM_OPS(dp_pm_runtime_suspend, dp_pm_runtime_resume, NULL)
 +      SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
 +                              pm_runtime_force_resume)
  };
  
  static struct platform_driver dp_display_driver = {
@@@ -1381,6 -1434,19 +1386,6 @@@ void __exit msm_dp_unregister(void
        platform_driver_unregister(&dp_display_driver);
  }
  
 -void msm_dp_irq_postinstall(struct msm_dp *dp_display)
 -{
 -      struct dp_display_private *dp;
 -
 -      if (!dp_display)
 -              return;
 -
 -      dp = container_of(dp_display, struct dp_display_private, dp_display);
 -
 -      if (!dp_display->is_edp)
 -              dp_add_event(dp, EV_HPD_INIT_SETUP, 0, 0);
 -}
 -
  bool msm_dp_wide_bus_available(const struct msm_dp *dp_display)
  {
        struct dp_display_private *dp;
        return dp->wide_bus_en;
  }
  
 -void msm_dp_debugfs_init(struct msm_dp *dp_display, struct drm_minor *minor)
 +void dp_display_debugfs_init(struct msm_dp *dp_display, struct dentry *root, bool is_edp)
  {
        struct dp_display_private *dp;
        struct device *dev;
  
        dp->debug = dp_debug_get(dev, dp->panel,
                                        dp->link, dp->dp_display.connector,
 -                                      minor);
 +                                      root, is_edp);
        if (IS_ERR(dp->debug)) {
                rc = PTR_ERR(dp->debug);
                DRM_ERROR("failed to initialize debug, rc = %d\n", rc);
@@@ -1413,8 -1479,33 +1418,8 @@@ static int dp_display_get_next_bridge(s
  {
        int rc;
        struct dp_display_private *dp_priv;
 -      struct device_node *aux_bus;
 -      struct device *dev;
  
        dp_priv = container_of(dp, struct dp_display_private, dp_display);
 -      dev = &dp_priv->dp_display.pdev->dev;
 -      aux_bus = of_get_child_by_name(dev->of_node, "aux-bus");
 -
 -      if (aux_bus && dp->is_edp) {
 -              dp_display_host_init(dp_priv);
 -              dp_catalog_ctrl_hpd_enable(dp_priv->catalog);
 -              dp_display_host_phy_init(dp_priv);
 -
 -              /*
 -               * The code below assumes that the panel will finish probing
 -               * by the time devm_of_dp_aux_populate_ep_devices() returns.
 -               * This isn't a great assumption since it will fail if the
 -               * panel driver is probed asynchronously but is the best we
 -               * can do without a bigger driver reorganization.
 -               */
 -              rc = of_dp_aux_populate_bus(dp_priv->aux, NULL);
 -              of_node_put(aux_bus);
 -              if (rc)
 -                      goto error;
 -      } else if (dp->is_edp) {
 -              DRM_ERROR("eDP aux_bus not found\n");
 -              return -ENODEV;
 -      }
  
        /*
         * External bridges are mandatory for eDP interfaces: one has to
        if (!dp->is_edp && rc == -ENODEV)
                return 0;
  
 -      if (!rc) {
 +      if (!rc)
                dp->next_bridge = dp_priv->parser->next_bridge;
 -              return 0;
 -      }
  
 -error:
 -      if (dp->is_edp) {
 -              of_dp_aux_depopulate_bus(dp_priv->aux);
 -              dp_display_host_phy_exit(dp_priv);
 -              dp_display_host_deinit(dp_priv);
 -      }
        return rc;
  }
  
@@@ -1443,6 -1542,12 +1448,6 @@@ int msm_dp_modeset_init(struct msm_dp *
  
        dp_priv = container_of(dp_display, struct dp_display_private, dp_display);
  
 -      ret = dp_display_request_irq(dp_display);
 -      if (ret) {
 -              DRM_ERROR("request_irq failed, ret=%d\n", ret);
 -              return ret;
 -      }
 -
        ret = dp_display_get_next_bridge(dp_display);
        if (ret)
                return ret;
@@@ -1488,11 -1593,6 +1493,11 @@@ void dp_bridge_atomic_enable(struct drm
                dp_hpd_plug_handle(dp_display, 0);
  
        mutex_lock(&dp_display->event_mutex);
 +      if (pm_runtime_resume_and_get(&dp->pdev->dev)) {
 +              DRM_ERROR("failed to pm_runtime_resume\n");
 +              mutex_unlock(&dp_display->event_mutex);
 +              return;
 +      }
  
        state = dp_display->hpd_state;
        if (state != ST_DISPLAY_OFF && state != ST_MAINLINK_READY) {
@@@ -1557,9 -1657,10 +1562,9 @@@ void dp_bridge_atomic_post_disable(stru
        mutex_lock(&dp_display->event_mutex);
  
        state = dp_display->hpd_state;
 -      if (state != ST_DISCONNECT_PENDING && state != ST_CONNECTED) {
 -              mutex_unlock(&dp_display->event_mutex);
 -              return;
 -      }
 +      if (state != ST_DISCONNECT_PENDING && state != ST_CONNECTED)
 +              drm_dbg_dp(dp->drm_dev, "type=%d wrong hpd_state=%d\n",
 +                         dp->connector_type, state);
  
        dp_display_disable(dp_display);
  
        }
  
        drm_dbg_dp(dp->drm_dev, "type=%d Done\n", dp->connector_type);
 +
 +      pm_runtime_put_sync(&dp->pdev->dev);
        mutex_unlock(&dp_display->event_mutex);
  }
  
@@@ -1612,21 -1711,7 +1617,21 @@@ void dp_bridge_hpd_enable(struct drm_br
        struct msm_dp *dp_display = dp_bridge->dp_display;
        struct dp_display_private *dp = container_of(dp_display, struct dp_display_private, dp_display);
  
 +      /*
 +       * this is for external DP with hpd irq enabled case,
 +       * step-1: dp_pm_runtime_resume() enable dp host only
 +       * step-2: enable hdp block and have hpd irq enabled here
 +       * step-3: waiting for plugin irq while phy is not initialized
 +       * step-4: DP PHY is initialized at plugin handler before link training
 +       *
 +       */
        mutex_lock(&dp->event_mutex);
 +      if (pm_runtime_resume_and_get(&dp_display->pdev->dev)) {
 +              DRM_ERROR("failed to resume power\n");
 +              mutex_unlock(&dp->event_mutex);
 +              return;
 +      }
 +
        dp_catalog_ctrl_hpd_enable(dp->catalog);
  
        /* enable HDP interrupts */
@@@ -1648,8 -1733,6 +1653,8 @@@ void dp_bridge_hpd_disable(struct drm_b
        dp_catalog_ctrl_hpd_disable(dp->catalog);
  
        dp_display->internal_hpd = false;
 +
 +      pm_runtime_put_sync(&dp_display->pdev->dev);
        mutex_unlock(&dp->event_mutex);
  }
  
@@@ -1664,8 -1747,13 +1669,8 @@@ void dp_bridge_hpd_notify(struct drm_br
        if (dp_display->internal_hpd)
                return;
  
 -      if (!dp->core_initialized) {
 -              drm_dbg_dp(dp->drm_dev, "not initialized\n");
 -              return;
 -      }
 -
 -      if (!dp_display->is_connected && status == connector_status_connected)
 +      if (!dp_display->link_ready && status == connector_status_connected)
                dp_add_event(dp, EV_HPD_PLUG_INT, 0, 0);
 -      else if (dp_display->is_connected && status == connector_status_disconnected)
 +      else if (dp_display->link_ready && status == connector_status_disconnected)
                dp_add_event(dp, EV_HPD_UNPLUG_INT, 0, 0);
  }
index 0efb501490ccea79a3379155c11a122fb1e0e55f,e3bdd7dd4cdc7de80b1ca1e2cd1f60386c31594c..46e6889037e8881072c77b23fd1fe240f0e23e9c
@@@ -24,10 -24,10 +24,10 @@@ static enum drm_connector_status dp_bri
  
        dp = to_dp_bridge(bridge)->dp_display;
  
 -      drm_dbg_dp(dp->drm_dev, "is_connected = %s\n",
 -              (dp->is_connected) ? "true" : "false");
 +      drm_dbg_dp(dp->drm_dev, "link_ready = %s\n",
 +              (dp->link_ready) ? "true" : "false");
  
 -      return (dp->is_connected) ? connector_status_connected :
 +      return (dp->link_ready) ? connector_status_connected :
                                        connector_status_disconnected;
  }
  
@@@ -40,8 -40,8 +40,8 @@@ static int dp_bridge_atomic_check(struc
  
        dp = to_dp_bridge(bridge)->dp_display;
  
 -      drm_dbg_dp(dp->drm_dev, "is_connected = %s\n",
 -              (dp->is_connected) ? "true" : "false");
 +      drm_dbg_dp(dp->drm_dev, "link_ready = %s\n",
 +              (dp->link_ready) ? "true" : "false");
  
        /*
         * There is no protection in the DRM framework to check if the display
@@@ -55,7 -55,7 +55,7 @@@
         * After that this piece of code can be removed.
         */
        if (bridge->ops & DRM_BRIDGE_OP_HPD)
 -              return (dp->is_connected) ? 0 : -ENOTCONN;
 +              return (dp->link_ready) ? 0 : -ENOTCONN;
  
        return 0;
  }
@@@ -78,7 -78,7 +78,7 @@@ static int dp_bridge_get_modes(struct d
        dp = to_dp_bridge(bridge)->dp_display;
  
        /* pluggable case assumes EDID is read when HPD */
 -      if (dp->is_connected) {
 +      if (dp->link_ready) {
                rc = dp_display_get_modes(dp);
                if (rc <= 0) {
                        DRM_ERROR("failed to get DP sink modes, rc=%d\n", rc);
        return rc;
  }
  
 +static void dp_bridge_debugfs_init(struct drm_bridge *bridge, struct dentry *root)
 +{
 +      struct msm_dp *dp = to_dp_bridge(bridge)->dp_display;
 +
 +      dp_display_debugfs_init(dp, root, false);
 +}
 +
  static const struct drm_bridge_funcs dp_bridge_ops = {
        .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
        .atomic_destroy_state   = drm_atomic_helper_bridge_destroy_state,
        .hpd_enable   = dp_bridge_hpd_enable,
        .hpd_disable  = dp_bridge_hpd_disable,
        .hpd_notify   = dp_bridge_hpd_notify,
 +      .debugfs_init = dp_bridge_debugfs_init,
  };
  
  static int edp_bridge_atomic_check(struct drm_bridge *drm_bridge,
@@@ -268,13 -260,6 +268,13 @@@ static enum drm_mode_status edp_bridge_
        return MODE_OK;
  }
  
 +static void edp_bridge_debugfs_init(struct drm_bridge *bridge, struct dentry *root)
 +{
 +      struct msm_dp *dp = to_dp_bridge(bridge)->dp_display;
 +
 +      dp_display_debugfs_init(dp, root, true);
 +}
 +
  static const struct drm_bridge_funcs edp_bridge_ops = {
        .atomic_enable = edp_bridge_atomic_enable,
        .atomic_disable = edp_bridge_atomic_disable,
        .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
        .atomic_check = edp_bridge_atomic_check,
 +      .debugfs_init = edp_bridge_debugfs_init,
  };
  
  int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev,
@@@ -361,6 -345,9 +361,9 @@@ struct drm_connector *dp_drm_connector_
        if (IS_ERR(connector))
                return connector;
  
+       if (!dp_display->is_edp)
+               drm_connector_attach_dp_subconnector_property(connector);
        drm_connector_attach_encoder(connector, encoder);
  
        return connector;
index c66193f2dc0d4fab201ab9ef6b8479199ffce0aa,89a6344bc8653d61a3dea4860cb3320f1bcf7a15..82d015aa2d634cc8706b1db6e6d3786634beeea1
@@@ -918,7 -918,7 +918,7 @@@ static int dsi_7nm_phy_enable(struct ms
        if ((phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V5_2)) {
                if (phy->cphy_mode) {
                        vreg_ctrl_0 = 0x45;
-                       vreg_ctrl_1 = 0x45;
+                       vreg_ctrl_1 = 0x41;
                        glbl_rescode_top_ctrl = 0x00;
                        glbl_rescode_bot_ctrl = 0x00;
                } else {
@@@ -1121,10 -1121,6 +1121,10 @@@ static const struct regulator_bulk_dat
        { .supply = "vdds", .init_load_uA = 37550 },
  };
  
 +static const struct regulator_bulk_data dsi_phy_7nm_98000uA_regulators[] = {
 +      { .supply = "vdds", .init_load_uA = 98000 },
 +};
 +
  static const struct regulator_bulk_data dsi_phy_7nm_97800uA_regulators[] = {
        { .supply = "vdds", .init_load_uA = 97800 },
  };
@@@ -1285,26 -1281,3 +1285,26 @@@ const struct msm_dsi_phy_cfg dsi_phy_4n
        .num_dsi_phy = 2,
        .quirks = DSI_PHY_7NM_QUIRK_V5_2,
  };
 +
 +const struct msm_dsi_phy_cfg dsi_phy_4nm_8650_cfgs = {
 +      .has_phy_lane = true,
 +      .regulator_data = dsi_phy_7nm_98000uA_regulators,
 +      .num_regulators = ARRAY_SIZE(dsi_phy_7nm_98000uA_regulators),
 +      .ops = {
 +              .enable = dsi_7nm_phy_enable,
 +              .disable = dsi_7nm_phy_disable,
 +              .pll_init = dsi_pll_7nm_init,
 +              .save_pll_state = dsi_7nm_pll_save_state,
 +              .restore_pll_state = dsi_7nm_pll_restore_state,
 +              .set_continuous_clock = dsi_7nm_set_continuous_clock,
 +      },
 +      .min_pll_rate = 600000000UL,
 +#ifdef CONFIG_64BIT
 +      .max_pll_rate = 5000000000UL,
 +#else
 +      .max_pll_rate = ULONG_MAX,
 +#endif
 +      .io_start = { 0xae95000, 0xae97000 },
 +      .num_dsi_phy = 2,
 +      .quirks = DSI_PHY_7NM_QUIRK_V5_2,
 +};
index 75d60aab5780964ae6fcd98f59784756c17d46de,3f217b57829347413a5e570ba3441fc758e915ae..50b65ffc24b1cfa03856497c8c69bb89b1c0384d
   * - 1.9.0 - Add MSM_SUBMIT_FENCE_SN_IN
   * - 1.10.0 - Add MSM_SUBMIT_BO_NO_IMPLICIT
   * - 1.11.0 - Add wait boost (MSM_WAIT_FENCE_BOOST, MSM_PREP_BOOST)
 + * - 1.12.0 - Add MSM_INFO_SET_METADATA and MSM_INFO_GET_METADATA
   */
  #define MSM_VERSION_MAJOR     1
 -#define MSM_VERSION_MINOR     10
 +#define MSM_VERSION_MINOR     12
  #define MSM_VERSION_PATCHLEVEL        0
  
  static void msm_deinit_vram(struct drm_device *ddev);
@@@ -289,8 -288,6 +289,6 @@@ static int msm_drm_init(struct device *
        if (ret)
                goto err_msm_uninit;
  
-       drm_kms_helper_poll_init(ddev);
        if (priv->kms_init) {
                drm_kms_helper_poll_init(ddev);
                msm_fbdev_setup(ddev);
@@@ -547,85 -544,6 +545,85 @@@ static int msm_ioctl_gem_info_set_iova(
        return msm_gem_set_iova(obj, ctx->aspace, iova);
  }
  
 +static int msm_ioctl_gem_info_set_metadata(struct drm_gem_object *obj,
 +                                         __user void *metadata,
 +                                         u32 metadata_size)
 +{
 +      struct msm_gem_object *msm_obj = to_msm_bo(obj);
 +      void *buf;
 +      int ret;
 +
 +      /* Impose a moderate upper bound on metadata size: */
 +      if (metadata_size > 128) {
 +              return -EOVERFLOW;
 +      }
 +
 +      /* Use a temporary buf to keep copy_from_user() outside of gem obj lock: */
 +      buf = memdup_user(metadata, metadata_size);
 +      if (IS_ERR(buf))
 +              return PTR_ERR(buf);
 +
 +      ret = msm_gem_lock_interruptible(obj);
 +      if (ret)
 +              goto out;
 +
 +      msm_obj->metadata =
 +              krealloc(msm_obj->metadata, metadata_size, GFP_KERNEL);
 +      msm_obj->metadata_size = metadata_size;
 +      memcpy(msm_obj->metadata, buf, metadata_size);
 +
 +      msm_gem_unlock(obj);
 +
 +out:
 +      kfree(buf);
 +
 +      return ret;
 +}
 +
 +static int msm_ioctl_gem_info_get_metadata(struct drm_gem_object *obj,
 +                                         __user void *metadata,
 +                                         u32 *metadata_size)
 +{
 +      struct msm_gem_object *msm_obj = to_msm_bo(obj);
 +      void *buf;
 +      int ret, len;
 +
 +      if (!metadata) {
 +              /*
 +               * Querying the size is inherently racey, but
 +               * EXT_external_objects expects the app to confirm
 +               * via device and driver UUIDs that the exporter and
 +               * importer versions match.  All we can do from the
 +               * kernel side is check the length under obj lock
 +               * when userspace tries to retrieve the metadata
 +               */
 +              *metadata_size = msm_obj->metadata_size;
 +              return 0;
 +      }
 +
 +      ret = msm_gem_lock_interruptible(obj);
 +      if (ret)
 +              return ret;
 +
 +      /* Avoid copy_to_user() under gem obj lock: */
 +      len = msm_obj->metadata_size;
 +      buf = kmemdup(msm_obj->metadata, len, GFP_KERNEL);
 +
 +      msm_gem_unlock(obj);
 +
 +      if (*metadata_size < len) {
 +              ret = -ETOOSMALL;
 +      } else if (copy_to_user(metadata, buf, len)) {
 +              ret = -EFAULT;
 +      } else {
 +              *metadata_size = len;
 +      }
 +
 +      kfree(buf);
 +
 +      return 0;
 +}
 +
  static int msm_ioctl_gem_info(struct drm_device *dev, void *data,
                struct drm_file *file)
  {
                break;
        case MSM_INFO_SET_NAME:
        case MSM_INFO_GET_NAME:
 +      case MSM_INFO_SET_METADATA:
 +      case MSM_INFO_GET_METADATA:
                break;
        default:
                return -EINVAL;
                break;
        case MSM_INFO_GET_NAME:
                if (args->value && (args->len < strlen(msm_obj->name))) {
 -                      ret = -EINVAL;
 +                      ret = -ETOOSMALL;
                        break;
                }
                args->len = strlen(msm_obj->name);
                                ret = -EFAULT;
                }
                break;
 +      case MSM_INFO_SET_METADATA:
 +              ret = msm_ioctl_gem_info_set_metadata(
 +                      obj, u64_to_user_ptr(args->value), args->len);
 +              break;
 +      case MSM_INFO_GET_METADATA:
 +              ret = msm_ioctl_gem_info_get_metadata(
 +                      obj, u64_to_user_ptr(args->value), &args->len);
 +              break;
        }
  
        drm_gem_object_put(obj);
index 30d72191cee680199408f1101992871e7a93da50,c002cabe7b9c507e583ed4fbed899016117ce523..7aa5e14ab9aa1b65680b82b3f84a8844cc1cfb42
  #include "msm_gem.h"
  #include "msm_gpu_trace.h"
  
 +/* For userspace errors, use DRM_UT_DRIVER.. so that userspace can enable
 + * error msgs for debugging, but we don't spam dmesg by default
 + */
 +#define SUBMIT_ERROR(submit, fmt, ...) \
 +      DRM_DEV_DEBUG_DRIVER((submit)->dev->dev, fmt, ##__VA_ARGS__)
 +
  /*
   * Cmdstream submission:
   */
@@@ -43,7 -37,7 +43,7 @@@ static struct msm_gem_submit *submit_cr
        if (sz > SIZE_MAX)
                return ERR_PTR(-ENOMEM);
  
 -      submit = kzalloc(sz, GFP_KERNEL);
 +      submit = kzalloc(sz, GFP_KERNEL | __GFP_NOWARN);
        if (!submit)
                return ERR_PTR(-ENOMEM);
  
@@@ -54,7 -48,7 +54,7 @@@
                return ERR_PTR(ret);
        }
  
-       ret = drm_sched_job_init(&submit->base, queue->entity, queue);
+       ret = drm_sched_job_init(&submit->base, queue->entity, 1, queue);
        if (ret) {
                kfree(submit->hw_fence);
                kfree(submit);
@@@ -142,7 -136,7 +142,7 @@@ static int submit_lookup_objects(struc
  
                if ((submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) ||
                        !(submit_bo.flags & MANDATORY_FLAGS)) {
 -                      DRM_ERROR("invalid flags: %x\n", submit_bo.flags);
 +                      SUBMIT_ERROR(submit, "invalid flags: %x\n", submit_bo.flags);
                        ret = -EINVAL;
                        i = 0;
                        goto out;
                 */
                obj = idr_find(&file->object_idr, submit->bos[i].handle);
                if (!obj) {
 -                      DRM_ERROR("invalid handle %u at index %u\n", submit->bos[i].handle, i);
 +                      SUBMIT_ERROR(submit, "invalid handle %u at index %u\n", submit->bos[i].handle, i);
                        ret = -EINVAL;
                        goto out_unlock;
                }
@@@ -208,13 -202,13 +208,13 @@@ static int submit_lookup_cmds(struct ms
                case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
                        break;
                default:
 -                      DRM_ERROR("invalid type: %08x\n", submit_cmd.type);
 +                      SUBMIT_ERROR(submit, "invalid type: %08x\n", submit_cmd.type);
                        return -EINVAL;
                }
  
                if (submit_cmd.size % 4) {
 -                      DRM_ERROR("non-aligned cmdstream buffer size: %u\n",
 -                                      submit_cmd.size);
 +                      SUBMIT_ERROR(submit, "non-aligned cmdstream buffer size: %u\n",
 +                                   submit_cmd.size);
                        ret = -EINVAL;
                        goto out;
                }
                        ret = -ENOMEM;
                        goto out;
                }
 -              submit->cmd[i].relocs = kmalloc(sz, GFP_KERNEL);
 +              submit->cmd[i].relocs = kmalloc(sz, GFP_KERNEL | __GFP_NOWARN);
                if (!submit->cmd[i].relocs) {
                        ret = -ENOMEM;
                        goto out;
@@@ -312,8 -306,8 +312,8 @@@ retry
  
  fail:
        if (ret == -EALREADY) {
 -              DRM_ERROR("handle %u at index %u already on submit list\n",
 -                              submit->bos[i].handle, i);
 +              SUBMIT_ERROR(submit, "handle %u at index %u already on submit list\n",
 +                           submit->bos[i].handle, i);
                ret = -EINVAL;
        }
  
@@@ -454,8 -448,8 +454,8 @@@ static int submit_bo(struct msm_gem_sub
                struct drm_gem_object **obj, uint64_t *iova, bool *valid)
  {
        if (idx >= submit->nr_bos) {
 -              DRM_ERROR("invalid buffer index: %u (out of %u)\n",
 -                              idx, submit->nr_bos);
 +              SUBMIT_ERROR(submit, "invalid buffer index: %u (out of %u)\n",
 +                           idx, submit->nr_bos);
                return -EINVAL;
        }
  
@@@ -481,7 -475,7 +481,7 @@@ static int submit_reloc(struct msm_gem_
                return 0;
  
        if (offset % 4) {
 -              DRM_ERROR("non-aligned cmdstream buffer: %u\n", offset);
 +              SUBMIT_ERROR(submit, "non-aligned cmdstream buffer: %u\n", offset);
                return -EINVAL;
        }
  
                bool valid;
  
                if (submit_reloc.submit_offset % 4) {
 -                      DRM_ERROR("non-aligned reloc offset: %u\n",
 -                                      submit_reloc.submit_offset);
 +                      SUBMIT_ERROR(submit, "non-aligned reloc offset: %u\n",
 +                                   submit_reloc.submit_offset);
                        ret = -EINVAL;
                        goto out;
                }
  
                if ((off >= (obj->size / 4)) ||
                                (off < last_offset)) {
 -                      DRM_ERROR("invalid offset %u at reloc %u\n", off, i);
 +                      SUBMIT_ERROR(submit, "invalid offset %u at reloc %u\n", off, i);
                        ret = -EINVAL;
                        goto out;
                }
@@@ -887,7 -881,7 +887,7 @@@ int msm_ioctl_gem_submit(struct drm_dev
                if (!submit->cmd[i].size ||
                        ((submit->cmd[i].size + submit->cmd[i].offset) >
                                obj->size / 4)) {
 -                      DRM_ERROR("invalid cmdstream size: %u\n", submit->cmd[i].size * 4);
 +                      SUBMIT_ERROR(submit, "invalid cmdstream size: %u\n", submit->cmd[i].size * 4);
                        ret = -EINVAL;
                        goto out;
                }
  
                if (!gpu->allow_relocs) {
                        if (submit->cmd[i].nr_relocs) {
 -                              DRM_ERROR("relocs not allowed\n");
 +                              SUBMIT_ERROR(submit, "relocs not allowed\n");
                                ret = -EINVAL;
                                goto out;
                        }
This page took 0.11869 seconds and 4 git commands to generate.