test: add liftoff_mock_drm_get_plane

Allows to get a mock plane from a plane ID.
This commit is contained in:
Simon Ser 2019-09-13 19:46:21 +03:00
parent 1cd18f9156
commit 54bb501cae
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 16 additions and 0 deletions

View file

@ -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,

View file

@ -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)
{