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

Commit 4dd64c85 authored by Alan Kwong's avatar Alan Kwong
Browse files

drm/msm/sde: add inline rotation support to drm plane



Add inline rotation support to drm plane. Inline rotation
reduces ddr usage by redirecting traffic between rotator
output and source pipe to system cache.

CRs-Fixed: 2009714
Change-Id: I9bb39b700d648ee936a1b61eca4bf5cd7b1b8d38
Signed-off-by: default avatarAlan Kwong <akwong@codeaurora.org>
parent 4fc006e6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -279,6 +279,9 @@ Bus Scaling Subnodes:
- qcom,sde-data-bus:		Property to provide Bus scaling for data bus access for
				mdss blocks.

- qcom,sde-inline-rotator:	A 2 cell property, with format of (rotator phandle,
				instance id), of inline rotator device.

Bus Scaling Data:
- qcom,msm-bus,name:		String property describing client name.
- qcom,msm-bus,num-cases:	This is the number of Bus Scaling use cases
@@ -492,6 +495,8 @@ Example:
        compatible = "qcom,msm-hdmi-audio-codec-rx";
    };

    qcom,sde-inline-rotator = <&mdss_rotator 0>;

    qcom,platform-supply-entries {
       #address-cells = <1>;
       #size-cells = <0>;
+3 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm -Idrivers/gpu/drm/msm/dsi-stagi
ccflags-$(CONFIG_DRM_MSM_DSI) += -Idrivers/gpu/drm/msm/dsi
ccflags-$(CONFIG_DRM_MSM_DSI_PLL) += -Idrivers/gpu/drm/msm/dsi
ccflags-y += -Idrivers/gpu/drm/msm/sde
ccflags-y += -Idrivers/media/platform/msm/sde/rotator

msm_drm-y := \
	hdmi/hdmi.o \
@@ -128,10 +129,12 @@ msm_drm-$(CONFIG_DRM_MSM) += \
	sde/sde_hw_util.o \
	sde/sde_hw_sspp.o \
	sde/sde_hw_wb.o \
	sde/sde_hw_rot.o \
	sde/sde_hw_pingpong.o \
	sde/sde_hw_top.o \
	sde/sde_hw_interrupts.o \
	sde/sde_hw_vbif.o \
	sde/sde_hw_blk.o \
	sde/sde_formats.o \
	sde_power_handle.o \
	sde/sde_hw_color_processing_v1_7.o \
+5 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ enum msm_mdp_plane_property {
	PLANE_PROP_SKIN_COLOR,
	PLANE_PROP_SKY_COLOR,
	PLANE_PROP_FOLIAGE_COLOR,
	PLANE_PROP_ROT_CAPS_V1,

	/* # of blob properties */
	PLANE_PROP_BLOBCOUNT,
@@ -105,6 +106,10 @@ enum msm_mdp_plane_property {
	PLANE_PROP_VALUE_ADJUST,
	PLANE_PROP_CONTRAST_ADJUST,
	PLANE_PROP_EXCL_RECT_V1,
	PLANE_PROP_ROT_DST_X,
	PLANE_PROP_ROT_DST_Y,
	PLANE_PROP_ROT_DST_W,
	PLANE_PROP_ROT_DST_H,

	/* enum/bitmask properties */
	PLANE_PROP_ROTATION,
+19 −2
Original line number Diff line number Diff line
@@ -260,6 +260,8 @@ static void _sde_crtc_blend_setup_mixer(struct drm_crtc *crtc,
	int left_crtc_zpos_cnt[SDE_STAGE_MAX + 1] = {0};
	int right_crtc_zpos_cnt[SDE_STAGE_MAX + 1] = {0};
	int i;
	bool sbuf_mode = false;
	u32 prefill = 0;

	if (!sde_crtc || !mixer) {
		SDE_ERROR("invalid sde_crtc or mixer\n");
@@ -275,8 +277,10 @@ static void _sde_crtc_blend_setup_mixer(struct drm_crtc *crtc,

		pstate = to_sde_plane_state(plane->state);

		flush_mask = ctl->ops.get_bitmask_sspp(ctl,
							sde_plane_pipe(plane));
		if (sde_plane_is_sbuf_mode(plane, &prefill))
			sbuf_mode = true;

		sde_plane_get_ctl_flush(plane, ctl, &flush_mask);

		/* always stage plane on either left or right lm */
		if (plane->state->crtc_x >= crtc_split_width) {
@@ -355,6 +359,19 @@ static void _sde_crtc_blend_setup_mixer(struct drm_crtc *crtc,
			_sde_crtc_setup_dim_layer_cfg(crtc, sde_crtc,
					mixer, &cstate->dim_layer[i]);
	}

	if (ctl->ops.setup_sbuf_cfg) {
		cstate = to_sde_crtc_state(crtc->state);
		if (!sbuf_mode) {
			cstate->sbuf_cfg.rot_op_mode =
					SDE_CTL_ROT_OP_MODE_OFFLINE;
		} else {
			cstate->sbuf_cfg.rot_op_mode =
					SDE_CTL_ROT_OP_MODE_INLINE_SYNC;
		}

		ctl->ops.setup_sbuf_cfg(ctl, &cstate->sbuf_cfg);
	}
}

/**
+2 −0
Original line number Diff line number Diff line
@@ -201,6 +201,7 @@ struct sde_crtc {
 * @dim_layer: Dim layer configs
 * @cur_perf: current performance state
 * @new_perf: new performance state
 * @sbuf_cfg: stream buffer configuration
 */
struct sde_crtc_state {
	struct drm_crtc_state base;
@@ -219,6 +220,7 @@ struct sde_crtc_state {

	struct sde_core_perf_params cur_perf;
	struct sde_core_perf_params new_perf;
	struct sde_ctl_sbuf_cfg sbuf_cfg;
};

#define to_sde_crtc_state(x) \
Loading