drivers/gpu/drm/drm_internal.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/drm_internal.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/drm_internal.h
Extension
.h
Size
10141 bytes
Lines
295
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.

Dependency Surface

Detected Declarations

Annotated Snippet

#ifndef __DRM_INTERNAL_H__
#define __DRM_INTERNAL_H__

#include <linux/kthread.h>
#include <linux/types.h>

#include <drm/drm_ioctl.h>
#include <drm/drm_vblank.h>

#define DRM_IF_MAJOR 1
#define DRM_IF_MINOR 4

#define DRM_IF_VERSION(maj, min) (maj << 16 | min)

struct dentry;
struct dma_buf;
struct iosys_map;
struct drm_connector;
struct drm_crtc;
struct drm_framebuffer;
struct drm_gem_object;
struct drm_master;
struct drm_minor;
struct drm_prime_file_private;
struct drm_printer;
struct drm_vblank_crtc;

/* drm_client_event.c */
#if defined(CONFIG_DRM_CLIENT)
void drm_client_debugfs_init(struct drm_device *dev);
#else
static inline void drm_client_debugfs_init(struct drm_device *dev)
{ }
#endif

/* drm_client_sysrq.c */
#if defined(CONFIG_DRM_CLIENT) && defined(CONFIG_MAGIC_SYSRQ)
void drm_client_sysrq_register(struct drm_device *dev);
void drm_client_sysrq_unregister(struct drm_device *dev);
#else
static inline void drm_client_sysrq_register(struct drm_device *dev)
{ }
static inline void drm_client_sysrq_unregister(struct drm_device *dev)
{ }
#endif

/* drm_file.c */
extern struct mutex drm_global_mutex;
bool drm_dev_needs_global_mutex(struct drm_device *dev);
struct drm_file *drm_file_alloc(struct drm_minor *minor);
void drm_file_free(struct drm_file *file);

#ifdef CONFIG_PCI

/* drm_pci.c */
int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master);

#else

static inline int drm_pci_set_busid(struct drm_device *dev,
				    struct drm_master *master)
{
	return -EINVAL;
}

#endif

/* drm_prime.c */
int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
				 struct drm_file *file_priv);
int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data,
				 struct drm_file *file_priv);

void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv);
void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv);
int drm_prime_add_buf_handle(struct drm_prime_file_private *prime_fpriv,
			     struct dma_buf *dma_buf, uint32_t handle);
void drm_prime_remove_buf_handle(struct drm_prime_file_private *prime_fpriv,
				 uint32_t handle);

/* drm_managed.c */
void drm_managed_release(struct drm_device *dev);
void drmm_add_final_kfree(struct drm_device *dev, void *container);

/* drm_vblank.c */
static inline bool drm_vblank_passed(u64 seq, u64 ref)
{
	return (seq - ref) <= (1 << 23);
}

Annotation

Implementation Notes