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

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

Merge "disp: msm: dp: filter modes based on sde resource availability"

parents a30c33a6 98434934
Loading
Loading
Loading
Loading
+14 −2
Original line number Original line Diff line number Diff line
@@ -1869,7 +1869,8 @@ static int dp_display_unprepare(struct dp_display *dp_display, void *panel)


static enum drm_mode_status dp_display_validate_mode(
static enum drm_mode_status dp_display_validate_mode(
		struct dp_display *dp_display,
		struct dp_display *dp_display,
		void *panel, struct drm_display_mode *mode)
		void *panel, struct drm_display_mode *mode,
		const struct msm_resource_caps_info *avail_res)
{
{
	struct dp_display_private *dp;
	struct dp_display_private *dp;
	struct drm_dp_link *link_info;
	struct drm_dp_link *link_info;
@@ -1882,8 +1883,10 @@ static enum drm_mode_status dp_display_validate_mode(
	int hdis, vdis, vref, ar, _hdis, _vdis, _vref, _ar, rate;
	int hdis, vdis, vref, ar, _hdis, _vdis, _vref, _ar, rate;
	struct dp_display_mode dp_mode;
	struct dp_display_mode dp_mode;
	bool dsc_en;
	bool dsc_en;
	u32 num_lm = 0;


	if (!dp_display || !mode || !panel) {
	if (!dp_display || !mode || !panel ||
			!avail_res || !avail_res->max_mixer_width) {
		pr_err("invalid params\n");
		pr_err("invalid params\n");
		return mode_status;
		return mode_status;
	}
	}
@@ -1926,6 +1929,15 @@ static enum drm_mode_status dp_display_validate_mode(
		goto end;
		goto end;
	}
	}


	num_lm = (avail_res->max_mixer_width <= mode->hdisplay) ?
			2 : 1;
	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,
				avail_res->num_lm, avail_res->num_3dmux);
		goto end;
	}

	/*
	/*
	 * If the connector exists in the mst connector list and if debug is
	 * If the connector exists in the mst connector list and if debug is
	 * enabled for that connector, use the mst connector settings from the
	 * enabled for that connector, use the mst connector settings from the
+2 −1
Original line number Original line Diff line number Diff line
@@ -81,7 +81,8 @@ struct dp_display {
	int (*set_mode)(struct dp_display *dp_display, void *panel,
	int (*set_mode)(struct dp_display *dp_display, void *panel,
			struct dp_display_mode *mode);
			struct dp_display_mode *mode);
	enum drm_mode_status (*validate_mode)(struct dp_display *dp_display,
	enum drm_mode_status (*validate_mode)(struct dp_display *dp_display,
			void *panel, struct drm_display_mode *mode);
			void *panel, struct drm_display_mode *mode,
			const struct msm_resource_caps_info *avail_res);
	int (*get_modes)(struct dp_display *dp_display, void *panel,
	int (*get_modes)(struct dp_display *dp_display, void *panel,
		struct dp_display_mode *dp_mode);
		struct dp_display_mode *dp_mode);
	int (*prepare)(struct dp_display *dp_display, void *panel);
	int (*prepare)(struct dp_display *dp_display, void *panel);
+2 −1
Original line number Original line Diff line number Diff line
@@ -600,7 +600,8 @@ enum drm_mode_status dp_connector_mode_valid(struct drm_connector *connector,
	dp_disp = display;
	dp_disp = display;
	mode->vrefresh = drm_mode_vrefresh(mode);
	mode->vrefresh = drm_mode_vrefresh(mode);


	return dp_disp->validate_mode(dp_disp, sde_conn->drv_panel, mode);
	return dp_disp->validate_mode(dp_disp, sde_conn->drv_panel,
			mode, avail_res);
}
}


int dp_connector_update_pps(struct drm_connector *connector,
int dp_connector_update_pps(struct drm_connector *connector,