aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-01-19 18:57:30 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:05 -0800
commit9ca58ca517006b245077ba282d9f35826c8a166a (patch)
tree150fc62572e11d7d85a7bf61bc25408c6a81469d /src
parent455e2d6dcee51c459ee41ead2279116aa614a983 (diff)
iris: delete iris_pipe.c, shuffle code around
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_blit.c57
-rw-r--r--src/gallium/drivers/iris/iris_clear.c75
-rw-r--r--src/gallium/drivers/iris/iris_context.c109
-rw-r--r--src/gallium/drivers/iris/iris_context.h4
-rw-r--r--src/gallium/drivers/iris/iris_pipe.c329
-rw-r--r--src/gallium/drivers/iris/iris_query.c96
-rw-r--r--src/gallium/drivers/iris/iris_resource.c123
-rw-r--r--src/gallium/drivers/iris/meson.build6
8 files changed, 469 insertions, 330 deletions
diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c
new file mode 100644
index 00000000000..e7ffe31ee4b
--- /dev/null
+++ b/src/gallium/drivers/iris/iris_blit.c
@@ -0,0 +1,57 @@
+/*
+ * Copyright © 2017 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
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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 <stdio.h>
+#include "pipe/p_defines.h"
+#include "pipe/p_state.h"
+#include "pipe/p_context.h"
+#include "pipe/p_screen.h"
+#include "util/u_inlines.h"
+#include "util/ralloc.h"
+#include "iris_context.h"
+#include "iris_resource.h"
+#include "iris_screen.h"
+
+static void
+iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
+{
+}
+
+
+static boolean
+iris_generate_mipmap(struct pipe_context *ctx,
+ struct pipe_resource *resource,
+ enum pipe_format format,
+ unsigned base_level,
+ unsigned last_level,
+ unsigned first_layer,
+ unsigned last_layer)
+{
+ return true;
+}
+
+void
+iris_init_blit_functions(struct pipe_context *ctx)
+{
+ ctx->blit = iris_blit;
+ ctx->generate_mipmap = iris_generate_mipmap;
+}
diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c
new file mode 100644
index 00000000000..807e9ef7ec2
--- /dev/null
+++ b/src/gallium/drivers/iris/iris_clear.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright © 2017 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
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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 <stdio.h>
+#include <errno.h>
+#include "pipe/p_defines.h"
+#include "pipe/p_state.h"
+#include "pipe/p_context.h"
+#include "pipe/p_screen.h"
+#include "util/u_inlines.h"
+#include "util/u_format.h"
+#include "util/u_upload_mgr.h"
+#include "util/ralloc.h"
+#include "iris_context.h"
+#include "iris_resource.h"
+#include "iris_screen.h"
+#include "intel/compiler/brw_compiler.h"
+
+static void
+iris_clear(struct pipe_context *ctx,
+ unsigned buffers,
+ const union pipe_color_union *color,
+ double depth,
+ unsigned stencil)
+{
+}
+
+static void
+iris_clear_render_target(struct pipe_context *ctx,
+ struct pipe_surface *dst,
+ const union pipe_color_union *color,
+ unsigned dst_x, unsigned dst_y,
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
+{
+}
+
+static void
+iris_clear_depth_stencil(struct pipe_context *ctx,
+ struct pipe_surface *dst,
+ unsigned clear_flags,
+ double depth,
+ unsigned stencil,
+ unsigned dst_x, unsigned dst_y,
+ unsigned width, unsigned height,
+ bool render_condition_enabled)
+{
+}
+
+void
+iris_init_clear_functions(struct pipe_context *ctx)
+{
+ ctx->clear = iris_clear;
+ ctx->clear_render_target = iris_clear_render_target;
+ ctx->clear_depth_stencil = iris_clear_depth_stencil;
+}
diff --git a/src/gallium/drivers/iris/iris_context.c b/src/gallium/drivers/iris/iris_context.c
new file mode 100644
index 00000000000..0daa77483ca
--- /dev/null
+++ b/src/gallium/drivers/iris/iris_context.c
@@ -0,0 +1,109 @@
+/*
+ * Copyright © 2017 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
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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 <stdio.h>
+#include <time.h>
+#include "pipe/p_defines.h"
+#include "pipe/p_state.h"
+#include "util/u_inlines.h"
+#include "util/u_format.h"
+#include "util/u_upload_mgr.h"
+#include "iris_context.h"
+#include "iris_resource.h"
+#include "iris_screen.h"
+
+static void
+iris_flush(struct pipe_context *ctx,
+ struct pipe_fence_handle **fence,
+ unsigned flags)
+{
+ if (fence)
+ *fence = NULL;
+}
+
+/**
+ * For debugging purposes, this returns a time in seconds.
+ */
+double
+get_time(void)
+{
+ struct timespec tp;
+
+ clock_gettime(CLOCK_MONOTONIC, &tp);
+
+ return tp.tv_sec + tp.tv_nsec / 1000000000.0;
+}
+
+static void
+iris_set_debug_callback(struct pipe_context *ctx,
+ const struct pipe_debug_callback *cb)
+{
+ struct iris_context *ice = (struct iris_context *)ctx;
+
+ if (cb)
+ ice->dbg = *cb;
+ else
+ memset(&ice->dbg, 0, sizeof(ice->dbg));
+}
+
+static void
+iris_destroy_context(struct pipe_context *ctx)
+{
+ if (ctx->stream_uploader)
+ u_upload_destroy(ctx->stream_uploader);
+
+ free(ctx);
+}
+
+struct pipe_context *
+iris_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
+{
+ struct iris_context *ice = calloc(1, sizeof(struct iris_context));
+
+ if (!ice)
+ return NULL;
+
+ struct pipe_context *ctx = &ice->ctx;
+
+ ctx->screen = screen;
+ ctx->priv = priv;
+
+ ctx->stream_uploader = u_upload_create_default(ctx);
+ if (!ctx->stream_uploader) {
+ free(ctx);
+ return NULL;
+ }
+ ctx->const_uploader = ctx->stream_uploader;
+
+ ctx->destroy = iris_destroy_context;
+ ctx->flush = iris_flush;
+ ctx->set_debug_callback = iris_set_debug_callback;
+
+ iris_init_blit_functions(ctx);
+ iris_init_clear_functions(ctx);
+ iris_init_program_functions(ctx);
+ iris_init_resource_functions(ctx);
+ iris_init_state_functions(ctx);
+ iris_init_query_functions(ctx);
+
+ return ctx;
+}
diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h
index 6652510a364..c9cd80a21e2 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -113,8 +113,12 @@ double get_time(void);
struct pipe_context *
iris_create_context(struct pipe_screen *screen, void *priv, unsigned flags);
+void iris_init_blit_functions(struct pipe_context *ctx);
+void iris_init_clear_functions(struct pipe_context *ctx);
void iris_init_program_functions(struct pipe_context *ctx);
+void iris_init_resource_functions(struct pipe_context *ctx);
void iris_init_state_functions(struct pipe_context *ctx);
+void iris_init_query_functions(struct pipe_context *ctx);
void iris_upload_render_state(struct iris_context *ice,
struct iris_batch *batch,
diff --git a/src/gallium/drivers/iris/iris_pipe.c b/src/gallium/drivers/iris/iris_pipe.c
deleted file mode 100644
index 0aa14c0c0d0..00000000000
--- a/src/gallium/drivers/iris/iris_pipe.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * Copyright © 2017 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
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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 <stdio.h>
-#include <errno.h>
-#include "pipe/p_defines.h"
-#include "pipe/p_state.h"
-#include "pipe/p_context.h"
-#include "pipe/p_screen.h"
-#include "util/u_inlines.h"
-#include "util/u_format.h"
-#include "util/u_upload_mgr.h"
-#include "util/ralloc.h"
-#include "iris_context.h"
-#include "iris_resource.h"
-#include "iris_screen.h"
-#include "intel/compiler/brw_compiler.h"
-
-/**
- * For debugging purposes, this returns a time in seconds.
- */
-double
-get_time(void)
-{
- struct timespec tp;
-
- clock_gettime(CLOCK_MONOTONIC, &tp);
-
- return tp.tv_sec + tp.tv_nsec / 1000000000.0;
-}
-
-/*
- * query
- */
-struct iris_query {
- unsigned query;
-};
-static struct pipe_query *
-iris_create_query(struct pipe_context *ctx, unsigned query_type, unsigned index)
-{
- struct iris_query *query = calloc(1, sizeof(struct iris_query));
-
- return (struct pipe_query *)query;
-}
-
-static void
-iris_destroy_query(struct pipe_context *ctx, struct pipe_query *query)
-{
- free(query);
-}
-
-static boolean
-iris_begin_query(struct pipe_context *ctx, struct pipe_query *query)
-{
- return true;
-}
-
-static bool
-iris_end_query(struct pipe_context *ctx, struct pipe_query *query)
-{
- return true;
-}
-
-static boolean
-iris_get_query_result(struct pipe_context *ctx,
- struct pipe_query *query,
- boolean wait,
- union pipe_query_result *vresult)
-{
- uint64_t *result = (uint64_t*)vresult;
-
- *result = 0;
- return TRUE;
-}
-
-static void
-iris_set_active_query_state(struct pipe_context *pipe, boolean enable)
-{
-}
-
-
-/*
- * transfer
- */
-static void *
-iris_transfer_map(struct pipe_context *ctx,
- struct pipe_resource *resource,
- unsigned level,
- enum pipe_transfer_usage usage,
- const struct pipe_box *box,
- struct pipe_transfer **ptransfer)
-{
- struct iris_context *ice = (struct iris_context *)ctx;
- struct iris_resource *res = (struct iris_resource *)resource;
- struct pipe_transfer *transfer;
-
- // PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE
- // PIPE_TRANSFER_DISCARD_RANGE
- // PIPE_TRANSFER_MAP_DIRECTLY
-
- transfer = calloc(1, sizeof(struct pipe_transfer));
- if (!transfer)
- return NULL;
-
- pipe_resource_reference(&transfer->resource, resource);
- transfer->level = level;
- transfer->usage = usage;
- transfer->box = *box;
- transfer->stride = 1;
- transfer->layer_stride = 1;
- *ptransfer = transfer;
-
- if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED) &&
- iris_batch_references(&ice->render_batch, res->bo)) {
- iris_batch_flush(&ice->render_batch);
- }
-
- if ((usage & PIPE_TRANSFER_DONTBLOCK) && iris_bo_busy(res->bo))
- return NULL;
-
- usage &= (PIPE_TRANSFER_READ |
- PIPE_TRANSFER_WRITE |
- PIPE_TRANSFER_UNSYNCHRONIZED |
- PIPE_TRANSFER_PERSISTENT |
- PIPE_TRANSFER_COHERENT);
-
- return iris_bo_map(&ice->dbg, res->bo, usage);
-}
-
-static void
-iris_transfer_flush_region(struct pipe_context *pipe,
- struct pipe_transfer *transfer,
- const struct pipe_box *box)
-{
-}
-
-static void
-iris_transfer_unmap(struct pipe_context *pipe,
- struct pipe_transfer *transfer)
-{
- pipe_resource_reference(&transfer->resource, NULL);
- free(transfer);
-}
-
-static void
-iris_buffer_subdata(struct pipe_context *pipe,
- struct pipe_resource *resource,
- unsigned usage, unsigned offset,
- unsigned size, const void *data)
-{
-}
-
-static void
-iris_texture_subdata(struct pipe_context *pipe,
- struct pipe_resource *resource,
- unsigned level,
- unsigned usage,
- const struct pipe_box *box,
- const void *data,
- unsigned stride,
- unsigned layer_stride)
-{
-}
-
-
-/*
- *clear/copy
- */
-static void
-iris_clear(struct pipe_context *ctx, unsigned buffers,
- const union pipe_color_union *color, double depth, unsigned stencil)
-{
-}
-
-static void
-iris_clear_render_target(struct pipe_context *ctx,
- struct pipe_surface *dst,
- const union pipe_color_union *color,
- unsigned dstx, unsigned dsty,
- unsigned width, unsigned height,
- bool render_condition_enabled)
-{
-}
-
-static void
-iris_clear_depth_stencil(struct pipe_context *ctx,
- struct pipe_surface *dst,
- unsigned clear_flags,
- double depth,
- unsigned stencil,
- unsigned dstx, unsigned dsty,
- unsigned width, unsigned height,
- bool render_condition_enabled)
-{
-}
-
-static void
-iris_resource_copy_region(struct pipe_context *ctx,
- struct pipe_resource *dst,
- unsigned dst_level,
- unsigned dstx, unsigned dsty, unsigned dstz,
- struct pipe_resource *src,
- unsigned src_level,
- const struct pipe_box *src_box)
-{
-}
-
-static void
-iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
-{
-}
-
-
-static void
-iris_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
-{
-}
-
-
-/*
- * context
- */
-static void
-iris_flush(struct pipe_context *ctx,
- struct pipe_fence_handle **fence,
- unsigned flags)
-{
- if (fence)
- *fence = NULL;
-}
-
-static void
-iris_destroy_context(struct pipe_context *ctx)
-{
- if (ctx->stream_uploader)
- u_upload_destroy(ctx->stream_uploader);
-
- free(ctx);
-}
-
-static boolean
-iris_generate_mipmap(struct pipe_context *ctx,
- struct pipe_resource *resource,
- enum pipe_format format,
- unsigned base_level,
- unsigned last_level,
- unsigned first_layer,
- unsigned last_layer)
-{
- return true;
-}
-
-static void
-iris_set_debug_callback(struct pipe_context *ctx,
- const struct pipe_debug_callback *cb)
-{
- struct iris_context *ice = (struct iris_context *)ctx;
-
- if (cb)
- ice->dbg = *cb;
- else
- memset(&ice->dbg, 0, sizeof(ice->dbg));
-}
-
-struct pipe_context *
-iris_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
-{
- struct iris_context *ice = calloc(1, sizeof(struct iris_context));
-
- if (!ice)
- return NULL;
-
- struct pipe_context *ctx = &ice->ctx;
-
- ctx->screen = screen;
- ctx->priv = priv;
-
- ctx->stream_uploader = u_upload_create_default(ctx);
- if (!ctx->stream_uploader) {
- free(ctx);
- return NULL;
- }
- ctx->const_uploader = ctx->stream_uploader;
-
- ctx->destroy = iris_destroy_context;
- ctx->flush = iris_flush;
- ctx->clear = iris_clear;
- ctx->clear_render_target = iris_clear_render_target;
- ctx->clear_depth_stencil = iris_clear_depth_stencil;
- ctx->resource_copy_region = iris_resource_copy_region;
- ctx->generate_mipmap = iris_generate_mipmap;
- ctx->blit = iris_blit;
- ctx->flush_resource = iris_flush_resource;
- ctx->create_query = iris_create_query;
- ctx->destroy_query = iris_destroy_query;
- ctx->begin_query = iris_begin_query;
- ctx->end_query = iris_end_query;
- ctx->get_query_result = iris_get_query_result;
- ctx->set_active_query_state = iris_set_active_query_state;
- ctx->transfer_map = iris_transfer_map;
- ctx->transfer_flush_region = iris_transfer_flush_region;
- ctx->transfer_unmap = iris_transfer_unmap;
- ctx->buffer_subdata = iris_buffer_subdata;
- ctx->texture_subdata = iris_texture_subdata;
- ctx->set_debug_callback = iris_set_debug_callback;
- iris_init_program_functions(ctx);
- iris_init_state_functions(ctx);
-
- return ctx;
-}
diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c
new file mode 100644
index 00000000000..ee55e23b4b9
--- /dev/null
+++ b/src/gallium/drivers/iris/iris_query.c
@@ -0,0 +1,96 @@
+/*
+ * Copyright © 2017 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
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHOR(S) AND/OR THEIR SUPPLIERS 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 <stdio.h>
+#include <errno.h>
+#include "pipe/p_defines.h"
+#include "pipe/p_state.h"
+#include "pipe/p_context.h"
+#include "pipe/p_screen.h"
+#include "util/u_inlines.h"
+#include "util/u_format.h"
+#include "util/u_upload_mgr.h"
+#include "util/ralloc.h"
+#include "iris_context.h"
+#include "iris_resource.h"
+#include "iris_screen.h"
+#include "intel/compiler/brw_compiler.h"
+
+struct iris_query {
+ unsigned query;
+};
+
+static struct pipe_query *
+iris_create_query(struct pipe_context *ctx,
+ unsigned query_type,
+ unsigned index)
+{
+ struct iris_query *query = calloc(1, sizeof(struct iris_query));
+
+ return (struct pipe_query *)query;
+}
+
+static void
+iris_destroy_query(struct pipe_context *ctx, struct pipe_query *query)
+{
+ free(query);
+}
+
+static boolean
+iris_begin_query(struct pipe_context *ctx, struct pipe_query *query)
+{
+ return true;
+}
+
+static bool
+iris_end_query(struct pipe_context *ctx, struct pipe_query *query)
+{
+ return true;
+}
+
+static boolean
+iris_get_query_result(struct pipe_context *ctx,
+ struct pipe_query *query,
+ boolean wait,
+ union pipe_query_result *vresult)
+{
+ uint64_t *result = (uint64_t*)vresult;
+
+ *result = 0;
+ return TRUE;
+}
+
+static void
+iris_set_active_query_state(struct pipe_context *pipe, boolean enable)
+{
+}
+
+void
+iris_init_query_functions(struct pipe_context *ctx)
+{
+ ctx->create_query = iris_create_query;
+ ctx->destroy_query = iris_destroy_query;
+ ctx->begin_query = iris_begin_query;
+ ctx->end_query = iris_end_query;
+ ctx->get_query_result = iris_get_query_result;
+ ctx->set_active_query_state = iris_set_active_query_state;
+}
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index b141d0de8b3..2566806ee27 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -30,6 +30,8 @@
#include "util/u_format.h"
#include "util/u_upload_mgr.h"
#include "util/ralloc.h"
+#include "iris_batch.h"
+#include "iris_context.h"
#include "iris_resource.h"
#include "iris_screen.h"
#include "intel/common/gen_debug.h"
@@ -356,6 +358,115 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
return false;
}
+static void *
+iris_transfer_map(struct pipe_context *ctx,
+ struct pipe_resource *resource,
+ unsigned level,
+ enum pipe_transfer_usage usage,
+ const struct pipe_box *box,
+ struct pipe_transfer **ptransfer)
+{
+ struct iris_context *ice = (struct iris_context *)ctx;
+ struct iris_resource *res = (struct iris_resource *)resource;
+ struct pipe_transfer *transfer;
+
+ // PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE
+ // PIPE_TRANSFER_DISCARD_RANGE
+ // PIPE_TRANSFER_MAP_DIRECTLY
+
+ transfer = calloc(1, sizeof(struct pipe_transfer));
+ if (!transfer)
+ return NULL;
+
+ pipe_resource_reference(&transfer->resource, resource);
+ transfer->level = level;
+ transfer->usage = usage;
+ transfer->box = *box;
+ transfer->stride = 1;
+ transfer->layer_stride = 1;
+ *ptransfer = transfer;
+
+ if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED) &&
+ iris_batch_references(&ice->render_batch, res->bo)) {
+ iris_batch_flush(&ice->render_batch);
+ }
+
+ if ((usage & PIPE_TRANSFER_DONTBLOCK) && iris_bo_busy(res->bo))
+ return NULL;
+
+ usage &= (PIPE_TRANSFER_READ |
+ PIPE_TRANSFER_WRITE |
+ PIPE_TRANSFER_UNSYNCHRONIZED |
+ PIPE_TRANSFER_PERSISTENT |
+ PIPE_TRANSFER_COHERENT);
+
+ return iris_bo_map(&ice->dbg, res->bo, usage);
+}
+
+static void
+iris_transfer_flush_region(struct pipe_context *pipe,
+ struct pipe_transfer *transfer,
+ const struct pipe_box *box)
+{
+}
+
+static void
+iris_transfer_unmap(struct pipe_context *pipe,
+ struct pipe_transfer *transfer)
+{
+ pipe_resource_reference(&transfer->resource, NULL);
+ free(transfer);
+}
+
+static void
+iris_buffer_subdata(struct pipe_context *pipe,
+ struct pipe_resource *resource,
+ unsigned usage, unsigned offset,
+ unsigned size, const void *data)
+{
+}
+
+static void
+iris_texture_subdata(struct pipe_context *pipe,
+ struct pipe_resource *resource,
+ unsigned level,
+ unsigned usage,
+ const struct pipe_box *box,
+ const void *data,
+ unsigned stride,
+ unsigned layer_stride)
+{
+}
+
+
+static void
+iris_resource_copy_region(struct pipe_context *ctx,
+ struct pipe_resource *dst,
+ unsigned dst_level,
+ unsigned dstx, unsigned dsty, unsigned dstz,
+ struct pipe_resource *src,
+ unsigned src_level,
+ const struct pipe_box *src_box)
+{
+}
+
+static void
+iris_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
+{
+}
+
+static boolean
+iris_generate_mipmap(struct pipe_context *ctx,
+ struct pipe_resource *resource,
+ enum pipe_format format,
+ unsigned base_level,
+ unsigned last_level,
+ unsigned first_layer,
+ unsigned last_layer)
+{
+ return true;
+}
+
void
iris_init_screen_resource_functions(struct pipe_screen *pscreen)
{
@@ -366,3 +477,15 @@ iris_init_screen_resource_functions(struct pipe_screen *pscreen)
pscreen->resource_get_handle = iris_resource_get_handle;
pscreen->resource_destroy = iris_resource_destroy;
}
+
+void
+iris_init_resource_functions(struct pipe_context *ctx)
+{
+ ctx->flush_resource = iris_flush_resource;
+ ctx->transfer_map = iris_transfer_map;
+ ctx->transfer_flush_region = iris_transfer_flush_region;
+ ctx->transfer_unmap = iris_transfer_unmap;
+ ctx->buffer_subdata = iris_buffer_subdata;
+ ctx->texture_subdata = iris_texture_subdata;
+ ctx->resource_copy_region = iris_resource_copy_region;
+}
diff --git a/src/gallium/drivers/iris/meson.build b/src/gallium/drivers/iris/meson.build
index 4563edb4218..fc33e9c59c1 100644
--- a/src/gallium/drivers/iris/meson.build
+++ b/src/gallium/drivers/iris/meson.build
@@ -21,13 +21,17 @@
files_libiris = files(
'iris_batch.c',
'iris_batch.h',
+ 'iris_blit.c',
'iris_bufmgr.c',
'iris_bufmgr.h',
+ 'iris_clear.c',
+ 'iris_context.c',
'iris_context.h',
'iris_draw.c',
'iris_formats.c',
- 'iris_pipe.c',
+ 'iris_pipe.h',
'iris_program.c',
+ 'iris_query.c',
'iris_resource.c',
'iris_resource.h',
'iris_screen.c',