Detail i915 winsys interface comments.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Sat, 3 Nov 2007 01:08:15 +0000 (01:08 +0000)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Sat, 3 Nov 2007 02:01:32 +0000 (02:01 +0000)
src/mesa/pipe/i915simple/i915_winsys.h

index 5447636..947c5a3 100644 (file)
  * 
  **************************************************************************/
 
-#ifndef I915_WINSYS_H
-#define I915_WINSYS_H
-
-
-/* This is the interface that softpipe requires any window system
- * hosting it to implement.  This is the only include file in softpipe
+/**
+ * \file
+ * This is the interface that i915simple requires any window system
+ * hosting it to implement.  This is the only include file in i915simple
  * which is public.
+ * 
  */
 
+#ifndef I915_WINSYS_H
+#define I915_WINSYS_H
+
 
 /* Pipe drivers are (meant to be!) independent of both GL and the
  * window system.  The window system provides a buffer manager and a
 struct pipe_buffer_handle;
 struct pipe_winsys;
 
+
+/**
+ * Additional winsys interface for i915simple.
+ * 
+ * It is an over-simple batchbuffer mechanism.  Will want to improve the
+ * performance of this, perhaps based on the cmdstream stuff.  It
+ * would be pretty impossible to implement swz on top of this
+ * interface.
+ *
+ * Will also need additions/changes to implement static/dynamic
+ * indirect state.
+ */
 struct i915_winsys {
 
-   /* An over-simple batchbuffer mechanism.  Will want to improve the
-    * performance of this, perhaps based on the cmdstream stuff.  It
-    * would be pretty impossible to implement swz on top of this
-    * interface.
-    *
-    * Will also need additions/changes to implement static/dynamic
-    * indirect state.
+   /**
+    * Reserve space on batch buffer. 
+    * 
+    * Returns a null pointer if there is insufficient space in the batch buffer 
+    * to hold the requested number of dwords and relocations.
+    * 
+    * The number of dwords should also include the number of relocations.
     */
    unsigned *(*batch_start)( struct i915_winsys *sws,
                             unsigned dwords,
                             unsigned relocs );
+   
    void (*batch_dword)( struct i915_winsys *sws,
                        unsigned dword );
+   
+   /**
+    * Emit a relocation to a buffer.
+    * 
+    * Used not only when the buffer addresses are not pinned, but also to 
+    * ensure refered buffers will not be destroyed until the current batch 
+    * buffer execution is finished.
+    *
+    * The access flags is a combination of I915_BUFFER_ACCESS_WRITE and 
+    * I915_BUFFER_ACCESS_READ macros.
+    */
    void (*batch_reloc)( struct i915_winsys *sws,
                        struct pipe_buffer_handle *buf,
                        unsigned access_flags,
                        unsigned delta );
+   
    void (*batch_flush)( struct i915_winsys *sws );
-
-#if 0
-   void (*batch_chain)( struct i915_winsys *sws, 
-                       struct pipe_buffer_handle *buf ):
-#endif
 };
 
 #define I915_BUFFER_ACCESS_WRITE   0x1