/* Return the required GTT alignment for an object, taking into account potential fence register mapping if needed.  */
static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj)
/* Return the required GTT alignment for an object, taking into account potential fence register mapping if needed.  */
static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj)
{
	struct drm_device *dev = obj->dev;
	struct drm_i915_gem_object *obj_priv = obj->driver_private;
	int start, i;
	if (IS_I965G(dev) || obj_priv->tiling_mode == I915_TILING_NONE)
		return 4096;
	if (IS_I9XX(dev))
		start = 1024*1024;
	else
		start = 512*1024;
	for (i = start; i < obj->size; i <<= 1)
		;
	return i;
}