gallium/pipebuffer: change pb_cache_manager_create() size_factor to float
authorBrian Paul <brianp@vmware.com>
Fri, 14 Feb 2014 14:45:23 +0000 (07:45 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 14 Feb 2014 16:56:55 +0000 (09:56 -0700)
Requested by Marek.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
src/gallium/auxiliary/pipebuffer/pb_bufmgr.h
src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
src/gallium/winsys/svga/drm/vmw_screen_pools.c

index 3044ec881fd976b509bc2183aee4220cc48f68cf..d5b0ee2ac9677a42ea2d540bd3a96351676170e0 100644 (file)
@@ -161,8 +161,8 @@ pb_slab_range_manager_create(struct pb_manager *provider,
  */
 struct pb_manager *
 pb_cache_manager_create(struct pb_manager *provider, 
-                       unsigned usecs,
-                       unsigned size_factor,
+                        unsigned usecs,
+                        float size_factor,
                         unsigned bypass_usage);
 
 
index 0469146d15bc2753a2d4c397963934ec53b11978..32a88754042e3898a0bc98cd545d5685fc1823ca 100644 (file)
@@ -82,7 +82,7 @@ struct pb_cache_manager
    
    struct list_head delayed;
    pb_size numDelayed;
-   unsigned size_factor;
+   float size_factor;
    unsigned bypass_usage;
 };
 
@@ -236,7 +236,7 @@ pb_cache_is_buffer_compat(struct pb_cache_buffer *buf,
       return 0;
 
    /* be lenient with size */
-   if(buf->base.size > buf->mgr->size_factor*size)
+   if(buf->base.size > (unsigned) (buf->mgr->size_factor * size))
       return 0;
    
    if(!pb_check_alignment(desc->alignment, buf->base.alignment))
@@ -403,8 +403,8 @@ pb_cache_manager_destroy(struct pb_manager *mgr)
  */
 struct pb_manager *
 pb_cache_manager_create(struct pb_manager *provider, 
-                       unsigned usecs,
-                       unsigned size_factor,
+                        unsigned usecs,
+                        float size_factor,
                         unsigned bypass_usage)
 {
    struct pb_cache_manager *mgr;
index 6f0e2a57669d2b7946b695dcbda3b7e4b3811f3e..44cd0d165fed2df9c2b8235195c7649f14340266 100644 (file)
@@ -645,7 +645,7 @@ PUBLIC struct radeon_winsys *radeon_drm_winsys_create(int fd)
     ws->kman = radeon_bomgr_create(ws);
     if (!ws->kman)
         goto fail;
-    ws->cman = pb_cache_manager_create(ws->kman, 1000000, 2, 0);
+    ws->cman = pb_cache_manager_create(ws->kman, 1000000, 2.0f, 0);
     if (!ws->cman)
         goto fail;
 
index 7f7b77982aff943cd04ab669d47c13fd6de4b411..c97b71fc5e45db7707e1b6c37886fe849f809fee 100644 (file)
@@ -115,7 +115,7 @@ vmw_mob_pools_init(struct vmw_winsys_screen *vws)
    struct pb_desc desc;
 
    vws->pools.mob_cache = 
-      pb_cache_manager_create(vws->pools.gmr, 100000, 2,
+      pb_cache_manager_create(vws->pools.gmr, 100000, 2.0f,
                               VMW_BUFFER_USAGE_SHARED);
    if (!vws->pools.mob_cache)
       return FALSE;