Squashed commit of gallium-no-texture-blanket
authorKeith Whitwell <keithw@vmware.com>
Tue, 9 Mar 2010 10:54:13 +0000 (10:54 +0000)
committerKeith Whitwell <keithw@vmware.com>
Tue, 9 Mar 2010 10:54:54 +0000 (10:54 +0000)
commit f90b3f01af82b9522067b1824e21709a6fb2d3af
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 8 14:39:44 2010 +0000

    gallium: remove p_screen::surface_buffer_create

    This isn't very useful without texture_blanket(), which has also been
    removed.

    Note that this function hasn't been removed from the old pipe_winsys
    (u_simple_screen) still used internally by some drivers (eg softpipe).

commit 6c462de39a4b9980a5f034a95e580efdfcb8173b
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 8 14:27:40 2010 +0000

    egl/x11: disable texture_blanket usage

commit b42da9160df9f47224e5b3291b972f41767aa6e5
Merge: 4be2436 3ca9336
Author: Keith Whitwell <keithw@vmware.com>
Date:   Mon Mar 8 14:27:24 2010 +0000

    Merge commit 'origin/master' into gallium-no-texture-blanket

    Conflicts:
     src/gallium/drivers/svga/svga_screen_texture.c

commit 4be2436316929e3dfc55bc34d810920c06556b66
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 4 14:59:26 2010 +0000

    gallium: remove texture blanket call

    No longer needed, except for nouveau and egl/xll/native_ximage.c.

    Fix for nouveau is to keep the call, but move it to an internal
    function within nouveau.

    Fix for that egl/x11 relies on gallium-sw-api branch or its successor.

commit 69b6764330367d63c237d0bde9fb96435d0e0257
Author: Keith Whitwell <keithw@vmware.com>
Date:   Thu Mar 4 13:35:16 2010 +0000

    drm_api: wrap comment

19 files changed:
src/gallium/auxiliary/util/u_simple_screen.c
src/gallium/drivers/i915/i915_texture.c
src/gallium/drivers/i965/brw_screen_texture.c
src/gallium/drivers/i965/brw_winsys.h
src/gallium/drivers/identity/id_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/nouveau/nouveau_screen.c
src/gallium/drivers/nouveau/nouveau_screen.h
src/gallium/drivers/nv30/nv30_miptree.c
src/gallium/drivers/nv40/nv40_miptree.c
src/gallium/drivers/nv50/nv50_miptree.c
src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/softpipe/sp_texture.c
src/gallium/drivers/svga/svga_screen_texture.c
src/gallium/drivers/trace/tr_screen.c
src/gallium/include/pipe/p_screen.h
src/gallium/include/state_tracker/drm_api.h
src/gallium/state_trackers/egl/x11/native_ximage.c

index 53f3c16dbccbaaca0ded0b77f16e1f0f6efe52f2..9203cb6580c86452b9e17da2bf0456e8b49a5029 100644 (file)
@@ -59,22 +59,7 @@ pass_user_buffer_create(struct pipe_screen *screen,
    return buffer;
 }
 
-static struct pipe_buffer *
-pass_surface_buffer_create(struct pipe_screen *screen,
-                           unsigned width, unsigned height,
-                           enum pipe_format format,
-                           unsigned usage,
-                           unsigned tex_usage,
-                           unsigned *stride)
-{
-   struct pipe_buffer *buffer =
-      screen->winsys->surface_buffer_create(screen->winsys, width, height,
-                                            format, usage, tex_usage, stride);
 
-   buffer->screen = screen;
-
-   return buffer;
-}
 
 static void *
 pass_buffer_map(struct pipe_screen *screen,
@@ -135,7 +120,6 @@ u_simple_screen_init(struct pipe_screen *screen)
 {
    screen->buffer_create = pass_buffer_create;
    screen->user_buffer_create = pass_user_buffer_create;
-   screen->surface_buffer_create = pass_surface_buffer_create;
 
    screen->buffer_map = pass_buffer_map;
    screen->buffer_unmap = pass_buffer_unmap;
index 5b1f42313ef6156c6517fad0e60d2d9f19f23fa5..3ce52cdcdbd906849bdc4ccb40e19871688993ea 100644 (file)
@@ -724,43 +724,6 @@ i915_texture_get_handle(struct pipe_screen * screen,
    return iws->buffer_get_handle(iws, tex->buffer, whandle, tex->stride);
 }
 
-static struct pipe_texture *
-i915_texture_blanket(struct pipe_screen * screen,
-                     const struct pipe_texture *base,
-                     const unsigned *stride,
-                     struct pipe_buffer *buffer)
-{
-#if 0
-   struct i915_texture *tex;
-   assert(screen);
-
-   /* Only supports one type */
-   if (base->target != PIPE_TEXTURE_2D ||
-       base->last_level != 0 ||
-       base->depth0 != 1) {
-      return NULL;
-   }
-
-   tex = CALLOC_STRUCT(i915_texture);
-   if (!tex)
-      return NULL;
-
-   tex->base = *base;
-   pipe_reference_init(&tex->base.reference, 1);
-   tex->base.screen = screen;
-
-   tex->stride = stride[0];
-
-   i915_miptree_set_level_info(tex, 0, 1, base->width0, base->height0, 1);
-   i915_miptree_set_image_offset(tex, 0, 0, 0, 0);
-
-   pipe_buffer_reference(&tex->buffer, buffer);
-
-   return &tex->base;
-#else
-   return NULL;
-#endif
-}
 
 static void
 i915_texture_destroy(struct pipe_texture *pt)
@@ -923,7 +886,6 @@ i915_init_screen_texture_functions(struct i915_screen *is)
    is->base.texture_create = i915_texture_create;
    is->base.texture_from_handle = i915_texture_from_handle;
    is->base.texture_get_handle = i915_texture_get_handle;
-   is->base.texture_blanket = i915_texture_blanket;
    is->base.texture_destroy = i915_texture_destroy;
    is->base.get_tex_surface = i915_get_tex_surface;
    is->base.tex_surface_destroy = i915_tex_surface_destroy;
index caa16ee1502515a163b8ae73cf55d0d846115ae5..cc79bfc7715117c7a5ba30319f4a41334a4a1e50 100644 (file)
@@ -416,13 +416,7 @@ brw_texture_get_handle(struct pipe_screen *screen,
    return bscreen->sws->bo_get_handle(tex->bo, whandle, stride);
 }
 
-static struct pipe_texture *brw_texture_blanket(struct pipe_screen *screen,
-                                               const struct pipe_texture *templ,
-                                               const unsigned *stride,
-                                               struct pipe_buffer *buffer)
-{
-   return NULL;
-}
+
 
 static void brw_texture_destroy(struct pipe_texture *pt)
 {
@@ -571,7 +565,6 @@ void brw_screen_tex_init( struct brw_screen *brw_screen )
    brw_screen->base.texture_from_handle = brw_texture_from_handle;
    brw_screen->base.texture_get_handle = brw_texture_get_handle;
    brw_screen->base.texture_destroy = brw_texture_destroy;
-   brw_screen->base.texture_blanket = brw_texture_blanket;
    brw_screen->base.get_tex_transfer = brw_get_tex_transfer;
    brw_screen->base.transfer_map = brw_transfer_map;
    brw_screen->base.transfer_unmap = brw_transfer_unmap;
index 139e26e31fef0fe925f3e8c09af55a691fd9a706..f30c7f181323fb0d5cedf364149c613f57a9ee32 100644 (file)
@@ -267,28 +267,6 @@ bo_reference(struct brw_winsys_buffer **ptr, struct brw_winsys_buffer *buf)
 struct pipe_screen *brw_create_screen(struct brw_winsys_screen *iws, unsigned pci_id);
 
 
-/**
- * Get the brw_winsys buffer backing the texture.
- *
- * TODO UGLY
- */
-struct pipe_texture;
-boolean brw_texture_get_winsys_buffer(struct pipe_texture *texture,
-                                      struct brw_winsys_buffer **buffer,
-                                      unsigned *stride);
-
-/**
- * Wrap a brw_winsys buffer with a texture blanket.
- *
- * TODO UGLY
- */
-struct pipe_texture * 
-brw_texture_blanket_winsys_buffer(struct pipe_screen *screen,
-                                  const struct pipe_texture *template,
-                                  unsigned pitch,
-                                 unsigned tiling,
-                                  struct brw_winsys_buffer *buffer);
-
 
 /*************************************************************************
  * Cooperative dumping between winsys and driver.  TODO: make this
index 77e15b92f772e44abd808c82d5c48afb6562b402..b9d0f003d74fd62fd08b33d5f5421a1e687b3c66 100644 (file)
@@ -167,27 +167,7 @@ identity_screen_texture_get_handle(struct pipe_screen *_screen,
    return screen->texture_get_handle(screen, texture, handle);
 }
 
-static struct pipe_texture *
-identity_screen_texture_blanket(struct pipe_screen *_screen,
-                                const struct pipe_texture *templat,
-                                const unsigned *stride,
-                                struct pipe_buffer *_buffer)
-{
-   struct identity_screen *id_screen = identity_screen(_screen);
-   struct identity_buffer *id_buffer = identity_buffer(_buffer);
-   struct pipe_screen *screen = id_screen->screen;
-   struct pipe_buffer *buffer = id_buffer->buffer;
-   struct pipe_texture *result;
-
-   result = screen->texture_blanket(screen,
-                                    templat,
-                                    stride,
-                                    buffer);
 
-   if (result)
-      return identity_texture_create(id_screen, result);
-   return NULL;
-}
 
 static void
 identity_screen_texture_destroy(struct pipe_texture *_texture)
@@ -331,31 +311,6 @@ identity_screen_user_buffer_create(struct pipe_screen *_screen,
    return NULL;
 }
 
-static struct pipe_buffer *
-identity_screen_surface_buffer_create(struct pipe_screen *_screen,
-                                      unsigned width,
-                                      unsigned height,
-                                      enum pipe_format format,
-                                      unsigned usage,
-                                      unsigned tex_usage,
-                                      unsigned *stride)
-{
-   struct identity_screen *id_screen = identity_screen(_screen);
-   struct pipe_screen *screen = id_screen->screen;
-   struct pipe_buffer *result;
-
-   result = screen->surface_buffer_create(screen,
-                                          width,
-                                          height,
-                                          format,
-                                          usage,
-                                          tex_usage,
-                                          stride);
-
-   if (result)
-      return identity_buffer_create(id_screen, result);
-   return NULL;
-}
 
 static void *
 identity_screen_buffer_map(struct pipe_screen *_screen,
@@ -530,7 +485,6 @@ identity_screen_create(struct pipe_screen *screen)
    id_screen->base.texture_create = identity_screen_texture_create;
    id_screen->base.texture_from_handle = identity_screen_texture_from_handle;
    id_screen->base.texture_get_handle = identity_screen_texture_get_handle;
-   id_screen->base.texture_blanket = identity_screen_texture_blanket;
    id_screen->base.texture_destroy = identity_screen_texture_destroy;
    id_screen->base.get_tex_surface = identity_screen_get_tex_surface;
    id_screen->base.tex_surface_destroy = identity_screen_tex_surface_destroy;
@@ -540,7 +494,6 @@ identity_screen_create(struct pipe_screen *screen)
    id_screen->base.transfer_unmap = identity_screen_transfer_unmap;
    id_screen->base.buffer_create = identity_screen_buffer_create;
    id_screen->base.user_buffer_create = identity_screen_user_buffer_create;
-   id_screen->base.surface_buffer_create = identity_screen_surface_buffer_create;
    if (screen->buffer_map)
       id_screen->base.buffer_map = identity_screen_buffer_map;
    if (screen->buffer_map_range)
index 2c6fd67eae8c5ae8bb1bef6a6d53e8f99c40983a..934b0d8439e282335064f6b67850ae3b31773d24 100644 (file)
@@ -238,18 +238,6 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
 }
 
 
-static struct pipe_buffer *
-llvmpipe_surface_buffer_create(struct pipe_screen *screen,
-                               unsigned width, unsigned height,
-                               enum pipe_format format,
-                               unsigned tex_usage,
-                               unsigned usage,
-                               unsigned *stride)
-{
-   /* This function should never be used */
-   assert(0);
-   return NULL;
-}
 
 
 static void
@@ -309,7 +297,6 @@ llvmpipe_create_screen(struct llvmpipe_winsys *winsys)
    screen->base.get_paramf = llvmpipe_get_paramf;
    screen->base.is_format_supported = llvmpipe_is_format_supported;
 
-   screen->base.surface_buffer_create = llvmpipe_surface_buffer_create;
    screen->base.context_create = llvmpipe_create_context;
    screen->base.flush_frontbuffer = llvmpipe_flush_frontbuffer;
 
index 7d15e8560078df21bc27240f69771191888b9ebc..e41d6238ed2b36ac80b50849652d5f500c25cd47 100644 (file)
@@ -143,43 +143,6 @@ llvmpipe_texture_create(struct pipe_screen *_screen,
 }
 
 
-static struct pipe_texture *
-llvmpipe_texture_blanket(struct pipe_screen * screen,
-                         const struct pipe_texture *base,
-                         const unsigned *stride,
-                         struct pipe_buffer *buffer)
-{
-   /* FIXME */
-#if 0
-   struct llvmpipe_texture *lpt;
-   assert(screen);
-
-   /* Only supports one type */
-   if (base->target != PIPE_TEXTURE_2D ||
-       base->last_level != 0 ||
-       base->depth0 != 1) {
-      return NULL;
-   }
-
-   lpt = CALLOC_STRUCT(llvmpipe_texture);
-   if (!lpt)
-      return NULL;
-
-   lpt->base = *base;
-   pipe_reference_init(&lpt->base.reference, 1);
-   lpt->base.screen = screen;
-   lpt->stride[0] = stride[0];
-
-   pipe_buffer_reference(&lpt->buffer, buffer);
-
-   return &lpt->base;
-#else
-   debug_printf("llvmpipe_texture_blanket() not implemented!");
-   return NULL;
-#endif
-}
-
-
 static void
 llvmpipe_texture_destroy(struct pipe_texture *pt)
 {
@@ -409,7 +372,6 @@ void
 llvmpipe_init_screen_texture_funcs(struct pipe_screen *screen)
 {
    screen->texture_create = llvmpipe_texture_create;
-   screen->texture_blanket = llvmpipe_texture_blanket;
    screen->texture_destroy = llvmpipe_texture_destroy;
 
    screen->get_tex_surface = llvmpipe_get_tex_surface;
index 2013eef0c5ac61ac58f7c964f14e07c0e49e187c..f7d10a591f62324230ec4a9654f495d482e66150 100644 (file)
@@ -273,7 +273,8 @@ nouveau_screen_texture_from_handle(struct pipe_screen *pscreen,
        pb->usage = PIPE_BUFFER_USAGE_GPU_READ_WRITE |
                    PIPE_BUFFER_USAGE_CPU_READ_WRITE;
        pb->size = nouveau_bo(pb)->size;
-       pt = pscreen->texture_blanket(pscreen, templ, &whandle->stride, pb);
+       pt = nouveau_screen(pscreen)->texture_blanket(pscreen, templ,
+                                                      &whandle->stride, pb);
        pipe_buffer_reference(&pb, NULL);
        return pt;
 }
index a7927d88dfc832fec9011e52e95fa7a5481b0762..f4a7a2bc234cce2715eb29f14a2034330a317ef0 100644 (file)
@@ -6,6 +6,18 @@ struct nouveau_screen {
        struct nouveau_device *device;
        struct nouveau_channel *channel;
 
+        /**
+         * Create a new texture object, using the given template info, but on top of
+         * existing memory.
+         * 
+         * It is assumed that the buffer data is layed out according to the expected
+         * by the hardware. NULL will be returned if any inconsistency is found.  
+         */
+        struct pipe_texture * (*texture_blanket)(struct pipe_screen *,
+                                                 const struct pipe_texture *templat,
+                                                 const unsigned *stride,
+                                                 struct pipe_buffer *buffer);
+
        int (*pre_pipebuffer_map_callback) (struct pipe_screen *pscreen,
                struct pipe_buffer *pb, unsigned usage);
 };
index cb756cf6e649363bdbf6b77b6f195c507844a2af..5ef74a832dcea3835f74e344626ceca0a1410a35 100644 (file)
@@ -232,8 +232,9 @@ void
 nv30_screen_init_miptree_functions(struct pipe_screen *pscreen)
 {
        pscreen->texture_create = nv30_miptree_create;
-       pscreen->texture_blanket = nv30_miptree_blanket;
        pscreen->texture_destroy = nv30_miptree_destroy;
        pscreen->get_tex_surface = nv30_miptree_surface_new;
        pscreen->tex_surface_destroy = nv30_miptree_surface_del;
+
+       nouveau_screen(pscreen)->texture_blanket = nv50_miptree_blanket;
 }
index b17255dc6bd01260b0b2f19fa22026c047fa72c9..62e97bcea480ff71376526ab1f263d8751dee5be 100644 (file)
@@ -227,9 +227,10 @@ void
 nv40_screen_init_miptree_functions(struct pipe_screen *pscreen)
 {
        pscreen->texture_create = nv40_miptree_create;
-       pscreen->texture_blanket = nv40_miptree_blanket;
        pscreen->texture_destroy = nv40_miptree_destroy;
        pscreen->get_tex_surface = nv40_miptree_surface_new;
        pscreen->tex_surface_destroy = nv40_miptree_surface_del;
+
+       nouveau_screen(pscreen)->texture_blanket = nv40_miptree_blanket;
 }
 
index a7788249aba31369c3396a338a803a5ef574fffe..e091cae602423023ac2f960805b8336aeedf0db5 100644 (file)
@@ -255,9 +255,10 @@ void
 nv50_screen_init_miptree_functions(struct pipe_screen *pscreen)
 {
        pscreen->texture_create = nv50_miptree_create;
-       pscreen->texture_blanket = nv50_miptree_blanket;
        pscreen->texture_destroy = nv50_miptree_destroy;
        pscreen->get_tex_surface = nv50_miptree_surface_new;
        pscreen->tex_surface_destroy = nv50_miptree_surface_del;
+
+       nouveau_screen(pscreen)->texture_blanket = nv50_miptree_blanket;
 }
 
index 21e5910450f14ade162f75f33a9e019b0efb12a6..04124afd4dca1f331ab7a865905fa97d129888ed 100644 (file)
@@ -851,41 +851,6 @@ static void r300_tex_surface_destroy(struct pipe_surface* s)
     FREE(s);
 }
 
-static struct pipe_texture*
-    r300_texture_blanket(struct pipe_screen* screen,
-                         const struct pipe_texture* base,
-                         const unsigned* stride,
-                         struct pipe_buffer* buffer)
-{
-    struct r300_texture* tex;
-    struct r300_screen* rscreen = r300_screen(screen);
-
-    /* Support only 2D textures without mipmaps */
-    if (base->target != PIPE_TEXTURE_2D ||
-        base->depth0 != 1 ||
-        base->last_level != 0) {
-        return NULL;
-    }
-
-    tex = CALLOC_STRUCT(r300_texture);
-    if (!tex) {
-        return NULL;
-    }
-
-    tex->tex = *base;
-    pipe_reference_init(&tex->tex.reference, 1);
-    tex->tex.screen = screen;
-
-    tex->stride_override = *stride;
-    tex->pitch[0] = *stride / util_format_get_blocksize(base->format);
-
-    r300_setup_flags(tex);
-    r300_setup_texture_state(rscreen, tex);
-
-    pipe_buffer_reference(&tex->buffer, buffer);
-
-    return (struct pipe_texture*)tex;
-}
 
 static struct pipe_texture*
     r300_texture_from_handle(struct pipe_screen* screen,
@@ -1007,7 +972,6 @@ void r300_init_screen_texture_functions(struct pipe_screen* screen)
     screen->texture_destroy = r300_texture_destroy;
     screen->get_tex_surface = r300_get_tex_surface;
     screen->tex_surface_destroy = r300_tex_surface_destroy;
-    screen->texture_blanket = r300_texture_blanket;
 
     screen->video_surface_create = r300_video_surface_create;
     screen->video_surface_destroy= r300_video_surface_destroy;
index 6ea060023daa42665f0782f17b7d0d618bb75c76..c0052359fdca0c08799df69905aae0786b496632 100644 (file)
@@ -36,6 +36,7 @@
 #include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
+#include "util/u_simple_screen.h"
 
 #include "sp_context.h"
 #include "sp_texture.h"
@@ -91,13 +92,13 @@ softpipe_displaytarget_layout(struct pipe_screen *screen,
                      PIPE_BUFFER_USAGE_GPU_READ_WRITE);
    unsigned tex_usage = spt->base.tex_usage;
 
-   spt->buffer = screen->surface_buffer_create( screen
-                                                spt->base.width0, 
-                                                spt->base.height0,
-                                                spt->base.format,
-                                                usage,
-                                                tex_usage,
-                                                &spt->stride[0]);
+   spt->buffer = screen->winsys->surface_buffer_create( screen->winsys
+                                                        spt->base.width0, 
+                                                        spt->base.height0,
+                                                        spt->base.format,
+                                                        usage,
+                                                        tex_usage,
+                                                        &spt->stride[0]);
 
    return spt->buffer != NULL;
 }
@@ -141,38 +142,6 @@ softpipe_texture_create(struct pipe_screen *screen,
 }
 
 
-/**
- * Create a new pipe_texture which wraps an existing buffer.
- */
-static struct pipe_texture *
-softpipe_texture_blanket(struct pipe_screen * screen,
-                         const struct pipe_texture *base,
-                         const unsigned *stride,
-                         struct pipe_buffer *buffer)
-{
-   struct softpipe_texture *spt;
-   assert(screen);
-
-   /* Only supports one type */
-   if (base->target != PIPE_TEXTURE_2D ||
-       base->last_level != 0 ||
-       base->depth0 != 1) {
-      return NULL;
-   }
-
-   spt = CALLOC_STRUCT(softpipe_texture);
-   if (!spt)
-      return NULL;
-
-   spt->base = *base;
-   pipe_reference_init(&spt->base.reference, 1);
-   spt->base.screen = screen;
-   spt->stride[0] = stride[0];
-
-   pipe_buffer_reference(&spt->buffer, buffer);
-
-   return &spt->base;
-}
 
 
 static void
@@ -459,7 +428,6 @@ void
 softpipe_init_screen_texture_funcs(struct pipe_screen *screen)
 {
    screen->texture_create = softpipe_texture_create;
-   screen->texture_blanket = softpipe_texture_blanket;
    screen->texture_destroy = softpipe_texture_destroy;
 
    screen->get_tex_surface = softpipe_get_tex_surface;
index 4b045c44d894f9ccc28918d93a92dd407e6f6233..5b581debfc7d9c51c0acd6ad7c4d1809a5607f69 100644 (file)
@@ -359,71 +359,7 @@ error1:
 }
 
 
-static struct pipe_texture *
-svga_texture_blanket(struct pipe_screen * screen,
-                     const struct pipe_texture *base,
-                     const unsigned *stride,
-                     struct pipe_buffer *buffer)
-{
-   struct svga_texture *tex;
-   struct svga_buffer *sbuf = svga_buffer(buffer);
-   struct svga_winsys_screen *sws = svga_winsys_screen(screen);
-   assert(screen);
-
-   /* Only supports one type */
-   if (base->target != PIPE_TEXTURE_2D ||
-       base->last_level != 0 ||
-       base->depth0 != 1) {
-      return NULL;
-   }
-
-   /**
-    * We currently can't do texture blanket on
-    * SVGA3D_BUFFER. Need to blit to a temporary surface?
-    */
-
-   assert(sbuf->handle);
-   if (!sbuf->handle)
-      return NULL;
-
-   if (svga_translate_format(base->format) != sbuf->key.format) {
-      unsigned f1 = svga_translate_format(base->format);
-      unsigned f2 = sbuf->key.format;
-
-      /* It's okay for XRGB and ARGB or depth with/out stencil to get mixed up */
-      if ( !( (f1 == SVGA3D_X8R8G8B8 && f2 == SVGA3D_A8R8G8B8) ||
-              (f1 == SVGA3D_A8R8G8B8 && f2 == SVGA3D_X8R8G8B8) ||
-              (f1 == SVGA3D_Z_D24X8 && f2 == SVGA3D_Z_D24S8) ) ) {
-         debug_printf("%s wrong format %u != %u\n", __FUNCTION__, f1, f2);
-         return NULL;
-      }
-   }
-
-   tex = CALLOC_STRUCT(svga_texture);
-   if (!tex)
-      return NULL;
-
-   tex->base = *base;
-   
 
-   if (sbuf->key.format == 1)
-      tex->base.format = PIPE_FORMAT_B8G8R8X8_UNORM;
-   else if (sbuf->key.format == 2)
-      tex->base.format = PIPE_FORMAT_B8G8R8A8_UNORM;
-
-   pipe_reference_init(&tex->base.reference, 1);
-   tex->base.screen = screen;
-
-   SVGA_DBG(DEBUG_DMA, "blanket sid %p\n", sbuf->handle);
-
-   /* We don't own this storage, so don't try to cache it.
-    */
-   assert(sbuf->key.cachable == 0);
-   tex->key.cachable = 0;
-   sws->surface_reference(sws, &tex->handle, sbuf->handle);
-
-   return &tex->base;
-}
 
 
 static struct pipe_texture *
@@ -984,7 +920,6 @@ svga_screen_init_texture_functions(struct pipe_screen *screen)
    screen->texture_destroy = svga_texture_destroy;
    screen->get_tex_surface = svga_get_tex_surface;
    screen->tex_surface_destroy = svga_tex_surface_destroy;
-   screen->texture_blanket = svga_texture_blanket;
    screen->get_tex_transfer = svga_get_tex_transfer;
    screen->transfer_map = svga_transfer_map;
    screen->transfer_unmap = svga_transfer_unmap;
index ac0876c3a8092d00376ec3261abea2bb13de1917..a15addeb8cff31de27c2be4e2bddebc396119aea 100644 (file)
@@ -269,36 +269,6 @@ trace_screen_texture_get_handle(struct pipe_screen *_screen,
    return screen->texture_get_handle(screen, texture, handle);
 }
 
-static struct pipe_texture *
-trace_screen_texture_blanket(struct pipe_screen *_screen,
-                             const struct pipe_texture *templat,
-                             const unsigned *ppitch,
-                             struct pipe_buffer *_buffer)
-{
-   struct trace_screen *tr_scr = trace_screen(_screen);
-   struct trace_buffer *tr_buf = trace_buffer(_buffer);
-   struct pipe_screen *screen = tr_scr->screen;
-   struct pipe_buffer *buffer = tr_buf->buffer;
-   unsigned pitch = *ppitch;
-   struct pipe_texture *result;
-
-   trace_dump_call_begin("pipe_screen", "texture_blanket");
-
-   trace_dump_arg(ptr, screen);
-   trace_dump_arg(template, templat);
-   trace_dump_arg(uint, pitch);
-   trace_dump_arg(ptr, buffer);
-
-   result = screen->texture_blanket(screen, templat, ppitch, buffer);
-
-   trace_dump_ret(ptr, result);
-
-   trace_dump_call_end();
-
-   result = trace_texture_create(tr_scr, result);
-
-   return result;
-}
 
 
 static void
@@ -516,45 +486,7 @@ trace_screen_transfer_unmap(struct pipe_screen *_screen,
  */
 
 
-static struct pipe_buffer *
-trace_screen_surface_buffer_create(struct pipe_screen *_screen,
-                                   unsigned width, unsigned height,
-                                   enum pipe_format format,
-                                   unsigned usage,
-                                   unsigned tex_usage,
-                                   unsigned *pstride)
-{
-   struct trace_screen *tr_scr = trace_screen(_screen);
-   struct pipe_screen *screen = tr_scr->screen;
-   unsigned stride;
-   struct pipe_buffer *result;
 
-   trace_dump_call_begin("pipe_screen", "surface_buffer_create");
-
-   trace_dump_arg(ptr, screen);
-   trace_dump_arg(uint, width);
-   trace_dump_arg(uint, height);
-   trace_dump_arg(format, format);
-   trace_dump_arg(uint, usage);
-   trace_dump_arg(uint, tex_usage);
-
-   result = screen->surface_buffer_create(screen,
-                                          width, height,
-                                          format,
-                                          usage,
-                                          tex_usage,
-                                          pstride);
-
-   stride = *pstride;
-
-   trace_dump_arg(uint, stride);
-
-   trace_dump_ret(ptr, result);
-
-   trace_dump_call_end();
-
-   return trace_buffer_create(tr_scr, result);
-}
 
 
 static struct pipe_buffer *
@@ -965,7 +897,6 @@ trace_screen_create(struct pipe_screen *screen)
    tr_scr->base.texture_create = trace_screen_texture_create;
    tr_scr->base.texture_from_handle = trace_screen_texture_from_handle;
    tr_scr->base.texture_get_handle = trace_screen_texture_get_handle;
-   tr_scr->base.texture_blanket = trace_screen_texture_blanket;
    tr_scr->base.texture_destroy = trace_screen_texture_destroy;
    tr_scr->base.get_tex_surface = trace_screen_get_tex_surface;
    tr_scr->base.tex_surface_destroy = trace_screen_tex_surface_destroy;
@@ -975,7 +906,6 @@ trace_screen_create(struct pipe_screen *screen)
    tr_scr->base.transfer_unmap = trace_screen_transfer_unmap;
    tr_scr->base.buffer_create = trace_screen_buffer_create;
    tr_scr->base.user_buffer_create = trace_screen_user_buffer_create;
-   tr_scr->base.surface_buffer_create = trace_screen_surface_buffer_create;
    if (screen->buffer_map)
       tr_scr->base.buffer_map = trace_screen_buffer_map;
    if (screen->buffer_map_range)
index 617c47e4dc2605fa22e73af8271bf893d1bc8994..690455f7222b32ba2190cbf206ce398930107821 100644 (file)
@@ -127,17 +127,6 @@ struct pipe_screen {
                                  struct pipe_texture *tex,
                                  struct winsys_handle *handle);
 
-   /**
-    * Create a new texture object, using the given template info, but on top of
-    * existing memory.
-    * 
-    * It is assumed that the buffer data is layed out according to the expected
-    * by the hardware. NULL will be returned if any inconsistency is found.  
-    */
-   struct pipe_texture * (*texture_blanket)(struct pipe_screen *,
-                                            const struct pipe_texture *templat,
-                                            const unsigned *stride,
-                                            struct pipe_buffer *buffer);
 
    void (*texture_destroy)(struct pipe_texture *pt);
 
@@ -207,23 +196,6 @@ struct pipe_screen {
                                              void *ptr,
                                              unsigned bytes);
 
-   /**
-    * Allocate storage for a display target surface.
-    *
-    * Often surfaces which are meant to be blitted to the front screen (i.e.,
-    * display targets) must be allocated with special characteristics, memory
-    * pools, or obtained directly from the windowing system.
-    *
-    * This callback is invoked by the pipe_screenwhen creating a texture marked
-    * with the PIPE_TEXTURE_USAGE_DISPLAY_TARGET flag  to get the underlying
-    * buffer storage.
-    */
-   struct pipe_buffer *(*surface_buffer_create)(struct pipe_screen *screen,
-                                               unsigned width, unsigned height,
-                                               enum pipe_format format,
-                                               unsigned usage,
-                                               unsigned tex_usage,
-                                               unsigned *stride);
 
 
    /**
index d3edddd5d4e0f13d3b5c760e941baa5ade0c818d..fe7ef253ef0e86305be04068338295d018453c2d 100644 (file)
@@ -26,8 +26,9 @@ enum drm_create_screen_mode {
 struct winsys_handle
 {
        /**
-        * Unused for texture_from_handle, always DRM_API_HANDLE_TYPE_SHARED.
-        * Input to texture_get_handle, use TEXTURE_USAGE to select handle for kms or ipc.
+        * Unused for texture_from_handle, always
+        * DRM_API_HANDLE_TYPE_SHARED.  Input to texture_get_handle,
+        * use TEXTURE_USAGE to select handle for kms or ipc.
         */
        unsigned type;
        /**
index 3421c1951aa250dd9a6de3e37268a551508e3d52..a94b1ca6c66043b9f594fbc3ec3bd7b40c5c44b7 100644 (file)
@@ -156,6 +156,11 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf,
    templ.depth0 = 1;
    templ.tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET;
 
+#if 0
+   /* Interesting and suprising use of texture_blanket +
+    * user_buffer_create...  To be superceded by the sw_winsys branch,
+    * but currently disabled.
+    */
    if (xbuf->shm_info) {
       struct pipe_buffer *pbuf;
       unsigned stride, size;
@@ -188,7 +193,9 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf,
          }
       }
    }
-   else {
+   else
+#endif
+   {
       xbuf->texture = screen->texture_create(screen, &templ);
    }