mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
APIs to set preemption modes right now have config based code to set default preemption modes or to check if given preemption mode is valid or not. This makes code unreadable and complex. Rework nvgpu_gr_obj_ctx_init_ctxsw_preemption_mode() so that it checks for initial preemption modes in the beginning. If no preemption mode is passed while allocating context, get default preemption modes with gops.gr.init.get_default_preemption_modes() and use them. Rework nvgpu_gr_ctx_check_valid_preemption_mode() so that it is more readable. Use gops.gr.init.get_supported_preemption_modes() to validate incoming preemption modes against supported preemption modes. Log preemption modes getting set in nvgpu_gr_obj_ctx_set_ctxsw_preemption_mode(). Disable failing unit test. It will need rework according to new code. Jira NVGPU-5648 Change-Id: Ie1a3e1aeae7826a123e104d9d016f181bea3b271 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2419034 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Lakshmanan M <lm@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit