Lines Matching refs:xcp_cfg
523 struct amdgpu_xcp_cfg *xcp_cfg) in amdgpu_xcp_get_res_info() argument
526 return xcp_mgr->funcs->get_xcp_res_info(xcp_mgr, mode, xcp_cfg); in amdgpu_xcp_get_res_info()
535 struct amdgpu_xcp_cfg *xcp_cfg = to_xcp_cfg(kobj); in supported_xcp_configs_show() local
536 struct amdgpu_xcp_mgr *xcp_mgr = xcp_cfg->xcp_mgr; in supported_xcp_configs_show()
556 struct amdgpu_xcp_cfg *xcp_cfg = to_xcp_cfg(kobj); in supported_nps_configs_show() local
560 if (!xcp_cfg || !xcp_cfg->compatible_nps_modes) in supported_nps_configs_show()
563 for_each_inst(mode, xcp_cfg->compatible_nps_modes) { in supported_nps_configs_show()
576 struct amdgpu_xcp_cfg *xcp_cfg = to_xcp_cfg(kobj); in xcp_config_show() local
579 amdgpu_gfx_compute_mode_desc(xcp_cfg->mode)); in xcp_config_show()
586 struct amdgpu_xcp_cfg *xcp_cfg = to_xcp_cfg(kobj); in xcp_config_store() local
602 r = amdgpu_xcp_get_res_info(xcp_cfg->xcp_mgr, mode, xcp_cfg); in xcp_config_store()
607 xcp_cfg->mode = mode; in xcp_config_store()
616 struct amdgpu_xcp_cfg *xcp_cfg = to_xcp_cfg(kobj); in xcp_cfg_sysfs_release() local
618 kfree(xcp_cfg); in xcp_cfg_sysfs_release()
641 struct amdgpu_xcp_cfg *xcp_cfg; in amdgpu_xcp_cfg_sysfs_init() local
647 xcp_cfg = kzalloc(sizeof(*xcp_cfg), GFP_KERNEL); in amdgpu_xcp_cfg_sysfs_init()
648 if (!xcp_cfg) in amdgpu_xcp_cfg_sysfs_init()
650 xcp_cfg->xcp_mgr = adev->xcp_mgr; in amdgpu_xcp_cfg_sysfs_init()
652 r = kobject_init_and_add(&xcp_cfg->kobj, &xcp_cfg_sysfs_ktype, in amdgpu_xcp_cfg_sysfs_init()
657 r = sysfs_create_files(&xcp_cfg->kobj, xcp_attrs); in amdgpu_xcp_cfg_sysfs_init()
662 r = sysfs_create_file(&xcp_cfg->kobj, &supp_nps_sysfs_mode.attr); in amdgpu_xcp_cfg_sysfs_init()
664 sysfs_remove_files(&xcp_cfg->kobj, xcp_attrs); in amdgpu_xcp_cfg_sysfs_init()
669 mode = (xcp_cfg->xcp_mgr->mode == in amdgpu_xcp_cfg_sysfs_init()
672 xcp_cfg->xcp_mgr->mode; in amdgpu_xcp_cfg_sysfs_init()
673 r = amdgpu_xcp_get_res_info(xcp_cfg->xcp_mgr, mode, xcp_cfg); in amdgpu_xcp_cfg_sysfs_init()
675 sysfs_remove_file(&xcp_cfg->kobj, &supp_nps_sysfs_mode.attr); in amdgpu_xcp_cfg_sysfs_init()
676 sysfs_remove_files(&xcp_cfg->kobj, xcp_attrs); in amdgpu_xcp_cfg_sysfs_init()
680 xcp_cfg->mode = mode; in amdgpu_xcp_cfg_sysfs_init()
681 for (i = 0; i < xcp_cfg->num_res; i++) { in amdgpu_xcp_cfg_sysfs_init()
682 xcp_res = &xcp_cfg->xcp_res[i]; in amdgpu_xcp_cfg_sysfs_init()
686 &xcp_cfg->kobj, "%s", in amdgpu_xcp_cfg_sysfs_init()
692 adev->xcp_mgr->xcp_cfg = xcp_cfg; in amdgpu_xcp_cfg_sysfs_init()
696 xcp_res = &xcp_cfg->xcp_res[i]; in amdgpu_xcp_cfg_sysfs_init()
700 sysfs_remove_file(&xcp_cfg->kobj, &supp_nps_sysfs_mode.attr); in amdgpu_xcp_cfg_sysfs_init()
701 sysfs_remove_files(&xcp_cfg->kobj, xcp_attrs); in amdgpu_xcp_cfg_sysfs_init()
703 kobject_put(&xcp_cfg->kobj); in amdgpu_xcp_cfg_sysfs_init()
709 struct amdgpu_xcp_cfg *xcp_cfg; in amdgpu_xcp_cfg_sysfs_fini() local
715 xcp_cfg = adev->xcp_mgr->xcp_cfg; in amdgpu_xcp_cfg_sysfs_fini()
716 for (i = 0; i < xcp_cfg->num_res; i++) { in amdgpu_xcp_cfg_sysfs_fini()
717 xcp_res = &xcp_cfg->xcp_res[i]; in amdgpu_xcp_cfg_sysfs_fini()
721 sysfs_remove_file(&xcp_cfg->kobj, &supp_nps_sysfs_mode.attr); in amdgpu_xcp_cfg_sysfs_fini()
722 sysfs_remove_files(&xcp_cfg->kobj, xcp_attrs); in amdgpu_xcp_cfg_sysfs_fini()
723 kobject_put(&xcp_cfg->kobj); in amdgpu_xcp_cfg_sysfs_fini()