drm/amd/display: Enable HostVM based on rIOMMU active
authorjsg <jsg@openbsd.org>
Thu, 15 Jun 2023 02:53:11 +0000 (02:53 +0000)
committerjsg <jsg@openbsd.org>
Thu, 15 Jun 2023 02:53:11 +0000 (02:53 +0000)
From Gabe Teeger
d547d499e451f1e38ad22450602122e0e73f8540 in linux-6.1.y/6.1.30
97fa4dfa66fdd52ad3d0c9fadeaaa1e87605bac7 in mainline linux

sys/dev/pci/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c

index 4f91e64..bf77e56 100644 (file)
@@ -310,6 +310,10 @@ int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *c
                                pipe->plane_state->src_rect.width < pipe->plane_state->dst_rect.width))
                        upscaled = true;
 
+               /* Apply HostVM policy - either based on hypervisor globally enabled, or rIOMMU active */
+               if (dc->debug.dml_hostvm_override == DML_HOSTVM_NO_OVERRIDE)
+                       pipes[i].pipe.src.hostvm = dc->vm_pa_config.is_hvm_enabled || dc->res_pool->hubbub->riommu_active;
+
                /*
                 * Immediate flip can be set dynamically after enabling the plane.
                 * We need to require support for immediate flip or underflow can be