<commit_before>
#include "intel_drm_winsys.h"
#include "util/u_memory.h"

#include "i915_drm.h"

#define BATCH_RESERVED 16

#define INTEL_DEFAULT_RELOCS 100
#define INTEL_MAX_RELOCS 400

#define INTEL_BATCH_NO_CLIPRECTS 0x1
#define INTEL_BATCH_CLIPRECTS    0x2

#undef INTEL_RUN_SYNC

struct intel_drm_batchbuffer
{
   struct intel_batchbuffer base;

   size_t actual_size;

   drm_intel_bo *bo;
};

static INLINE struct intel_drm_batchbuffer *
intel_drm_batchbuffer(struct intel_batchbuffer *batch)
{
   return (struct intel_drm_batchbuffer *)batch;
}

static void
intel_drm_batchbuffer_reset(struct intel_drm_batchbuffer *batch)
{
   struct intel_drm_winsys *idws = intel_drm_winsys(batch->base.iws);

   if (batch->bo)
      drm_intel_bo_unreference(batch->bo);
   batch->bo = drm_intel_bo_alloc(idws->pools.gem,
                                  "gallium3d_batchbuffer",
                                  batch->actual_size,
                                  4096);
   drm_intel_bo_map(batch->bo, TRUE);
   batch->base.map = batch->bo->virtual;

   memset(batch->base.map, 0, batch->actual_size);
   batch->base.ptr = batch->base.map;
   batch->base.size = batch->actual_size - BATCH_RESERVED;
   batch->base.relocs = 0;
}

static struct intel_batchbuffer *
intel_drm_batchbuffer_create(struct intel_winsys *iws)
{
   struct intel_drm_winsys *idws = intel_drm_winsys(iws);
   struct intel_drm_batchbuffer *batch = CALLOC_STRUCT(intel_drm_batchbuffer);

   batch->base.map = NULL;
   batch->base.ptr = NULL;
   batch->base.size = 0;

   batch->base.relocs = 0;
   batch->base.max_relocs = 100;/*INTEL_DEFAULT_RELOCS;*/

   batch->base.iws = iws;

   batch->actual_size = idws->max_batch_size;

   intel_drm_batchbuffer_reset(batch);

   return &batch->base;
}

static int<commit_msg>i915g: Up the number of relocs<commit_after>
#include "intel_drm_winsys.h"
#include "util/u_memory.h"

#include "i915_drm.h"

#define BATCH_RESERVED 16

#define INTEL_DEFAULT_RELOCS 100
#define INTEL_MAX_RELOCS 400

#define INTEL_BATCH_NO_CLIPRECTS 0x1
#define INTEL_BATCH_CLIPRECTS    0x2

#undef INTEL_RUN_SYNC

struct intel_drm_batchbuffer
{
   struct intel_batchbuffer base;

   size_t actual_size;

   drm_intel_bo *bo;
};

static INLINE struct intel_drm_batchbuffer *
intel_drm_batchbuffer(struct intel_batchbuffer *batch)
{
   return (struct intel_drm_batchbuffer *)batch;
}

static void
intel_drm_batchbuffer_reset(struct intel_drm_batchbuffer *batch)
{
   struct intel_drm_winsys *idws = intel_drm_winsys(batch->base.iws);

   if (batch->bo)
      drm_intel_bo_unreference(batch->bo);
   batch->bo = drm_intel_bo_alloc(idws->pools.gem,
                                  "gallium3d_batchbuffer",
                                  batch->actual_size,
                                  4096);
   drm_intel_bo_map(batch->bo, TRUE);
   batch->base.map = batch->bo->virtual;

   memset(batch->base.map, 0, batch->actual_size);
   batch->base.ptr = batch->base.map;
   batch->base.size = batch->actual_size - BATCH_RESERVED;
   batch->base.relocs = 0;
}

static struct intel_batchbuffer *
intel_drm_batchbuffer_create(struct intel_winsys *iws)
{
   struct intel_drm_winsys *idws = intel_drm_winsys(iws);
   struct intel_drm_batchbuffer *batch = CALLOC_STRUCT(intel_drm_batchbuffer);

   batch->base.map = NULL;
   batch->base.ptr = NULL;
   batch->base.size = 0;

   batch->base.relocs = 0;
   batch->base.max_relocs = 300;/*INTEL_DEFAULT_RELOCS;*/

   batch->base.iws = iws;

   batch->actual_size = idws->max_batch_size;

   intel_drm_batchbuffer_reset(batch);

   return &batch->base;
}

static int
{'fraction_non_alphanumeric': 0.10448592922819727, 'fraction_numerical': 0.015881861242685986, 'mean_word_length': 3.650259067357513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6076884', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1295, 'n_words': 220}