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

Commit add42955 authored by Lloyd Atkinson's avatar Lloyd Atkinson Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: check with cp properties before msm properties



Reverse the order of the property set checks in the SDE CRTC to
check color processing first, then msm property system to allow
msm property system to correctly catch errors.

Change-Id: I6cbb1ef9a6b22f1c58e4213960dc8c1aafe43be1
Signed-off-by: default avatarLloyd Atkinson <latkinso@codeaurora.org>
parent 5c1f0d88
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1016,8 +1016,10 @@ int sde_cp_crtc_set_property(struct drm_crtc *crtc,
		}
	}

	if (!found)
	if (!found) {
		ret = -ENOENT;
		goto exit;
	}

	/**
	 * sde_crtc is virtual ensure that hardware has been attached to the
+60 −55
Original line number Diff line number Diff line
@@ -4991,39 +4991,46 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc,
{
	struct sde_crtc *sde_crtc;
	struct sde_crtc_state *cstate;
	int idx, ret = -EINVAL;
	int idx, ret;

	if (!crtc || !state || !property) {
		SDE_ERROR("invalid argument(s)\n");
	} else {
		return -EINVAL;
	}

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

	/* check with cp property system first */
	ret = sde_cp_crtc_set_property(crtc, property, val);
	if (ret != -ENOENT)
		goto exit;

	/* if not handled by cp, check msm_property system */
	ret = msm_property_atomic_set(&sde_crtc->property_info,
			&cstate->property_state, property, val);
		if (!ret) {
			idx = msm_property_index(&sde_crtc->property_info,
					property);
	if (ret)
		goto exit;

	idx = msm_property_index(&sde_crtc->property_info, property);
	switch (idx) {
	case CRTC_PROP_INPUT_FENCE_TIMEOUT:
		_sde_crtc_set_input_fence_timeout(cstate);
		break;
	case CRTC_PROP_DIM_LAYER_V1:
				_sde_crtc_set_dim_layer_v1(cstate,
							(void __user *)val);
		_sde_crtc_set_dim_layer_v1(cstate, (void __user *)val);
		break;
	case CRTC_PROP_ROI_V1:
				ret = _sde_crtc_set_roi_v1(state,
							(void __user *)val);
		ret = _sde_crtc_set_roi_v1(state, (void __user *)val);
		break;
	case CRTC_PROP_DEST_SCALER:
				ret = _sde_crtc_set_dest_scaler(sde_crtc,
						cstate, (void __user *)val);
		ret = _sde_crtc_set_dest_scaler(sde_crtc, cstate,
				(void __user *)val);
		break;
	case CRTC_PROP_DEST_SCALER_LUT_ED:
	case CRTC_PROP_DEST_SCALER_LUT_CIR:
	case CRTC_PROP_DEST_SCALER_LUT_SEP:
				ret = _sde_crtc_set_dest_scaler_lut(sde_crtc,
								cstate, idx);
		ret = _sde_crtc_set_dest_scaler_lut(sde_crtc, cstate, idx);
		break;
	case CRTC_PROP_CORE_CLK:
	case CRTC_PROP_CORE_AB:
@@ -5041,16 +5048,14 @@ static int sde_crtc_atomic_set_property(struct drm_crtc *crtc,
		/* nothing to do */
		break;
	}
		} else {
			ret = sde_cp_crtc_set_property(crtc,
					property, val);
		}
		if (ret)
			DRM_ERROR("failed to set the property\n");

		SDE_DEBUG("crtc%d %s[%d] <= 0x%llx ret=%d\n", crtc->base.id,
				property->name, property->base.id, val, ret);
	}
exit:
	if (ret)
		SDE_ERROR("%s: failed to set property%d %s: %d\n", crtc->name,
				DRMID(property), property->name, ret);
	else
		SDE_DEBUG("%s: %s[%d] <= 0x%llx\n", crtc->name, property->name,
				property->base.id, val);

	return ret;
}