Merge remote branch 'origin/master' into radeon-rewrite
authorDave Airlie <airlied@redhat.com>
Thu, 12 Feb 2009 15:11:25 +0000 (01:11 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 12 Feb 2009 15:11:25 +0000 (01:11 +1000)
Conflicts:
configure.ac
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r300/r300_render.c

1  2 
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/r300/r300_reg.h
src/mesa/drivers/dri/r300/r300_render.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/radeon_program_pair.c
src/mesa/drivers/dri/radeon/radeon_context.c
src/mesa/drivers/dri/radeon/radeon_screen.c

index 1f5a9f2427b8a0a0b2d8454d65c83af8647e4927,c06751516eb47f72aff9be99629284d92ecaab53..431bf8235c344056bc967db0da2ad5d001851e79
@@@ -61,11 -62,6 +61,8 @@@ WITH THE SOFTWARE OR THE USE OR OTHER D
  #include "r200_maos.h"
  #include "r200_vertprog.h"
  
- #define need_GL_ARB_multisample
- #define need_GL_ARB_texture_compression
- #define need_GL_ARB_vertex_buffer_object
 +#include "radeon_span.h"
 +
  #define need_GL_ARB_vertex_program
  #define need_GL_ATI_fragment_shader
  #define need_GL_EXT_blend_minmax
index 8bad6467f2d94131cf64be25367810b798c98b78,4c14c7eefed7da69dc9ba70968e52c33b8096b5c..6d68309d3f038ba5f89cded1660dfa377db09bbc
@@@ -344,8 -308,11 +349,10 @@@ GLboolean r300CreateContext(const __GLc
  #if 0
        ctx->Const.MaxArrayLockSize =
            ( /*512 */ RADEON_BUFFER_SIZE * 16 * 1024) / (4 * 4);
 -#endif
  #endif
  
+       ctx->Const.MaxDrawBuffers = 1;
        /* Initialize the software rasterizer and helper modules.
         */
        _swrast_CreateContext(ctx);
Simple merge
index 8055952a768a00c7b34ef342af65fa8f21c7143d,16ce4a11999b30201628b7b28f41700e20ac9367..f46477f0f6714d67496788ca23a5edc641c0ca93
@@@ -173,47 -175,43 +173,49 @@@ int r300NumVerts(r300ContextPtr rmesa, 
  static void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts)
  {
        r300ContextPtr rmesa = R300_CONTEXT(ctx);
 -      struct r300_dma_region *rvb = &rmesa->state.elt_dma;
        void *out;
  
 -      if (r300IsGartMemory(rmesa, elts, n_elts * 4)) {
 -              rvb->address = rmesa->radeon.radeonScreen->gartTextures.map;
 -              rvb->start = ((char *)elts) - rvb->address;
 -              rvb->aos_offset =
 -                  rmesa->radeon.radeonScreen->gart_texture_offset +
 -                  rvb->start;
 -              return;
 -      } else if (r300IsGartMemory(rmesa, elts, 1)) {
 -              WARN_ONCE("Pointer not within GART memory!\n");
 -              _mesa_exit(-1);
 -      }
 -
 -      r300AllocDmaRegion(rmesa, rvb, n_elts * 4, 4);
 -      rvb->aos_offset = GET_START(rvb);
 -
 -      out = rvb->address + rvb->start;
 +      radeonAllocDmaRegion(&rmesa->radeon, &rmesa->state.elt_dma_bo,
 +                           &rmesa->state.elt_dma_offset, n_elts * 4, 4);
 +      radeon_bo_map(rmesa->state.elt_dma_bo, 1);
 +      out = rmesa->state.elt_dma_bo->ptr + rmesa->state.elt_dma_offset;
        memcpy(out, elts, n_elts * 4);
 +      radeon_bo_unmap(rmesa->state.elt_dma_bo);
  }
  
 -static void r300FireEB(r300ContextPtr rmesa, unsigned long addr,
 -                     int vertex_count, int type)
 +static void r300FireEB(r300ContextPtr rmesa, int vertex_count, int type)
  {
 -      int cmd_reserved = 0;
 -      int cmd_written = 0;
 -      drm_radeon_cmd_header_t *cmd = NULL;
 -
 -      start_packet3(CP_PACKET3(R300_PACKET3_3D_DRAW_INDX_2, 0), 0);
 -      e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type | R300_VAP_VF_CNTL__INDEX_SIZE_32bit);
 -
 -      start_packet3(CP_PACKET3(R300_PACKET3_INDX_BUFFER, 2), 2);
 -      e32(R300_INDX_BUFFER_ONE_REG_WR | (0 << R300_INDX_BUFFER_SKIP_SHIFT) |
 -          (R300_VAP_PORT_IDX0 >> 2));
 -      e32(addr);
 -      e32(vertex_count);
 +      BATCH_LOCALS(&rmesa->radeon);
 +
 +      if (vertex_count > 0) {
 +              BEGIN_BATCH(10);
 +              OUT_BATCH_PACKET3(R300_PACKET3_3D_DRAW_INDX_2, 0);
 +              OUT_BATCH(R300_VAP_VF_CNTL__PRIM_WALK_INDICES |
 +                        ((vertex_count + 0) << 16) |
 +                        type |
 +                        R300_VAP_VF_CNTL__INDEX_SIZE_32bit);
 +              
 +              if (!rmesa->radeon.radeonScreen->kernel_mm) {
 +                      OUT_BATCH_PACKET3(R300_PACKET3_INDX_BUFFER, 2);
-                       OUT_BATCH(R300_EB_UNK1 | (0 << 16) | R300_EB_UNK2);
++                      OUT_BATCH(R300_INDX_BUFFER_ONE_REG_WR | (0 << R300_INDX_BUFFER_SKIP_SHIFT) |
++                               (R300_VAP_PORT_IDX0 >> 2));
 +                      OUT_BATCH_RELOC(rmesa->state.elt_dma_offset,
 +                                      rmesa->state.elt_dma_bo,
 +                                      rmesa->state.elt_dma_offset,
 +                                      RADEON_GEM_DOMAIN_GTT, 0, 0);
 +                      OUT_BATCH(vertex_count);
 +              } else {
 +                      OUT_BATCH_PACKET3(R300_PACKET3_INDX_BUFFER, 2);
-                       OUT_BATCH(R300_EB_UNK1 | (0 << 16) | R300_EB_UNK2);
++                      OUT_BATCH(R300_INDX_BUFFER_ONE_REG_WR | (0 << R300_INDX_BUFFER_SKIP_SHIFT) |
++                               (R300_VAP_PORT_IDX0 >> 2));
 +                      OUT_BATCH(rmesa->state.elt_dma_offset);
 +                      OUT_BATCH(vertex_count);
 +                      radeon_cs_write_reloc(rmesa->radeon.cmdbuf.cs,
 +                                            rmesa->state.elt_dma_bo,
 +                                            RADEON_GEM_DOMAIN_GTT, 0, 0);
 +              }
 +              END_BATCH();
 +      }
  }
  
  static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset)
index 8b06fb4d3e9baff44eff068f01cd7c843b5ff1dc,56c22faafa7572e027fb8a0ca0758a3b31104b4e..21b94d2e527db75a893790422a0efd13e514634b
@@@ -212,7 -206,10 +212,9 @@@ DRI_CONF_BEGI
  DRI_CONF_END;
  static const GLuint __driNConfigOptions = 17;
  
+ extern const struct dri_extension gl_20_extension[];
  #ifndef RADEON_DEBUG
 -int RADEON_DEBUG = 0;
  
  static const struct dri_debug_control debug_control[] = {
        {"fall", DEBUG_FALLBACKS},