Commit 293a5548 authored by Daniele Ceraolo Spurio's avatar Daniele Ceraolo Spurio Committed by Chris Wilson
Browse files

drm/i915/uc: Move uC debugfs to its own folder under GT



uC is a component of the GT, so it makes sense for the uC debugfs files
to be in the GT folder. A subfolder has been used to keep the same
structure we have for the code.

v2: use intel_* prefix (Jani), rebase on new gt_debugfs_register_files,
    fix permissions for writable debugfs files.

v3: Rename files (Michal), remove blank line (Jani), fix sparse warns.

Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Andi Shyti <andi.shyti@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Tony Ye <tony.ye@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Reviewed-by: Andi Shyti <andi.shyti@intel.com> #v2
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200326181121.16869-6-daniele.ceraolospurio@intel.com
parent 34904bd6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -167,14 +167,18 @@ i915-y += \

# general-purpose microcontroller (GuC) support
i915-y += gt/uc/intel_uc.o \
	  gt/uc/intel_uc_debugfs.o \
	  gt/uc/intel_uc_fw.o \
	  gt/uc/intel_guc.o \
	  gt/uc/intel_guc_ads.o \
	  gt/uc/intel_guc_ct.o \
	  gt/uc/intel_guc_debugfs.o \
	  gt/uc/intel_guc_fw.o \
	  gt/uc/intel_guc_log.o \
	  gt/uc/intel_guc_log_debugfs.o \
	  gt/uc/intel_guc_submission.o \
	  gt/uc/intel_huc.o \
	  gt/uc/intel_huc_debugfs.o \
	  gt/uc/intel_huc_fw.o

# modesetting core code
+5 −1
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
#include "debugfs_engines.h"
#include "debugfs_gt.h"
#include "debugfs_gt_pm.h"
#include "uc/intel_uc_debugfs.h"
#include "i915_drv.h"

void debugfs_gt_register(struct intel_gt *gt)
@@ -24,6 +25,8 @@ void debugfs_gt_register(struct intel_gt *gt)

	debugfs_engines_register(gt, root);
	debugfs_gt_pm_register(gt, root);

	intel_uc_debugfs_register(&gt->uc, root);
}

void intel_gt_debugfs_register_files(struct dentry *root,
@@ -31,9 +34,10 @@ void intel_gt_debugfs_register_files(struct dentry *root,
				     unsigned long count, void *data)
{
	while (count--) {
		umode_t mode = files->fops->write ? 0644 : 0444;
		if (!files->eval || files->eval(data))
			debugfs_create_file(files->name,
					    0444, root, data,
					    mode, root, data,
					    files->fops);

		files++;
+5 −0
Original line number Diff line number Diff line
@@ -74,6 +74,11 @@ struct intel_guc {
	struct mutex send_mutex;
};

static inline struct intel_guc *log_to_guc(struct intel_guc_log *log)
{
	return container_of(log, struct intel_guc, log);
}

static
inline int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len)
{
+42 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: MIT
/*
 * Copyright © 2020 Intel Corporation
 */

#include <drm/drm_print.h>

#include "gt/debugfs_gt.h"
#include "intel_guc.h"
#include "intel_guc_debugfs.h"
#include "intel_guc_log_debugfs.h"

static int guc_info_show(struct seq_file *m, void *data)
{
	struct intel_guc *guc = m->private;
	struct drm_printer p = drm_seq_file_printer(m);

	if (!intel_guc_is_supported(guc))
		return -ENODEV;

	intel_guc_load_status(guc, &p);
	drm_puts(&p, "\n");
	intel_guc_log_info(&guc->log, &p);

	/* Add more as required ... */

	return 0;
}
DEFINE_GT_DEBUGFS_ATTRIBUTE(guc_info);

void intel_guc_debugfs_register(struct intel_guc *guc, struct dentry *root)
{
	static const struct debugfs_gt_file files[] = {
		{ "guc_info", &guc_info_fops, NULL },
	};

	if (!intel_guc_is_supported(guc))
		return;

	intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), guc);
	intel_guc_log_debugfs_register(&guc->log, root);
}
+14 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2020 Intel Corporation
 */

#ifndef DEBUGFS_GUC_H
#define DEBUGFS_GUC_H

struct intel_guc;
struct dentry;

void intel_guc_debugfs_register(struct intel_guc *guc, struct dentry *root);

#endif /* DEBUGFS_GUC_H */
Loading