Merge branch 'pipe-video' of git://anongit.freedesktop.org/~deathsimple/xvmc-r600...
authorThomas Balling Sørensen <tball@tball-laptop.(none)>
Tue, 26 Oct 2010 11:01:40 +0000 (13:01 +0200)
committerThomas Balling Sørensen <tball@tball-laptop.(none)>
Tue, 26 Oct 2010 11:01:40 +0000 (13:01 +0200)
Conflicts:
configure.ac
src/gallium/auxiliary/vl/vl_compositor.c
src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
src/gallium/drivers/softpipe/sp_video_context.c
src/gallium/include/pipe/p_defines.h
src/gallium/include/pipe/p_screen.h

1  2 
configure.ac
src/gallium/auxiliary/vl/vl_compositor.c
src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
src/gallium/drivers/r600/Makefile
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/softpipe/sp_video_context.c
src/gallium/include/pipe/p_defines.h
src/gallium/include/pipe/p_screen.h

diff --cc configure.ac
  dnl Gallium helper functions
  dnl
  gallium_check_st() {
++<<<<<<< HEAD
 +    if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_EGL" = xyes || test "x$HAVE_ST_XORG" = xyes || test "x$HAVE_ST_XVMC" = xyes || test "x$HAVE_ST_VDPAU" = xyes || test "x$HAVE_ST_VA" = xyes; then
++=======
+     if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes || test "x$HAVE_ST_XVMC" = xyes; then
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
           GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
      fi
      if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
      if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
           GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
      fi
++<<<<<<< HEAD
 +    if test "x$HAVE_ST_XORG" = xyes && test "x$4" != x; then
 +         GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
 +    fi
 +    if test "x$HAVE_ST_XVMC" = xyes && test "x$5" != x; then
 +         GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
 +    fi
 +    if test "x$HAVE_ST_VDPAU" = xyes && test "x$6" != x; then
 +         GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
 +    fi
 +    if test "x$HAVE_ST_VA" = xyes && test "x$7" != x; then
 +         GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $7"
 +    fi
++=======
+     if test "x$HAVE_ST_XVMC" = xyes && test "x$5" != x; then
+          GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
+     fi
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
  }
  
  
@@@ -1609,7 -1586,7 +1619,11 @@@ AC_ARG_ENABLE([gallium-nouveau]
      [enable_gallium_nouveau=no])
  if test "x$enable_gallium_nouveau" = xyes; then
      GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50"
++<<<<<<< HEAD
 +    gallium_check_st "nouveau/drm" "dri-nouveau" "egl-nouveau" "xorg-nouveau" "xvmc-nouveau"
++=======
+     gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "xvmc-nouveau"
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
  fi
  
  dnl
@@@ -556,9 -557,7 +558,8 @@@ static void draw_layers(struct vl_compo
  
        c->pipe->bind_fs_state(c->pipe, frag_shaders[i]);
        c->pipe->set_fragment_sampler_views(c->pipe, 1, &surface_view);
-         
 +
-         util_draw_arrays(c->pipe,PIPE_PRIM_TRIANGLES,i * 6,6);
+       util_draw_arrays(c->pipe, PIPE_PRIM_TRIANGLES, i * 6, 6);
  
        if (delete_view) {
           pipe_sampler_view_reference(&surface_view, NULL);
@@@ -1077,8 -1079,8 +1082,8 @@@ flush(struct vl_mpeg12_mc_renderer *r
        r->pipe->bind_vs_state(r->pipe, r->i_vs);
        r->pipe->bind_fs_state(r->pipe, r->i_fs);
  
-         util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_INTRA] * 24);
-         
 -      util_draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start,
 -                       num_macroblocks[MACROBLOCK_TYPE_INTRA] * 24);
++      util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_INTRA] * 24);
++
        vb_start += num_macroblocks[MACROBLOCK_TYPE_INTRA] * 24;
     }
  
        r->pipe->bind_vs_state(r->pipe, r->p_vs[0]);
        r->pipe->bind_fs_state(r->pipe, r->p_fs[0]);
  
-         util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_FWD_FRAME_PRED] * 24);
 -      util_draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start,
 -                       num_macroblocks[MACROBLOCK_TYPE_FWD_FRAME_PRED] * 24);
++      util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_FWD_FRAME_PRED] * 24);
++
 +
        vb_start += num_macroblocks[MACROBLOCK_TYPE_FWD_FRAME_PRED] * 24;
     }
  
        r->pipe->bind_vs_state(r->pipe, r->p_vs[1]);
        r->pipe->bind_fs_state(r->pipe, r->p_fs[1]);
  
-         util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_FWD_FIELD_PRED] * 24);
 -      util_draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start,
 -                       num_macroblocks[MACROBLOCK_TYPE_FWD_FIELD_PRED] * 24);
++      util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_FWD_FIELD_PRED] * 24);
++
 +
        vb_start += num_macroblocks[MACROBLOCK_TYPE_FWD_FIELD_PRED] * 24;
     }
  
        r->pipe->bind_vs_state(r->pipe, r->b_vs[0]);
        r->pipe->bind_fs_state(r->pipe, r->b_fs[0]);
  
 -      util_draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start,
 -                       num_macroblocks[MACROBLOCK_TYPE_BI_FRAME_PRED] * 24);
++
 +      util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_BI_FRAME_PRED] * 24);
 +
        vb_start += num_macroblocks[MACROBLOCK_TYPE_BI_FRAME_PRED] * 24;
     }
  
@@@ -17,10 -17,9 +17,11 @@@ C_SOURCES = 
        r600_shader.c \
        r600_state.c \
        r600_texture.c \
+       r600_video_context.c \
        r700_asm.c \
        evergreen_state.c \
 -      eg_asm.c
 +      eg_asm.c \
 +      r600_translate.c \
 +      r600_state_common.c
  
  include ../../Makefile.template
Simple merge
@@@ -98,8 -98,8 +98,13 @@@ sp_mpeg12_is_format_supported(struct pi
     if (geom & PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO)
        return FALSE;
  
++<<<<<<< HEAD
 +   return ctx->pipe->screen->is_format_supported(ctx->pipe->screen, format, PIPE_TEXTURE_2D, 1,
 +                                                  usage, geom);
++=======
+    return ctx->pipe->screen->is_format_supported(ctx->pipe->screen, format, PIPE_TEXTURE_2D,
+                                                  0, usage, geom);
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
  }
  
  static void
@@@ -126,13 -126,14 +131,14 @@@ sp_mpeg12_decode_macroblocks(struct pip
  }
  
  static void
 -sp_mpeg12_surface_fill(struct pipe_video_context *vpipe,
 +sp_mpeg12_clear_render_target(struct pipe_video_context *vpipe,
                         struct pipe_surface *dst,
                         unsigned dstx, unsigned dsty,
 -                       unsigned width, unsigned height,
 -                       unsigned value)
 +                                         const float *rgba,
 +                       unsigned width, unsigned height)
  {
     struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe;
+    float rgba[4] = { 0, 0, 0, 0 };
  
     assert(vpipe);
     assert(dst);
@@@ -158,10 -157,20 +164,27 @@@ sp_mpeg12_resource_copy_region(struct p
     assert(vpipe);
     assert(dst);
  
++<<<<<<< HEAD
 +   if (ctx->pipe->resource_copy_region)
 +      ctx->pipe->resource_copy_region(ctx->pipe, dst, subdst, dstx, dsty, dstz, src, subsrc, srcx, srcy, srcz, width, height);
 +   else
 +      util_resource_copy_region(ctx->pipe, dst, subdst, dstx, dsty, dstz, src, subsrc, srcx, srcy, srcz, width, height);
++=======
+    struct pipe_subresource subdst, subsrc;
+    subdst.face = dst->face;
+    subdst.level = dst->level;
+    subsrc.face = src->face;
+    subsrc.level = src->level;
+    if (ctx->pipe->resource_copy_region)
+       ctx->pipe->resource_copy_region(ctx->pipe, dst->texture, subdst, dstx, dsty, dst->zslice,
+                                       src->texture, subsrc, srcx, srcy, src->zslice,
+                                       width, height);
+    else
+       util_resource_copy_region(ctx->pipe, dst->texture, subdst, dstx, dsty, dst->zslice,
+                                 src->texture, subsrc, srcx, srcy, src->zslice,
+                                 width, height);
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
  }
  
  static struct pipe_transfer*
@@@ -342,9 -352,12 +366,18 @@@ init_pipe_state(struct sp_mpeg12_contex
     rast.flatshade = 1;
     rast.flatshade_first = 0;
     rast.light_twoside = 0;
++<<<<<<< HEAD
 +   rast.cull_face = PIPE_FACE_FRONT;
 +   rast.fill_front = PIPE_POLYGON_MODE_FILL;
 +   rast.fill_back = PIPE_POLYGON_MODE_FILL;
++=======
+    rast.front_ccw = 1;
+    rast.cull_face = PIPE_FACE_NONE;
+    rast.fill_back = PIPE_POLYGON_MODE_FILL;
+    rast.fill_front = PIPE_POLYGON_MODE_FILL;
+    rast.offset_point = 0;
+    rast.offset_line = 0;
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
     rast.scissor = 0;
     rast.poly_smooth = 0;
     rast.poly_stipple_enable = 0;
     ctx->rast = ctx->pipe->create_rasterizer_state(ctx->pipe, &rast);
     ctx->pipe->bind_rasterizer_state(ctx->pipe, ctx->rast);
  
++<<<<<<< HEAD
 +
++=======
+    memset(&blend, 0, sizeof blend);
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
     blend.independent_blend_enable = 0;
     blend.rt[0].blend_enable = 0;
     blend.rt[0].rgb_func = PIPE_BLEND_ADD;
@@@ -494,7 -492,6 +494,10 @@@ enum pipe_shader_ca
  #define PIPE_REFERENCED_FOR_READ  (1 << 0)
  #define PIPE_REFERENCED_FOR_WRITE (1 << 1)
  
++<<<<<<< HEAD
 +
++=======
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
  enum pipe_video_codec
  {
     PIPE_VIDEO_CODEC_UNKNOWN = 0,
@@@ -520,7 -516,6 +523,10 @@@ enum pipe_video_profil
     PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH
  };
  
++<<<<<<< HEAD
 +
++=======
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
  /**
   * Composite query types
   */
@@@ -534,7 -529,6 +540,10 @@@ struct pipe_query_data_timestamp_disjoi
     uint64_t frequency;
     boolean  disjoint;
  };
++<<<<<<< HEAD
 +
++=======
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
  
  #ifdef __cplusplus
  }
@@@ -92,13 -92,13 +92,21 @@@ struct pipe_screen 
      */
     int (*get_shader_param)( struct pipe_screen *, unsigned shader, enum pipe_shader_cap param );
  
++<<<<<<< HEAD
 +   struct pipe_context * (*context_create)( struct pipe_screen *, void *priv );
++=======
+    struct pipe_context * (*context_create)( struct pipe_screen *,
+                                             void *priv );
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
  
     struct pipe_video_context * (*video_context_create)( struct pipe_screen *screen,
                                                          enum pipe_video_profile profile,
                                                          enum pipe_video_chroma_format chroma_format,
                                                          unsigned width, unsigned height, void *priv );
++<<<<<<< HEAD
 +
++=======
++>>>>>>> 97a7cf230a70c64fff300931ae7c00aa00449c97
  
     /**
      * Check if the given pipe_format is supported as a texture or