Skip to content

Commit c68b874

Browse files
6by9gregkh
authored andcommitted
drm/vc4: hvs: Correct logic on stopping an HVS channel
[ Upstream commit 7ab6512 ] When factoring out __vc4_hvs_stop_channel, the logic got inverted from if (condition) // stop channel to if (condition) goto out //stop channel out: and also changed the exact register writes used to stop the channel. Correct the logic so that the channel is actually stopped, and revert to the original register writes. Fixes: 6d01a10 ("drm/vc4: crtc: Move HVS init and close to a function") Reviewed-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Dave Stevenson <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent e9e836d commit c68b874

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/gpu/drm/vc4/vc4_hvs.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -420,13 +420,11 @@ void vc4_hvs_stop_channel(struct vc4_hvs *hvs, unsigned int chan)
420420
if (!drm_dev_enter(drm, &idx))
421421
return;
422422

423-
if (HVS_READ(SCALER_DISPCTRLX(chan)) & SCALER_DISPCTRLX_ENABLE)
423+
if (!(HVS_READ(SCALER_DISPCTRLX(chan)) & SCALER_DISPCTRLX_ENABLE))
424424
goto out;
425425

426-
HVS_WRITE(SCALER_DISPCTRLX(chan),
427-
HVS_READ(SCALER_DISPCTRLX(chan)) | SCALER_DISPCTRLX_RESET);
428-
HVS_WRITE(SCALER_DISPCTRLX(chan),
429-
HVS_READ(SCALER_DISPCTRLX(chan)) & ~SCALER_DISPCTRLX_ENABLE);
426+
HVS_WRITE(SCALER_DISPCTRLX(chan), SCALER_DISPCTRLX_RESET);
427+
HVS_WRITE(SCALER_DISPCTRLX(chan), 0);
430428

431429
/* Once we leave, the scaler should be disabled and its fifo empty. */
432430
WARN_ON_ONCE(HVS_READ(SCALER_DISPCTRLX(chan)) & SCALER_DISPCTRLX_RESET);

0 commit comments

Comments
 (0)