intel: add cmd_fail() to signal command buffer errors
The main purpose is have a place to set breakpoing on on command buffer
errors.
diff --git a/icd/intel/cmd_meta.c b/icd/intel/cmd_meta.c
index ed74217..12081b4 100644
--- a/icd/intel/cmd_meta.c
+++ b/icd/intel/cmd_meta.c
@@ -72,7 +72,7 @@
res = cmd_meta_create_buf_view(cmd, (XGL_BUFFER) buf,
buf->size, format, &view);
if (res != XGL_SUCCESS) {
- cmd->result = res;
+ cmd_fail(cmd, res);
return;
}
@@ -100,7 +100,7 @@
res = cmd_meta_create_buf_view(cmd, (XGL_BUFFER) buf,
buf->size, format, &view);
if (res != XGL_SUCCESS) {
- cmd->result = res;
+ cmd_fail(cmd, res);
return;
}
@@ -158,7 +158,7 @@
ret = intel_img_view_create(cmd->dev, &info, &view);
if (ret != XGL_SUCCESS) {
- cmd->result = ret;
+ cmd_fail(cmd, ret);
return;
}
@@ -257,7 +257,7 @@
ret = intel_rt_view_create(cmd->dev, &info, &rt);
if (ret != XGL_SUCCESS) {
- cmd->result = ret;
+ cmd_fail(cmd, ret);
return;
}
@@ -288,7 +288,7 @@
res = cmd_meta_create_buf_view(cmd, (XGL_BUFFER) XGL_NULL_HANDLE,
size, format, &view);
if (res != XGL_SUCCESS) {
- cmd->result = res;
+ cmd_fail(cmd, res);
return;
}
@@ -323,7 +323,7 @@
ret = intel_ds_view_create(cmd->dev, &info, &ds);
if (ret != XGL_SUCCESS) {
- cmd->result = ret;
+ cmd_fail(cmd, ret);
return;
}
@@ -447,7 +447,7 @@
intel_dev_log(cmd->dev, XGL_DBG_MSG_ERROR,
XGL_VALIDATION_LEVEL_0, XGL_NULL_HANDLE, 0, 0,
"unaligned xglCmdCopyBuffer unsupported");
- cmd->result = XGL_ERROR_UNKNOWN;
+ cmd_fail(cmd, XGL_ERROR_UNKNOWN);
continue;
}
@@ -487,7 +487,7 @@
uint32_t i;
if (src->type != dst->type) {
- cmd->result = XGL_ERROR_UNKNOWN;
+ cmd_fail(cmd, XGL_ERROR_UNKNOWN);
return;
}
@@ -496,7 +496,7 @@
raw_format = cmd_meta_img_raw_format(cmd, src->layout.format);
} else if (icd_format_is_compressed(src->layout.format) ||
icd_format_is_compressed(dst->layout.format)) {
- cmd->result = XGL_ERROR_UNKNOWN;
+ cmd_fail(cmd, XGL_ERROR_UNKNOWN);
return;
}
@@ -646,7 +646,7 @@
XGL_VALIDATION_LEVEL_0, XGL_NULL_HANDLE, 0, 0,
"xglCmdCopyImageToBuffer with bpp %d unsupported",
icd_format_get_size(img->layout.format));
- cmd->result = XGL_ERROR_UNKNOWN;
+ cmd_fail(cmd, XGL_ERROR_UNKNOWN);
return;
}
@@ -703,14 +703,14 @@
res = intel_buf_create(cmd->dev, &buf_info, &src_buf);
if (res != XGL_SUCCESS) {
- cmd->result = res;
+ cmd_fail(cmd, res);
return;
}
res = intel_buf_create(cmd->dev, &buf_info, &dst_buf);
if (res != XGL_SUCCESS) {
intel_buf_destroy(src_buf);
- cmd->result = res;
+ cmd_fail(cmd, res);
return;
}
@@ -741,7 +741,7 @@
/* must be 4-byte aligned */
if ((destOffset | dataSize) & 3) {
- cmd->result = XGL_ERROR_UNKNOWN;
+ cmd_fail(cmd, XGL_ERROR_UNKNOWN);
return;
}
@@ -787,7 +787,7 @@
/* must be 4-byte aligned */
if ((destOffset | fillSize) & 3) {
- cmd->result = XGL_ERROR_UNKNOWN;
+ cmd_fail(cmd, XGL_ERROR_UNKNOWN);
return;
}
@@ -964,7 +964,7 @@
if (src->samples <= 1 || dst->samples > 1 ||
src->layout.format != dst->layout.format) {
- cmd->result = XGL_ERROR_UNKNOWN;
+ cmd_fail(cmd, XGL_ERROR_UNKNOWN);
return;
}