ilo: winsys may limit the batch buffer size
The maximum batch buffer size is determined at the time of drm_intel_bufmgr_gem_init(). Make sure the pipe driver does not exceed the limit.
This commit is contained in:
@@ -68,6 +68,7 @@ enum ilo_debug {
|
||||
struct ilo_dev_info {
|
||||
/* these mirror intel_winsys_info */
|
||||
int devid;
|
||||
int max_batch_size;
|
||||
bool has_llc;
|
||||
bool has_gen7_sol_reset;
|
||||
bool has_address_swizzling;
|
||||
|
@@ -120,6 +120,7 @@ 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)
|
||||
@@ -135,7 +136,12 @@ ilo_context_create(struct pipe_screen *screen, void *priv)
|
||||
util_slab_create(&ilo->transfer_mempool,
|
||||
sizeof(struct ilo_transfer), 64, UTIL_SLAB_SINGLETHREADED);
|
||||
|
||||
ilo->cp = ilo_cp_create(ilo->winsys, is->dev.has_llc);
|
||||
/* 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->shader_cache = ilo_shader_cache_create();
|
||||
if (ilo->cp)
|
||||
ilo->hw3d = ilo_3d_create(ilo->cp, ilo->dev);
|
||||
|
@@ -272,7 +272,7 @@ ilo_cp_destroy(struct ilo_cp *cp)
|
||||
* Create a command parser.
|
||||
*/
|
||||
struct ilo_cp *
|
||||
ilo_cp_create(struct intel_winsys *winsys, bool direct_map)
|
||||
ilo_cp_create(struct intel_winsys *winsys, int size, bool direct_map)
|
||||
{
|
||||
struct ilo_cp *cp;
|
||||
|
||||
@@ -286,7 +286,7 @@ ilo_cp_create(struct intel_winsys *winsys, bool direct_map)
|
||||
cp->ring = ILO_CP_RING_RENDER;
|
||||
cp->no_implicit_flush = false;
|
||||
|
||||
cp->bo_size = 8192;
|
||||
cp->bo_size = size;
|
||||
|
||||
if (!direct_map) {
|
||||
cp->sys = MALLOC(cp->bo_size * 4);
|
||||
|
@@ -85,7 +85,7 @@ struct ilo_cp_jmp_buf {
|
||||
};
|
||||
|
||||
struct ilo_cp *
|
||||
ilo_cp_create(struct intel_winsys *winsys, bool direct_map);
|
||||
ilo_cp_create(struct intel_winsys *winsys, int size, bool direct_map);
|
||||
|
||||
void
|
||||
ilo_cp_destroy(struct ilo_cp *cp);
|
||||
|
@@ -648,6 +648,7 @@ static bool
|
||||
init_dev(struct ilo_dev_info *dev, const struct intel_winsys_info *info)
|
||||
{
|
||||
dev->devid = info->devid;
|
||||
dev->max_batch_size = info->max_batch_size;
|
||||
dev->has_llc = info->has_llc;
|
||||
dev->has_gen7_sol_reset = info->has_gen7_sol_reset;
|
||||
dev->has_address_swizzling = info->has_address_swizzling;
|
||||
|
@@ -135,6 +135,8 @@ init_info(struct intel_winsys *winsys)
|
||||
|
||||
info->devid = drm_intel_bufmgr_gem_get_devid(winsys->bufmgr);
|
||||
|
||||
info->max_batch_size = BATCH_SZ;
|
||||
|
||||
get_param(winsys, I915_PARAM_HAS_LLC, &val);
|
||||
info->has_llc = val;
|
||||
|
||||
|
@@ -70,6 +70,7 @@ struct intel_bo;
|
||||
struct intel_winsys_info {
|
||||
int devid;
|
||||
|
||||
int max_batch_size;
|
||||
bool has_llc;
|
||||
bool has_gen7_sol_reset;
|
||||
bool has_address_swizzling;
|
||||
|
Reference in New Issue
Block a user