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

Commit dc7aa950 authored by Rohith Palakurthi's avatar Rohith Palakurthi
Browse files

Merge remote-tracking branch 'quic/dev/msm-4.14-display' into msm-4.14



* quic/dev/msm-4.14-display:
  drm/msm/sde: fix variable declaration compilation issues
  drm/msm/dp: fix variable declaration compilation issues
  drm/msm/dsi-staging: update edid with resolution details
  drm/msm/dsi-staging: add default edid
  ARM: dts: msm: reserve memory for display ramdump for TRINKET
  ARM: dts: msm: add cont splash memory for TRINKET

Change-Id: I75d2e9cb8eebaab58dda8494ce39ca8349f12b01
Signed-off-by: default avatarRohith Palakurthi <prohit@codeaurora.org>
parents 29714970 2bdc98a7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -552,6 +552,16 @@
			size = <0 0x400000>;
		};

		cont_splash_memory: cont_splash_region@5c000000 {
			reg = <0x0 0x5c000000 0x0 0x01000000>;
			label = "cont_splash_region";
		};

		disp_rdump_memory: disp_rdump_region@5c000000 {
			reg = <0x0 0x5c000000 0x0 0x01000000>;
			label = "disp_rdump_region";
		};

		/* global autoconfigured region for contiguous allocations */
		linux,cma {
			compatible = "shared-dma-pool";
+4 −3
Original line number Diff line number Diff line
@@ -259,6 +259,7 @@ static void dp_display_check_source_hdcp_caps(struct dp_display_private *dp)
static void dp_display_hdcp_register_streams(struct dp_display_private *dp)
{
	int rc;
	size_t i;
	struct sde_hdcp_ops *ops = dp->hdcp.ops;
	void *data = dp->hdcp.data;

@@ -268,7 +269,7 @@ static void dp_display_hdcp_register_streams(struct dp_display_private *dp)
		int index = 0;

		pr_debug("Registering all active panel streams with HDCP\n");
		for (size_t i = DP_STREAM_0; i < DP_STREAM_MAX; i++) {
		for (i = DP_STREAM_0; i < DP_STREAM_MAX; i++) {
			if (!dp->active_panels[i])
				continue;
			streams[index].stream_id = i;
@@ -1653,7 +1654,7 @@ static int dp_display_pre_disable(struct dp_display *dp_display, void *panel)
	struct dp_display_private *dp;
	struct dp_panel *dp_panel = panel;
	struct dp_link_hdcp_status *status;
	int rc = 0;
	int i, rc = 0;

	if (!dp_display || !panel) {
		pr_err("invalid input\n");
@@ -1677,7 +1678,7 @@ static int dp_display_pre_disable(struct dp_display *dp_display, void *panel)
		if (dp->mst.mst_active) {
			dp_display_hdcp_deregister_stream(dp,
				dp_panel->stream_id);
			for (int i = DP_STREAM_0; i < DP_STREAM_MAX; i++) {
			for (i = DP_STREAM_0; i < DP_STREAM_MAX; i++) {
				if (i != dp_panel->stream_id)
					continue;
				if (dp->active_panels[i]) {
+114 −4
Original line number Diff line number Diff line
@@ -680,13 +680,111 @@ void dsi_connector_put_modes(struct drm_connector *connector,
	dsi_display->modes = NULL;
}

int dsi_connector_get_modes(struct drm_connector *connector,
		void *display)

static int dsi_drm_update_edid_name(struct edid *edid, const char *name)
{
	u32 count = 0;
	u8 *dtd = (u8 *)&edid->detailed_timings[3];
	u8 standard_header[] = {0x00, 0x00, 0x00, 0xFE, 0x00};
	u32 dtd_size = 18;
	u32 header_size = sizeof(standard_header);

	if (!name)
		return -EINVAL;

	/* Fill standard header */
	memcpy(dtd, standard_header, header_size);

	dtd_size -= header_size;
	dtd_size = min_t(u32, dtd_size, strlen(name));

	memcpy(dtd + header_size, name, dtd_size);

	return 0;
}

static void dsi_drm_update_dtd(struct edid *edid,
		struct dsi_display_mode *modes, u32 modes_count)
{
	u32 i;
	u32 count = min_t(u32, modes_count, 3);

	for (i = 0; i < count; i++) {
		struct detailed_timing *dtd = &edid->detailed_timings[i];
		struct dsi_display_mode *mode = &modes[i];
		struct dsi_mode_info *timing = &mode->timing;
		struct detailed_pixel_timing *pd = &dtd->data.pixel_data;
		u32 h_blank = timing->h_front_porch + timing->h_sync_width +
				timing->h_back_porch;
		u32 v_blank = timing->v_front_porch + timing->v_sync_width +
				timing->v_back_porch;
		u32 h_img = 0, v_img = 0;

		dtd->pixel_clock = mode->pixel_clk_khz / 10;

		pd->hactive_lo = timing->h_active & 0xFF;
		pd->hblank_lo = h_blank & 0xFF;
		pd->hactive_hblank_hi = ((h_blank >> 8) & 0xF) |
				((timing->h_active >> 8) & 0xF) << 4;

		pd->vactive_lo = timing->v_active & 0xFF;
		pd->vblank_lo = v_blank & 0xFF;
		pd->vactive_vblank_hi = ((v_blank >> 8) & 0xF) |
				((timing->v_active >> 8) & 0xF) << 4;

		pd->hsync_offset_lo = timing->h_front_porch & 0xFF;
		pd->hsync_pulse_width_lo = timing->h_sync_width & 0xFF;
		pd->vsync_offset_pulse_width_lo =
			((timing->v_front_porch & 0xF) << 4) |
			(timing->v_sync_width & 0xF);

		pd->hsync_vsync_offset_pulse_width_hi =
			(((timing->h_front_porch >> 8) & 0x3) << 6) |
			(((timing->h_sync_width >> 8) & 0x3) << 4) |
			(((timing->v_front_porch >> 4) & 0x3) << 2) |
			(((timing->v_sync_width >> 4) & 0x3) << 0);

		pd->width_mm_lo = h_img & 0xFF;
		pd->height_mm_lo = v_img & 0xFF;
		pd->width_height_mm_hi = (((h_img >> 8) & 0xF) << 4) |
			((v_img >> 8) & 0xF);

		pd->hborder = 0;
		pd->vborder = 0;
		pd->misc = 0;
	}
}

static void dsi_drm_update_checksum(struct edid *edid)
{
	u8 *data = (u8 *)edid;
	u32 i, sum = 0;

	for (i = 0; i < EDID_LENGTH - 1; i++)
		sum += data[i];

	edid->checksum = 0x100 - (sum & 0xFF);
}

int dsi_connector_get_modes(struct drm_connector *connector, void *data)
{
	int rc, i;
	u32 count = 0, edid_size;
	struct dsi_display_mode *modes = NULL;
	struct drm_display_mode drm_mode;
	int rc, i;
	struct dsi_display *display = data;
	struct edid edid;
	const u8 edid_buf[EDID_LENGTH] = {
		0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x44, 0x6D,
		0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1B, 0x10, 0x01, 0x03,
		0x80, 0x50, 0x2D, 0x78, 0x0A, 0x0D, 0xC9, 0xA0, 0x57, 0x47,
		0x98, 0x27, 0x12, 0x48, 0x4C, 0x00, 0x00, 0x00, 0x01, 0x01,
		0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
		0x01, 0x01, 0x01, 0x01,
	};

	edid_size = min_t(u32, sizeof(edid), EDID_LENGTH);

	memcpy(&edid, edid_buf, edid_size);

	if (sde_connector_get_panel(connector)) {
		/*
@@ -729,6 +827,18 @@ int dsi_connector_get_modes(struct drm_connector *connector,
			m->type |= DRM_MODE_TYPE_PREFERRED;
		drm_mode_probed_add(connector, m);
	}

	rc = dsi_drm_update_edid_name(&edid, display->panel->name);
	if (rc) {
		count = 0;
		goto end;
	}

	dsi_drm_update_dtd(&edid, modes, count);
	dsi_drm_update_checksum(&edid);
	rc = drm_mode_connector_update_edid_property(connector, &edid);
	if (rc)
		count = 0;
end:
	pr_debug("MODE COUNT =%d\n\n", count);
	return count;
+4 −4
Original line number Diff line number Diff line
@@ -855,7 +855,7 @@ static struct list_head *sde_hdcp_2x_stream_present(
static void sde_hdcp_2x_open_stream(struct sde_hdcp_2x_ctrl *hdcp)
{
	int rc;
	size_t iterations;
	size_t i, iterations;
	u8 stream_id;
	u8 virtual_channel;
	u32 stream_handle = 0;
@@ -868,7 +868,7 @@ static void sde_hdcp_2x_open_stream(struct sde_hdcp_2x_ctrl *hdcp)

	iterations = min(hdcp->num_streams, (u8)(MAX_STREAM_COUNT));

	for (size_t i  = 0; i < iterations; i++) {
	for (i  = 0; i < iterations; i++) {
		if (hdcp->stream_count == MAX_STREAM_COUNT) {
			pr_debug("Registered the maximum amount of streams\n");
			break;
@@ -926,7 +926,7 @@ static void sde_hdcp_2x_open_stream_work(struct kthread_work *work)
static void sde_hdcp_2x_close_stream(struct sde_hdcp_2x_ctrl *hdcp)
{
	int rc;
	size_t iterations;
	size_t i, iterations;
	u8 stream_id;
	u8 virtual_channel;
	struct list_head *entry;
@@ -940,7 +940,7 @@ static void sde_hdcp_2x_close_stream(struct sde_hdcp_2x_ctrl *hdcp)

	iterations = min(hdcp->num_streams, (u8)(MAX_STREAM_COUNT));

	for (size_t i = 0; i < iterations; i++) {
	for (i = 0; i < iterations; i++) {
		if (hdcp->stream_count == 0) {
			pr_debug("No streams are currently registered\n");
			return;