Commit 86921609 authored by Dave Airlie's avatar Dave Airlie
Browse files

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



Fixes for v6.7-rc3:
- Panel fixes for innolux and auo,b101uan08.3 panel.
- Fix ivpu MMIO reset.
- AST fix on connetor disconnection.
- nouveau gsp fix.
- rockchip color fix.
- Fix Himax83102-j02 timings.

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/12322257-2e0c-43d3-8241-876aafc10e4a@linux.intel.com
parents fca9a805 ab93edb2
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;

+1 −1
Original line number Diff line number Diff line
@@ -539,7 +539,7 @@ r535_fifo_runl_ctor(struct nvkm_fifo *fifo)
	struct nvkm_runl *runl;
	struct nvkm_engn *engn;
	u32 cgids = 2048;
	u32 chids = 2048 / CHID_PER_USERD;
	u32 chids = 2048;
	int ret;
	NV2080_CTRL_FIFO_GET_DEVICE_INFO_TABLE_PARAMS *ctrl;

+5 −4
Original line number Diff line number Diff line
@@ -1709,6 +1709,7 @@ static const struct panel_desc auo_b101uan08_3_desc = {
	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
		      MIPI_DSI_MODE_LPM,
	.init_cmds = auo_b101uan08_3_init_cmd,
	.lp11_before_reset = true,
};

static const struct drm_display_mode boe_tv105wum_nw0_default_mode = {
@@ -1766,11 +1767,11 @@ static const struct panel_desc starry_qfh032011_53g_desc = {
};

static const struct drm_display_mode starry_himax83102_j02_default_mode = {
	.clock = 161600,
	.clock = 162850,
	.hdisplay = 1200,
	.hsync_start = 1200 + 40,
	.hsync_end = 1200 + 40 + 20,
	.htotal = 1200 + 40 + 20 + 40,
	.hsync_start = 1200 + 50,
	.hsync_end = 1200 + 50 + 20,
	.htotal = 1200 + 50 + 20 + 50,
	.vdisplay = 1920,
	.vsync_start = 1920 + 116,
	.vsync_end = 1920 + 116 + 8,
Loading