Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/vc4: hvs: Reset muxes at probe time

By default, the HVS driver will force the HVS output 3 to be muxed to
the HVS channel 2. However, the Transposer can only be assigned to the
HVS channel 2, so whenever we try to use the writeback connector, we'll
mux its associated output (Output 2) to the channel 2.

This leads to both the output 2 and 3 feeding from the same channel,
which is explicitly discouraged in the documentation.

In order to avoid this, let's reset all the output muxes to their reset
value.

Fixes: 87ebcd42fb7b ("drm/vc4: crtc: Assign output to channel automatically")
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/r/20220328153659.2382206-2-maxime@cerno.tech

+21 -5
+21 -5
drivers/gpu/drm/vc4/vc4_hvs.c
··· 611 611 struct vc4_hvs *hvs = NULL; 612 612 int ret; 613 613 u32 dispctrl; 614 + u32 reg; 614 615 615 616 hvs = devm_kzalloc(&pdev->dev, sizeof(*hvs), GFP_KERNEL); 616 617 if (!hvs) ··· 683 682 684 683 vc4->hvs = hvs; 685 684 685 + reg = HVS_READ(SCALER_DISPECTRL); 686 + reg &= ~SCALER_DISPECTRL_DSP2_MUX_MASK; 687 + HVS_WRITE(SCALER_DISPECTRL, 688 + reg | VC4_SET_FIELD(0, SCALER_DISPECTRL_DSP2_MUX)); 689 + 690 + reg = HVS_READ(SCALER_DISPCTRL); 691 + reg &= ~SCALER_DISPCTRL_DSP3_MUX_MASK; 692 + HVS_WRITE(SCALER_DISPCTRL, 693 + reg | VC4_SET_FIELD(3, SCALER_DISPCTRL_DSP3_MUX)); 694 + 695 + reg = HVS_READ(SCALER_DISPEOLN); 696 + reg &= ~SCALER_DISPEOLN_DSP4_MUX_MASK; 697 + HVS_WRITE(SCALER_DISPEOLN, 698 + reg | VC4_SET_FIELD(3, SCALER_DISPEOLN_DSP4_MUX)); 699 + 700 + reg = HVS_READ(SCALER_DISPDITHER); 701 + reg &= ~SCALER_DISPDITHER_DSP5_MUX_MASK; 702 + HVS_WRITE(SCALER_DISPDITHER, 703 + reg | VC4_SET_FIELD(3, SCALER_DISPDITHER_DSP5_MUX)); 704 + 686 705 dispctrl = HVS_READ(SCALER_DISPCTRL); 687 706 688 707 dispctrl |= SCALER_DISPCTRL_ENABLE; ··· 710 689 SCALER_DISPCTRL_DISPEIRQ(1) | 711 690 SCALER_DISPCTRL_DISPEIRQ(2); 712 691 713 - /* Set DSP3 (PV1) to use HVS channel 2, which would otherwise 714 - * be unused. 715 - */ 716 - dispctrl &= ~SCALER_DISPCTRL_DSP3_MUX_MASK; 717 692 dispctrl &= ~(SCALER_DISPCTRL_DMAEIRQ | 718 693 SCALER_DISPCTRL_SLVWREIRQ | 719 694 SCALER_DISPCTRL_SLVRDEIRQ | ··· 723 706 SCALER_DISPCTRL_DSPEISLUR(1) | 724 707 SCALER_DISPCTRL_DSPEISLUR(2) | 725 708 SCALER_DISPCTRL_SCLEIRQ); 726 - dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_DSP3_MUX); 727 709 728 710 HVS_WRITE(SCALER_DISPCTRL, dispctrl); 729 711