mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
clangd reports many "unused header" warnings throughout the Xe driver. Start working to clean this up by removing unnecessary includes in our .c files and/or replacing them with explicit includes of other headers that were previously being included indirectly. By far the most common offender here was unnecessary inclusion of xe_gt.h. That likely originates from the early days of xe.ko when xe_mmio did not exist and all register accesses, including those unrelated to GTs, were done with GT functions. There's still a lot of additional #include cleanup that can be done in the headers themselves; that will come as a followup series. v2: - Squash the 79-patch series down to a single patch. (MattB) Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260115032803.4067824-2-matthew.d.roper@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
70 lines
1.4 KiB
C
70 lines
1.4 KiB
C
// SPDX-License-Identifier: MIT
|
|
/*
|
|
* Copyright © 2022 Intel Corporation
|
|
*/
|
|
|
|
#include "xe_huc_debugfs.h"
|
|
|
|
#include <drm/drm_debugfs.h>
|
|
#include <drm/drm_managed.h>
|
|
#include <drm/drm_print.h>
|
|
|
|
#include "xe_gt_types.h"
|
|
#include "xe_huc.h"
|
|
#include "xe_pm.h"
|
|
|
|
static struct xe_gt *
|
|
huc_to_gt(struct xe_huc *huc)
|
|
{
|
|
return container_of(huc, struct xe_gt, uc.huc);
|
|
}
|
|
|
|
static struct xe_device *
|
|
huc_to_xe(struct xe_huc *huc)
|
|
{
|
|
return gt_to_xe(huc_to_gt(huc));
|
|
}
|
|
|
|
static struct xe_huc *node_to_huc(struct drm_info_node *node)
|
|
{
|
|
return node->info_ent->data;
|
|
}
|
|
|
|
static int huc_info(struct seq_file *m, void *data)
|
|
{
|
|
struct xe_huc *huc = node_to_huc(m->private);
|
|
struct xe_device *xe = huc_to_xe(huc);
|
|
struct drm_printer p = drm_seq_file_printer(m);
|
|
|
|
guard(xe_pm_runtime)(xe);
|
|
xe_huc_print_info(huc, &p);
|
|
|
|
return 0;
|
|
}
|
|
|
|
static const struct drm_info_list debugfs_list[] = {
|
|
{"huc_info", huc_info, 0},
|
|
};
|
|
|
|
void xe_huc_debugfs_register(struct xe_huc *huc, struct dentry *parent)
|
|
{
|
|
struct drm_minor *minor = huc_to_xe(huc)->drm.primary;
|
|
struct drm_info_list *local;
|
|
int i;
|
|
|
|
#define DEBUGFS_SIZE (ARRAY_SIZE(debugfs_list) * sizeof(struct drm_info_list))
|
|
local = drmm_kmalloc(&huc_to_xe(huc)->drm, DEBUGFS_SIZE, GFP_KERNEL);
|
|
if (!local)
|
|
return;
|
|
|
|
memcpy(local, debugfs_list, DEBUGFS_SIZE);
|
|
#undef DEBUGFS_SIZE
|
|
|
|
for (i = 0; i < ARRAY_SIZE(debugfs_list); ++i)
|
|
local[i].data = huc;
|
|
|
|
drm_debugfs_create_files(local,
|
|
ARRAY_SIZE(debugfs_list),
|
|
parent, minor);
|
|
}
|