Commit 90a8b23f authored by Ashutosh Dixit's avatar Ashutosh Dixit Committed by Rodrigo Vivi

drm/xe/pmu: Remove PMU from Xe till uapi is finalized

PMU uapi is likely to change in the future. Till the uapi is finalized,
remove PMU from Xe. PMU can be re-added after uapi is finalized.

v2: Include xe_drm.h in xe/tests/xe_dma_buf.c (Francois)
Signed-off-by: default avatarAshutosh Dixit <ashutosh.dixit@intel.com>
Acked-by: default avatarAravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
Acked-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Acked-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Acked-by: default avatarMateusz Naklicki <mateusz.naklicki@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 9d329b4c
...@@ -276,8 +276,6 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \ ...@@ -276,8 +276,6 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
i915-display/skl_universal_plane.o \ i915-display/skl_universal_plane.o \
i915-display/skl_watermark.o i915-display/skl_watermark.o
xe-$(CONFIG_PERF_EVENTS) += xe_pmu.o
ifeq ($(CONFIG_ACPI),y) ifeq ($(CONFIG_ACPI),y)
xe-$(CONFIG_DRM_XE_DISPLAY) += \ xe-$(CONFIG_DRM_XE_DISPLAY) += \
i915-display/intel_acpi.o \ i915-display/intel_acpi.o \
......
...@@ -316,11 +316,6 @@ ...@@ -316,11 +316,6 @@
#define INVALIDATION_BROADCAST_MODE_DIS REG_BIT(12) #define INVALIDATION_BROADCAST_MODE_DIS REG_BIT(12)
#define GLOBAL_INVALIDATION_MODE REG_BIT(2) #define GLOBAL_INVALIDATION_MODE REG_BIT(2)
#define XE_OAG_RC0_ANY_ENGINE_BUSY_FREE XE_REG(0xdb80)
#define XE_OAG_ANY_MEDIA_FF_BUSY_FREE XE_REG(0xdba0)
#define XE_OAG_BLT_BUSY_FREE XE_REG(0xdbbc)
#define XE_OAG_RENDER_BUSY_FREE XE_REG(0xdbdc)
#define HALF_SLICE_CHICKEN5 XE_REG_MCR(0xe188, XE_REG_OPTION_MASKED) #define HALF_SLICE_CHICKEN5 XE_REG_MCR(0xe188, XE_REG_OPTION_MASKED)
#define DISABLE_SAMPLE_G_PERFORMANCE REG_BIT(0) #define DISABLE_SAMPLE_G_PERFORMANCE REG_BIT(0)
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
* Copyright © 2022 Intel Corporation * Copyright © 2022 Intel Corporation
*/ */
#include <drm/xe_drm.h>
#include <kunit/test.h> #include <kunit/test.h>
#include <kunit/visibility.h> #include <kunit/visibility.h>
......
...@@ -529,8 +529,6 @@ int xe_device_probe(struct xe_device *xe) ...@@ -529,8 +529,6 @@ int xe_device_probe(struct xe_device *xe)
xe_debugfs_register(xe); xe_debugfs_register(xe);
xe_pmu_register(&xe->pmu);
xe_hwmon_register(xe); xe_hwmon_register(xe);
err = drmm_add_action_or_reset(&xe->drm, xe_device_sanitize, xe); err = drmm_add_action_or_reset(&xe->drm, xe_device_sanitize, xe);
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "xe_lmtt_types.h" #include "xe_lmtt_types.h"
#include "xe_platform_types.h" #include "xe_platform_types.h"
#include "xe_pt_types.h" #include "xe_pt_types.h"
#include "xe_pmu.h"
#include "xe_sriov_types.h" #include "xe_sriov_types.h"
#include "xe_step_types.h" #include "xe_step_types.h"
...@@ -427,9 +426,6 @@ struct xe_device { ...@@ -427,9 +426,6 @@ struct xe_device {
*/ */
struct task_struct *pm_callback_task; struct task_struct *pm_callback_task;
/** @pmu: performance monitoring unit */
struct xe_pmu pmu;
/** @hwmon: hwmon subsystem integration */ /** @hwmon: hwmon subsystem integration */
struct xe_hwmon *hwmon; struct xe_hwmon *hwmon;
......
...@@ -709,8 +709,6 @@ int xe_gt_suspend(struct xe_gt *gt) ...@@ -709,8 +709,6 @@ int xe_gt_suspend(struct xe_gt *gt)
if (err) if (err)
goto err_msg; goto err_msg;
xe_pmu_suspend(gt);
err = xe_uc_suspend(&gt->uc); err = xe_uc_suspend(&gt->uc);
if (err) if (err)
goto err_force_wake; goto err_force_wake;
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "xe_drv.h" #include "xe_drv.h"
#include "xe_hw_fence.h" #include "xe_hw_fence.h"
#include "xe_pci.h" #include "xe_pci.h"
#include "xe_pmu.h"
#include "xe_sched_job.h" #include "xe_sched_job.h"
struct xe_modparam xe_modparam = { struct xe_modparam xe_modparam = {
...@@ -63,10 +62,6 @@ static const struct init_funcs init_funcs[] = { ...@@ -63,10 +62,6 @@ static const struct init_funcs init_funcs[] = {
.init = xe_sched_job_module_init, .init = xe_sched_job_module_init,
.exit = xe_sched_job_module_exit, .exit = xe_sched_job_module_exit,
}, },
{
.init = xe_pmu_init,
.exit = xe_pmu_exit,
},
{ {
.init = xe_register_pci_driver, .init = xe_register_pci_driver,
.exit = xe_unregister_pci_driver, .exit = xe_unregister_pci_driver,
......
This diff is collapsed.
/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2023 Intel Corporation
*/
#ifndef _XE_PMU_H_
#define _XE_PMU_H_
#include "xe_gt_types.h"
#include "xe_pmu_types.h"
#if IS_ENABLED(CONFIG_PERF_EVENTS)
int xe_pmu_init(void);
void xe_pmu_exit(void);
void xe_pmu_register(struct xe_pmu *pmu);
void xe_pmu_suspend(struct xe_gt *gt);
#else
static inline int xe_pmu_init(void) { return 0; }
static inline void xe_pmu_exit(void) {}
static inline void xe_pmu_register(struct xe_pmu *pmu) {}
static inline void xe_pmu_suspend(struct xe_gt *gt) {}
#endif
#endif
/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2023 Intel Corporation
*/
#ifndef _XE_PMU_TYPES_H_
#define _XE_PMU_TYPES_H_
#include <linux/perf_event.h>
#include <linux/spinlock_types.h>
#include <uapi/drm/xe_drm.h>
enum {
__XE_SAMPLE_RENDER_GROUP_BUSY,
__XE_SAMPLE_COPY_GROUP_BUSY,
__XE_SAMPLE_MEDIA_GROUP_BUSY,
__XE_SAMPLE_ANY_ENGINE_GROUP_BUSY,
__XE_NUM_PMU_SAMPLERS
};
#define XE_PMU_MAX_GT 2
struct xe_pmu {
/**
* @cpuhp: Struct used for CPU hotplug handling.
*/
struct {
struct hlist_node node;
unsigned int cpu;
} cpuhp;
/**
* @base: PMU base.
*/
struct pmu base;
/**
* @closed: xe is unregistering.
*/
bool closed;
/**
* @name: Name as registered with perf core.
*/
const char *name;
/**
* @lock: Lock protecting enable mask and ref count handling.
*/
spinlock_t lock;
/**
* @sample: Current and previous (raw) counters.
*
* These counters are updated when the device is awake.
*
*/
u64 sample[XE_PMU_MAX_GT][__XE_NUM_PMU_SAMPLERS];
/**
* @events_attr_group: Device events attribute group.
*/
struct attribute_group events_attr_group;
/**
* @xe_attr: Memory block holding device attributes.
*/
void *xe_attr;
/**
* @pmu_attr: Memory block holding device attributes.
*/
void *pmu_attr;
};
#endif
...@@ -1074,46 +1074,6 @@ struct drm_xe_wait_user_fence { ...@@ -1074,46 +1074,6 @@ struct drm_xe_wait_user_fence {
/** @reserved: Reserved */ /** @reserved: Reserved */
__u64 reserved[2]; __u64 reserved[2];
}; };
/**
* DOC: XE PMU event config IDs
*
* Check 'man perf_event_open' to use the ID's DRM_XE_PMU_XXXX listed in xe_drm.h
* in 'struct perf_event_attr' as part of perf_event_open syscall to read a
* particular event.
*
* For example to open the DRMXE_PMU_RENDER_GROUP_BUSY(0):
*
* .. code-block:: C
*
* struct perf_event_attr attr;
* long long count;
* int cpu = 0;
* int fd;
*
* memset(&attr, 0, sizeof(struct perf_event_attr));
* attr.type = type; // eg: /sys/bus/event_source/devices/xe_0000_56_00.0/type
* attr.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED;
* attr.use_clockid = 1;
* attr.clockid = CLOCK_MONOTONIC;
* attr.config = DRM_XE_PMU_RENDER_GROUP_BUSY(0);
*
* fd = syscall(__NR_perf_event_open, &attr, -1, cpu, -1, 0);
*/
/*
* Top bits of every counter are GT id.
*/
#define __DRM_XE_PMU_GT_SHIFT (56)
#define ___DRM_XE_PMU_OTHER(gt, x) \
(((__u64)(x)) | ((__u64)(gt) << __DRM_XE_PMU_GT_SHIFT))
#define DRM_XE_PMU_RENDER_GROUP_BUSY(gt) ___DRM_XE_PMU_OTHER(gt, 0)
#define DRM_XE_PMU_COPY_GROUP_BUSY(gt) ___DRM_XE_PMU_OTHER(gt, 1)
#define DRM_XE_PMU_MEDIA_GROUP_BUSY(gt) ___DRM_XE_PMU_OTHER(gt, 2)
#define DRM_XE_PMU_ANY_ENGINE_GROUP_BUSY(gt) ___DRM_XE_PMU_OTHER(gt, 3)
#if defined(__cplusplus) #if defined(__cplusplus)
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment