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

Commit 1f35fd00 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "disp: msm: update topology based on clock requirement"

parents 49a66145 da892c0b
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -2060,6 +2060,7 @@ static enum drm_mode_status dp_display_validate_mode(
	struct dp_display_mode dp_mode;
	bool dsc_en;
	u32 num_lm = 0;
	int rc = 0;

	if (!dp_display || !mode || !panel ||
			!avail_res || !avail_res->max_mixer_width) {
@@ -2105,8 +2106,12 @@ static enum drm_mode_status dp_display_validate_mode(
		goto end;
	}

	num_lm = (avail_res->max_mixer_width <= mode->hdisplay) ?
			2 : 1;
	rc = msm_get_mixer_count(dp->priv, mode, avail_res, &num_lm);
	if (rc) {
		DP_ERR("error getting mixer count. rc:%d\n", rc);
		goto end;
	}

	if (num_lm > avail_res->num_lm ||
			(num_lm == 2 && !avail_res->num_3dmux)) {
		DP_MST_DEBUG("num_lm:%d, req lm:%d 3dmux:%d\n", num_lm,
+13 −5
Original line number Diff line number Diff line
@@ -376,8 +376,6 @@ int dp_connector_get_mode_info(struct drm_connector *connector,
		struct msm_mode_info *mode_info,
		void *display, const struct msm_resource_caps_info *avail_res)
{
	const u32 dual_lm = 2;
	const u32 single_lm = 1;
	const u32 single_intf = 1;
	const u32 no_enc = 0;
	struct msm_display_topology *topology;
@@ -385,9 +383,12 @@ int dp_connector_get_mode_info(struct drm_connector *connector,
	struct dp_panel *dp_panel;
	struct dp_display_mode dp_mode;
	struct dp_display *dp_disp = display;
	struct msm_drm_private *priv;
	int rc = 0;

	if (!drm_mode || !mode_info || !avail_res ||
			!avail_res->max_mixer_width || !connector || !display) {
			!avail_res->max_mixer_width || !connector || !display ||
			!connector->dev || !connector->dev->dev_private) {
		DP_ERR("invalid params\n");
		return -EINVAL;
	}
@@ -396,10 +397,17 @@ int dp_connector_get_mode_info(struct drm_connector *connector,

	sde_conn = to_sde_connector(connector);
	dp_panel = sde_conn->drv_panel;
	priv = connector->dev->dev_private;

	topology = &mode_info->topology;
	topology->num_lm = (avail_res->max_mixer_width < drm_mode->hdisplay) ?
							dual_lm : single_lm;

	rc = msm_get_mixer_count(priv, drm_mode, avail_res,
			&topology->num_lm);
	if (rc) {
		DP_ERR("error getting mixer count. rc:%d\n", rc);
		return rc;
	}

	topology->num_enc = no_enc;
	topology->num_intf = single_intf;

+27 −0
Original line number Diff line number Diff line
@@ -1938,6 +1938,33 @@ msm_gem_smmu_address_space_get(struct drm_device *dev,
	return funcs->get_address_space(priv->kms, domain);
}

int msm_get_mixer_count(struct msm_drm_private *priv,
		const struct drm_display_mode *mode,
		const struct msm_resource_caps_info *res, u32 *num_lm)
{
	struct msm_kms *kms;
	const struct msm_kms_funcs *funcs;

	if (!priv) {
		DRM_ERROR("invalid drm private struct\n");
		return -EINVAL;
	}

	kms = priv->kms;
	if (!kms) {
		DRM_ERROR("invalid msm kms struct\n");
		return -EINVAL;
	}

	funcs = kms->funcs;
	if (!funcs || !funcs->get_mixer_count) {
		DRM_ERROR("invalid function pointers\n");
		return -EINVAL;
	}

	return funcs->get_mixer_count(priv->kms, mode, res, num_lm);
}

static int msm_drm_bind(struct device *dev)
{
	return msm_drm_init(dev, &msm_driver);
+4 −0
Original line number Diff line number Diff line
@@ -1029,4 +1029,8 @@ static inline unsigned long timeout_to_jiffies(const ktime_t *timeout)
	return remaining_jiffies;
}

int msm_get_mixer_count(struct msm_drm_private *priv,
		const struct drm_display_mode *mode,
		const struct msm_resource_caps_info *res, u32 *num_lm);

#endif /* __MSM_DRV_H__ */
+4 −0
Original line number Diff line number Diff line
@@ -122,6 +122,10 @@ struct msm_kms_funcs {
	int (*cont_splash_config)(struct msm_kms *kms);
	/* check for continuous splash status */
	bool (*check_for_splash)(struct msm_kms *kms);
	/* topology information */
	int (*get_mixer_count)(const struct msm_kms *kms,
			const struct drm_display_mode *mode,
			const struct msm_resource_caps_info *res, u32 *num_lm);
};

struct msm_kms {
Loading