Commit afa0f6ee authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'drm-fixes-2023-11-24' of git://anongit.freedesktop.org/drm/drm

Pull drm fixes from Dave Airlie:
 "Back to regular scheduled fixes pull request, mainly a bunch of msm,
  some i915 and otherwise a few scattered, one memory crasher in the
  nouveau GSP paths is helping stabilise that work.

  msm:
   - Fix the VREG_CTRL_1 for 4nm CPHY to match downstream
   - Remove duplicate call to drm_kms_helper_poll_init() in
     msm_drm_init()
   - Fix the safe_lut_tbl[] for sc8280xp to match downstream
   - Don't attach the drm_dp_set_subconnector_property() for eDP
   - Fix to attach drm_dp_set_subconnector_property() for DP. Otherwise
     there is a bootup crash on multiple targets
   - Remove unnecessary NULL check left behind during cleanup

  i915:
   - Fix race between DP MST connectore registration and setup
   - Fix GT memory leak on probe error path

  panel:
   - Fixes for innolux and auo,b101uan08.3 panel.
   - Fix Himax83102-j02 timings.

  ivpu:
   - Fix ivpu MMIO reset.

  ast:
   - AST fix on connetor disconnection.

  nouveau:
   - gsp memory corruption fix

  rockchip:
   - color fix"

* tag 'drm-fixes-2023-11-24' of git://anongit.freedesktop.org/drm/drm:
  nouveau/gsp: allocate enough space for all channel ids.
  drm/panel: boe-tv101wum-nl6: Fine tune Himax83102-j02 panel HFP and HBP
  drm/ast: Disconnect BMC if physical connector is connected
  accel/ivpu/37xx: Fix hangs related to MMIO reset
  drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP full
  drm/i915: do not clean GT table on error path
  drm/i915/dp_mst: Fix race between connector registration and setup
  drm/panel: simple: Fix Innolux G101ICE-L01 timings
  drm/panel: simple: Fix Innolux G101ICE-L01 bus flags
  drm/msm: remove unnecessary NULL check
  drm/panel: auo,b101uan08.3: Fine tune the panel power sequence
  drm/msm/dp: attach the DP subconnector property
  drm/msm/dp: don't touch DP subconnector property in eDP case
  drm/msm/dpu: Add missing safe_lut_tbl in sc8280xp catalog
  drm/msm: remove exra drm_kms_helper_poll_init() call
  drm/msm/dsi: use the correct VREG_CTRL_1 value for 4nm cphy
parents f1a09972 b3ca8a08
Loading
Loading
Loading
Loading
+22 −24
Original line number Diff line number Diff line
@@ -502,6 +502,16 @@ static int ivpu_boot_pwr_domain_enable(struct ivpu_device *vdev)
	return ret;
}

static int ivpu_boot_pwr_domain_disable(struct ivpu_device *vdev)
{
	ivpu_boot_dpu_active_drive(vdev, false);
	ivpu_boot_pwr_island_isolation_drive(vdev, true);
	ivpu_boot_pwr_island_trickle_drive(vdev, false);
	ivpu_boot_pwr_island_drive(vdev, false);

	return ivpu_boot_wait_for_pwr_island_status(vdev, 0x0);
}

static void ivpu_boot_no_snoop_enable(struct ivpu_device *vdev)
{
	u32 val = REGV_RD32(VPU_37XX_HOST_IF_TCU_PTW_OVERRIDES);
@@ -600,25 +610,17 @@ static int ivpu_hw_37xx_info_init(struct ivpu_device *vdev)

static int ivpu_hw_37xx_reset(struct ivpu_device *vdev)
{
	int ret;
	u32 val;

	if (IVPU_WA(punit_disabled))
		return 0;
	int ret = 0;

	ret = REGB_POLL_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, 0, TIMEOUT_US);
	if (ret) {
		ivpu_err(vdev, "Timed out waiting for TRIGGER bit\n");
		return ret;
	if (ivpu_boot_pwr_domain_disable(vdev)) {
		ivpu_err(vdev, "Failed to disable power domain\n");
		ret = -EIO;
	}

	val = REGB_RD32(VPU_37XX_BUTTRESS_VPU_IP_RESET);
	val = REG_SET_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, val);
	REGB_WR32(VPU_37XX_BUTTRESS_VPU_IP_RESET, val);

	ret = REGB_POLL_FLD(VPU_37XX_BUTTRESS_VPU_IP_RESET, TRIGGER, 0, TIMEOUT_US);
	if (ret)
		ivpu_err(vdev, "Timed out waiting for RESET completion\n");
	if (ivpu_pll_disable(vdev)) {
		ivpu_err(vdev, "Failed to disable PLL\n");
		ret = -EIO;
	}

	return ret;
}
@@ -651,10 +653,6 @@ static int ivpu_hw_37xx_power_up(struct ivpu_device *vdev)
{
	int ret;

	ret = ivpu_hw_37xx_reset(vdev);
	if (ret)
		ivpu_warn(vdev, "Failed to reset HW: %d\n", ret);

	ret = ivpu_hw_37xx_d0i3_disable(vdev);
	if (ret)
		ivpu_warn(vdev, "Failed to disable D0I3: %d\n", ret);
@@ -722,11 +720,11 @@ static int ivpu_hw_37xx_power_down(struct ivpu_device *vdev)
{
	int ret = 0;

	if (!ivpu_hw_37xx_is_idle(vdev) && ivpu_hw_37xx_reset(vdev))
		ivpu_err(vdev, "Failed to reset the VPU\n");
	if (!ivpu_hw_37xx_is_idle(vdev))
		ivpu_warn(vdev, "VPU not idle during power down\n");

	if (ivpu_pll_disable(vdev)) {
		ivpu_err(vdev, "Failed to disable PLL\n");
	if (ivpu_hw_37xx_reset(vdev)) {
		ivpu_err(vdev, "Failed to reset VPU\n");
		ret = -EIO;
	}

+12 −1
Original line number Diff line number Diff line
@@ -174,6 +174,17 @@ to_ast_sil164_connector(struct drm_connector *connector)
	return container_of(connector, struct ast_sil164_connector, base);
}

struct ast_bmc_connector {
	struct drm_connector base;
	struct drm_connector *physical_connector;
};

static inline struct ast_bmc_connector *
to_ast_bmc_connector(struct drm_connector *connector)
{
	return container_of(connector, struct ast_bmc_connector, base);
}

/*
 * Device
 */
@@ -218,7 +229,7 @@ struct ast_device {
		} astdp;
		struct {
			struct drm_encoder encoder;
			struct drm_connector connector;
			struct ast_bmc_connector bmc_connector;
		} bmc;
	} output;

+55 −7
Original line number Diff line number Diff line
@@ -1767,6 +1767,30 @@ static const struct drm_encoder_funcs ast_bmc_encoder_funcs = {
	.destroy = drm_encoder_cleanup,
};

static int ast_bmc_connector_helper_detect_ctx(struct drm_connector *connector,
					       struct drm_modeset_acquire_ctx *ctx,
					       bool force)
{
	struct ast_bmc_connector *bmc_connector = to_ast_bmc_connector(connector);
	struct drm_connector *physical_connector = bmc_connector->physical_connector;

	/*
	 * Most user-space compositors cannot handle more than one connected
	 * connector per CRTC. Hence, we only mark the BMC as connected if the
	 * physical connector is disconnected. If the physical connector's status
	 * is connected or unknown, the BMC remains disconnected. This has no
	 * effect on the output of the BMC.
	 *
	 * FIXME: Remove this logic once user-space compositors can handle more
	 *        than one connector per CRTC. The BMC should always be connected.
	 */

	if (physical_connector && physical_connector->status == connector_status_disconnected)
		return connector_status_connected;

	return connector_status_disconnected;
}

static int ast_bmc_connector_helper_get_modes(struct drm_connector *connector)
{
	return drm_add_modes_noedid(connector, 4096, 4096);
@@ -1774,6 +1798,7 @@ static int ast_bmc_connector_helper_get_modes(struct drm_connector *connector)

static const struct drm_connector_helper_funcs ast_bmc_connector_helper_funcs = {
	.get_modes = ast_bmc_connector_helper_get_modes,
	.detect_ctx = ast_bmc_connector_helper_detect_ctx,
};

static const struct drm_connector_funcs ast_bmc_connector_funcs = {
@@ -1784,12 +1809,33 @@ static const struct drm_connector_funcs ast_bmc_connector_funcs = {
	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
};

static int ast_bmc_output_init(struct ast_device *ast)
static int ast_bmc_connector_init(struct drm_device *dev,
				  struct ast_bmc_connector *bmc_connector,
				  struct drm_connector *physical_connector)
{
	struct drm_connector *connector = &bmc_connector->base;
	int ret;

	ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs,
				 DRM_MODE_CONNECTOR_VIRTUAL);
	if (ret)
		return ret;

	drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs);

	bmc_connector->physical_connector = physical_connector;

	return 0;
}

static int ast_bmc_output_init(struct ast_device *ast,
			       struct drm_connector *physical_connector)
{
	struct drm_device *dev = &ast->base;
	struct drm_crtc *crtc = &ast->crtc;
	struct drm_encoder *encoder = &ast->output.bmc.encoder;
	struct drm_connector *connector = &ast->output.bmc.connector;
	struct ast_bmc_connector *bmc_connector = &ast->output.bmc.bmc_connector;
	struct drm_connector *connector = &bmc_connector->base;
	int ret;

	ret = drm_encoder_init(dev, encoder,
@@ -1799,13 +1845,10 @@ static int ast_bmc_output_init(struct ast_device *ast)
		return ret;
	encoder->possible_crtcs = drm_crtc_mask(crtc);

	ret = drm_connector_init(dev, connector, &ast_bmc_connector_funcs,
				 DRM_MODE_CONNECTOR_VIRTUAL);
	ret = ast_bmc_connector_init(dev, bmc_connector, physical_connector);
	if (ret)
		return ret;

	drm_connector_helper_add(connector, &ast_bmc_connector_helper_funcs);

	ret = drm_connector_attach_encoder(connector, encoder);
	if (ret)
		return ret;
@@ -1864,6 +1907,7 @@ static const struct drm_mode_config_funcs ast_mode_config_funcs = {
int ast_mode_config_init(struct ast_device *ast)
{
	struct drm_device *dev = &ast->base;
	struct drm_connector *physical_connector = NULL;
	int ret;

	ret = drmm_mode_config_init(dev);
@@ -1904,23 +1948,27 @@ int ast_mode_config_init(struct ast_device *ast)
		ret = ast_vga_output_init(ast);
		if (ret)
			return ret;
		physical_connector = &ast->output.vga.vga_connector.base;
	}
	if (ast->tx_chip_types & AST_TX_SIL164_BIT) {
		ret = ast_sil164_output_init(ast);
		if (ret)
			return ret;
		physical_connector = &ast->output.sil164.sil164_connector.base;
	}
	if (ast->tx_chip_types & AST_TX_DP501_BIT) {
		ret = ast_dp501_output_init(ast);
		if (ret)
			return ret;
		physical_connector = &ast->output.dp501.connector;
	}
	if (ast->tx_chip_types & AST_TX_ASTDP_BIT) {
		ret = ast_astdp_output_init(ast);
		if (ret)
			return ret;
		physical_connector = &ast->output.astdp.connector;
	}
	ret = ast_bmc_output_init(ast);
	ret = ast_bmc_output_init(ast, physical_connector);
	if (ret)
		return ret;

+8 −8
Original line number Diff line number Diff line
@@ -1161,6 +1161,14 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
	intel_connector->port = port;
	drm_dp_mst_get_port_malloc(port);

	/*
	 * TODO: set the AUX for the actual MST port decompressing the stream.
	 * At the moment the driver only supports enabling this globally in the
	 * first downstream MST branch, via intel_dp's (root port) AUX.
	 */
	intel_connector->dp.dsc_decompression_aux = &intel_dp->aux;
	intel_dp_mst_read_decompression_port_dsc_caps(intel_dp, intel_connector);

	connector = &intel_connector->base;
	ret = drm_connector_init(dev, connector, &intel_dp_mst_connector_funcs,
				 DRM_MODE_CONNECTOR_DisplayPort);
@@ -1172,14 +1180,6 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo

	drm_connector_helper_add(connector, &intel_dp_mst_connector_helper_funcs);

	/*
	 * TODO: set the AUX for the actual MST port decompressing the stream.
	 * At the moment the driver only supports enabling this globally in the
	 * first downstream MST branch, via intel_dp's (root port) AUX.
	 */
	intel_connector->dp.dsc_decompression_aux = &intel_dp->aux;
	intel_dp_mst_read_decompression_port_dsc_caps(intel_dp, intel_connector);

	for_each_pipe(dev_priv, pipe) {
		struct drm_encoder *enc =
			&intel_dp->mst_encoders[pipe]->base.base;
+0 −11
Original line number Diff line number Diff line
@@ -982,8 +982,6 @@ int intel_gt_probe_all(struct drm_i915_private *i915)

err:
	i915_probe_error(i915, "Failed to initialize %s! (%d)\n", gtdef->name, ret);
	intel_gt_release_all(i915);

	return ret;
}

@@ -1002,15 +1000,6 @@ int intel_gt_tiles_init(struct drm_i915_private *i915)
	return 0;
}

void intel_gt_release_all(struct drm_i915_private *i915)
{
	struct intel_gt *gt;
	unsigned int id;

	for_each_gt(gt, i915, id)
		i915->gt[id] = NULL;
}

void intel_gt_info_print(const struct intel_gt_info *info,
			 struct drm_printer *p)
{
Loading