[g3dvl] add some more PIPE_VIDEO_CAPs
[mesa.git] / src / gallium / drivers / r600 / r600.h
index 3d6f9c23ece0ea8ee5cf315c542b221cd878563f..2af4d311f60f788e626913dbab86b8413b7045ed 100644 (file)
@@ -30,6 +30,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <util/u_double_list.h>
+#include <util/u_inlines.h>
 #include <pipe/p_compiler.h>
 
 #define RADEON_CTX_MAX_PM4     (64 * 1024 / 4)
@@ -47,38 +48,6 @@ struct winsys_handle;
 
 enum radeon_family {
        CHIP_UNKNOWN,
-       CHIP_R100,
-       CHIP_RV100,
-       CHIP_RS100,
-       CHIP_RV200,
-       CHIP_RS200,
-       CHIP_R200,
-       CHIP_RV250,
-       CHIP_RS300,
-       CHIP_RV280,
-       CHIP_R300,
-       CHIP_R350,
-       CHIP_RV350,
-       CHIP_RV370,
-       CHIP_RV380,
-       CHIP_R420,
-       CHIP_R423,
-       CHIP_R430,
-       CHIP_R480,
-       CHIP_R481,
-       CHIP_RV410,
-       CHIP_RS400,
-       CHIP_RC410,
-       CHIP_RS480,
-       CHIP_RS600,
-       CHIP_RS690,
-       CHIP_RS740,
-       CHIP_RV515,
-       CHIP_R520,
-       CHIP_RV530,
-       CHIP_RV560,
-       CHIP_RV570,
-       CHIP_R580,
        CHIP_R600,
        CHIP_RV610,
        CHIP_RV630,
@@ -135,14 +104,24 @@ struct r600_bo *r600_bo_handle(struct radeon *radeon,
                                unsigned handle, unsigned *array_mode);
 void *r600_bo_map(struct radeon *radeon, struct r600_bo *bo, unsigned usage, void *ctx);
 void r600_bo_unmap(struct radeon *radeon, struct r600_bo *bo);
-void r600_bo_reference(struct radeon *radeon, struct r600_bo **dst,
-                           struct r600_bo *src);
 boolean r600_bo_get_winsys_handle(struct radeon *radeon, struct r600_bo *pb_bo,
                                unsigned stride, struct winsys_handle *whandle);
 static INLINE unsigned r600_bo_offset(struct r600_bo *bo)
 {
        return 0;
 }
+void r600_bo_destroy(struct radeon *radeon, struct r600_bo *bo);
+
+/* this relies on the pipe_reference being the first member of r600_bo */
+static INLINE void r600_bo_reference(struct radeon *radeon, struct r600_bo **dst, struct r600_bo *src)
+{
+       struct r600_bo *old = *dst;
+
+       if (pipe_reference((struct pipe_reference *)(*dst), (struct pipe_reference *)src)) {
+               r600_bo_destroy(radeon, old);
+       }
+       *dst = src;
+}
 
 
 /* R600/R700 STATES */
@@ -183,6 +162,9 @@ struct r600_pipe_resource_state {
 
 #define R600_BLOCK_STATUS_ENABLED      (1 << 0)
 #define R600_BLOCK_STATUS_DIRTY                (1 << 1)
+#define R600_BLOCK_STATUS_RESOURCE_DIRTY       (1 << 2)
+
+#define R600_BLOCK_STATUS_RESOURCE_VERTEX      (1 << 3)
 
 struct r600_block_reloc {
        struct r600_bo          *bo;
@@ -246,6 +228,7 @@ struct r600_query {
 #define R600_QUERY_STATE_STARTED       (1 << 0)
 #define R600_QUERY_STATE_ENDED         (1 << 1)
 #define R600_QUERY_STATE_SUSPENDED     (1 << 2)
+#define R600_QUERY_STATE_FLUSHED       (1 << 3)
 
 #define R600_CONTEXT_DRAW_PENDING      (1 << 0)
 #define R600_CONTEXT_DST_CACHES_DIRTY  (1 << 1)
@@ -257,11 +240,13 @@ struct r600_context {
        unsigned                nblocks;
        struct r600_block       **blocks;
        struct list_head        dirty;
+       struct list_head        resource_dirty;
        struct list_head        enable_list;
        unsigned                pm4_ndwords;
        unsigned                pm4_cdwords;
        unsigned                pm4_dirty_cdwords;
        unsigned                ctx_pm4_ndwords;
+       unsigned                init_dwords;
        unsigned                nreloc;
        unsigned                creloc;
        struct r600_reloc       *reloc;
@@ -278,6 +263,7 @@ struct r600_context {
        struct r600_range vs_resources;
        struct r600_range fs_resources;
        int num_ps_resources, num_vs_resources, num_fs_resources;
+       boolean                 have_depth_texture, have_depth_fb;
 };
 
 struct r600_draw {
@@ -309,7 +295,7 @@ boolean r600_context_query_result(struct r600_context *ctx,
 void r600_query_begin(struct r600_context *ctx, struct r600_query *query);
 void r600_query_end(struct r600_context *ctx, struct r600_query *query);
 void r600_context_queries_suspend(struct r600_context *ctx);
-void r600_context_queries_resume(struct r600_context *ctx);
+void r600_context_queries_resume(struct r600_context *ctx, boolean flushed);
 void r600_query_predication(struct r600_context *ctx, struct r600_query *query, int operation,
                            int flag_wait);
 void r600_context_emit_fence(struct r600_context *ctx, struct r600_bo *fence,