mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
freedreno/drm: Don't try to export suballoc bo
Suballoc BOs don't have a real handle, so attempting to dmabuf export won't work. Likewise for handle or flink-name export. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23324>
This commit is contained in:
parent
be705ce760
commit
7cc8185ca3
1 changed files with 8 additions and 0 deletions
|
|
@ -490,6 +490,9 @@ bo_flush(struct fd_bo *bo)
|
|||
int
|
||||
fd_bo_get_name(struct fd_bo *bo, uint32_t *name)
|
||||
{
|
||||
if (suballoc_bo(bo))
|
||||
return -1;
|
||||
|
||||
if (!bo->name) {
|
||||
struct drm_gem_flink req = {
|
||||
.handle = bo->handle,
|
||||
|
|
@ -517,6 +520,8 @@ fd_bo_get_name(struct fd_bo *bo, uint32_t *name)
|
|||
uint32_t
|
||||
fd_bo_handle(struct fd_bo *bo)
|
||||
{
|
||||
if (suballoc_bo(bo))
|
||||
return 0;
|
||||
bo->bo_reuse = NO_CACHE;
|
||||
bo->alloc_flags |= FD_BO_SHARED;
|
||||
bo_flush(bo);
|
||||
|
|
@ -528,6 +533,9 @@ fd_bo_dmabuf(struct fd_bo *bo)
|
|||
{
|
||||
int ret, prime_fd;
|
||||
|
||||
if (suballoc_bo(bo))
|
||||
return -1;
|
||||
|
||||
ret = drmPrimeHandleToFD(bo->dev->fd, bo->handle, DRM_CLOEXEC | DRM_RDWR,
|
||||
&prime_fd);
|
||||
if (ret) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue