summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-09-27 15:06:06 -0700
committerEric Anholt <eric@anholt.net>2007-09-27 15:11:47 -0700
commit35331a511fcd023a7b6f0eb298098d872b856a9f (patch)
tree52d9349ccc783d2dc540c7b51fc8b52ec7fc14a5 /src/mesa/drivers/dri/i965
parentb2c8b1385a3d2500e21a899d612ce2398ba7185f (diff)
[965] Add batchbuffer dumping under INTEL_DEBUG=bat, like 915.
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/Makefile2
-rw-r--r--src/mesa/drivers/dri/i965/intel_batchbuffer.c11
-rw-r--r--src/mesa/drivers/dri/i965/intel_context.c2
-rw-r--r--src/mesa/drivers/dri/i965/intel_context.h17
l---------src/mesa/drivers/dri/i965/intel_decode.c1
5 files changed, 17 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile
index 5748d7ff05..7e07bc9c1a 100644
--- a/src/mesa/drivers/dri/i965/Makefile
+++ b/src/mesa/drivers/dri/i965/Makefile
@@ -11,6 +11,7 @@ DRIVER_SOURCES = \
intel_buffer_objects.c \
intel_buffers.c \
intel_context.c \
+ intel_decode.c \
intel_ioctl.c \
intel_mipmap_tree.c \
intel_regions.c \
@@ -92,6 +93,7 @@ DRIVER_DEFINES = -I../intel
include ../Makefile.template
+intel_decode.o: ../intel/intel_decode.c
intel_tex_layout.o: ../intel/intel_tex_layout.c
server:
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index 2aaa10e1c2..fb58c0e708 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -28,6 +28,7 @@
#include "imports.h"
#include "intel_batchbuffer.h"
#include "intel_ioctl.h"
+#include "intel_decode.h"
#include "bufmgr.h"
@@ -168,6 +169,16 @@ GLboolean intel_batchbuffer_flush( struct intel_batchbuffer *batch )
goto out;
}
+ if (INTEL_DEBUG & DEBUG_BATCH) {
+ char *map;
+
+ map = bmMapBuffer(batch->intel, batch->buffer,
+ BM_MEM_AGP|BM_MEM_LOCAL|BM_CLIENT);
+ intel_decode((uint32_t *)(map + batch->offset), used / 4,
+ offset + batch->offset, intel->intelScreen->deviceID);
+ bmUnmapBuffer(batch->intel, batch->buffer);
+ }
+
/* Fire the batch buffer, which was uploaded above:
*/
intel_batch_ioctl(batch->intel,
diff --git a/src/mesa/drivers/dri/i965/intel_context.c b/src/mesa/drivers/dri/i965/intel_context.c
index 022819d582..2cf311c713 100644
--- a/src/mesa/drivers/dri/i965/intel_context.c
+++ b/src/mesa/drivers/dri/i965/intel_context.c
@@ -46,6 +46,7 @@
#include "drivers/common/driverfuncs.h"
#include "intel_screen.h"
+#include "intel_chipset.h"
#include "i830_dri.h"
#include "i830_common.h"
@@ -225,6 +226,7 @@ static const struct dri_debug_control debug_control[] =
{ "thre", DEBUG_SINGLE_THREAD },
{ "wm", DEBUG_WM },
{ "vs", DEBUG_VS },
+ { "bat", DEBUG_BATCH },
{ NULL, 0 }
};
diff --git a/src/mesa/drivers/dri/i965/intel_context.h b/src/mesa/drivers/dri/i965/intel_context.h
index 06cfc6946d..f63c2f613d 100644
--- a/src/mesa/drivers/dri/i965/intel_context.h
+++ b/src/mesa/drivers/dri/i965/intel_context.h
@@ -355,22 +355,7 @@ extern int INTEL_DEBUG;
#define DEBUG_WM 0x10000
#define DEBUG_URB 0x20000
#define DEBUG_VS 0x40000
-
-
-#define PCI_CHIP_845_G 0x2562
-#define PCI_CHIP_I830_M 0x3577
-#define PCI_CHIP_I855_GM 0x3582
-#define PCI_CHIP_I865_G 0x2572
-#define PCI_CHIP_I915_G 0x2582
-#define PCI_CHIP_I915_GM 0x2592
-#define PCI_CHIP_I945_G 0x2772
-#define PCI_CHIP_I965_G 0x29A2
-#define PCI_CHIP_I965_Q 0x2992
-#define PCI_CHIP_I965_G_1 0x2982
-#define PCI_CHIP_I946_GZ 0x2972
-#define PCI_CHIP_I965_GM 0x2A02
-#define PCI_CHIP_I965_GME 0x2A12
-
+#define DEBUG_BATCH 0x80000
/* ================================================================
* intel_context.c:
diff --git a/src/mesa/drivers/dri/i965/intel_decode.c b/src/mesa/drivers/dri/i965/intel_decode.c
new file mode 120000
index 0000000000..f671b6cbb1
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/intel_decode.c
@@ -0,0 +1 @@
+../intel/intel_decode.c \ No newline at end of file