From: jsg Date: Mon, 5 Sep 2022 14:22:58 +0000 (+0000) Subject: drm/amd/display: avoid doing vm_init multiple time X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9e61ec965a34e63e180a8b13289ba4d4a03305c5;p=openbsd drm/amd/display: avoid doing vm_init multiple time From Charlene Liu 85dd24ff77c15f5fc0e16bc3f288f5d1ac93e02b in linux 5.15.y/5.15.65 5544a7b5a07480192eb5fd3536462faed2c21528 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/display/dc/dcn21/dcn21_hubbub.c b/sys/dev/pci/drm/amd/display/dc/dcn21/dcn21_hubbub.c index 36044cb8ec8..1c0f56d8ba8 100644 --- a/sys/dev/pci/drm/amd/display/dc/dcn21/dcn21_hubbub.c +++ b/sys/dev/pci/drm/amd/display/dc/dcn21/dcn21_hubbub.c @@ -67,9 +67,15 @@ static uint32_t convert_and_clamp( void dcn21_dchvm_init(struct hubbub *hubbub) { struct dcn20_hubbub *hubbub1 = TO_DCN20_HUBBUB(hubbub); - uint32_t riommu_active; + uint32_t riommu_active, prefetch_done; int i; + REG_GET(DCHVM_RIOMMU_STAT0, HOSTVM_PREFETCH_DONE, &prefetch_done); + + if (prefetch_done) { + hubbub->riommu_active = true; + return; + } //Init DCHVM block REG_UPDATE(DCHVM_CTRL0, HOSTVM_INIT_REQ, 1);