XenevaOS
Loading...
Searching...
No Matches
drm_kunit_helpers.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0
2
3#ifndef DRM_KUNIT_HELPERS_H_
4#define DRM_KUNIT_HELPERS_H_
5
6#include <drm/drm_drv.h>
7
8#include <linux/device.h>
9
10#include <kunit/test.h>
11
12struct drm_connector;
13struct drm_crtc_funcs;
15struct drm_device;
16struct drm_plane_funcs;
18struct kunit;
19
21void drm_kunit_helper_free_device(struct kunit *test, struct device *dev);
22
23struct drm_device *
25 struct device *dev,
26 size_t size, size_t offset,
27 const struct drm_driver *driver);
28
49#define drm_kunit_helper_alloc_drm_device_with_driver(_test, _dev, _type, _member, _drv) \
50 ((_type *)__drm_kunit_helper_alloc_drm_device_with_driver(_test, _dev, \
51 sizeof(_type), \
52 offsetof(_type, _member), \
53 _drv))
54
55static inline struct drm_device *
56__drm_kunit_helper_alloc_drm_device(struct kunit *test,
57 struct device *dev,
58 size_t size, size_t offset,
59 u32 features)
60{
61 struct drm_driver *driver;
62
63 driver = devm_kzalloc(dev, sizeof(*driver), GFP_KERNEL);
64 KUNIT_ASSERT_NOT_NULL(test, driver);
65
66 driver->driver_features = features;
67
69 size, offset,
70 driver);
71}
72
94#define drm_kunit_helper_alloc_drm_device(_test, _dev, _type, _member, _feat) \
95 ((_type *)__drm_kunit_helper_alloc_drm_device(_test, _dev, \
96 sizeof(_type), \
97 offsetof(_type, _member), \
98 _feat))
99
100struct drm_atomic_commit *
102 struct drm_device *drm,
103 struct drm_modeset_acquire_ctx *ctx);
104
105struct drm_plane *
107 struct drm_device *drm,
108 const struct drm_plane_funcs *funcs,
109 const struct drm_plane_helper_funcs *helper_funcs,
110 const uint32_t *formats,
111 unsigned int num_formats,
112 const uint64_t *modifiers);
113
114struct drm_crtc *
116 struct drm_device *drm,
117 struct drm_plane *primary,
118 struct drm_plane *cursor,
119 const struct drm_crtc_funcs *funcs,
120 const struct drm_crtc_helper_funcs *helper_funcs);
121
123 struct drm_device *drm,
124 struct drm_crtc *crtc,
125 struct drm_connector *connector,
126 const struct drm_display_mode *mode,
127 struct drm_modeset_acquire_ctx *ctx);
128
130 struct drm_display_mode *mode);
131
132struct drm_display_mode *
134 u8 video_code);
135
136#endif // DRM_KUNIT_HELPERS_H_
unsigned int uint32_t
Definition acefiex.h:163
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
size_t size
Definition drm_bridge.h:1299
size_t size_t const struct drm_bridge_funcs * funcs
Definition drm_bridge.h:1300
size_t size_t offset
Definition drm_bridge.h:1299
struct drm_crtc struct drm_plane * primary
Definition drm_crtc.h:1239
struct drm_crtc struct drm_plane struct drm_plane * cursor
Definition drm_crtc.h:1240
struct drm_crtc * crtc
Definition drm_crtc.h:1238
struct drm_atomic_commit * drm_kunit_helper_atomic_state_alloc(struct kunit *test, struct drm_device *drm, struct drm_modeset_acquire_ctx *ctx)
struct drm_display_mode * drm_kunit_display_mode_from_cea_vic(struct kunit *test, struct drm_device *dev, u8 video_code)
void drm_kunit_helper_free_device(struct kunit *test, struct device *dev)
struct device * drm_kunit_helper_alloc_device(struct kunit *test)
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)
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)
int drm_kunit_add_mode_destroy_action(struct kunit *test, struct drm_display_mode *mode)
int drm_kunit_helper_enable_crtc_connector(struct kunit *test, struct drm_device *drm, struct drm_crtc *crtc, struct drm_connector *connector, const struct drm_display_mode *mode, struct drm_modeset_acquire_ctx *ctx)
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)
struct drm_plane uint32_t const struct drm_plane_funcs const uint32_t * formats
Definition drm_plane.h:831
const struct device * dev
Definition drm_print.h:519
#define GFP_KERNEL
Definition gfp_types.h:377
uint8_t u8
Definition kernel.h:14
uint32_t u32
Definition kernel.h:16
int test
Definition p_mobj.c:45
Definition fs.h:255
Definition drm_atomic.h:480
Definition drm_connector.h:1998
Definition drm_crtc.h:425
Definition drm_modeset_helper_vtables.h:61
Definition drm_crtc.h:955
Definition drm_device.h:75
const struct drm_driver * driver
Definition drm_device.h:123
Definition drm_modes.h:252
Definition drm_drv.h:199
u32 driver_features
Definition drm_drv.h:430
Definition drm_modeset_lock.h:46
Definition drm_plane.h:300
Definition drm_modeset_helper_vtables.h:1189
Definition drm_plane.h:641
uint64_t * modifiers
Definition drm_plane.h:687
#define mode(x)