drivers/gpu/drm/udl/udl_drv.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/udl/udl_drv.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/udl/udl_drv.c- Extension
.c- Size
- 3567 bytes
- Lines
- 150
- 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/module.hdrm/clients/drm_client_setup.hdrm/drm_drv.hdrm/drm_fbdev_shmem.hdrm/drm_file.hdrm/drm_gem_shmem_helper.hdrm/drm_managed.hdrm/drm_modeset_helper.hdrm/drm_ioctl.hdrm/drm_probe_helper.hdrm/drm_print.hudl_drv.h
Detected Declarations
function Copyrightfunction udl_usb_resumefunction udl_usb_reset_resumefunction udl_usb_probefunction udl_usb_disconnect
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2012 Red Hat
*/
#include <linux/module.h>
#include <drm/clients/drm_client_setup.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_shmem.h>
#include <drm/drm_file.h>
#include <drm/drm_gem_shmem_helper.h>
#include <drm/drm_managed.h>
#include <drm/drm_modeset_helper.h>
#include <drm/drm_ioctl.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_print.h>
#include "udl_drv.h"
static int udl_usb_suspend(struct usb_interface *interface,
pm_message_t message)
{
struct drm_device *dev = usb_get_intfdata(interface);
struct udl_device *udl = to_udl(dev);
int ret;
ret = drm_mode_config_helper_suspend(dev);
if (ret)
return ret;
udl_sync_pending_urbs(udl);
return 0;
}
static int udl_usb_resume(struct usb_interface *interface)
{
struct drm_device *dev = usb_get_intfdata(interface);
return drm_mode_config_helper_resume(dev);
}
static int udl_usb_reset_resume(struct usb_interface *interface)
{
struct drm_device *dev = usb_get_intfdata(interface);
struct udl_device *udl = to_udl(dev);
udl_select_std_channel(udl);
return drm_mode_config_helper_resume(dev);
}
DEFINE_DRM_GEM_FOPS(udl_driver_fops);
static const struct drm_driver driver = {
.driver_features = DRIVER_ATOMIC | DRIVER_GEM | DRIVER_MODESET,
/* GEM hooks */
.fops = &udl_driver_fops,
DRM_GEM_SHMEM_DRIVER_OPS,
DRM_FBDEV_SHMEM_DRIVER_OPS,
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
.major = DRIVER_MAJOR,
.minor = DRIVER_MINOR,
.patchlevel = DRIVER_PATCHLEVEL,
};
static struct udl_device *udl_driver_create(struct usb_interface *interface)
{
struct udl_device *udl;
int r;
udl = devm_drm_dev_alloc(&interface->dev, &driver,
struct udl_device, drm);
if (IS_ERR(udl))
return udl;
r = udl_init(udl);
if (r)
return ERR_PTR(r);
usb_set_intfdata(interface, udl);
return udl;
}
static int udl_usb_probe(struct usb_interface *interface,
const struct usb_device_id *id)
Annotation
- Immediate include surface: `linux/module.h`, `drm/clients/drm_client_setup.h`, `drm/drm_drv.h`, `drm/drm_fbdev_shmem.h`, `drm/drm_file.h`, `drm/drm_gem_shmem_helper.h`, `drm/drm_managed.h`, `drm/drm_modeset_helper.h`.
- Detected declarations: `function Copyright`, `function udl_usb_resume`, `function udl_usb_reset_resume`, `function udl_usb_probe`, `function udl_usb_disconnect`.
- 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.