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

Commit de1f4ef4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm: change CSC matrix selection logic for CDM block"

parents 9a34ec62 7c79cabf
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -2364,6 +2364,36 @@ int sde_hdmi_pre_kickoff(struct drm_connector *connector,
	return 0;
}

bool sde_hdmi_mode_needs_full_range(void *display)
{
	struct sde_hdmi *hdmi_display = (struct sde_hdmi *)display;
	struct drm_display_mode *mode;
	u32 mode_fmt_flags = 0;
	u32 cea_mode;

	if (!hdmi_display) {
		SDE_ERROR("invalid input\n");
		return false;
	}

	mode = &hdmi_display->mode;
	/* Cache the format flags before clearing */
	mode_fmt_flags = mode->flags;
	/**
	 * Clear the RGB/YUV format flags before calling upstream API
	 * as the API also compares the flags and then returns a mode
	 */
	mode->flags &= ~SDE_DRM_MODE_FLAG_FMT_MASK;
	cea_mode = drm_match_cea_mode(mode);
	/* Restore the format flags */
	mode->flags = mode_fmt_flags;

	if (cea_mode > SDE_HDMI_VIC_640x480)
		return false;

	return true;
}

int sde_hdmi_connector_get_modes(struct drm_connector *connector, void *display)
{
	struct sde_hdmi *hdmi_display = (struct sde_hdmi *)display;
+13 −0
Original line number Diff line number Diff line
@@ -482,6 +482,14 @@ int sde_hdmi_pre_kickoff(struct drm_connector *connector,
		void *display,
		struct msm_display_kickoff_params *params);

/*
 * sde_hdmi_mode_needs_full_range - does mode need full range
 * quantization
 * @display: Pointer to private display structure
 * Returns: true or false based on mode
 */
bool sde_hdmi_mode_needs_full_range(void *display);

#else /*#ifdef CONFIG_DRM_SDE_HDMI*/

static inline u32 sde_hdmi_get_num_of_displays(void)
@@ -596,5 +604,10 @@ static inline int sde_hdmi_set_property(struct drm_connector *connector,
	return 0;
}

static inline bool sde_hdmi_mode_needs_full_range(void *display)
{
	return false;
}

#endif /*#else of CONFIG_DRM_SDE_HDMI*/
#endif /* _SDE_HDMI_H_ */
+33 −2
Original line number Diff line number Diff line
@@ -582,18 +582,49 @@ static void _sde_hdmi_bridge_post_disable(struct drm_bridge *bridge)
}

static void _sde_hdmi_bridge_set_avi_infoframe(struct hdmi *hdmi,
	const struct drm_display_mode *mode)
	struct drm_display_mode *mode)
{
	u8 avi_iframe[HDMI_AVI_INFOFRAME_BUFFER_SIZE] = {0};
	u8 *avi_frame = &avi_iframe[HDMI_INFOFRAME_HEADER_SIZE];
	u8 checksum;
	u32 reg_val;
	u32 mode_fmt_flags = 0;
	struct hdmi_avi_infoframe info;
	struct drm_connector *connector;

	if (!hdmi || !mode) {
		SDE_ERROR("invalid input\n");
		return;
	}

	connector = hdmi->connector;

	if (!connector) {
		SDE_ERROR("invalid input\n");
		return;
	}

	/* Cache the format flags before clearing */
	mode_fmt_flags = mode->flags;
	/**
	 * Clear the RGB/YUV format flags before calling upstream API
	 * as the API also compares the flags and then returns a mode
	 */
	mode->flags &= ~SDE_DRM_MODE_FLAG_FMT_MASK;
	drm_hdmi_avi_infoframe_from_display_mode(&info, mode);
	/* Restore the format flags */
	mode->flags = mode_fmt_flags;

	if (mode->private_flags & MSM_MODE_FLAG_COLOR_FORMAT_YCBCR420)
	if (mode->private_flags & MSM_MODE_FLAG_COLOR_FORMAT_YCBCR420) {
		info.colorspace = HDMI_COLORSPACE_YUV420;
		/**
		 * If sink supports quantization select,
		 * override to full range
		 */
		if (connector->yuv_qs)
			info.ycc_quantization_range =
				HDMI_YCC_QUANTIZATION_RANGE_FULL;
	}

	hdmi_avi_infoframe_pack(&info, avi_iframe, sizeof(avi_iframe));
	checksum = avi_iframe[HDMI_INFOFRAME_HEADER_SIZE - 1];
+2 −0
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@
#define HDMI_GET_MSB(x)(x >> 8)
#define HDMI_GET_LSB(x)(x & 0xff)

#define SDE_HDMI_VIC_640x480 0x1

/*
 * Bits 1:0 in HDMI_HW_DDC_CTRL that dictate how the HDCP 2.2 RxStatus will be
 * read by the hardware
+22 −0
Original line number Diff line number Diff line
@@ -90,6 +90,28 @@ int sde_connector_pre_kickoff(struct drm_connector *connector)
	return rc;
}

bool sde_connector_mode_needs_full_range(struct drm_connector *connector)
{
	struct sde_connector *c_conn;

	if (!connector) {
		SDE_ERROR("invalid argument\n");
		return false;
	}

	c_conn = to_sde_connector(connector);

	if (!c_conn->display) {
		SDE_ERROR("invalid argument\n");
		return false;
	}

	if (!c_conn->ops.mode_needs_full_range)
		return false;

	return c_conn->ops.mode_needs_full_range(c_conn->display);
}

static void sde_connector_destroy(struct drm_connector *connector)
{
	struct sde_connector *c_conn;
Loading