aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau/nouveau_scratch.h
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2010-10-29 21:56:50 +0200
committerFrancisco Jerez <[email protected]>2010-10-31 02:44:45 +0200
commitf2098e0fefbbcd72df4c8283d195beae4a113f35 (patch)
tree645ff4cc0be04ab6106be1781b1dba86170d093f /src/mesa/drivers/dri/nouveau/nouveau_scratch.h
parent6daaf4535998a05ec6e974828cee33c513d2b5a2 (diff)
dri/nouveau: Split out the scratch helpers to a separate file.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_scratch.h')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_scratch.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_scratch.h b/src/mesa/drivers/dri/nouveau/nouveau_scratch.h
new file mode 100644
index 00000000000..b60b33dd1ac
--- /dev/null
+++ b/src/mesa/drivers/dri/nouveau/nouveau_scratch.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2009-2010 Francisco Jerez.
+ * All Rights Reserved.
+ *
+ * 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 COPYRIGHT OWNER(S) AND/OR ITS 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.
+ *
+ */
+
+#ifndef __NOUVEAU_SCRATCH_H__
+#define __NOUVEAU_SCRATCH_H__
+
+#define NOUVEAU_SCRATCH_COUNT 2
+#define NOUVEAU_SCRATCH_SIZE 3*1024*1024
+
+struct nouveau_scratch_state {
+ struct nouveau_bo *bo[NOUVEAU_SCRATCH_COUNT];
+
+ int index;
+ int offset;
+ void *buf;
+};
+
+void *
+nouveau_get_scratch(struct gl_context *ctx, unsigned size,
+ struct nouveau_bo **bo, unsigned *offset);
+
+void
+nouveau_scratch_init(struct gl_context *ctx);
+
+void
+nouveau_scratch_destroy(struct gl_context *ctx);
+
+#endif