Module: Mesa
Branch: master
Commit: 354d84b6297fe2937e9684175ea9d3b650b75417
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=354d84b6297fe2937e9684175ea9d3b650b75417

Author: Chia-I Wu <olva...@gmail.com>
Date:   Tue Aug 26 13:31:29 2014 +0800

ilo: remove max_batch_size

It is used to derive an artificial limit on max relocs per bo.  We choose not
to export it anymore.

---

 src/gallium/drivers/ilo/ilo_common.h            |    1 -
 src/gallium/drivers/ilo/ilo_context.c           |    7 +------
 src/gallium/drivers/ilo/ilo_screen.c            |    1 -
 src/gallium/winsys/intel/drm/intel_drm_winsys.c |    8 +++-----
 src/gallium/winsys/intel/intel_winsys.h         |    1 -
 5 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/src/gallium/drivers/ilo/ilo_common.h 
b/src/gallium/drivers/ilo/ilo_common.h
index e4f28b3..20c7842 100644
--- a/src/gallium/drivers/ilo/ilo_common.h
+++ b/src/gallium/drivers/ilo/ilo_common.h
@@ -70,7 +70,6 @@ struct ilo_dev_info {
    int devid;
    size_t aperture_total;
    size_t aperture_mappable;
-   int max_batch_size;
    bool has_llc;
    bool has_address_swizzling;
    bool has_logical_context;
diff --git a/src/gallium/drivers/ilo/ilo_context.c 
b/src/gallium/drivers/ilo/ilo_context.c
index ab750ac..04df389 100644
--- a/src/gallium/drivers/ilo/ilo_context.c
+++ b/src/gallium/drivers/ilo/ilo_context.c
@@ -104,7 +104,6 @@ ilo_context_create(struct pipe_screen *screen, void *priv)
 {
    struct ilo_screen *is = ilo_screen(screen);
    struct ilo_context *ilo;
-   int cp_size;
 
    ilo = CALLOC_STRUCT(ilo_context);
    if (!ilo)
@@ -121,11 +120,7 @@ ilo_context_create(struct pipe_screen *screen, void *priv)
          sizeof(struct ilo_transfer), 64, UTIL_SLAB_SINGLETHREADED);
 
    /* 8192 DWords */
-   cp_size = 8192;
-   if (cp_size * 4 > is->dev.max_batch_size)
-      cp_size = is->dev.max_batch_size / 4;
-
-   ilo->cp = ilo_cp_create(ilo->winsys, cp_size, is->dev.has_llc);
+   ilo->cp = ilo_cp_create(ilo->winsys, 8192, is->dev.has_llc);
    ilo->shader_cache = ilo_shader_cache_create();
    if (ilo->cp)
       ilo->hw3d = ilo_3d_create(ilo->cp, ilo->dev);
diff --git a/src/gallium/drivers/ilo/ilo_screen.c 
b/src/gallium/drivers/ilo/ilo_screen.c
index 15658da..1ab14cf 100644
--- a/src/gallium/drivers/ilo/ilo_screen.c
+++ b/src/gallium/drivers/ilo/ilo_screen.c
@@ -640,7 +640,6 @@ init_dev(struct ilo_dev_info *dev, const struct 
intel_winsys_info *info)
    dev->devid = info->devid;
    dev->aperture_total = info->aperture_total;
    dev->aperture_mappable = info->aperture_mappable;
-   dev->max_batch_size = info->max_batch_size;
    dev->has_llc = info->has_llc;
    dev->has_address_swizzling = info->has_address_swizzling;
    dev->has_logical_context = info->has_logical_context;
diff --git a/src/gallium/winsys/intel/drm/intel_drm_winsys.c 
b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
index c8ae6c1..6f85852 100644
--- a/src/gallium/winsys/intel/drm/intel_drm_winsys.c
+++ b/src/gallium/winsys/intel/drm/intel_drm_winsys.c
@@ -43,8 +43,6 @@
 #include "util/u_debug.h"
 #include "../intel_winsys.h"
 
-#define BATCH_SZ (8192 * sizeof(uint32_t))
-
 struct intel_winsys {
    int fd;
    drm_intel_bufmgr *bufmgr;
@@ -145,8 +143,6 @@ probe_winsys(struct intel_winsys *winsys)
       return false;
    }
 
-   info->max_batch_size = BATCH_SZ;
-
    get_param(winsys, I915_PARAM_HAS_LLC, &val);
    info->has_llc = val;
    info->has_address_swizzling = test_address_swizzling(winsys);
@@ -169,6 +165,8 @@ probe_winsys(struct intel_winsys *winsys)
 struct intel_winsys *
 intel_winsys_create_for_fd(int fd)
 {
+   /* so that we can have enough (up to 4094) relocs per bo */
+   const int batch_size = sizeof(uint32_t) * 8192;
    struct intel_winsys *winsys;
 
    winsys = CALLOC_STRUCT(intel_winsys);
@@ -177,7 +175,7 @@ intel_winsys_create_for_fd(int fd)
 
    winsys->fd = fd;
 
-   winsys->bufmgr = drm_intel_bufmgr_gem_init(winsys->fd, BATCH_SZ);
+   winsys->bufmgr = drm_intel_bufmgr_gem_init(winsys->fd, batch_size);
    if (!winsys->bufmgr) {
       debug_error("failed to create GEM buffer manager");
       FREE(winsys);
diff --git a/src/gallium/winsys/intel/intel_winsys.h 
b/src/gallium/winsys/intel/intel_winsys.h
index bc18bb6..c928cad 100644
--- a/src/gallium/winsys/intel/intel_winsys.h
+++ b/src/gallium/winsys/intel/intel_winsys.h
@@ -69,7 +69,6 @@ struct intel_winsys_info {
    size_t aperture_total;
    size_t aperture_mappable;
 
-   int max_batch_size;
    bool has_llc;
    bool has_address_swizzling;
    bool has_logical_context;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to