mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2025-01-30 20:34:19 +01:00
test: add liftoff_mock_drm_get_plane
Allows to get a mock plane from a plane ID.
This commit is contained in:
parent
1cd18f9156
commit
54bb501cae
2 changed files with 16 additions and 0 deletions
|
@ -12,6 +12,7 @@ struct liftoff_layer;
|
|||
int liftoff_mock_drm_open(void);
|
||||
uint32_t liftoff_mock_drm_create_fb(struct liftoff_layer *layer);
|
||||
struct liftoff_mock_plane *liftoff_mock_drm_create_plane(int type);
|
||||
struct liftoff_mock_plane *liftoff_mock_drm_get_plane(uint32_t id);
|
||||
void liftoff_mock_plane_add_compatible_layer(struct liftoff_mock_plane *plane,
|
||||
struct liftoff_layer *layer);
|
||||
struct liftoff_layer *liftoff_mock_plane_get_layer(struct liftoff_mock_plane *plane,
|
||||
|
|
|
@ -98,6 +98,21 @@ struct liftoff_mock_plane *liftoff_mock_drm_create_plane(int type)
|
|||
return plane;
|
||||
}
|
||||
|
||||
struct liftoff_mock_plane *liftoff_mock_drm_get_plane(uint32_t id)
|
||||
{
|
||||
struct liftoff_mock_plane *plane;
|
||||
|
||||
plane = &mock_planes[0];
|
||||
while (plane->id != 0) {
|
||||
if (plane->id == id) {
|
||||
return plane;
|
||||
}
|
||||
plane++;
|
||||
}
|
||||
|
||||
assert(0);
|
||||
}
|
||||
|
||||
void liftoff_mock_plane_add_compatible_layer(struct liftoff_mock_plane *plane,
|
||||
struct liftoff_layer *layer)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue