iris: fix dmabuf retval comparisons
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 30 Jan 2018 20:30:34 +0000 (12:30 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:05 +0000 (10:26 -0800)
0 means success

src/gallium/drivers/iris/iris_resource.c

index be75de2402c7b35c71eac1147369eb65055c89e4..2d314ce5e7575fd99499d15975d43fec0047cb5b 100644 (file)
@@ -355,11 +355,11 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
 
    switch (whandle->type) {
    case WINSYS_HANDLE_TYPE_SHARED:
-      return iris_bo_flink(res->bo, &whandle->handle) > 0;
+      return iris_bo_flink(res->bo, &whandle->handle) == 0;
    case WINSYS_HANDLE_TYPE_KMS:
-      return iris_bo_export_gem_handle(res->bo);
+      return iris_bo_export_gem_handle(res->bo) == 0;
    case WINSYS_HANDLE_TYPE_FD:
-      return iris_bo_export_dmabuf(res->bo, (int *) &whandle->handle) > 0;
+      return iris_bo_export_dmabuf(res->bo, (int *) &whandle->handle) == 0;
    }
 
    return false;