Skip to content

Commit

Permalink
drm/xe/eustall: Add support to init, enable and disable EU stall samp…
Browse files Browse the repository at this point in the history
…ling

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
  • Loading branch information
Harish Chegondi authored and Ashutosh Dixit committed Feb 26, 2025
1 parent 1537ec8 commit 9a0b11d
Show file tree
Hide file tree
Showing 5 changed files with 409 additions and 7 deletions.
29 changes: 29 additions & 0 deletions drivers/gpu/drm/xe/regs/xe_eu_stall_regs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2025 Intel Corporation
*/

#ifndef _XE_EU_STALL_REGS_H_
#define _XE_EU_STALL_REGS_H_

#include "regs/xe_reg_defs.h"

#define XEHPC_EUSTALL_BASE XE_REG_MCR(0xe520)
#define XEHPC_EUSTALL_BASE_BUF_ADDR REG_GENMASK(31, 6)
#define XEHPC_EUSTALL_BASE_XECORE_BUF_SZ REG_GENMASK(5, 3)
#define XEHPC_EUSTALL_BASE_ENABLE_SAMPLING REG_BIT(1)

#define XEHPC_EUSTALL_BASE_UPPER XE_REG_MCR(0xe524)

#define XEHPC_EUSTALL_REPORT XE_REG_MCR(0xe528, XE_REG_OPTION_MASKED)
#define XEHPC_EUSTALL_REPORT_WRITE_PTR_MASK REG_GENMASK(15, 2)
#define XEHPC_EUSTALL_REPORT_OVERFLOW_DROP REG_BIT(1)

#define XEHPC_EUSTALL_REPORT1 XE_REG_MCR(0xe52c, XE_REG_OPTION_MASKED)
#define XEHPC_EUSTALL_REPORT1_READ_PTR_MASK REG_GENMASK(15, 2)

#define XEHPC_EUSTALL_CTRL XE_REG_MCR(0xe53c, XE_REG_OPTION_MASKED)
#define EUSTALL_MOCS REG_GENMASK(9, 3)
#define EUSTALL_SAMPLE_RATE REG_GENMASK(2, 0)

#endif
Loading

0 comments on commit 9a0b11d

Please sign in to comment.