Move pf_get_block() to u_format auxiliary module.
authorMichal Krol <michal@vmware.com>
Thu, 3 Dec 2009 09:52:47 +0000 (10:52 +0100)
committerMichal Krol <michal@vmware.com>
Thu, 3 Dec 2009 09:52:47 +0000 (10:52 +0100)
37 files changed:
src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/draw/draw_pipe_pstipple.c
src/gallium/auxiliary/util/u_blit.c
src/gallium/auxiliary/util/u_format.h
src/gallium/auxiliary/util/u_surface.c
src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/r300/r300_texture.c
src/gallium/drivers/softpipe/sp_texture.c
src/gallium/include/pipe/p_format.h
src/gallium/state_trackers/dri/dri_drawable.c
src/gallium/state_trackers/egl/egl_surface.c
src/gallium/state_trackers/python/p_device.i
src/gallium/state_trackers/python/st_softpipe_winsys.c
src/gallium/state_trackers/vega/api_filters.c
src/gallium/state_trackers/vega/image.c
src/gallium/state_trackers/vega/mask.c
src/gallium/state_trackers/vega/paint.c
src/gallium/state_trackers/vega/renderer.c
src/gallium/state_trackers/vega/vg_tracker.c
src/gallium/state_trackers/xorg/xorg_crtc.c
src/gallium/state_trackers/xorg/xorg_dri2.c
src/gallium/state_trackers/xorg/xorg_exa.c
src/gallium/state_trackers/xorg/xorg_renderer.c
src/gallium/state_trackers/xorg/xorg_xv.c
src/gallium/state_trackers/xorg/xvmc/surface.c
src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
src/gallium/winsys/drm/radeon/core/radeon_buffer.c
src/gallium/winsys/egl_xlib/sw_winsys.c
src/gallium/winsys/g3dvl/xlib/xsp_winsys.c
src/gallium/winsys/gdi/gdi_softpipe_winsys.c
src/gallium/winsys/xlib/xlib_cell.c
src/gallium/winsys/xlib/xlib_llvmpipe.c
src/gallium/winsys/xlib/xlib_softpipe.c
src/mesa/state_tracker/st_cb_fbo.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_texture.c

index 8ccd527b3afd06577cd6d34856305e7a5519757b..dbeb22b91735f798ce288d9a17b090064895ba5a 100644 (file)
@@ -35,6 +35,8 @@
 #include "pipe/p_context.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_shader_tokens.h"
+
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 
@@ -402,7 +404,7 @@ aaline_create_texture(struct aaline_stage *aaline)
    texTemp.width0 = 1 << MAX_TEXTURE_LEVEL;
    texTemp.height0 = 1 << MAX_TEXTURE_LEVEL;
    texTemp.depth0 = 1;
-   pf_get_block(texTemp.format, &texTemp.block);
+   util_format_get_block(texTemp.format, &texTemp.block);
 
    aaline->texture = screen->texture_create(screen, &texTemp);
    if (!aaline->texture)
index a500edd7feeb6b234f85b9c9e6aca2d850356f62..53dc163895216a2eca608dc3be5bc94285edc28a 100644 (file)
@@ -38,6 +38,7 @@
 #include "pipe/p_defines.h"
 #include "pipe/p_shader_tokens.h"
 
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 
@@ -431,7 +432,7 @@ pstip_create_texture(struct pstip_stage *pstip)
    texTemp.width0 = 32;
    texTemp.height0 = 32;
    texTemp.depth0 = 1;
-   pf_get_block(texTemp.format, &texTemp.block);
+   util_format_get_block(texTemp.format, &texTemp.block);
 
    pstip->texture = screen->texture_create(screen, &texTemp);
    if (pstip->texture == NULL)
index 5372df573527414d424e525e7fd4c5caf93df2d1..df2bcf2d021fd8f4a80f5f9b74b386c0bc8d1885 100644 (file)
@@ -42,6 +42,7 @@
 
 #include "util/u_blit.h"
 #include "util/u_draw_quad.h"
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #include "util/u_simple_shaders.h"
@@ -357,7 +358,7 @@ util_blit_pixels_writemask(struct blit_state *ctx,
       texTemp.width0 = srcW;
       texTemp.height0 = srcH;
       texTemp.depth0 = 1;
-      pf_get_block(src->format, &texTemp.block);
+      util_format_get_block(src->format, &texTemp.block);
 
       tex = screen->texture_create(screen, &texTemp);
       if (!tex)
index e57c9e00233a4cd22ef304f9cb586f1b56d779ef..583b62e606b55b0b3f83ba6988eb561f84cd644c 100644 (file)
@@ -50,7 +50,7 @@ struct util_format_block
    /** Block height in pixels */
    unsigned height;
 
-   /** Block size in bytes */
+   /** Block size in bits */
    unsigned bits;
 };
 
@@ -159,6 +159,30 @@ util_format_is_depth_and_stencil(enum pipe_format format)
            desc->swizzle[1] != UTIL_FORMAT_SWIZZLE_NONE) ? TRUE : FALSE;
 }
 
+/**
+ * Describe pixel format's block.   
+ * 
+ * @sa http://msdn2.microsoft.com/en-us/library/ms796147.aspx
+ */
+static INLINE void 
+util_format_get_block(enum pipe_format format,
+                      struct pipe_format_block *block)
+{
+   const struct util_format_description *desc = util_format_description(format);
+
+   assert(format);
+   if (!format) {
+      block->size = 0;
+      block->width = 1;
+      block->height = 1;
+      return;
+   }
+
+   block->size = desc->block.bits / 8;
+   block->width = desc->block.width;
+   block->height = desc->block.height;
+}
+
 
 /*
  * Format access functions.
index de8c266db83007de32288e5dfb09555ef5f0069e..9c84ca733b0c4dd1023a76a3115a823982fd9f3a 100644 (file)
@@ -36,6 +36,7 @@
 #include "pipe/p_state.h"
 #include "pipe/p_defines.h"
 
+#include "util/u_format.h"
 #include "util/u_surface.h"
 
 
@@ -82,7 +83,7 @@ util_create_rgba_surface(struct pipe_screen *screen,
    templ.width0 = width;
    templ.height0 = height;
    templ.depth0 = 1;
-   pf_get_block(format, &templ.block);
+   util_format_get_block(format, &templ.block);
    templ.tex_usage = usage;
 
    *textureOut = screen->texture_create(screen, &templ);
index 85fe2efd2b69a04818cb4e2f48ee7ad060701463..32374abb493af851953d932c319effdbaeccd53a 100644 (file)
@@ -29,6 +29,7 @@
 #include <assert.h>
 #include <pipe/p_context.h>
 #include <pipe/p_inlines.h>
+#include <util/u_format.h>
 #include <util/u_math.h>
 #include <util/u_memory.h>
 #include <tgsi/tgsi_parse.h>
@@ -834,7 +835,7 @@ init_buffers(struct vl_mpeg12_mc_renderer *r)
    template.height0 = r->pot_buffers ?
       util_next_power_of_two(r->picture_height) : r->picture_height;
    template.depth0 = 1;
-   pf_get_block(template.format, &template.block);
+   util_format_get_block(template.format, &template.block);
    template.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER | PIPE_TEXTURE_USAGE_DYNAMIC;
 
    r->textures.individual.y = r->pipe->screen->texture_create(r->pipe->screen, &template);
index 65d62fd072358ea785167087e735ecb22954c8c1..9b19cac9729e28d6d5e843c329c69433a52e1191 100644 (file)
@@ -34,6 +34,8 @@
 #include "pipe/p_defines.h"
 #include "pipe/p_inlines.h"
 #include "pipe/internal/p_winsys_screen.h"
+
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 
@@ -63,7 +65,7 @@ llvmpipe_texture_layout(struct llvmpipe_screen *screen,
 
    unsigned buffer_size = 0;
 
-   pf_get_block(lpt->base.format, &lpt->base.block);
+   util_format_get_block(lpt->base.format, &lpt->base.block);
 
    for (level = 0; level <= pt->last_level; level++) {
       unsigned nblocksx, nblocksy;
@@ -100,7 +102,7 @@ llvmpipe_displaytarget_layout(struct llvmpipe_screen *screen,
 {
    struct llvmpipe_winsys *winsys = screen->winsys;
 
-   pf_get_block(lpt->base.format, &lpt->base.block);
+   util_format_get_block(lpt->base.format, &lpt->base.block);
    lpt->base.nblocksx[0] = pf_get_nblocksx(&lpt->base.block, lpt->base.width0);  
    lpt->base.nblocksy[0] = pf_get_nblocksy(&lpt->base.block, lpt->base.height0);  
 
index 093a21ebe243c5735bf941584fbe82dce8ec9e5e..5538ec3918d97f765c2d04aad038ff9c16cdbbe9 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "pipe/p_screen.h"
 
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 
@@ -283,7 +284,7 @@ r300_video_surface_create(struct pipe_screen *screen,
     template.width0 = util_next_power_of_two(width);
     template.height0 = util_next_power_of_two(height);
     template.depth0 = 1;
-    pf_get_block(template.format, &template.block);
+    util_format_get_block(template.format, &template.block);
     template.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER |
                          PIPE_TEXTURE_USAGE_RENDER_TARGET;
 
index ac5f61e46f419e39a7ae4dbbd1506013bbb1d695..0f3323ff2f1edfb9bd200d88c6e7388d67fa8a48 100644 (file)
@@ -32,6 +32,8 @@
 
 #include "pipe/p_defines.h"
 #include "pipe/p_inlines.h"
+
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 
@@ -438,7 +440,7 @@ softpipe_video_surface_create(struct pipe_screen *screen,
    template.width0 = util_next_power_of_two(width);
    template.height0 = util_next_power_of_two(height);
    template.depth0 = 1;
-   pf_get_block(template.format, &template.block);
+   util_format_get_block(template.format, &template.block);
    template.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER | PIPE_TEXTURE_USAGE_RENDER_TARGET;
 
    sp_vsfc->tex = screen->texture_create(screen, &template);
index 69639ab011dab277b637ffe6c5fe97fa5ddda504..3be5b18a258166dbfa97b7b11268030fd83bb9e7 100644 (file)
@@ -479,45 +479,6 @@ struct pipe_format_block
    unsigned height;
 };
 
-/**
- * Describe pixel format's block.   
- * 
- * @sa http://msdn2.microsoft.com/en-us/library/ms796147.aspx
- */
-static INLINE void 
-pf_get_block(enum pipe_format format, struct pipe_format_block *block)
-{
-   switch(format) {
-   case PIPE_FORMAT_DXT1_RGBA:
-   case PIPE_FORMAT_DXT1_RGB:
-   case PIPE_FORMAT_DXT1_SRGBA:
-   case PIPE_FORMAT_DXT1_SRGB:
-      block->size = 8;
-      block->width = 4;
-      block->height = 4;
-      break;
-   case PIPE_FORMAT_DXT3_RGBA:
-   case PIPE_FORMAT_DXT5_RGBA:
-   case PIPE_FORMAT_DXT3_SRGBA:
-   case PIPE_FORMAT_DXT5_SRGBA:
-      block->size = 16;
-      block->width = 4;
-      block->height = 4;
-      break;
-   case PIPE_FORMAT_YCBCR:
-   case PIPE_FORMAT_YCBCR_REV:
-      block->size = 4; /* 2*cpp */
-      block->width = 2;
-      block->height = 1;
-      break;
-   default:
-      block->size = pf_get_size(format);
-      block->width = 1;
-      block->height = 1;
-      break;
-   }
-}
-
 static INLINE unsigned
 pf_get_nblocksx(const struct pipe_format_block *block, unsigned x)
 {
index 45a6059ea83decb6d19d9aa296d9ec79b6332ad4..2749cdee8d8a1dee1cfb739f077c5fa16d86a04f 100644 (file)
@@ -44,6 +44,7 @@
 #include "state_tracker/st_context.h"
 #include "state_tracker/st_cb_fbo.h"
 
+#include "util/u_format.h"
 #include "util/u_memory.h"
 #include "util/u_rect.h"
  
@@ -66,7 +67,7 @@ dri_surface_from_handle(struct drm_api *api,
    templat.format = format;
    templat.width0 = width;
    templat.height0 = height;
-   pf_get_block(templat.format, &templat.block);
+   util_format_get_block(templat.format, &templat.block);
 
    texture = api->texture_from_shared_handle(api, screen, &templat,
                                              "dri2 buffer", pitch, handle);
index ddd9b04cd48a9994b143e5df2bc8c212ac2d78fb..35c8b106858cd309fd0babaca8d7b4ce2d35100c 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "state_tracker/drm_api.h"
 
+#include "util/u_format.h"
 #include "util/u_rect.h"
 
 /*
@@ -118,7 +119,7 @@ drm_create_texture(_EGLDisplay *dpy,
        templat.format = PIPE_FORMAT_A8R8G8B8_UNORM;
        templat.width0 = w;
        templat.height0 = h;
-       pf_get_block(templat.format, &templat.block);
+       util_format_get_block(templat.format, &templat.block);
 
        texture = screen->texture_create(dev->screen,
                                         &templat);
index a83bcc71a1ac569a14b82d5e74a4fb80750ad0e7..bfe3f051fc0f0c13432009823e291f0fcefd7780 100644 (file)
@@ -112,7 +112,7 @@ struct st_device {
       struct pipe_texture templat;
       memset(&templat, 0, sizeof(templat));
       templat.format = format;
-      pf_get_block(templat.format, &templat.block);
+      util_format_get_block(templat.format, &templat.block);
       templat.width0 = width;
       templat.height0 = height;
       templat.depth0 = depth;
index f0abd12e3dcad2127cfe396aabb27067645731a9..010a5ded66a07b5d743e3ee8bc628560be555536 100644 (file)
@@ -40,6 +40,7 @@
 #include "pipe/p_format.h"
 #include "pipe/p_context.h"
 #include "pipe/p_inlines.h"
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #include "softpipe/sp_winsys.h"
@@ -179,7 +180,7 @@ st_softpipe_surface_buffer_create(struct pipe_winsys *winsys,
    struct pipe_format_block block;
    unsigned nblocksx, nblocksy;
 
-   pf_get_block(format, &block);
+   util_format_get_block(format, &block);
    nblocksx = pf_get_nblocksx(&block, width);
    nblocksy = pf_get_nblocksy(&block, height);
    *stride = round_up(nblocksx * block.size, alignment);
index faf396d08775492375d463322ea09078ae52d3c2..4787ae38f0f61285354a5fa16b82a03b479f185f 100644 (file)
@@ -38,6 +38,7 @@
 #include "pipe/p_screen.h"
 #include "pipe/p_shader_tokens.h"
 
+#include "util/u_format.h"
 #include "util/u_memory.h"
 
 
@@ -71,7 +72,7 @@ static INLINE struct pipe_texture *create_texture_1d(struct vg_context *ctx,
    templ.width0 = color_data_len;
    templ.height0 = 1;
    templ.depth0 = 1;
-   pf_get_block(PIPE_FORMAT_A8R8G8B8_UNORM, &templ.block);
+   util_format_get_block(PIPE_FORMAT_A8R8G8B8_UNORM, &templ.block);
    templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
 
    tex = screen->texture_create(screen, &templ);
index 4684a5727dda98d0267b13e4cf810b8b0e263d55..24ca911f792801a7647246b4afee30fd0ece742e 100644 (file)
@@ -39,6 +39,7 @@
 #include "pipe/p_screen.h"
 #include "pipe/p_inlines.h"
 #include "util/u_blit.h"
+#include "util/u_format.h"
 #include "util/u_tile.h"
 #include "util/u_memory.h"
 #include "util/u_math.h"
@@ -270,7 +271,7 @@ struct vg_image * image_create(VGImageFormat format,
    memset(&pt, 0, sizeof(pt));
    pt.target = PIPE_TEXTURE_2D;
    pt.format = pformat;
-   pf_get_block(pformat, &pt.block);
+   util_format_get_block(pformat, &pt.block);
    pt.last_level = 0;
    pt.width0 = width;
    pt.height0 = height;
index b84103fdbaca6d00c7efa4f7026d63741e90ba00..6e93e2551ecc66bd00b286b6eda548226d3a857a 100644 (file)
@@ -36,6 +36,7 @@
 #include "pipe/p_context.h"
 #include "pipe/p_screen.h"
 #include "pipe/p_inlines.h"
+#include "util/u_format.h"
 #include "util/u_memory.h"
 
 struct vg_mask_layer {
@@ -491,7 +492,7 @@ struct vg_mask_layer * mask_layer_create(VGint width, VGint height)
       memset(&pt, 0, sizeof(pt));
       pt.target = PIPE_TEXTURE_2D;
       pt.format = PIPE_FORMAT_A8R8G8B8_UNORM;
-      pf_get_block(PIPE_FORMAT_A8R8G8B8_UNORM, &pt.block);
+      util_format_get_block(PIPE_FORMAT_A8R8G8B8_UNORM, &pt.block);
       pt.last_level = 0;
       pt.width0 = width;
       pt.height0 = height;
index e8ca7d9e89bca6696384187abb813a235eed27fb..b88322f433978a7cd78aec9f1568c194e86b3740 100644 (file)
@@ -34,6 +34,7 @@
 #include "pipe/p_compiler.h"
 #include "pipe/p_inlines.h"
 
+#include "util/u_format.h"
 #include "util/u_memory.h"
 #include "util/u_math.h"
 
@@ -154,7 +155,7 @@ static INLINE struct pipe_texture *create_gradient_texture(struct vg_paint *p)
    templ.width0 = 1024;
    templ.height0 = 1;
    templ.depth0 = 1;
-   pf_get_block(PIPE_FORMAT_A8R8G8B8_UNORM, &templ.block);
+   util_format_get_block(PIPE_FORMAT_A8R8G8B8_UNORM, &templ.block);
    templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
 
    tex = screen->texture_create(screen, &templ);
index 9085ed1bfe075364ab35a21b939adfad8c767900..1706ed83f258935c744513dd17a43d0c3ce292cb 100644 (file)
@@ -35,6 +35,7 @@
 #include "pipe/p_shader_tokens.h"
 
 #include "util/u_draw_quad.h"
+#include "util/u_format.h"
 #include "util/u_simple_shaders.h"
 #include "util/u_memory.h"
 #include "util/u_rect.h"
@@ -448,7 +449,7 @@ void renderer_copy_surface(struct renderer *ctx,
    texTemp.width0 = srcW;
    texTemp.height0 = srcH;
    texTemp.depth0 = 1;
-   pf_get_block(src->format, &texTemp.block);
+   util_format_get_block(src->format, &texTemp.block);
 
    tex = screen->texture_create(screen, &texTemp);
    if (!tex)
index d28463dd1b89973262d5a0513e45c5de748ba382..e7b04a8e0689aff980dcd907f807c6e00adf5e24 100644 (file)
@@ -31,6 +31,7 @@
 #include "pipe/p_context.h"
 #include "pipe/p_inlines.h"
 #include "pipe/p_screen.h"
+#include "util/u_format.h"
 #include "util/u_memory.h"
 #include "util/u_math.h"
 
@@ -50,7 +51,7 @@ create_texture(struct pipe_context *pipe, enum pipe_format format,
    }
 
    templ.target = PIPE_TEXTURE_2D;
-   pf_get_block(templ.format, &templ.block);
+   util_format_get_block(templ.format, &templ.block);
    templ.width0 = width;
    templ.height0 = height;
    templ.depth0 = 1;
index 9e8c14d741c3d8d6c23d0ce3416171d724a20e94..fe994d1ea38f359271df58de141b580b9a49e3d9 100644 (file)
@@ -50,6 +50,7 @@
 #endif
 
 #include "pipe/p_inlines.h"
+#include "util/u_format.h"
 #include "util/u_rect.h"
 
 #ifdef HAVE_LIBKMS
@@ -200,7 +201,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
        templat.format = PIPE_FORMAT_A8R8G8B8_UNORM;
        templat.width0 = 64;
        templat.height0 = 64;
-       pf_get_block(templat.format, &templat.block);
+       util_format_get_block(templat.format, &templat.block);
 
        crtcp->cursor_tex = ms->screen->texture_create(ms->screen,
                                                       &templat);
index 36711609d2f38e5ab710c17aa29d13f146f8f4c6..fe2e0f68aae4a5cf11e72fa8477266d3bea3ccc9 100644 (file)
@@ -109,7 +109,7 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int form
            else
                template.format = ms->ds_depth_bits_last ?
                    PIPE_FORMAT_S8Z24_UNORM : PIPE_FORMAT_Z24S8_UNORM;
-           pf_get_block(template.format, &template.block);
+           util_format_get_block(template.format, &template.block);
            template.width0 = pDraw->width;
            template.height0 = pDraw->height;
            template.depth0 = 1;
index aa46cd45f1668ad505c0ba19cdfdd94ffa9236e9..f79e1ef8450de3947d4483c235ff8cbcb01cfc99 100644 (file)
@@ -43,6 +43,7 @@
 #include "pipe/p_state.h"
 #include "pipe/p_inlines.h"
 
+#include "util/u_format.h"
 #include "util/u_rect.h"
 #include "util/u_math.h"
 #include "util/u_debug.h"
@@ -899,7 +900,7 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
        memset(&template, 0, sizeof(template));
        template.target = PIPE_TEXTURE_2D;
        exa_get_pipe_format(depth, &template.format, &bitsPerPixel, &priv->picture_format);
-       pf_get_block(template.format, &template.block);
+       util_format_get_block(template.format, &template.block);
         if (ROUND_UP_TEXTURES && priv->flags == 0) {
            template.width0 = util_next_power_of_two(width);
            template.height0 = util_next_power_of_two(height);
@@ -985,7 +986,7 @@ xorg_exa_create_root_texture(ScrnInfoPtr pScrn,
     memset(&template, 0, sizeof(template));
     template.target = PIPE_TEXTURE_2D;
     exa_get_pipe_format(depth, &template.format, &bitsPerPixel, &dummy);
-    pf_get_block(template.format, &template.block);
+    util_format_get_block(template.format, &template.block);
     template.width0 = width;
     template.height0 = height;
     template.depth0 = 1;
index f7773951004adf8c2cd6f962556b13a31bdd8be3..7cac91e564fd8bcf2b557cb3e1c414799b2d04d6 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "cso_cache/cso_context.h"
 #include "util/u_draw_quad.h"
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #include "util/u_rect.h"
@@ -512,7 +513,7 @@ renderer_clone_texture(struct xorg_renderer *r,
    templ.width0 = src->width0;
    templ.height0 = src->height0;
    templ.depth0 = 1;
-   pf_get_block(format, &templ.block);
+   util_format_get_block(format, &templ.block);
    templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
 
    pt = screen->texture_create(screen, &templ);
index b8eca8c81765d65325fece99e6bb1110e48cca0b..8c491c030d65194b6ea7dc84da809c5643585b42 100644 (file)
@@ -13,6 +13,8 @@
 #include "pipe/p_screen.h"
 #include "pipe/p_inlines.h"
 
+#include "util/u_format.h"
+
 /*XXX get these from pipe's texture limits */
 #define IMAGE_MAX_WIDTH                2048
 #define IMAGE_MAX_HEIGHT       2048
@@ -170,7 +172,7 @@ create_component_texture(struct pipe_context *pipe,
    templ.width0 = width;
    templ.height0 = height;
    templ.depth0 = 1;
-   pf_get_block(PIPE_FORMAT_L8_UNORM, &templ.block);
+   util_format_get_block(PIPE_FORMAT_L8_UNORM, &templ.block);
    templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER;
 
    tex = screen->texture_create(screen, &templ);
index 8cb73f48970021a46720c68e0f24f8a5a48dfdd2..5059424da76e13d6fdee87137b69bf8fda4b6c7c 100644 (file)
@@ -106,7 +106,7 @@ CreateOrResizeBackBuffer(struct pipe_video_context *vpipe, unsigned int width, u
    template.width0 = width;
    template.height0 = height;
    template.depth0 = 1;
-   pf_get_block(template.format, &template.block);
+   util_format_get_block(template.format, &template.block);
    template.tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET;
 
    tex = vpipe->screen->texture_create(vpipe->screen, &template);
index d4978613247c74222b4a2c2229002e586270755d..cc25fd1741745cb5db4dfd6f2b73591fb5a2e7f7 100644 (file)
@@ -1,5 +1,6 @@
 #include "pipe/p_context.h"
 #include "pipe/p_state.h"
+#include "util/u_format.h"
 #include "util/u_memory.h"
 
 #include "nouveau_drm_api.h"
@@ -28,7 +29,7 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_screen *pscreen,
        tmpl.format = format;
        tmpl.width0 = width;
        tmpl.height0 = height;
-       pf_get_block(tmpl.format, &tmpl.block);
+       util_format_get_block(tmpl.format, &tmpl.block);
 
        pt = api->texture_from_shared_handle(api, pscreen, &tmpl,
                                             "front buffer", pitch, handle);
index 74afffc9cfa1ff3a7d4cc75ed0b2fea746088f33..555c57d4e7b90d47a1b7c3733cd57ccf2bd2b201 100644 (file)
@@ -36,6 +36,8 @@
 #include "softpipe/sp_texture.h"
 #include "r300_context.h"
 #include <X11/Xutil.h>
+#include "util/u_format.h"
+
 struct radeon_vl_context
 {
     Display *display;
@@ -116,7 +118,7 @@ static struct pipe_buffer *radeon_surface_buffer_create(struct pipe_winsys *ws,
     struct pipe_format_block block;
     unsigned nblocksx, nblocksy, size;
 
-    pf_get_block(format, &block);
+    util_format_get_block(format, &block);
 
     nblocksx = pf_get_nblocksx(&block, width);
     nblocksy = pf_get_nblocksy(&block, height);
@@ -321,7 +323,7 @@ struct pipe_surface *radeon_surface_from_handle(struct radeon_context *radeon_co
     tmpl.height0 = h;
     tmpl.depth0 = 1;
     tmpl.format = format;
-    pf_get_block(tmpl.format, &tmpl.block);
+    util_format_get_block(tmpl.format, &tmpl.block);
     tmpl.nblocksx[0] = pf_get_nblocksx(&tmpl.block, w);
     tmpl.nblocksy[0] = pf_get_nblocksy(&tmpl.block, h);
 
index 79ff2cc985d1b5120389fb7b1904ab923c0bb2a1..2cd89bb04a1494e59439fa9aaf5be06d22e6bfd1 100644 (file)
@@ -38,6 +38,7 @@
 #include "pipe/internal/p_winsys_screen.h"
 #include "pipe/p_state.h"
 #include "pipe/p_inlines.h"
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 
@@ -173,7 +174,7 @@ surface_buffer_create(struct pipe_winsys *winsys,
    struct pipe_format_block block;
    unsigned nblocksx, nblocksy;
 
-   pf_get_block(format, &block);
+   util_format_get_block(format, &block);
    nblocksx = pf_get_nblocksx(&block, width);
    nblocksy = pf_get_nblocksy(&block, height);
    *stride = round_up(nblocksx * block.size, alignment);
index 08067aad64c4c3f3cc1964da3db457cc0a62b274..44b508c1d4d67ea43b3d5e4ccf4de6cca7af7fea 100644 (file)
@@ -30,6 +30,7 @@
 #include <pipe/internal/p_winsys_screen.h>
 #include <pipe/p_state.h>
 #include <pipe/p_inlines.h>
+#include <util/u_format.h>
 #include <util/u_memory.h>
 #include <util/u_math.h>
 #include <softpipe/sp_winsys.h>
@@ -141,7 +142,7 @@ static struct pipe_buffer* xsp_surface_buffer_create
    struct pipe_format_block block;
    unsigned nblocksx, nblocksy;
 
-   pf_get_block(format, &block);
+   util_format_get_block(format, &block);
    nblocksx = pf_get_nblocksx(&block, width);
    nblocksy = pf_get_nblocksy(&block, height);
    *stride = align(nblocksx * block.size, ALIGNMENT);
index 5e0ccf32f48f77bbf6711158505ffebc4b39e892..d9fb2080a15197bbbf39c3e435d1a2d3b6659b5a 100644 (file)
@@ -42,6 +42,7 @@
 #include "pipe/p_format.h"
 #include "pipe/p_context.h"
 #include "pipe/p_inlines.h"
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #include "softpipe/sp_winsys.h"
@@ -173,7 +174,7 @@ gdi_softpipe_surface_buffer_create(struct pipe_winsys *winsys,
    struct pipe_format_block block;
    unsigned nblocksx, nblocksy;
 
-   pf_get_block(format, &block);
+   util_format_get_block(format, &block);
    nblocksx = pf_get_nblocksx(&block, width);
    nblocksy = pf_get_nblocksy(&block, height);
    *stride = round_up(nblocksx * block.size, alignment);
index 13e609f58fe059242782e1c3c36cf77c380da3b8..84f445c8e9080e1ad1fb452ea5433e5eba0b76c7 100644 (file)
@@ -45,6 +45,7 @@
 #include "pipe/p_format.h"
 #include "pipe/p_context.h"
 #include "pipe/p_inlines.h"
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 
@@ -297,7 +298,7 @@ xm_surface_buffer_create(struct pipe_winsys *winsys,
    struct pipe_format_block block;
    unsigned nblocksx, nblocksy;
 
-   pf_get_block(format, &block);
+   util_format_get_block(format, &block);
    nblocksx = pf_get_nblocksx(&block, width);
    nblocksy = pf_get_nblocksy(&block, height);
    *stride = round_up(nblocksx * block.size, alignment);
index 3dd15e099b043278e5722640a900a11e73beb0b0..e7914583ba08c03523596b3f1999287f3ec89d80 100644 (file)
@@ -44,6 +44,7 @@
 #include "pipe/p_format.h"
 #include "pipe/p_context.h"
 #include "pipe/p_inlines.h"
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #include "llvmpipe/lp_winsys.h"
@@ -331,7 +332,7 @@ xm_displaytarget_create(struct llvmpipe_winsys *winsys,
    xm_dt->width = width;
    xm_dt->height = height;
 
-   pf_get_block(format, &xm_dt->block);
+   util_format_get_block(format, &xm_dt->block);
    nblocksx = pf_get_nblocksx(&xm_dt->block, width);
    nblocksy = pf_get_nblocksy(&xm_dt->block, height);
    xm_dt->stride = align(nblocksx * xm_dt->block.size, alignment);
index 260b39e2a0fb1dd93922baa8175590ff8b2a21bd..299469461403fdc950f7f84f4080191074e35907 100644 (file)
@@ -42,6 +42,7 @@
 #include "pipe/p_format.h"
 #include "pipe/p_context.h"
 #include "pipe/p_inlines.h"
+#include "util/u_format.h"
 #include "util/u_math.h"
 #include "util/u_memory.h"
 #include "softpipe/sp_winsys.h"
@@ -363,7 +364,7 @@ xm_surface_buffer_create(struct pipe_winsys *winsys,
    struct pipe_format_block block;
    unsigned nblocksx, nblocksy, size;
 
-   pf_get_block(format, &block);
+   util_format_get_block(format, &block);
    nblocksx = pf_get_nblocksx(&block, width);
    nblocksy = pf_get_nblocksy(&block, height);
    *stride = align(nblocksx * block.size, alignment);
index 7ccdddb00bc1fd443878e48e2ede5c3f3a8a6ed1..3a5b634e8710677fb9ec082838a7c02e1252fa3d 100644 (file)
@@ -105,7 +105,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
       _mesa_free(strb->data);
 
       assert(strb->format != PIPE_FORMAT_NONE);
-      pf_get_block(strb->format, &block);
+      util_format_get_block(strb->format, &block);
       
       strb->stride = pf_get_stride(&block, width);
       size = pf_get_2d_size(&block, strb->stride, height);
@@ -128,7 +128,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
       memset(&template, 0, sizeof(template));
       template.target = PIPE_TEXTURE_2D;
       template.format = format;
-      pf_get_block(format, &template.block);
+      util_format_get_block(format, &template.block);
       template.width0 = width;
       template.height0 = height;
       template.depth0 = 1;
index bf17f33fc14402cc8052e2224ce69ce60fcbf324..6084ded72d1770b5aa8e4bd097e5667074cc76d2 100644 (file)
@@ -406,7 +406,7 @@ compress_with_blit(GLcontext * ctx,
    memset(&templ, 0, sizeof(templ));
    templ.target = PIPE_TEXTURE_2D;
    templ.format = st_mesa_format_to_pipe_format(mesa_format);
-   pf_get_block(templ.format, &templ.block);
+   util_format_get_block(templ.format, &templ.block);
    templ.width0 = width;
    templ.height0 = height;
    templ.depth0 = 1;
index dbccee86c1c279fb1f09e49dad41d7d6e203fcf2..bd6ee5d71c6a506edc53593c8dcfc2e144a781ba 100644 (file)
@@ -43,6 +43,7 @@
 #include "pipe/p_context.h"
 #include "pipe/p_defines.h"
 #include "pipe/p_inlines.h"
+#include "util/u_format.h"
 #include "util/u_rect.h"
 #include "util/u_math.h"
 
@@ -104,7 +105,7 @@ st_texture_create(struct st_context *st,
    pt.width0 = width0;
    pt.height0 = height0;
    pt.depth0 = depth0;
-   pf_get_block(format, &pt.block);
+   util_format_get_block(format, &pt.block);
    pt.tex_usage = usage;
 
    newtex = screen->texture_create(screen, &pt);