gallium-r300: Fit it all together now.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Fri, 9 Jan 2009 13:11:19 +0000 (05:11 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 2 Feb 2009 07:30:20 +0000 (23:30 -0800)
In theory, it could work, but there's still some very big gaps.
Anything marked with XXX should be taken care of first, probably.

src/gallium/drivers/r300/Makefile
src/gallium/drivers/r300/r300_blit.c
src/gallium/drivers/r300/r300_blit.h
src/gallium/drivers/r300/r300_clear.c
src/gallium/drivers/r300/r300_clear.h
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_surface.h

index 918eb8e..bce7dcb 100644 (file)
@@ -4,10 +4,12 @@ include $(TOP)/configs/current
 LIBNAME = r300
 
 C_SOURCES = \
+       r300_blit.c \
        r300_clear.c \
        r300_context.c \
        r300_screen.c \
-       r300_state.c
+       r300_state.c \
+       r300_surface.c
 
 include ../../Makefile.template
 
index c01855d..5f5eba9 100644 (file)
@@ -20,6 +20,8 @@
  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  * USE OR OTHER DEALINGS IN THE SOFTWARE. */
 
+#include "r300_blit.h"
+
 /* Does a "paint" into the specified rectangle.
  * Returns 1 on success, 0 on error. */
 int r300_fill_blit(struct r300_context* r300,
index ac916ca..698b000 100644 (file)
 #ifndef R300_BLIT_H
 #define R300_BLIT_H
 
+#include "pipe/p_state.h"
+
+#include "radeon_reg.h"
+
+/* Forward declarations. */
+struct r300_context;
+
 extern int r300_fill_blit(struct r300_context* r300,
                           unsigned cpp,
                           short dst_pitch,
-                          struct pipe_buffer *dst_buffer,
+                          struct pipe_bufferdst_buffer,
                           unsigned dst_offset,
                           short x, short y,
                           short w, short h,
index f8f0e61..fd28437 100644 (file)
  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  * USE OR OTHER DEALINGS IN THE SOFTWARE. */
 
+#include "r300_clear.h"
+
 /* This gets its own file because Intel's is in its own file.
  * I assume there's a good reason. */
-void r300_clear(struct pipe_context* pipe, struct pipe_surface* ps, unsigned val)
+void r300_clear(struct pipe_context* pipe,
+                struct pipe_surface* ps,
+                unsigned color)
 {
-    pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
+    pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color);
     ps->status = PIPE_SURFACE_STATUS_DEFINED;
 }
\ No newline at end of file
index 58ac0a8..e24a069 100644 (file)
@@ -20,4 +20,8 @@
  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  * USE OR OTHER DEALINGS IN THE SOFTWARE. */
 
-void r300_clear(struct pipe_context* pipe, struct pipe_surface* ps, unsigned val);
\ No newline at end of file
+#include "pipe/p_context.h"
+
+void r300_clear(struct pipe_context* pipe,
+                struct pipe_surface* ps,
+                unsigned color);
index 7fde140..21bee5b 100644 (file)
@@ -50,5 +50,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     struct radeon_cs_manager* csm = radeon_cs_manager_gem_ctor(fd);
     r300->cs = cs_gem_create(csm, 64 * 1024 / 4); */
 
+    r300_init_surface_functions(r300);
+
     return &r300->context;
-}
\ No newline at end of file
+}
index f67823a..ae2dab1 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "pipe/p_context.h"
 
+#include "r300_surface.h"
+
 struct r300_context {
     /* Parent class */
     struct pipe_context context;
index 9c89623..0a114bb 100644 (file)
@@ -119,7 +119,7 @@ static void* r300_surface_map(struct pipe_screen* screen,
                               struct pipe_surface* surface,
                               unsigned flags)
 {
-    /* XXX is this all we need to do here? */
+    /* XXX this is not quite right */
     char* map = pipe_buffer_map(screen, surface->buffer, flags);
 
     if (!map) {
index 3e3d813..29858eb 100644 (file)
 #ifndef R300_SURFACE_H
 #define R300_SURFACE_H
 
+#include "pipe/p_context.h"
+#include "pipe/p_screen.h"
+
+#include "util/u_rect.h"
+
 #include "r300_blit.h"
+#include "r300_context.h"
+
+void r300_init_surface_functions(struct r300_context* r300);
 
 #endif /* R300_SURFACE_H */