modesetting: Export two functions I want to reuse from DRI2/Present.

This renames dumb_get_bo_from_handle(), since it wasn't using a handle
(GEM terminology) but a dmabuf fd.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Eric Anholt 2013-12-30 00:25:37 -08:00
parent 34a98c8103
commit 7064b00d47
2 changed files with 7 additions and 4 deletions

View File

@ -116,7 +116,7 @@ dumb_bo_unmap(int fd, struct dumb_bo *bo)
}
#endif
static int
int
dumb_bo_destroy(int fd, struct dumb_bo *bo)
{
struct drm_mode_destroy_dumb arg;
@ -137,8 +137,8 @@ dumb_bo_destroy(int fd, struct dumb_bo *bo)
return 0;
}
static struct dumb_bo *
dumb_get_bo_from_handle(int fd, int handle, int pitch, int size)
struct dumb_bo *
dumb_get_bo_from_fd(int fd, int handle, int pitch, int size)
{
struct dumb_bo *bo;
int ret;
@ -164,7 +164,7 @@ drmmode_SetSlaveBO(PixmapPtr ppix,
msPixmapPrivPtr ppriv = msGetPixmapPriv(drmmode, ppix);
ppriv->backing_bo =
dumb_get_bo_from_handle(drmmode->fd, fd_handle, pitch, size);
dumb_get_bo_from_fd(drmmode->fd, fd_handle, pitch, size);
if (!ppriv->backing_bo)
return FALSE;

View File

@ -121,6 +121,9 @@ Bool drmmode_map_cursor_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
void drmmode_free_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
void drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmmode,
int *depth, int *bpp);
struct dumb_bo *dumb_get_bo_from_fd(int drm_fd, int fd, int pitch, int size);
int dumb_bo_destroy(int fd, struct dumb_bo *bo);
#ifndef DRM_CAP_DUMB_PREFERRED_DEPTH
#define DRM_CAP_DUMB_PREFERRED_DEPTH 3