PATH:
usr
/
src
/
kernels
/
5.14.0-611.49.2.el9_7.x86_64
/
include
/
drm
// SPDX-License-Identifier: GPL-2.0 #ifndef DRM_KUNIT_HELPERS_H_ #define DRM_KUNIT_HELPERS_H_ #include <drm/drm_drv.h> #include <linux/device.h> #include <kunit/test.h> struct drm_crtc_funcs; struct drm_crtc_helper_funcs; struct drm_device; struct drm_plane_funcs; struct drm_plane_helper_funcs; struct kunit; struct device *drm_kunit_helper_alloc_device(struct kunit *test); void drm_kunit_helper_free_device(struct kunit *test, struct device *dev); struct drm_device * __drm_kunit_helper_alloc_drm_device_with_driver(struct kunit *test, struct device *dev, size_t size, size_t offset, const struct drm_driver *driver); /** * drm_kunit_helper_alloc_drm_device_with_driver - Allocates a mock DRM device for KUnit tests * @_test: The test context object * @_dev: The parent device object * @_type: the type of the struct which contains struct &drm_device * @_member: the name of the &drm_device within @_type. * @_drv: Mocked DRM device driver features * * This function creates a struct &drm_device from @_dev and @_drv. * * @_dev should be allocated using drm_kunit_helper_alloc_device(). * * The driver is tied to the @_test context and will get cleaned at the * end of the test. The drm_device is allocated through * devm_drm_dev_alloc() and will thus be freed through a device-managed * resource. * * Returns: * A pointer to the new drm_device, or an ERR_PTR() otherwise. */ #define drm_kunit_helper_alloc_drm_device_with_driver(_test, _dev, _type, _member, _drv) \ ((_type *)__drm_kunit_helper_alloc_drm_device_with_driver(_test, _dev, \ sizeof(_type), \ offsetof(_type, _member), \ _drv)) static inline struct drm_device * __drm_kunit_helper_alloc_drm_device(struct kunit *test, struct device *dev, size_t size, size_t offset, u32 features) { struct drm_driver *driver; driver = devm_kzalloc(dev, sizeof(*driver), GFP_KERNEL); KUNIT_ASSERT_NOT_NULL(test, driver); driver->driver_features = features; return __drm_kunit_helper_alloc_drm_device_with_driver(test, dev, size, offset, driver); } /** * drm_kunit_helper_alloc_drm_device - Allocates a mock DRM device for KUnit tests * @_test: The test context object * @_dev: The parent device object * @_type: the type of the struct which contains struct &drm_device * @_member: the name of the &drm_device within @_type. * @_feat: Mocked DRM device driver features * * This function creates a struct &drm_driver and will create a struct * &drm_device from @_dev and that driver. * * @_dev should be allocated using drm_kunit_helper_alloc_device(). * * The driver is tied to the @_test context and will get cleaned at the * end of the test. The drm_device is allocated through * devm_drm_dev_alloc() and will thus be freed through a device-managed * resource. * * Returns: * A pointer to the new drm_device, or an ERR_PTR() otherwise. */ #define drm_kunit_helper_alloc_drm_device(_test, _dev, _type, _member, _feat) \ ((_type *)__drm_kunit_helper_alloc_drm_device(_test, _dev, \ sizeof(_type), \ offsetof(_type, _member), \ _feat)) struct drm_atomic_state * drm_kunit_helper_atomic_state_alloc(struct kunit *test, struct drm_device *drm, struct drm_modeset_acquire_ctx *ctx); struct drm_plane * drm_kunit_helper_create_primary_plane(struct kunit *test, struct drm_device *drm, const struct drm_plane_funcs *funcs, const struct drm_plane_helper_funcs *helper_funcs, const uint32_t *formats, unsigned int num_formats, const uint64_t *modifiers); struct drm_crtc * drm_kunit_helper_create_crtc(struct kunit *test, struct drm_device *drm, struct drm_plane *primary, struct drm_plane *cursor, const struct drm_crtc_funcs *funcs, const struct drm_crtc_helper_funcs *helper_funcs); int drm_kunit_add_mode_destroy_action(struct kunit *test, struct drm_display_mode *mode); struct drm_display_mode * drm_kunit_display_mode_from_cea_vic(struct kunit *test, struct drm_device *dev, u8 video_code); #endif // DRM_KUNIT_HELPERS_H_
[-] drm_eld.h
[edit]
[-] drm_bridge.h
[edit]
[-] spsc_queue.h
[edit]
[-] drm_gem_dma_helper.h
[edit]
[-] drm_property.h
[edit]
[-] drm_auth.h
[edit]
[-] drm_mipi_dbi.h
[edit]
[-] drm_mode_object.h
[edit]
[-] drm_pciids.h
[edit]
[+]
ttm
[-] drm_privacy_screen_machine.h
[edit]
[-] drm_fixed.h
[edit]
[-] drm_fb_helper.h
[edit]
[-] drm_gem_ttm_helper.h
[edit]
[-] drm_pagemap.h
[edit]
[-] drm_atomic_uapi.h
[edit]
[-] drm_module.h
[edit]
[+]
display
[-] drm_encoder.h
[edit]
[-] drm_file.h
[edit]
[-] drm_connector.h
[edit]
[-] drm_utils.h
[edit]
[-] drm_suballoc.h
[edit]
[+]
intel
[-] drm_audio_component.h
[edit]
[-] drm_prime.h
[edit]
[-] drm_atomic_helper.h
[edit]
[-] i915_pciids.h
[edit]
[-] drm_mipi_dsi.h
[edit]
[-] drm_writeback.h
[edit]
[-] drm_gem_framebuffer_helper.h
[edit]
[-] drm_lease.h
[edit]
[-] drm_crtc_helper.h
[edit]
[-] drm_client.h
[edit]
[-] Makefile
[edit]
[-] drm_vblank.h
[edit]
[-] drm_format_helper.h
[edit]
[-] drm_fb_dma_helper.h
[edit]
[-] drm_mode_config.h
[edit]
[-] drm_debugfs.h
[edit]
[-] drm_print.h
[edit]
[-] drm_client_event.h
[edit]
[-] drm_panel.h
[edit]
[-] drm_gem_shmem_helper.h
[edit]
[-] drm_debugfs_crc.h
[edit]
[-] drm_cache.h
[edit]
[-] drm_sysfs.h
[edit]
[+]
clients
[-] drm_edid.h
[edit]
[-] drm_modeset_helper.h
[edit]
[-] drm_atomic_state_helper.h
[edit]
[-] drm_ioctl.h
[edit]
[-] drm_blend.h
[edit]
[-] drm_gem_vram_helper.h
[edit]
[-] drm_panic.h
[edit]
[-] drm_plane_helper.h
[edit]
[-] drm_fbdev_dma.h
[edit]
[-] drm_bridge_connector.h
[edit]
[-] drm_probe_helper.h
[edit]
[-] drm_modeset_helper_vtables.h
[edit]
[-] drm_device.h
[edit]
[-] drm_exec.h
[edit]
[-] drm_atomic.h
[edit]
[-] gud.h
[edit]
[-] drm_gem.h
[edit]
[-] drm_gpuvm.h
[edit]
[-] drm_mm.h
[edit]
[-] drm_plane.h
[edit]
[-] drm_gpusvm.h
[edit]
[-] drm_simple_kms_helper.h
[edit]
[-] drm_syncobj.h
[edit]
[-] drm_gem_atomic_helper.h
[edit]
[-] drm_fbdev_shmem.h
[edit]
[-] drm_framebuffer.h
[edit]
[-] drm_accel.h
[edit]
[-] drm_self_refresh_helper.h
[edit]
[-] amd_asic_type.h
[edit]
[-] drm_privacy_screen_consumer.h
[edit]
[-] gpu_scheduler.h
[edit]
[-] drm_fbdev_ttm.h
[edit]
[-] drm_managed.h
[edit]
[-] task_barrier.h
[edit]
[-] drm_fourcc.h
[edit]
[-] drm_vblank_work.h
[edit]
[-] drm_modes.h
[edit]
[-] drm_vma_manager.h
[edit]
[-] drm_buddy.h
[edit]
[-] drm_of.h
[edit]
[+]
..
[+]
bridge
[-] drm_modeset_lock.h
[edit]
[-] drm_rect.h
[edit]
[-] drm_flip_work.h
[edit]
[-] drm_util.h
[edit]
[-] drm_damage_helper.h
[edit]
[-] drm_drv.h
[edit]
[-] drm_kunit_helpers.h
[edit]
[-] drm_color_mgmt.h
[edit]
[-] drm_crtc.h
[edit]
[-] drm_privacy_screen_driver.h
[edit]