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

Commit 4c0403e0 authored by Lei Chen's avatar Lei Chen Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: Add SPI display driver



Add SPI display driver for handle IOCTLs from usespace and kickoff
display pixels data.

Change-Id: I24b9215df439f30de5aa7f510ce09014739ccb78
Signed-off-by: default avatarLei Chen <chenlei@codeaurora.org>
parent f0d55498
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
Qualcomm Technologies, Inc. mdss-spi-display

mdss-spi-display is a spi interface display which support send frame
data and command to panel, compatible with SPI interface specification.

Required properties:
- compatible:		Must be "qcom,mdss-spi-display"
- qcom,mdss-fb-map:	pHandle that specifies the framebuffer to which the
			interface is mapped.

Optional properties:
- label:		A string used to describe the controller used.

Example:
mdss_spi_display: qcom,mdss_spi_display {
	compatible = "qcom,mdss-spi-display";
	label = "mdss spi display";

	mdss_fb0: qcom,mdss_fb_primary {
		cell-index = <0>;
		compatible = "qcom,mdss-fb";
	};
};
+9 −0
Original line number Diff line number Diff line
@@ -82,6 +82,15 @@ config FB_MSM_MDSS_HDMI_MHL_SII8334
	MHL (Mobile High-Definition Link) technology
	uses USB connector to output HDMI content

config FB_MSM_MDSS_SPI_PANEL
	depends on SPI_QUP
	bool "Support SPI panel feature"
	---help---
	The MDSS SPI Panel provides support for transmittimg SPI signals of
	MDSS frame buffer data to connected panel. Limited by SPI clock rate,
	the current max fps only reach to ~30 fps with 240x240 resolution, and
	limited by MDP hardware architecture only supply GPU compostition.

config FB_MSM_MDSS_MHL3
	depends on FB_MSM_MDSS_HDMI_PANEL
	bool "MHL3 SII8620 Support"
+4 −0
Original line number Diff line number Diff line
@@ -64,6 +64,10 @@ obj-$(CONFIG_FB_MSM_MDSS_HDMI_MHL_SII8334) += mhl_sii8334.o mhl_msc.o
ccflags-y += -DTARGET_HW_MDSS_HDMI
endif

obj-$(CONFIG_FB_MSM_MDSS_SPI_PANEL) += mdss_spi_display.o
obj-$(CONFIG_FB_MSM_MDSS_SPI_PANEL) += mdss_spi_client.o
obj-$(CONFIG_FB_MSM_MDSS_SPI_PANEL) += mdss_spi_panel.o

obj-$(CONFIG_FB_MSM_MDSS_WRITEBACK) += mdss_wb.o

mdss-qpic-objs := mdss_qpic.o mdss_fb.o mdss_qpic_panel.o mdss_sync.o
+23 −2
Original line number Diff line number Diff line
@@ -362,6 +362,9 @@ static ssize_t mdss_fb_get_type(struct device *dev,
	case EDP_PANEL:
		ret = snprintf(buf, PAGE_SIZE, "edp panel\n");
		break;
	case SPI_PANEL:
		ret = snprintf(buf, PAGE_SIZE, "spi panel\n");
		break;
	default:
		ret = snprintf(buf, PAGE_SIZE, "unknown panel\n");
		break;
@@ -1278,6 +1281,9 @@ static int mdss_fb_probe(struct platform_device *pdev)

	mfd->pdev = pdev;

	if (mfd->panel.type == SPI_PANEL)
		mfd->fb_imgType = MDP_RGB_565;

	mfd->split_fb_left = mfd->split_fb_right = 0;

	mdss_fb_set_split_mode(mfd, pdata);
@@ -2122,8 +2128,9 @@ void mdss_fb_free_fb_ion_memory(struct msm_fb_data_type *mfd)

	dma_buf_end_cpu_access(mfd->fbmem_buf, DMA_BIDIRECTIONAL);

	if (mfd->mdp.fb_mem_get_iommu_domain && !(!mfd->fb_attachment ||
		!mfd->fb_attachment->dmabuf ||
	if ((mfd->mdp.fb_mem_get_iommu_domain ||
		(mfd->panel.type == SPI_PANEL)) &&
		!(!mfd->fb_attachment || !mfd->fb_attachment->dmabuf ||
		!mfd->fb_attachment->dmabuf->ops)) {
		dma_buf_unmap_attachment(mfd->fb_attachment, mfd->fb_table,
				DMA_BIDIRECTIONAL);
@@ -2168,6 +2175,20 @@ int mdss_fb_alloc_fb_ion_memory(struct msm_fb_data_type *mfd, size_t fb_size)
			goto err_put;
		}

		mfd->fb_table = dma_buf_map_attachment(mfd->fb_attachment,
				DMA_BIDIRECTIONAL);
		if (IS_ERR(mfd->fb_table)) {
			rc = PTR_ERR(mfd->fb_table);
			goto err_detach;
		}
	} else if (mfd->panel.type == SPI_PANEL) {
		mfd->fb_attachment = dma_buf_attach(mfd->fbmem_buf,
				&mfd->pdev->dev);
		if (IS_ERR(mfd->fb_attachment)) {
			rc = PTR_ERR(mfd->fb_attachment);
			goto err_put;
		}

		mfd->fb_table = dma_buf_map_attachment(mfd->fb_attachment,
			DMA_BIDIRECTIONAL);
		if (IS_ERR(mfd->fb_table)) {
+10 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ enum fps_resolution {
#define WRITEBACK_PANEL		10	/* Wifi display */
#define LVDS_PANEL		11	/* LVDS */
#define EDP_PANEL		12	/* LVDS */
#define SPI_PANEL               13	/* SPI */

#define DSC_PPS_LEN		128

@@ -108,6 +109,7 @@ enum {
	MDSS_PANEL_INTF_DSI,
	MDSS_PANEL_INTF_EDP,
	MDSS_PANEL_INTF_HDMI,
	MDSS_PANEL_INTF_SPI,
};

enum {
@@ -429,6 +431,10 @@ struct edp_panel_info {
	char frame_rate;	/* fps */
};

struct spi_panel_info {
	char frame_rate;	/* fps */
};

/**
 * struct dynamic_fps_data - defines dynamic fps related data
 * @hfp: horizontal front porch
@@ -741,6 +747,7 @@ struct mdss_panel_info {
	struct mipi_panel_info mipi;
	struct lvds_panel_info lvds;
	struct edp_panel_info edp;
	struct spi_panel_info spi;

	bool is_dba_panel;

@@ -877,6 +884,9 @@ static inline u32 mdss_panel_get_framerate(struct mdss_panel_info *panel_info,
			frame_rate = panel_info->lcdc.frame_rate;
			break;
		}
	case SPI_PANEL:
		frame_rate = panel_info->spi.frame_rate;
		break;
	default:
		pixel_total = (panel_info->lcdc.h_back_porch +
			  panel_info->lcdc.h_front_porch +
Loading