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

Commit 4c08e471 authored by Lloyd Atkinson's avatar Lloyd Atkinson
Browse files

drm/msm/sde: check cached connectors for partial update caps



Use CRTC's cached connector array, which contains all connectors
attached to the CRTC regardless of the atomic delta state, to
determine whether the currently attached connector supports
partial update.

Change-Id: I2c8898b082f519189a5176e9346d86b70c2b051c
Signed-off-by: default avatarLloyd Atkinson <latkinso@codeaurora.org>
parent d9f72f76
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -1186,8 +1186,6 @@ static int _sde_crtc_check_rois(struct drm_crtc *crtc,
	struct sde_crtc *sde_crtc;
	struct sde_crtc_state *sde_crtc_state;
	struct msm_mode_info mode_info;
	struct drm_connector *conn;
	struct drm_connector_state *conn_state;
	int rc, lm_idx, i;

	if (!crtc || !state)
@@ -1196,6 +1194,7 @@ static int _sde_crtc_check_rois(struct drm_crtc *crtc,
	memset(&mode_info, 0, sizeof(mode_info));

	sde_crtc = to_sde_crtc(crtc);
	sde_crtc_state = to_sde_crtc_state(state);

	if (hweight_long(state->connector_mask) != 1) {
		SDE_ERROR("invalid connector count(%d) for crtc: %d\n",
@@ -1204,8 +1203,17 @@ static int _sde_crtc_check_rois(struct drm_crtc *crtc,
		return -EINVAL;
	}

	for_each_connector_in_state(state->state, conn, conn_state, i) {
		rc = sde_connector_get_mode_info(conn_state, &mode_info);
	/*
	 * check connector array cached at modeset time since incoming atomic
	 * state may not include any connectors if they aren't modified
	 */
	for (i = 0; i < ARRAY_SIZE(sde_crtc_state->connectors); i++) {
		struct drm_connector *conn = sde_crtc_state->connectors[i];

		if (!conn || !conn->state)
			continue;

		rc = sde_connector_get_mode_info(conn->state, &mode_info);
		if (rc) {
			SDE_ERROR("failed to get mode info\n");
			return -EINVAL;
@@ -1216,7 +1224,6 @@ static int _sde_crtc_check_rois(struct drm_crtc *crtc,
	if (!mode_info.roi_caps.enabled)
		return 0;

	sde_crtc_state = to_sde_crtc_state(state);
	if (sde_crtc_state->user_roi_list.num_rects >
					mode_info.roi_caps.num_roi) {
		SDE_ERROR("roi count is more than supported limit, %d > %d\n",