From: Younes Manton Date: Sat, 24 Apr 2010 19:37:25 +0000 (-0400) Subject: vl: Adapt to dri changes. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f64d0cf524b2203e648a060366a2e4220096aa1f;p=mesa.git vl: Adapt to dri changes. --- diff --git a/src/gallium/drivers/nv40/nv40_screen.c b/src/gallium/drivers/nv40/nv40_screen.c index b216c5e38c9..779b7cdcb6f 100644 --- a/src/gallium/drivers/nv40/nv40_screen.c +++ b/src/gallium/drivers/nv40/nv40_screen.c @@ -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); diff --git a/src/gallium/drivers/nv40/nv40_video_context.c b/src/gallium/drivers/nv40/nv40_video_context.c index e2985e5a9c8..15a26ea3b3b 100644 --- a/src/gallium/drivers/nv40/nv40_video_context.c +++ b/src/gallium/drivers/nv40/nv40_video_context.c @@ -28,14 +28,19 @@ #include "nv40_video_context.h" #include - 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, diff --git a/src/gallium/drivers/nv40/nv40_video_context.h b/src/gallium/drivers/nv40/nv40_video_context.h index 206a342e35e..64196caca72 100644 --- a/src/gallium/drivers/nv40/nv40_video_context.h +++ b/src/gallium/drivers/nv40/nv40_video_context.h @@ -30,12 +30,9 @@ #include -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 diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index b8e007ec8ac..cf6a9c5e2f0 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -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. diff --git a/src/gallium/winsys/g3dvl/dri/dri_winsys.c b/src/gallium/winsys/g3dvl/dri/dri_winsys.c index da54c0976f6..c8ff8fae169 100644 --- a/src/gallium/winsys/g3dvl/dri/dri_winsys.c +++ b/src/gallium/winsys/g3dvl/dri/dri_winsys.c @@ -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); diff --git a/src/gallium/winsys/g3dvl/drm/Makefile.template b/src/gallium/winsys/g3dvl/drm/Makefile.template index a33d95677c5..2b79deef4bc 100644 --- a/src/gallium/winsys/g3dvl/drm/Makefile.template +++ b/src/gallium/winsys/g3dvl/drm/Makefile.template @@ -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 $@ diff --git a/src/gallium/winsys/g3dvl/drm/nouveau/Makefile b/src/gallium/winsys/g3dvl/drm/nouveau/Makefile index fe41ac9269e..5c55186f672 100644 --- a/src/gallium/winsys/g3dvl/drm/nouveau/Makefile +++ b/src/gallium/winsys/g3dvl/drm/nouveau/Makefile @@ -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 \