drm/xe/eustall: Add support to init, enable and disable EU stall sampling
authorHarish Chegondi <harish.chegondi@intel.com>
Wed, 26 Feb 2025 01:47:07 +0000 (17:47 -0800)
committerAshutosh Dixit <ashutosh.dixit@intel.com>
Wed, 26 Feb 2025 19:30:59 +0000 (11:30 -0800)
commit9a0b11d4cf3b4324378c322b7043962e648681ed
treeb8c012ad325ec651ef40f9206e92d385179f47bd
parent1537ec85ebd7d7aa3ce1a003007cd3588cd58bda
drm/xe/eustall: Add support to init, enable and disable EU stall sampling

Implement EU stall sampling APIs introduced in the previous patch for
Xe_HPC (PVC). Add register definitions and the code that accesses these
registers to the APIs.

Add initialization and clean up functions and their implementations,
EU stall enable and disable functions.

v11: Move stream->xecore_buf alloc to xe_eu_stall_data_buf_alloc().
     Register xe_eu_stall_fini() with devm_add_action_or_reset()
     instead of calling it from xe_gt_fini().
     Changed a couple of variables in struct xe_eu_stall_data_stream
     from unsigned int to int.
v10: Fixed error rewinding code
     Moved code around as per review feedback
v9: Moved structure definitions from xe_eu_stall.h to xe_eu_stall.c
    Moved read and poll implementations to the next patch
    Used xe_bo_create_pin_map_at_aligned instead of xe_bo_create_pin_map
    Changed lock names as per review feedback
    Moved drop data handling into a subsequent patch
    Moved code around as per review feedback
v8: Updated copyright year in xe_eu_stall_regs.h to 2025.
    Renamed struct drm_xe_eu_stall_data_pvc to struct xe_eu_stall_data_pvc
    since it is a local structure.
v6: Fix buffer wrap around over write bug (Matt Olson)

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/b6aeca593d521828a0b4fbf6cfd2844716c4fc66.1740533885.git.harish.chegondi@intel.com
drivers/gpu/drm/xe/regs/xe_eu_stall_regs.h [new file with mode: 0644]
drivers/gpu/drm/xe/xe_eu_stall.c
drivers/gpu/drm/xe/xe_eu_stall.h
drivers/gpu/drm/xe/xe_gt.c
drivers/gpu/drm/xe/xe_gt_types.h