glamor: Return the stride/size for glamor_dri3_name_from_pixmap(), too.
Just like for a caller of glamor_dri3_fd_from_pixmap(), otherwise the consumer of that named buffer has no idea what GL chose for the stride. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Markus Wick <markus@selfnet.de>
This commit is contained in:
parent
4e21b7ee49
commit
e23dd41195
|
@ -647,7 +647,7 @@ glamor_fd_from_pixmap(ScreenPtr screen,
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
glamor_name_from_pixmap(PixmapPtr pixmap)
|
glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
|
||||||
{
|
{
|
||||||
glamor_pixmap_private *pixmap_priv;
|
glamor_pixmap_private *pixmap_priv;
|
||||||
glamor_screen_private *glamor_priv =
|
glamor_screen_private *glamor_priv =
|
||||||
|
@ -663,7 +663,7 @@ glamor_name_from_pixmap(PixmapPtr pixmap)
|
||||||
return glamor_egl_dri3_fd_name_from_tex(pixmap->drawable.pScreen,
|
return glamor_egl_dri3_fd_name_from_tex(pixmap->drawable.pScreen,
|
||||||
pixmap,
|
pixmap,
|
||||||
pixmap_priv->base.fbo->tex,
|
pixmap_priv->base.fbo->tex,
|
||||||
TRUE, NULL, NULL);
|
TRUE, stride, size);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,7 +210,8 @@ extern _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen,
|
||||||
*
|
*
|
||||||
* Returns the name on success, -1 on error.
|
* Returns the name on success, -1 on error.
|
||||||
* */
|
* */
|
||||||
extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap);
|
extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap,
|
||||||
|
CARD16 *stride, CARD32 *size);
|
||||||
|
|
||||||
/* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd.
|
/* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd.
|
||||||
*
|
*
|
||||||
|
|
|
@ -441,10 +441,10 @@ glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (glamor_get_fd_from_bo(glamor_egl->fd, bo, &fd)) {
|
if (glamor_get_fd_from_bo(glamor_egl->fd, bo, &fd)) {
|
||||||
*stride = pixmap->devKind;
|
|
||||||
*size = pixmap->devKind * gbm_bo_get_height(bo);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*stride = pixmap->devKind;
|
||||||
|
*size = pixmap->devKind * gbm_bo_get_height(bo);
|
||||||
|
|
||||||
gbm_bo_destroy(bo);
|
gbm_bo_destroy(bo);
|
||||||
failure:
|
failure:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user