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 918eb8e1c40943b1ced3f53b67fb9521e2cd6e51..bce7dcbf3a39ad2df3c5963d459d61f50cce63a6 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 c01855defa3fcfb6d7fa9d8a954c82233f20eb83..5f5eba90c1f4e63ff50ba758b5f3f3950bd4c14f 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 ac916ca0626057262862925b4085df209eba98bf..698b00083a90b8c17d8f73d8f8f3c1a05543c4e6 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 f8f0e6193150231deac6158b3657f705279fb294..fd28437aaa4ff9a0f9d6f279746c6e25844a7ced 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 58ac0a875c06858abd2798162916d08386d36c92..e24a0690c9b399c24f4181a733fd073ef742217b 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 7fde1404d91e11895a52bc2831c54efca35e0ea6..21bee5beaef99737533e107f4dd38877a6de6efe 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 f67823aa1ec2e24fb31c84c83a0c23c03c1cfe38..ae2dab13ffc050f3dbee419804b74daeb31f04dc 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 9c89623df3c65c18d4ed2be6d5ac31f912c07832..0a114bbc0649552731cc1830eae971f807f4b740 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 3e3d813d99340db28ca536af5b7256f3ac038fdd..29858eb5417de76fd50dba7100f49b01132b9426 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 */