aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-core/xgi_cmdlist.c10
-rw-r--r--linux-core/xgi_drv.c6
2 files changed, 10 insertions, 6 deletions
diff --git a/linux-core/xgi_cmdlist.c b/linux-core/xgi_cmdlist.c
index 2fdfcc91..885b5066 100644
--- a/linux-core/xgi_cmdlist.c
+++ b/linux-core/xgi_cmdlist.c
@@ -45,11 +45,11 @@ int xgi_cmdlist_initialize(struct xgi_info * info, size_t size)
.size = size,
.owner = PCIE_2D,
};
+ int err;
- xgi_pcie_alloc(info, &mem_alloc, 0);
-
- if ((mem_alloc.size == 0) && (mem_alloc.hw_addr == 0)) {
- return -1;
+ err = xgi_pcie_alloc(info, &mem_alloc, 0);
+ if (err) {
+ return err;
}
s_cmdring._cmdRingSize = mem_alloc.size;
@@ -58,7 +58,7 @@ int xgi_cmdlist_initialize(struct xgi_info * info, size_t size)
s_cmdring._lastBatchStartAddr = 0;
s_cmdring._cmdRingOffset = 0;
- return 1;
+ return 0;
}
static void xgi_submit_cmdlist(struct xgi_info * info,
diff --git a/linux-core/xgi_drv.c b/linux-core/xgi_drv.c
index 13e79169..c4e7daae 100644
--- a/linux-core/xgi_drv.c
+++ b/linux-core/xgi_drv.c
@@ -231,7 +231,11 @@ int xgi_bootstrap(DRM_IOCTL_ARGS)
}
/* Alloc 1M bytes for cmdbuffer which is flush2D batch array */
- xgi_cmdlist_initialize(info, 0x100000);
+ err = xgi_cmdlist_initialize(info, 0x100000);
+ if (err) {
+ DRM_ERROR("xgi_cmdlist_initialize() failed\n");
+ return err;
+ }
info->bootstrap_done = 1;
return 0;