i965g: pull in a copy of intel_decode.c for now

With the stubbed out, non-hardware xlib winsys, trivial/clear runs and
prints a plausible command stream
This commit is contained in:
Keith Whitwell
2009-11-04 21:35:29 +00:00
parent cde48bc8d1
commit 951fdac566
6 changed files with 1835 additions and 11 deletions
+2 -1
View File
@@ -66,6 +66,7 @@ C_SOURCES = \
brw_screen_tex_layout.c \
brw_screen_texture.c \
brw_screen_surface.c \
brw_batchbuffer.c
brw_batchbuffer.c \
intel_decode.c
include ../../Makefile.template
+10 -8
View File
@@ -35,6 +35,7 @@
#include "brw_winsys.h"
#include "brw_debug.h"
#include "brw_structs.h"
#include "intel_decode.h"
#define USE_MALLOC_BUFFER 1
#define ALWAYS_EMIT_MI_FLUSH 1
@@ -47,9 +48,6 @@ brw_batchbuffer_reset(struct brw_batchbuffer *batch)
batch->buf = NULL;
}
if (batch->use_malloc_buffer && !batch->malloc_buffer)
batch->malloc_buffer = MALLOC(BRW_BATCH_SIZE);
batch->buf = batch->sws->bo_alloc(batch->sws,
BRW_BUFFER_TYPE_BATCH,
BRW_BATCH_SIZE, 4096);
@@ -64,12 +62,18 @@ brw_batchbuffer_reset(struct brw_batchbuffer *batch)
}
struct brw_batchbuffer *
brw_batchbuffer_alloc(struct brw_winsys_screen *sws)
brw_batchbuffer_alloc(struct brw_winsys_screen *sws,
struct brw_chipset chipset)
{
struct brw_batchbuffer *batch = CALLOC_STRUCT(brw_batchbuffer);
batch->use_malloc_buffer = USE_MALLOC_BUFFER;
if (batch->use_malloc_buffer) {
batch->malloc_buffer = MALLOC(BRW_BATCH_SIZE);
}
batch->sws = sws;
batch->chipset = chipset;
brw_batchbuffer_reset(batch);
return batch;
@@ -142,18 +146,16 @@ _brw_batchbuffer_flush(struct brw_batchbuffer *batch,
batch->sws->bo_exec(batch->buf, used );
#if 0
if (BRW_DEBUG & DEBUG_BATCH) {
if (1 /*BRW_DEBUG & DEBUG_BATCH*/) {
void *ptr = batch->sws->bo_map(batch->buf, GL_FALSE);
intel_decode(ptr,
used / 4,
batch->buf->offset,
batch->buf->offset[0],
batch->chipset.pci_id);
batch->sws->bo_unmap(batch->buf);
}
#endif
if (BRW_DEBUG & DEBUG_SYNC) {
/* Abuse map/unmap to achieve wait-for-fence.
+3 -1
View File
@@ -28,6 +28,7 @@ struct brw_batchbuffer {
struct brw_winsys_screen *sws;
struct brw_winsys_buffer *buf;
struct brw_chipset chipset;
/* Main-memory copy of the batch-buffer, built up incrementally &
* then copied as one to the true buffer.
@@ -57,7 +58,8 @@ struct brw_batchbuffer {
/*@}*/
};
struct brw_batchbuffer *brw_batchbuffer_alloc( struct brw_winsys_screen *sws );
struct brw_batchbuffer *brw_batchbuffer_alloc( struct brw_winsys_screen *sws,
struct brw_chipset chipset );
void brw_batchbuffer_free(struct brw_batchbuffer *batch);
+1 -1
View File
@@ -133,7 +133,7 @@ struct pipe_context *brw_create_context(struct pipe_screen *screen)
make_empty_list(&brw->query.active_head);
brw->batch = brw_batchbuffer_alloc( brw->sws );
brw->batch = brw_batchbuffer_alloc( brw->sws, brw->chipset );
if (brw->batch == NULL)
goto fail;
File diff suppressed because it is too large Load Diff
+29
View File
@@ -0,0 +1,29 @@
/*
* Copyright © 2007 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.
*
* Authors:
* Eric Anholt <eric@anholt.net>
*
*/
int intel_decode(uint32_t *data, int count, uint32_t hw_offset, uint32_t devid);
void intel_decode_context_reset(void);