]> www.infradead.org Git - users/hch/dma-mapping.git/commit
drm/msm/a6xx+: Insert a fence wait before SMMU table update
authorRob Clark <robdclark@chromium.org>
Tue, 15 Oct 2024 22:13:34 +0000 (15:13 -0700)
committerAbhinav Kumar <quic_abhinavk@quicinc.com>
Wed, 16 Oct 2024 00:18:16 +0000 (17:18 -0700)
commit77ad507dbb7ec1ecd60fc081d03616960ef596fd
tree07447d5dfa050edcb02a3912113e4203e80d3b16
parentf87f3b80abaf7949e638dd17dfdc267066eb52d5
drm/msm/a6xx+: Insert a fence wait before SMMU table update

The CP_SMMU_TABLE_UPDATE _should_ be waiting for idle, but on some
devices (x1-85, possibly others), it seems to pass that barrier while
there are still things in the event completion FIFO waiting to be
written back to memory.

Work around that by adding a fence wait before context switch.  The
CP_EVENT_WRITE that writes the fence is the last write from a submit,
so seeing this value hit memory is a reliable indication that it is
safe to proceed with the context switch.

v2: Only emit CP_WAIT_TIMESTAMP on a7xx, as it is not supported on a6xx.
    Conversely, I've not been able to reproduce this issue on a6xx, so
    hopefully it is limited to a7xx, or perhaps just certain a7xx
    devices.

Fixes: af66706accdf ("drm/msm/a6xx: Add skeleton A7xx support")
Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/63
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
drivers/gpu/drm/msm/adreno/a6xx_gpu.c