drivers/gpu/drm/xe/xe_tile_sysfs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_tile_sysfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_tile_sysfs.c- Extension
.c- Size
- 1170 bytes
- Lines
- 62
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kobject.hlinux/sysfs.hdrm/drm_managed.hxe_device_types.hxe_pm.hxe_tile_sysfs.hxe_vram_freq.h
Detected Declarations
function xe_tile_sysfs_kobj_releasefunction tile_sysfs_finifunction xe_tile_sysfs_init
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2023 Intel Corporation
*/
#include <linux/kobject.h>
#include <linux/sysfs.h>
#include <drm/drm_managed.h>
#include "xe_device_types.h"
#include "xe_pm.h"
#include "xe_tile_sysfs.h"
#include "xe_vram_freq.h"
static void xe_tile_sysfs_kobj_release(struct kobject *kobj)
{
kfree(kobj);
}
static const struct kobj_type xe_tile_sysfs_kobj_type = {
.release = xe_tile_sysfs_kobj_release,
.sysfs_ops = &kobj_sysfs_ops,
};
static void tile_sysfs_fini(void *arg)
{
struct xe_tile *tile = arg;
kobject_put(tile->sysfs);
}
int xe_tile_sysfs_init(struct xe_tile *tile)
{
struct xe_device *xe = tile_to_xe(tile);
struct device *dev = xe->drm.dev;
struct kobj_tile *kt;
int err;
kt = kzalloc_obj(*kt);
if (!kt)
return -ENOMEM;
kobject_init(&kt->base, &xe_tile_sysfs_kobj_type);
kt->tile = tile;
err = kobject_add(&kt->base, &dev->kobj, "tile%d", tile->id);
if (err)
goto err_object;
tile->sysfs = &kt->base;
err = xe_vram_freq_sysfs_init(tile);
if (err)
goto err_object;
return devm_add_action_or_reset(xe->drm.dev, tile_sysfs_fini, tile);
err_object:
kobject_put(&kt->base);
return err;
}
Annotation
- Immediate include surface: `linux/kobject.h`, `linux/sysfs.h`, `drm/drm_managed.h`, `xe_device_types.h`, `xe_pm.h`, `xe_tile_sysfs.h`, `xe_vram_freq.h`.
- Detected declarations: `function xe_tile_sysfs_kobj_release`, `function tile_sysfs_fini`, `function xe_tile_sysfs_init`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.