Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c6c6003 authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter
Browse files

drm/i915: Remove DRI1 ring accessors and API



With the deprecation of UMS, and by association DRI1, we have a tough
choice when updating the ring access routines. We either rewrite the
DRI1 routines blindly without testing (so likely to be broken) or take
the liberty of declaring them no longer supported and remove them
entirely. This takes the latter approach.

v2: Also remove the DRI1 sarea updates

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
[danvet: Fix rebase conflicts.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 7ba717cf
Loading
Loading
Loading
Loading
+15 −916

File changed.

Preview size limit exceeded, changes collapsed.

+0 −2
Original line number Diff line number Diff line
@@ -1573,8 +1573,6 @@ static struct drm_driver driver = {
	.resume = i915_resume_legacy,

	.device_is_agp = i915_driver_device_is_agp,
	.master_create = i915_master_create,
	.master_destroy = i915_master_destroy,
#if defined(CONFIG_DEBUG_FS)
	.debugfs_init = i915_debugfs_init,
	.debugfs_cleanup = i915_debugfs_cleanup,
+0 −27
Original line number Diff line number Diff line
@@ -327,12 +327,6 @@ struct intel_opregion {
struct intel_overlay;
struct intel_overlay_error_state;

struct drm_local_map;

struct drm_i915_master_private {
	struct drm_local_map *sarea;
	struct _drm_i915_sarea *sarea_priv;
};
#define I915_FENCE_REG_NONE -1
#define I915_MAX_NUM_FENCES 32
/* 32 fences + sign bit for FENCE_REG_NONE */
@@ -1127,19 +1121,6 @@ struct i915_power_domains {
	struct i915_power_well *power_wells;
};

struct i915_dri1_state {
	unsigned allow_batchbuffer : 1;
	u32 __iomem *gfx_hws_cpu_addr;

	unsigned int cpp;
	int back_offset;
	int front_offset;
	int current_page;
	int page_flipping;

	uint32_t counter;
};

struct i915_ums_state {
	/**
	 * Flag if the X Server, and thus DRM, is not currently in
@@ -1787,9 +1768,6 @@ struct drm_i915_private {

	uint32_t bios_vgacntr;

	/* Old dri1 support infrastructure, beware the dragons ya fools entering
	 * here! */
	struct i915_dri1_state dri1;
	/* Old ums support infrastructure, same warning applies. */
	struct i915_ums_state ums;

@@ -2351,8 +2329,6 @@ struct i915_params {
extern struct i915_params i915 __read_mostly;

				/* i915_dma.c */
void i915_update_dri1_breadcrumb(struct drm_device *dev);
extern void i915_kernel_lost_context(struct drm_device * dev);
extern int i915_driver_load(struct drm_device *, unsigned long flags);
extern int i915_driver_unload(struct drm_device *);
extern int i915_driver_open(struct drm_device *dev, struct drm_file *file);
@@ -2366,9 +2342,6 @@ extern int i915_driver_device_is_agp(struct drm_device * dev);
extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
			      unsigned long arg);
#endif
extern int i915_emit_box(struct drm_device *dev,
			 struct drm_clip_rect *box,
			 int DR1, int DR4);
extern int intel_gpu_reset(struct drm_device *dev);
extern int i915_reset(struct drm_device *dev);
extern unsigned long i915_chipset_val(struct drm_i915_private *dev_priv);
+0 −4
Original line number Diff line number Diff line
@@ -4664,7 +4664,6 @@ i915_gem_suspend(struct drm_device *dev)
	if (!drm_core_check_feature(dev, DRIVER_MODESET))
		i915_gem_evict_everything(dev);

	i915_kernel_lost_context(dev);
	i915_gem_stop_ringbuffers(dev);

	/* Hack!  Don't let anybody do execbuf while we don't control the chip.
@@ -4963,9 +4962,6 @@ int i915_gem_init(struct drm_device *dev)
	}
	mutex_unlock(&dev->struct_mutex);

	/* Allow hardware batchbuffers unless told otherwise, but not for KMS. */
	if (!drm_core_check_feature(dev, DRIVER_MODESET))
		dev_priv->dri1.allow_batchbuffer = 1;
	return ret;
}

+42 −1
Original line number Diff line number Diff line
@@ -1020,6 +1020,47 @@ i915_reset_gen7_sol_offsets(struct drm_device *dev,
	return 0;
}

static int
i915_emit_box(struct intel_engine_cs *ring,
	      struct drm_clip_rect *box,
	      int DR1, int DR4)
{
	int ret;

	if (box->y2 <= box->y1 || box->x2 <= box->x1 ||
	    box->y2 <= 0 || box->x2 <= 0) {
		DRM_ERROR("Bad box %d,%d..%d,%d\n",
			  box->x1, box->y1, box->x2, box->y2);
		return -EINVAL;
	}

	if (INTEL_INFO(ring->dev)->gen >= 4) {
		ret = intel_ring_begin(ring, 4);
		if (ret)
			return ret;

		intel_ring_emit(ring, GFX_OP_DRAWRECT_INFO_I965);
		intel_ring_emit(ring, (box->x1 & 0xffff) | box->y1 << 16);
		intel_ring_emit(ring, ((box->x2 - 1) & 0xffff) | (box->y2 - 1) << 16);
		intel_ring_emit(ring, DR4);
	} else {
		ret = intel_ring_begin(ring, 6);
		if (ret)
			return ret;

		intel_ring_emit(ring, GFX_OP_DRAWRECT_INFO);
		intel_ring_emit(ring, DR1);
		intel_ring_emit(ring, (box->x1 & 0xffff) | box->y1 << 16);
		intel_ring_emit(ring, ((box->x2 - 1) & 0xffff) | (box->y2 - 1) << 16);
		intel_ring_emit(ring, DR4);
		intel_ring_emit(ring, 0);
	}
	intel_ring_advance(ring);

	return 0;
}


int
i915_gem_ringbuffer_submission(struct drm_device *dev, struct drm_file *file,
			       struct intel_engine_cs *ring,
@@ -1148,7 +1189,7 @@ i915_gem_ringbuffer_submission(struct drm_device *dev, struct drm_file *file,
	exec_len = args->batch_len;
	if (cliprects) {
		for (i = 0; i < args->num_cliprects; i++) {
			ret = i915_emit_box(dev, &cliprects[i],
			ret = i915_emit_box(ring, &cliprects[i],
					    args->DR1, args->DR4);
			if (ret)
				goto error;
Loading