static const struct vop_common rk3399_common = {
.standby = VOP_REG_SYNC(RK3399_SYS_CTRL, 0x1, 22),
.gate_en = VOP_REG(RK3399_SYS_CTRL, 0x1, 23),
.mmu_en = VOP_REG(RK3399_SYS_CTRL, 0x1, 20),
.dither_down_sel = VOP_REG(RK3399_DSP_CTRL1, 0x1, 4),
.dither_down_mode = VOP_REG(RK3399_DSP_CTRL1, 0x1, 3),
.dither_down_en = VOP_REG(RK3399_DSP_CTRL1, 0x1, 2),
.pre_dither_down = VOP_REG(RK3399_DSP_CTRL1, 0x1, 1),
.dither_up = VOP_REG(RK3399_DSP_CTRL1, 0x1, 6),
.dsp_lut_en = VOP_REG(RK3399_DSP_CTRL1, 0x1, 0),
.update_gamma_lut = VOP_REG(RK3399_DSP_CTRL1, 0x1, 7),
.lut_buffer_index = VOP_REG(RK3399_DBG_POST_REG1, 0x1, 1),
.data_blank = VOP_REG(RK3399_DSP_CTRL0, 0x1, 19),
.dsp_blank = VOP_REG(RK3399_DSP_CTRL0, 0x3, 18),
.out_mode = VOP_REG(RK3399_DSP_CTRL0, 0xf, 0),
.cfg_done = VOP_REG_SYNC(RK3399_REG_CFG_DONE, 0x1, 0),
};
well the manual says you have but i see no where to be set in the linux driver. for vop2 there is no such thing. so i really don't knowOh, so i have to tell the vop to use mmu?
Ok, so I think i incorporated your drm changes correctly. It works without the iommu loaded, with it, I see the two planes and can move the cursor plane within running X11, but the video is garbage. I wonder if it is some caching is involed or if the memory simply stays garbage. Any ideas how to debug this? (I modified to only use vop little for now)well the manual says you have but i see no where to be set in the linux driver. for vop2 there is no such thing. so i really don't know
no, I still suspect some aclk_vop frequeny or mix on my rk3399 dtb... I reincluded vop2 and hdmi acts up...is the image displaying correctly before X starts ? (the vt console) ?
The iommu uses the clock of vop big and sets it to double speed which destroys the hdmi output even with iommu not using the iommu allocator... So double trouble. I wonder if the iommu can work at the lower freq... so perhaps the original efi rk_cru.c freq fix is correct..this looks to me like the iommu is not working.
you can change vop's memory start address from userland with a tool like devmem2. if iommu is working you should get read faults. if it's not it should just change the onscreen garbage
Well as far as I can tell from rk3399-base.dtsi the "aclk" in the iommu driver is the same as the aclk of the vop.. so my theory is that when iommu enables the clk the freq is taken from cru which is the double speed of what the vop should run atwhat board do you have ? Im looking at the pine64 dtb and the vop-lit and vop-big have diff iommus. also iommu code does not set any clock freq.
the vop lit/big set the clocks they have in common to the iommu. the dclk which is the pixel clock is not common
vopb_mmu: iommu@ff903f00 {
compatible = "rockchip,iommu";
reg = <0x0 0xff903f00 0x0 0x100>;
interrupts = <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH 0>;
clocks = <&cru ACLK_VOP0>, <&cru HCLK_VOP0>;
clock-names = "aclk", "iface";
power-domains = <&power RK3399_PD_VOPB>;
#iommu-cells = <0>;
status = "disabled";
};