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
index 59c2eb157b71d43d73e473490dcd707f9cbe3301,b9ece4e83e0a549566b326903d40a232fa67dfeb..c9daffbb3ae4703c6948806c2f6ed3dcbb8d9b68
  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
index 1dbf14ee7b9cb01a451fab8125e67c8f6f91c684,1a05f369d9b4d155c613527d854120bd5bb7ca12..c4be9c05a3ee22f079250ef9d74e39b137a558f5
@@@ -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);
index 264ab3d4566b6446a31ff50a3967f8888df791e9,977c8d67b551881161d7af1fdf928d97d77547f9..75e09deabc44d7c064bcefcc68d0a9a72c2ce46c
@@@ -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;
     }
  
index a484f38e9f12fcbf795e35cf8332d612bb699e4d,0dc9663de6a33ee6b0075eedfee2d3a96ac857d5..436de9c4dbde0d46318a59d81402e5f8f804e44d
@@@ -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
index a8c1b14428ff6c35d1a40095564acdd4dbb240ae,ff217d66c85e5e53288bfe85120443a8d378bb50..f39c46e596ce1f4867fd8286303a86353e7aa3d7
@@@ -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;
index e30b9904fa51e2091fd7e45caf51671dceb0f71f,9d5700ef439a2cb0c76d94babdccc714407595cc..f8eeebf6a7197b9ce9d0abbff3b9bb8099303498
@@@ -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
  }
index 75eeaeba1f71ce70f04c441494669b2f6f26843d,2f22ac22bbf7ca1fd9eee4cadd0d1abf3f022058..0303c5b2ea9f67444e53bd277860a8e0ed2a0230
@@@ -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