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

Commit 16649fc2 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

drm/msm/sde: update hdr properties



Update the HDR metadata properties even though HDR is not
supported. This is needed as subsequent hot plugs may or
may not have HDR supported. Update the HDR metadata to
avoid using residue data from previous session.

CRs-Fixed: 2339345
Change-Id: Iaba37b7ea6208dcbbe5d635decd536eae1d7a096
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent 52754a64
Loading
Loading
Loading
Loading
+14 −18
Original line number Diff line number Diff line
@@ -1325,24 +1325,17 @@ void sde_connector_commit_reset(struct drm_connector *connector, ktime_t ts)
static void sde_connector_update_hdr_props(struct drm_connector *connector)
{
	struct sde_connector *c_conn = to_sde_connector(connector);
	struct drm_msm_ext_hdr_properties hdr = {};

	hdr.hdr_supported = connector->hdr_supported;

	if (hdr.hdr_supported) {
		hdr.hdr_eotf = connector->hdr_eotf;
		hdr.hdr_metadata_type_one = connector->hdr_metadata_type_one;
		hdr.hdr_max_luminance = connector->hdr_max_luminance;
		hdr.hdr_avg_luminance = connector->hdr_avg_luminance;
		hdr.hdr_min_luminance = connector->hdr_min_luminance;

		msm_property_set_blob(&c_conn->property_info,
			      &c_conn->blob_ext_hdr,
			      &hdr,
			      sizeof(hdr),
			      CONNECTOR_PROP_EXT_HDR_INFO);
	struct drm_msm_ext_hdr_properties hdr = {
		connector->hdr_metadata_type_one,
		connector->hdr_supported,
		connector->hdr_eotf,
		connector->hdr_max_luminance,
		connector->hdr_avg_luminance,
		connector->hdr_min_luminance,
	};

	}
	msm_property_set_blob(&c_conn->property_info, &c_conn->blob_ext_hdr,
			&hdr, sizeof(hdr), CONNECTOR_PROP_EXT_HDR_INFO);
}

static enum drm_connector_status
@@ -1742,6 +1735,7 @@ static int sde_connector_get_modes(struct drm_connector *connector)
		return 0;
	}

	if (c_conn->hdr_capable)
		sde_connector_update_hdr_props(connector);

	return mode_count;
@@ -2265,6 +2259,8 @@ struct drm_connector *sde_connector_init(struct drm_device *dev,
	if (connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
		struct drm_msm_ext_hdr_properties hdr = {0};

		c_conn->hdr_capable = true;

		msm_property_install_blob(&c_conn->property_info,
				"ext_hdr_properties",
				DRM_MODE_PROP_IMMUTABLE,
+2 −0
Original line number Diff line number Diff line
@@ -378,6 +378,7 @@ struct sde_connector_evt {
 * @qsync_mode: Cached Qsync mode, 0=disabled, 1=continuous mode
 * @qsync_updated: Qsync settings were updated
 * last_cmd_tx_sts: status of the last command transfer
 * @hdr_capable: external hdr support present
 */
struct sde_connector {
	struct drm_connector base;
@@ -429,6 +430,7 @@ struct sde_connector {
	bool qsync_updated;

	bool last_cmd_tx_sts;
	bool hdr_capable;
};

/**