diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-02-23 18:42:19 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-02-24 18:09:18 +0900 |
commit | 1ee341f9d909f3b7ba2984fc912dabdb98c34b19 (patch) | |
tree | c887396bb13a671ea723242889151974755503b4 | |
parent | a36bbfd98b96426bbe0be3923c64da7ec0e565d0 (diff) |
Add amdgpu_pixmap_get_handle helper
(inspired by radeon commits dfad91fffb5bd013785223b42d78886df839eacf
and ccbda955ebae1d457d35293833f12791e0f9fb0b)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/amdgpu_bo_helper.c | 10 | ||||
-rw-r--r-- | src/amdgpu_bo_helper.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/amdgpu_bo_helper.c b/src/amdgpu_bo_helper.c index 65f1ac6..ad56197 100644 --- a/src/amdgpu_bo_helper.c +++ b/src/amdgpu_bo_helper.c @@ -131,6 +131,16 @@ Bool amdgpu_bo_get_handle(struct amdgpu_buffer *bo, uint32_t *handle) handle) == 0; } +Bool amdgpu_pixmap_get_handle(PixmapPtr pixmap, uint32_t *handle) +{ + struct amdgpu_buffer *bo = amdgpu_get_pixmap_bo(pixmap); + + if (!bo) + return FALSE; + + return amdgpu_bo_get_handle(bo, handle); +} + int amdgpu_bo_map(ScrnInfoPtr pScrn, struct amdgpu_buffer *bo) { int ret = 0; diff --git a/src/amdgpu_bo_helper.h b/src/amdgpu_bo_helper.h index 4dae200..10e2db7 100644 --- a/src/amdgpu_bo_helper.h +++ b/src/amdgpu_bo_helper.h @@ -31,6 +31,8 @@ extern struct amdgpu_buffer *amdgpu_alloc_pixmap_bo(ScrnInfoPtr pScrn, int width extern Bool amdgpu_bo_get_handle(struct amdgpu_buffer *bo, uint32_t *handle); +extern Bool amdgpu_pixmap_get_handle(PixmapPtr pixmap, uint32_t *handle); + extern int amdgpu_bo_map(ScrnInfoPtr pScrn, struct amdgpu_buffer *bo); extern void amdgpu_bo_unmap(struct amdgpu_buffer *bo); |