drivers/gpu/drm/tegra/drm.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/tegra/drm.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/tegra/drm.h- Extension
.h- Size
- 6349 bytes
- Lines
- 215
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/host1x.hlinux/iova.hlinux/gpio/consumer.hdrm/drm_atomic.hdrm/drm_bridge.hdrm/drm_encoder.hdrm/drm_fixed.hdrm/drm_probe_helper.huapi/drm/tegra_drm.hgem.hhub.htrace.h
Detected Declarations
struct drm_fb_helperstruct drm_fb_helper_surface_sizestruct edidstruct reset_controlstruct tegra_drmstruct tegra_drm_clientstruct tegra_drm_contextstruct tegra_drm_client_opsstruct tegra_drm_clientstruct cec_notifierstruct tegra_outputfunction tegra_drm_get_streamid_offset_thifunction host1x_to_drm_client
Annotated Snippet
struct tegra_drm {
struct drm_device *drm;
struct iommu_domain *domain;
bool use_explicit_iommu;
struct mutex mm_lock;
struct drm_mm mm;
struct {
struct iova_domain domain;
unsigned long shift;
unsigned long limit;
} carveout;
struct mutex clients_lock;
struct list_head clients;
unsigned int hmask, vmask;
unsigned int pitch_align;
unsigned int num_crtcs;
struct tegra_display_hub *hub;
};
static inline struct host1x *tegra_drm_to_host1x(struct tegra_drm *tegra)
{
return dev_get_drvdata(tegra->drm->dev->parent);
}
struct tegra_drm_client;
struct tegra_drm_context {
struct tegra_drm_client *client;
struct host1x_channel *channel;
/* Only used by legacy UAPI. */
unsigned int id;
/* Only used by new UAPI. */
struct xarray mappings;
struct host1x_memory_context *memory_context;
};
struct tegra_drm_client_ops {
int (*open_channel)(struct tegra_drm_client *client,
struct tegra_drm_context *context);
void (*close_channel)(struct tegra_drm_context *context);
int (*is_addr_reg)(struct device *dev, u32 class, u32 offset);
int (*is_valid_class)(u32 class);
int (*submit)(struct tegra_drm_context *context,
struct drm_tegra_submit *args, struct drm_device *drm,
struct drm_file *file);
int (*get_streamid_offset)(struct tegra_drm_client *client, u32 *offset);
int (*can_use_memory_ctx)(struct tegra_drm_client *client, bool *supported);
};
int tegra_drm_submit(struct tegra_drm_context *context,
struct drm_tegra_submit *args, struct drm_device *drm,
struct drm_file *file);
static inline int
tegra_drm_get_streamid_offset_thi(struct tegra_drm_client *client, u32 *offset)
{
*offset = 0x30;
return 0;
}
struct tegra_drm_client {
struct host1x_client base;
struct list_head list;
struct tegra_drm *drm;
struct host1x_channel *shared_channel;
/* Set by driver */
unsigned int version;
const struct tegra_drm_client_ops *ops;
};
static inline struct tegra_drm_client *
host1x_to_drm_client(struct host1x_client *client)
{
return container_of(client, struct tegra_drm_client, base);
}
int tegra_drm_register_client(struct tegra_drm *tegra,
struct tegra_drm_client *client);
int tegra_drm_unregister_client(struct tegra_drm *tegra,
struct tegra_drm_client *client);
int host1x_client_iommu_attach(struct host1x_client *client);
Annotation
- Immediate include surface: `linux/host1x.h`, `linux/iova.h`, `linux/gpio/consumer.h`, `drm/drm_atomic.h`, `drm/drm_bridge.h`, `drm/drm_encoder.h`, `drm/drm_fixed.h`, `drm/drm_probe_helper.h`.
- Detected declarations: `struct drm_fb_helper`, `struct drm_fb_helper_surface_size`, `struct edid`, `struct reset_control`, `struct tegra_drm`, `struct tegra_drm_client`, `struct tegra_drm_context`, `struct tegra_drm_client_ops`, `struct tegra_drm_client`, `struct cec_notifier`.
- 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.