summaryrefslogtreecommitdiffstats
path: root/src/isl
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2015-12-31 14:30:51 -0800
committerJason Ekstrand <[email protected]>2016-01-04 16:08:05 -0800
commit0639f44d0f545b30032695f402c6a4a7963ee8be (patch)
tree83514659993fd866f3efc857aeefcab0fed67af5 /src/isl
parent5f5fc23e7c622990a9b048b9d6bb4dabf61cf1f4 (diff)
isl: Add a file for format helpers
Diffstat (limited to 'src/isl')
-rw-r--r--src/isl/Makefile.am1
-rw-r--r--src/isl/isl.c15
-rw-r--r--src/isl/isl_format.c41
3 files changed, 42 insertions, 15 deletions
diff --git a/src/isl/Makefile.am b/src/isl/Makefile.am
index 134e62ad105..6fd1da669a3 100644
--- a/src/isl/Makefile.am
+++ b/src/isl/Makefile.am
@@ -44,6 +44,7 @@ libisl_la_CFLAGS = $(CFLAGS) -Wno-override-init
libisl_la_SOURCES = \
isl.c \
+ isl_format.c \
isl_format_layout.c \
isl_gen4.c \
isl_gen4.h \
diff --git a/src/isl/isl.c b/src/isl/isl.c
index 6c49164615b..00eb249b23f 100644
--- a/src/isl/isl.c
+++ b/src/isl/isl.c
@@ -65,21 +65,6 @@ isl_device_init(struct isl_device *dev,
assert(ISL_DEV_USE_SEPARATE_STENCIL(dev));
}
-bool
-isl_format_has_sint_channel(enum isl_format fmt)
-{
- const struct isl_format_layout *fmtl = isl_format_get_layout(fmt);
-
- return fmtl->channels.r.type == ISL_SINT ||
- fmtl->channels.g.type == ISL_SINT ||
- fmtl->channels.b.type == ISL_SINT ||
- fmtl->channels.a.type == ISL_SINT ||
- fmtl->channels.l.type == ISL_SINT ||
- fmtl->channels.i.type == ISL_SINT ||
- fmtl->channels.p.type == ISL_SINT ||
- fmtl->channels.g.type == ISL_SINT;
-}
-
/**
* @param[out] info is written only on success
*/
diff --git a/src/isl/isl_format.c b/src/isl/isl_format.c
new file mode 100644
index 00000000000..bebbd6efbc0
--- /dev/null
+++ b/src/isl/isl_format.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include <assert.h>
+
+#include "isl.h"
+
+bool
+isl_format_has_sint_channel(enum isl_format fmt)
+{
+ const struct isl_format_layout *fmtl = isl_format_get_layout(fmt);
+
+ return fmtl->channels.r.type == ISL_SINT ||
+ fmtl->channels.g.type == ISL_SINT ||
+ fmtl->channels.b.type == ISL_SINT ||
+ fmtl->channels.a.type == ISL_SINT ||
+ fmtl->channels.l.type == ISL_SINT ||
+ fmtl->channels.i.type == ISL_SINT ||
+ fmtl->channels.p.type == ISL_SINT ||
+ fmtl->channels.g.type == ISL_SINT;
+}