summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_guc_pc.c
diff options
context:
space:
mode:
authorVinay Belgaumkar <vinay.belgaumkar@intel.com>2023-11-18 03:14:49 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:45:08 +0300
commit975e4a3795d4f1373be538177525c0b714e0e65e (patch)
tree3c90febd24b445e133e8d6d4cdd465b1ceebea4c /drivers/gpu/drm/xe/xe_guc_pc.c
parentf1cb5f647e8959a1034941d85b311d7485a7095f (diff)
downloadlinux-975e4a3795d4f1373be538177525c0b714e0e65e.tar.xz
drm/xe: Manually setup C6 when skip_guc_pc is set
Skip the init/start/stop GuC PC functions and toggle C6 using register writes instead. Also request max possible frequency as dynamic freq management is disabled. v2: Fix compile warning Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_guc_pc.c')
-rw-r--r--drivers/gpu/drm/xe/xe_guc_pc.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
index 2919c6aea403..1943893a3fd7 100644
--- a/drivers/gpu/drm/xe/xe_guc_pc.c
+++ b/drivers/gpu/drm/xe/xe_guc_pc.c
@@ -16,6 +16,7 @@
#include "xe_bo.h"
#include "xe_device.h"
#include "xe_gt.h"
+#include "xe_gt_idle.h"
#include "xe_gt_sysfs.h"
#include "xe_gt_types.h"
#include "xe_guc_ct.h"
@@ -869,13 +870,24 @@ int xe_guc_pc_start(struct xe_guc_pc *pc)
xe_device_mem_access_get(pc_to_xe(pc));
- memset(pc->bo->vmap.vaddr, 0, size);
- slpc_shared_data_write(pc, header.size, size);
-
ret = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
if (ret)
goto out_fail_force_wake;
+ if (xe->info.skip_guc_pc) {
+ if (xe->info.platform != XE_PVC)
+ xe_gt_idle_enable_c6(gt);
+
+ /* Request max possible since dynamic freq mgmt is not enabled */
+ pc_set_cur_freq(pc, UINT_MAX);
+
+ ret = 0;
+ goto out;
+ }
+
+ memset(pc->bo->vmap.vaddr, 0, size);
+ slpc_shared_data_write(pc, header.size, size);
+
ret = pc_action_reset(pc);
if (ret)
goto out;
@@ -911,10 +923,17 @@ out_fail_force_wake:
*/
int xe_guc_pc_stop(struct xe_guc_pc *pc)
{
+ struct xe_device *xe = pc_to_xe(pc);
int ret;
xe_device_mem_access_get(pc_to_xe(pc));
+ if (xe->info.skip_guc_pc) {
+ xe_gt_idle_disable_c6(pc_to_gt(pc));
+ ret = 0;
+ goto out;
+ }
+
mutex_lock(&pc->freq_lock);
pc->freq_ready = false;
mutex_unlock(&pc->freq_lock);
@@ -935,6 +954,13 @@ out:
void xe_guc_pc_fini(struct xe_guc_pc *pc)
{
+ struct xe_device *xe = pc_to_xe(pc);
+
+ if (xe->info.skip_guc_pc) {
+ xe_gt_idle_disable_c6(pc_to_gt(pc));
+ return;
+ }
+
XE_WARN_ON(xe_guc_pc_gucrc_disable(pc));
XE_WARN_ON(xe_guc_pc_stop(pc));
sysfs_remove_files(pc_to_gt(pc)->sysfs, pc_attrs);
@@ -955,6 +981,9 @@ int xe_guc_pc_init(struct xe_guc_pc *pc)
u32 size = PAGE_ALIGN(sizeof(struct slpc_shared_data));
int err;
+ if (xe->info.skip_guc_pc)
+ return 0;
+
mutex_init(&pc->freq_lock);
bo = xe_bo_create_pin_map(xe, tile, NULL, size,