vl: Adapt to dri changes.
authorYounes Manton <younes.m@gmail.com>
Sat, 24 Apr 2010 19:37:25 +0000 (15:37 -0400)
committerYounes Manton <younes.m@gmail.com>
Sat, 24 Apr 2010 19:37:25 +0000 (15:37 -0400)
src/gallium/drivers/nv40/nv40_screen.c
src/gallium/drivers/nv40/nv40_video_context.c
src/gallium/drivers/nv40/nv40_video_context.h
src/gallium/include/pipe/p_screen.h
src/gallium/winsys/g3dvl/dri/dri_winsys.c
src/gallium/winsys/g3dvl/drm/Makefile.template
src/gallium/winsys/g3dvl/drm/nouveau/Makefile

index b216c5e38c95f391def494132cb70449eab4cfca..779b7cdcb6fa6342307fed7a3db7106278007c8c 100644 (file)
@@ -1,6 +1,7 @@
 #include "pipe/p_screen.h"
 
 #include "nv40_context.h"
+#include "nv40_video_context.h"
 #include "nv40_screen.h"
 
 #define NV4X_GRCLASS4097_CHIPSETS 0x00000baf
@@ -199,6 +200,7 @@ nv40_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
        pscreen->get_paramf = nv40_screen_get_paramf;
        pscreen->is_format_supported = nv40_screen_surface_format_supported;
        pscreen->context_create = nv40_create;
+       pscreen->video_context_create = nv40_video_create;
 
        nv40_screen_init_miptree_functions(pscreen);
        nv40_screen_init_transfer_functions(pscreen);
index e2985e5a9c80f253f0d7a4ab1faf548291dd3cf8..15a26ea3b3b10a01744fbb596bd4df6761f46439 100644 (file)
 #include "nv40_video_context.h"
 #include <softpipe/sp_video_context.h>
 
-
 struct pipe_video_context *
-nv40_video_create(struct pipe_context *pipe, enum pipe_video_profile profile,
+nv40_video_create(struct pipe_screen *screen, enum pipe_video_profile profile,
                   enum pipe_video_chroma_format chroma_format,
-                  unsigned width, unsigned height,
-                  unsigned pvctx_id)
+                  unsigned width, unsigned height, void *priv)
 {
-   assert(pipe);
+   struct pipe_context *pipe;
+
+   assert(screen);
+
+   pipe = screen->context_create(screen, priv);
+   if (!pipe)
+      return NULL;
+
    return sp_video_create_ex(pipe, profile, chroma_format, width, height,
                              VL_MPEG12_MC_RENDERER_BUFFER_PICTURE,
                              VL_MPEG12_MC_RENDERER_EMPTY_BLOCK_XFER_ONE,
index 206a342e35ee436383c38c234d7b67a5dd4fc410..64196caca72dc739012001b802e15b0bdb5c6362 100644 (file)
 
 #include <pipe/p_video_context.h>
 
-struct pipe_context;
-
-struct pipe_video_context*
-nv40_video_create(struct pipe_context *pipe, enum pipe_video_profile profile,
+struct pipe_video_context *
+nv40_video_create(struct pipe_screen *screen, enum pipe_video_profile profile,
                   enum pipe_video_chroma_format chroma_format,
-                  unsigned width, unsigned height,
-                  unsigned pvctx_id);
+                  unsigned width, unsigned height, void *priv);
 
 #endif
index b8e007ec8acf77d4fef68656c5223b17adb45aed..cf6a9c5e2f0fae02a6ca84c9f35ee325811e7316 100644 (file)
@@ -86,8 +86,13 @@ struct pipe_screen {
    float (*get_paramf)( struct pipe_screen *, int param );
 
    struct pipe_context * (*context_create)( struct pipe_screen *,
-                                           void *priv );
-   
+                                            void *priv );
+
+   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 );
+
    /**
     * Check if the given pipe_format is supported as a texture or
     * drawing surface.
index da54c0976f68305de40727b6554825da659c7831..c8ff8fae169c89d814b506ab4b71c73a789f1576 100644 (file)
@@ -358,18 +358,18 @@ vl_video_create(struct vl_screen *vscreen,
    /* XXX: Is default visual correct/sufficient here? */
    driCreateContext(vl_dri_scrn->dri_screen, vl_dri_scrn->visual, &vl_dri_ctx->dri_context);
 
-   if (!vl_dri_scrn->api->create_video_context) {
+   if (!vscreen->pscreen->video_context_create) {
       debug_printf("[G3DVL] No video support found on %s/%s.\n",
-                   vl_dri_scrn->base.pscreen->get_vendor(vl_dri_scrn->base.pscreen),
-                   vl_dri_scrn->base.pscreen->get_name(vl_dri_scrn->base.pscreen));
+                   vscreen->pscreen->get_vendor(vscreen->pscreen),
+                   vscreen->pscreen->get_name(vscreen->pscreen));
       FREE(vl_dri_ctx);
       return NULL;
    }
 
-   vl_dri_ctx->base.vpipe = vl_dri_scrn->api->create_video_context(vl_dri_scrn->api,
-                                                                   vscreen->pscreen,
+   vl_dri_ctx->base.vpipe = vscreen->pscreen->video_context_create(vscreen->pscreen,
                                                                    profile, chroma_format,
-                                                                   width, height);
+                                                                   width, height,
+                                                                   vl_dri_ctx->dri_context);
 
    if (!vl_dri_ctx->base.vpipe) {
       FREE(vl_dri_ctx);
index a33d95677c5c588eb67cb03e56e05b790bd2fd9d..2b79deef4bce52f34ec2135513b1a68ca08186c9 100644 (file)
@@ -15,7 +15,7 @@ INCLUDES = $(DRIVER_INCLUDES) \
 
 DEFINES += $(DRIVER_DEFINES) \
            -DGALLIUM_SOFTPIPE \
-          -DGALLIUM_TRACE
+           -DGALLIUM_TRACE
 
 # XXX: Hack, if we include libxvmctracker.a in LIBS none of the symbols are
 # pulled in by the linker because xsp_winsys.c doesn't refer to them
@@ -23,13 +23,7 @@ OBJECTS = $(C_SOURCES:.c=.o) $(TOP)/src/gallium/state_trackers/xorg/xvmc/*.o
 
 LIBS = $(TOP)/src/gallium/winsys/g3dvl/dri/libvldri.a \
        $(PIPE_DRIVERS) \
-       $(TOP)/src/gallium/auxiliary/vl/libvl.a \
-       $(TOP)/src/gallium/auxiliary/draw/libdraw.a \
-       $(TOP)/src/gallium/auxiliary/tgsi/libtgsi.a \
-       $(TOP)/src/gallium/auxiliary/translate/libtranslate.a \
-       $(TOP)/src/gallium/auxiliary/cso_cache/libcso_cache.a \
-       $(TOP)/src/gallium/auxiliary/rtasm/librtasm.a \
-       $(TOP)/src/gallium/auxiliary/util/libutil.a
+       $(TOP)/src/gallium/auxiliary/libgallium.a
 
 .c.o:
        $(CC) -c $(INCLUDES) $(DEFINES) $(CFLAGS) $< -o $@
index fe41ac9269e2a083b4d2e767ff5aa710500f13f8..5c55186f672ca32f16045fefdd70d1027147c364 100644 (file)
@@ -12,9 +12,6 @@ DRIVER_DEFINES = $(shell pkg-config libdrm libdrm_nouveau --cflags-only-other)
 
 PIPE_DRIVERS = \
        $(TOP)/src/gallium/winsys/drm/nouveau/drm/libnouveaudrm.a \
-       $(TOP)/src/gallium/drivers/nv04/libnv04.a \
-       $(TOP)/src/gallium/drivers/nv10/libnv10.a \
-       $(TOP)/src/gallium/drivers/nv20/libnv20.a \
        $(TOP)/src/gallium/drivers/nv30/libnv30.a \
        $(TOP)/src/gallium/drivers/nv40/libnv40.a \
        $(TOP)/src/gallium/drivers/nv50/libnv50.a \