From 0639f44d0f545b30032695f402c6a4a7963ee8be Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 31 Dec 2015 14:30:51 -0800 Subject: [PATCH] isl: Add a file for format helpers --- src/isl/Makefile.am | 1 + src/isl/isl.c | 15 --------------- src/isl/isl_format.c | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 15 deletions(-) create mode 100644 src/isl/isl_format.c 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 + +#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; +} -- 2.30.2