[Mesa-dev] [PATCH] gallium/vl: remove remaining softpipe video functions

Christian König deathsimple at vodafone.de
Tue Feb 11 02:57:12 PST 2014


From: Christian König <christian.koenig at amd.com>

Unused and unmaintained for quite a while.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 src/gallium/auxiliary/vl/vl_winsys.h      |   4 +-
 src/gallium/auxiliary/vl/vl_winsys_xsp.c  | 170 ------------------------------
 src/gallium/drivers/softpipe/sp_context.c |   5 -
 src/gallium/drivers/softpipe/sp_screen.c  |  31 ------
 4 files changed, 1 insertion(+), 209 deletions(-)
 delete mode 100644 src/gallium/auxiliary/vl/vl_winsys_xsp.c

diff --git a/src/gallium/auxiliary/vl/vl_winsys.h b/src/gallium/auxiliary/vl/vl_winsys.h
index a433f1b..642f010 100644
--- a/src/gallium/auxiliary/vl/vl_winsys.h
+++ b/src/gallium/auxiliary/vl/vl_winsys.h
@@ -26,9 +26,7 @@
  **************************************************************************/
 
 /*
- * vl targets use either a dri or sw based winsys backend, so their
- * Makefiles directly refer to either vl_winsys_dri.c or vl_winsys_xsp.c.
- * Both files implement the interface described in this header.
+ * Target makefiles directly refer to vl_winsys_dri.c to avoid DRI dependency
  */
 
 #ifndef vl_winsys_h
diff --git a/src/gallium/auxiliary/vl/vl_winsys_xsp.c b/src/gallium/auxiliary/vl/vl_winsys_xsp.c
deleted file mode 100644
index 72e53a0..0000000
--- a/src/gallium/auxiliary/vl/vl_winsys_xsp.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/**************************************************************************
- *
- * Copyright 2009 Younes Manton.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-/* directly referenced from target Makefile, because of X dependencies */
-
-#include <sys/time.h>
-
-#include "pipe/p_state.h"
-
-#include "util/u_memory.h"
-#include "util/u_format.h"
-#include "util/u_inlines.h"
-
-#include "state_tracker/xlib_sw_winsys.h"
-#include "softpipe/sp_public.h"
-
-#include "vl/vl_compositor.h"
-#include "vl/vl_winsys.h"
-
-struct vl_xsp_screen
-{
-   struct vl_screen base;
-   Display *display;
-   int screen;
-   Visual visual;
-   struct xlib_drawable xdraw;
-   struct pipe_resource *tex;
-   struct u_rect dirty_area;
-};
-
-struct pipe_resource*
-vl_screen_texture_from_drawable(struct vl_screen *vscreen, Drawable drawable)
-{
-   struct vl_xsp_screen *xsp_screen = (struct vl_xsp_screen*)vscreen;
-   Window root;
-   int x, y;
-   unsigned int width, height;
-   unsigned int border_width;
-   unsigned int depth;
-   struct pipe_resource templat;
-
-   assert(vscreen);
-   assert(drawable != None);
-
-   if (XGetGeometry(xsp_screen->display, drawable, &root, &x, &y, &width, &height, &border_width, &depth) == BadDrawable)
-      return NULL;
-
-   xsp_screen->xdraw.drawable = drawable;
-
-   if (xsp_screen->tex) {
-      if (xsp_screen->tex->width0 == width && xsp_screen->tex->height0 == height)
-         return xsp_screen->tex;
-      pipe_resource_reference(&xsp_screen->tex, NULL);
-      vl_compositor_reset_dirty_area(&xsp_screen->dirty_area);
-   }
-
-   memset(&templat, 0, sizeof(struct pipe_resource));
-   templat.target = PIPE_TEXTURE_2D;
-   /* XXX: Need to figure out drawable's format */
-   templat.format = PIPE_FORMAT_B8G8R8X8_UNORM;
-   templat.last_level = 0;
-   templat.width0 = width;
-   templat.height0 = height;
-   templat.depth0 = 1;
-   templat.usage = PIPE_USAGE_DEFAULT;
-   templat.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET;
-   templat.flags = 0;
-
-   xsp_screen->xdraw.depth = 24/*util_format_get_blocksizebits(templat.format) /
-                             util_format_get_blockwidth(templat.format)*/;
-
-   pipe_resource_reference(&xsp_screen->tex, vscreen->pscreen->resource_create(vscreen->pscreen, &templat));
-   return xsp_screen->tex;
-}
-
-struct u_rect *
-vl_screen_get_dirty_area(struct vl_screen *vscreen)
-{
-   struct vl_xsp_screen *xsp_screen = (struct vl_xsp_screen*)vscreen;
-   return &xsp_screen->dirty_area;
-}
-
-uint64_t
-vl_screen_get_timestamp(struct vl_screen *vscreen, Drawable drawable)
-{
-   struct timeval tv;
-   gettimeofday(&tv, NULL);
-   return (uint64_t)tv.tv_sec * 1000000000LL + (uint64_t)tv.tv_usec * 1000LL;
-}
-
-void
-vl_screen_set_next_timestamp(struct vl_screen *vscreen, uint64_t stamp)
-{
-   /* not supported on softpipe and so only a dummy */
-}
-
-void*
-vl_screen_get_private(struct vl_screen *vscreen)
-{
-   struct vl_xsp_screen *xsp_screen = (struct vl_xsp_screen*)vscreen;
-   return &xsp_screen->xdraw;
-}
-
-struct vl_screen*
-vl_screen_create(Display *display, int screen)
-{
-   struct vl_xsp_screen *xsp_screen;
-   struct sw_winsys *winsys;
-
-   assert(display);
-
-   xsp_screen = CALLOC_STRUCT(vl_xsp_screen);
-   if (!xsp_screen)
-      return NULL;
-
-   winsys = xlib_create_sw_winsys(display);
-   if (!winsys) {
-      FREE(xsp_screen);
-      return NULL;
-   }
-
-   xsp_screen->base.pscreen = softpipe_create_screen(winsys);
-   if (!xsp_screen->base.pscreen) {
-      winsys->destroy(winsys);
-      FREE(xsp_screen);
-      return NULL;
-   }
-
-   xsp_screen->display = display;
-   xsp_screen->screen = screen;
-   xsp_screen->xdraw.visual = XDefaultVisual(display, screen);
-   vl_compositor_reset_dirty_area(&xsp_screen->dirty_area);
-
-   return &xsp_screen->base;
-}
-
-void vl_screen_destroy(struct vl_screen *vscreen)
-{
-   struct vl_xsp_screen *xsp_screen = (struct vl_xsp_screen*)vscreen;
-
-   assert(vscreen);
-
-   pipe_resource_reference(&xsp_screen->tex, NULL);
-   vscreen->pscreen->destroy(vscreen->pscreen);
-   FREE(vscreen);
-}
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index b4c85df..34d2b80 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -38,8 +38,6 @@
 #include "util/u_pstipple.h"
 #include "util/u_inlines.h"
 #include "tgsi/tgsi_exec.h"
-#include "vl/vl_decoder.h"
-#include "vl/vl_video_buffer.h"
 #include "sp_clear.h"
 #include "sp_context.h"
 #include "sp_flush.h"
@@ -228,9 +226,6 @@ softpipe_create_context( struct pipe_screen *screen,
 
    softpipe->pipe.render_condition = softpipe_render_condition;
    
-   softpipe->pipe.create_video_codec = vl_create_decoder;
-   softpipe->pipe.create_video_buffer = vl_video_buffer_create;
-
    /*
     * Alloc caches for accessing drawing surfaces and textures.
     * Must be before quad stage setup!
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
index 147196e..46ac519 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -34,8 +34,6 @@
 #include "pipe/p_defines.h"
 #include "pipe/p_screen.h"
 #include "draw/draw_context.h"
-#include "vl/vl_decoder.h"
-#include "vl/vl_video_buffer.h"
 
 #include "state_tracker/sw_winsys.h"
 #include "tgsi/tgsi_exec.h"
@@ -250,33 +248,6 @@ softpipe_get_paramf(struct pipe_screen *screen, enum pipe_capf param)
    return 0.0;
 }
 
-static int
-softpipe_get_video_param(struct pipe_screen *screen,
-                         enum pipe_video_profile profile,
-			 enum pipe_video_entrypoint entrypoint,
-                         enum pipe_video_cap param)
-{
-   switch (param) {
-   case PIPE_VIDEO_CAP_SUPPORTED:
-       return vl_profile_supported(screen, profile, entrypoint);
-   case PIPE_VIDEO_CAP_NPOT_TEXTURES:
-      return 0;
-   case PIPE_VIDEO_CAP_MAX_WIDTH:
-   case PIPE_VIDEO_CAP_MAX_HEIGHT:
-      return vl_video_buffer_max_size(screen);
-   case PIPE_VIDEO_CAP_PREFERED_FORMAT:
-      return PIPE_FORMAT_NV12;
-   case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
-      return false;
-   case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED:
-      return false;
-   case PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE:
-      return true;
-   default:
-      return 0;
-   }
-}
-
 /**
  * Query format support for creating a texture, drawing surface, etc.
  * \param format  the format to test
@@ -408,10 +379,8 @@ softpipe_create_screen(struct sw_winsys *winsys)
    screen->base.get_param = softpipe_get_param;
    screen->base.get_shader_param = softpipe_get_shader_param;
    screen->base.get_paramf = softpipe_get_paramf;
-   screen->base.get_video_param = softpipe_get_video_param;
    screen->base.get_timestamp = softpipe_get_timestamp;
    screen->base.is_format_supported = softpipe_is_format_supported;
-   screen->base.is_video_format_supported = vl_video_buffer_is_format_supported;
    screen->base.context_create = softpipe_create_context;
    screen->base.flush_frontbuffer = softpipe_flush_frontbuffer;
 
-- 
1.8.3.2



More information about the mesa-dev mailing list