Add n_planes == 1 assert in drm_fbid_from_dmabuf

This code assumes a single planes. Let's add a safe-guard so that we
don't forget this function when adding support for multiple planes.
This commit is contained in:
Simon Ser 2020-05-15 14:55:32 +02:00
parent b305b7f123
commit 48b429e7b1
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -627,6 +627,8 @@ out:
uint32_t drm_fbid_from_dmabuf( struct drm_t *drm, struct wlr_dmabuf_attributes *dma_buf )
{
assert( dma_buf->n_planes == 1);
uint32_t ret = 0;
uint32_t handles[4] = { 0 };
drmPrimeFDToHandle( drm->fd, dma_buf->fd[0], &handles[0] );