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

Commit 29ae3ed1 authored by Alan Kwong's avatar Alan Kwong Committed by Gerrit - the friendly Code Review server
Browse files

msm: sde: Add v4l2 rotator driver to enable multi-context usecase



Current application interface of fbdev rotator driver has limited
support on multiple concurrent rotator sessions.  Using v4l2 m2m
framework will enable concurrent multi-session using standard
v4l2 interface.  This will also enable third-party clients to
use rotator service in background mode.

The driver supports same feature set as current fbdev rotator
driver, such as rotation, flip, and scale operation.

CRs-Fixed: 972831
Change-Id: I0bba76f2233c142b5a22451f824df7900ac60afa
Signed-off-by: default avatarAlan Kwong <akwong@codeaurora.org>
parent 17d7bd58
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -10,6 +10,9 @@ Required properties
- reg :			offset and length of the register set for the device.
- reg-names :		names to refer to register sets related to this device
- interrupts :		Interrupt associated with MDSS.
- interrupt-controller:	Mark the device node as an interrupt controller.
			This is an empty, boolean property.
- #interrupt-cells: 	Should be one. The first cell is interrupt number.
- vdd-supply :		Phandle for vdd regulator device node.
- qcom,max-clk-rate:	Specify maximum MDP core clock rate in hz that this
			device supports.
@@ -635,6 +638,8 @@ Example:
			<0xfd925000 0x1000>;
		reg-names = "mdp_phys", "vbif_phys", "vbif_nrt_phys";
		interrupts = <0 72 0>;
		interrupt-controller;
		#interrupt-cells = <1>;
		vdd-supply = <&gdsc_mdss>;
		batfet-supply = <&pm8941_chg_batif>;
		vdd-cx-supply = <&pm8841_s2_corner>;
+151 −0
Original line number Diff line number Diff line
SDE Rotator

SDE rotator is a v4l2 rotator driver, which manages the rotator hw
block inside the Snapdragon Display Engine (or Mobile Display Subsystem)

Required properties
- compatible:		Must be "qcom,sde-rotator".
- reg:			offset and length of the register set for the device.
- reg-names:		names to refer to register sets related to this device
- interrupt-parent:	phandle for the interrupt controller that
			services interrupts for this device.
- interrupts:		Interrupt associated with rotator.
- <name>-supply:	Phandle for <name> regulator device node.
- qcom,supply-names:	names to refer to regulator device node.
- clocks:		List of Phandles for clock device nodes
			needed by the device.
- clock-names:		List of clock names needed by the device.
Bus Scaling Data:
- qcom,msm-bus,name:		String property describing rotator client.
- qcom,msm-bus,num-cases:	This is the the number of Bus Scaling use cases
				defined in the vectors property. This must be
				set to <3> for rotator driver where use-case 0 is
				used to take off rotator BW votes from the system.
				And use-case 1 & 2 are used in ping-pong fashion
				to generate run-time BW requests.
- qcom,msm-bus,num-paths:	This represents the number of paths in each
				Bus Scaling Usecase. This value depends on
				how many number of AXI master ports are
				dedicated to rotator for particular chipset.
- qcom,msm-bus,vectors-KBps:	* A series of 4 cell properties, with a format
				of (src, dst, ab, ib) which is defined at
				Documentation/devicetree/bindings/arm/msm/msm_bus.txt
				* Current values of src & dst are defined at
				include/linux/msm-bus-board.h
				src values allowed for rotator are:
					25 = MSM_BUS_MASTER_ROTATOR
				dst values allowed for rotator are:
					512 = MSM_BUS_SLAVE_EBI_CH0
				ab: Represents aggregated bandwidth.
				ib: Represents instantaneous bandwidth.
				* Total number of 4 cell properties will be
				(number of use-cases * number of paths).
				* These values will be overridden by the driver
				based on the run-time requirements. So initial
				ab and ib values defined here are random and
				bare no logic except for the use-case 0 where ab
				and ib values needs to be 0.
				* Define realtime vector properties followed by
				non-realtime vector properties.

Optional properties
- qcom,rot-vbif-settings: 	Array with key-value pairs of constant VBIF register
				settings used to setup MDSS QoS for optimum performance.
				The key used should be offset from "rot_vbif_phys" register
				defined in reg property.
- qcom,mdss-rot-block-size:	This integer value indicates the size of a memory block
				(in pixels) to be used by the rotator. If this property
				is not specified, then a default value of 128 pixels
				would be used.
- qcom,mdss-highest-bank-bit:	This integer value indicate tile format as opposed to usual
				linear format. The value tells the GPU highest memory
				bank bit used.
- qcom,mdss-default-ot-wr-limit: This integer value indicates maximum number of pending
				writes that can be allowed on each WR xin.
				This value can be used to reduce the pending writes
				limit and can be tuned to match performance
				requirements depending upon system state.
				Some platforms require a dynamic ot limiting in
				some cases. Setting this default ot write limit
				will enable this dynamic limiting for the write
				operations in the platforms that require these
				limits.
- qcom,mdss-default-ot-rd-limit: This integer value indicates the default number of pending
				reads that can be allowed on each RD xin.
				Some platforms require a dynamic ot limiting in
				some cases. Setting this default ot read limit
				will enable this dynamic limiting for the read
				operations in the platforms that require these
				limits.
- qcom,mdss-rot-vbif-qos-setting: This array is used to program vbif qos remapper register
				  priority for rotator clients.
- qcom,mdss-rot-mode:		This is integer value indicates operation mode
				of the rotator device

Subnode properties:
- compatible:		Compatible name used in smmu v2.
			smmu_v2 names should be:
			"qcom,smmu_sde_rot_unsec"- smmu context bank device for
						unsecure rotation domain.
			"qcom,smmu_sde_rot_sec"	- smmu context bank device for
						secure rotation domain.
- iommus:		specifies the SID's used by this context bank
- gdsc-mdss-supply: 	Phandle for mdss supply regulator device node.
- clocks:		List of Phandles for clock device nodes
			needed by the device.
- clock-names:		List of clock names needed by the device.


Example:
	mdss_rotator: qcom,mdss_rotator {
		compatible = "qcom,sde_rotator";
		reg = <0xfd900000 0x22100>,
			<0xfd925000 0x1000>;
		reg-names = "mdp_phys", "rot_vbif_phys";
		interrupt-parent = <&mdss_mdp>;
		interrupts = <2 0>;

		qcom,mdss-mdp-reg-offset = <0x00001000>;

		rot-vdd-supply = <&gdsc_mdss>;
		qcom,supply-names = "rot-vdd";

		clocks = <&clock_mmss clk_mmss_mdss_ahb_clk>,
			<&clock_mmss clk_mmss_mdss_rot_clk>;
		clock-names = "iface_clk", "rot_core_clk";

		qcom,mdss-highest-bank-bit = <0x2>;

		/* Bus Scale Settings */
		qcom,msm-bus,name = "mdss_rotator";
		qcom,msm-bus,num-cases = <3>;
		qcom,msm-bus,num-paths = <1>;
		qcom,msm-bus,vectors-KBps =
			<25 512 0 0>,
			<25 512 0 6400000>,
			<25 512 0 6400000>;

		/* VBIF QoS remapper settings*/
		qcom,mdss-rot-vbif-qos-setting = <1 1 1 1>;

		qcom,mdss-default-ot-rd-limit = <8>;
		qcom,mdss-default-ot-wr-limit = <16>;

		smmu_rot_unsec: qcom,smmu_rot_unsec_cb {
			compatible = "qcom,smmu_sde_rot_unsec";
			iommus = <&mdp_smmu 0xe00>;
			gdsc-mdss-supply = <&gdsc_bimc_smmu>;
			clocks = <&clock_mmss clk_bimc_smmu_ahb_clk>,
				<&clock_mmss clk_bimc_smmu_axi_clk>;
			clock-names = "rot_ahb_clk", "rot_axi_clk";
		};

		smmu_sde_rot_sec: qcom,smmu_sde_rot_sec_cb {
			compatible = "qcom,smmu_sde_rot_sec";
			iommus = <&mmss_smmu 0xe01>;
			gdsc-mdss-supply = <&gdsc_bimc_smmu>;
			clocks = <&clock_mmss clk_bimc_smmu_ahb_clk>,
				<&clock_mmss clk_bimc_smmu_axi_clk>;
			clock-names = "rot_ahb_clk", "rot_axi_clk";
		};
	};
+1 −0
Original line number Diff line number Diff line
@@ -42,3 +42,4 @@ source "drivers/media/platform/msm/camera_v2/Kconfig"
endif # MSMB_CAMERA
source "drivers/media/platform/msm/dvb/Kconfig"
source "drivers/media/platform/msm/broadcast/Kconfig"
source "drivers/media/platform/msm/sde/Kconfig"
+1 −0
Original line number Diff line number Diff line
@@ -6,3 +6,4 @@ obj-$(CONFIG_MSM_VIDC_V4L2) += vidc/
obj-y += broadcast/
obj-$(CONFIG_DVB_MPQ) += dvb/
obj-$(CONFIG_MSMB_CAMERA) += camera_v2/
obj-y += sde/
 No newline at end of file
+8 −0
Original line number Diff line number Diff line
config MSM_SDE_ROTATOR
	bool "QTI V4L2 based SDE Rotator"
	depends on ARCH_MSM && VIDEO_V4L2
	select V4L2_MEM2MEM_DEV
	select VIDEOBUF2_CORE
	select SW_SYNC if SYNC
	---help---
	  Enable support of V4L2 rotator driver.
 No newline at end of file
Loading