Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 180e3a30 authored by Steve Cohen's avatar Steve Cohen Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: update qsync for intf te



Update qsync for new hardware where the tearcheck module
is moved in to the interface hardware block.

Change-Id: I0e8ef0928ed094a9b9b6903e5cddd638a17ac090
Signed-off-by: default avatarSteve Cohen <cohens@codeaurora.org>
parent a2ff218d
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1300,12 +1300,15 @@ static int sde_encoder_phys_cmd_prepare_for_kickoff(
	}

	if (sde_connector_qsync_updated(phys_enc->connector)) {

		tc_cfg.sync_threshold_start =
			_get_tearcheck_threshold(phys_enc);
		if (phys_enc->hw_pp->ops.update_tearcheck)
			phys_enc->hw_pp->ops.update_tearcheck(phys_enc->hw_pp,
					&tc_cfg);
		if (phys_enc->has_intf_te &&
				phys_enc->hw_intf->ops.update_tearcheck)
			phys_enc->hw_intf->ops.update_tearcheck(
					phys_enc->hw_intf, &tc_cfg);
		else if (phys_enc->hw_pp->ops.update_tearcheck)
			phys_enc->hw_pp->ops.update_tearcheck(
					phys_enc->hw_pp, &tc_cfg);
	}

	SDE_DEBUG_CMDENC(cmd_enc, "pp:%d pending_cnt %d\n",
+17 −0
Original line number Diff line number Diff line
@@ -435,6 +435,22 @@ static int sde_hw_intf_enable_te(struct sde_hw_intf *intf, bool enable)
	return 0;
}

static void sde_hw_intf_update_te(struct sde_hw_intf *intf,
		struct sde_hw_tear_check *te)
{
	struct sde_hw_blk_reg_map *c;
	int cfg;

	if (!intf || !te)
		return;

	c = &intf->hw;
	cfg = SDE_REG_READ(c, INTF_TEAR_SYNC_THRESH);
	cfg &= ~0xFFFF;
	cfg |= te->sync_threshold_start;
	SDE_REG_WRITE(c, INTF_TEAR_SYNC_THRESH, cfg);
}

static int sde_hw_intf_connect_external_te(struct sde_hw_intf *intf,
		bool enable_external_te)
{
@@ -513,6 +529,7 @@ static void _setup_intf_ops(struct sde_hw_intf_ops *ops,
	if (cap & BIT(SDE_INTF_TE)) {
		ops->setup_tearcheck = sde_hw_intf_setup_te_config;
		ops->enable_tearcheck = sde_hw_intf_enable_te;
		ops->update_tearcheck = sde_hw_intf_update_te;
		ops->connect_external_te = sde_hw_intf_connect_external_te;
		ops->get_vsync_info = sde_hw_intf_get_vsync_info;
		ops->setup_autorefresh = sde_hw_intf_setup_autorefresh_config;
+6 −0
Original line number Diff line number Diff line
@@ -112,6 +112,12 @@ struct sde_hw_intf_ops {
	int (*enable_tearcheck)(struct sde_hw_intf *intf,
			bool enable);

	/**
	 * updates tearcheck configuration
	 */
	void (*update_tearcheck)(struct sde_hw_intf *intf,
			struct sde_hw_tear_check *cfg);

	/**
	 * read, modify, write to either set or clear listening to external TE
	 * @Return: 1 if TE was originally connected, 0 if not, or -ERROR