Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Nov 2015 19:55:32 +0000 (UTC)
From:      =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= <dumbbell@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r290238 - head/sys/dev/drm2/i915
Message-ID:  <201511011955.tA1JtWo5005897@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell
Date: Sun Nov  1 19:55:32 2015
New Revision: 290238
URL: https://svnweb.freebsd.org/changeset/base/290238

Log:
  drm/i915: Reduce diff with Linux 3.8
  
  There is no functional change. The goal is to ease the future update to
  Linux 3.8's i915 driver.
  
  MFC after:	2 months

Modified:
  head/sys/dev/drm2/i915/intel_ringbuffer.c

Modified: head/sys/dev/drm2/i915/intel_ringbuffer.c
==============================================================================
--- head/sys/dev/drm2/i915/intel_ringbuffer.c	Sun Nov  1 18:42:48 2015	(r290237)
+++ head/sys/dev/drm2/i915/intel_ringbuffer.c	Sun Nov  1 19:55:32 2015	(r290238)
@@ -99,11 +99,11 @@ gen2_render_ring_flush(struct intel_ring
 
 static int
 gen4_render_ring_flush(struct intel_ring_buffer *ring,
-		  u32	invalidate_domains,
-		  u32	flush_domains)
+		       u32	invalidate_domains,
+		       u32	flush_domains)
 {
 	struct drm_device *dev = ring->dev;
-	uint32_t cmd;
+	u32 cmd;
 	int ret;
 
 	/*
@@ -268,7 +268,7 @@ gen6_render_ring_flush(struct intel_ring
 }
 
 static void ring_write_tail(struct intel_ring_buffer *ring,
-			    uint32_t value)
+			    u32 value)
 {
 	drm_i915_private_t *dev_priv = ring->dev->dev_private;
 	I915_WRITE_TAIL(ring, value);
@@ -277,7 +277,7 @@ static void ring_write_tail(struct intel
 u32 intel_ring_get_active_head(struct intel_ring_buffer *ring)
 {
 	drm_i915_private_t *dev_priv = ring->dev->dev_private;
-	uint32_t acthd_reg = INTEL_INFO(ring->dev)->gen >= 4 ?
+	u32 acthd_reg = INTEL_INFO(ring->dev)->gen >= 4 ?
 			RING_ACTHD(ring->mmio_base) : ACTHD;
 
 	return I915_READ(acthd_reg);
@@ -287,7 +287,7 @@ static int init_ring_common(struct intel
 {
 	drm_i915_private_t *dev_priv = ring->dev->dev_private;
 	struct drm_i915_gem_object *obj = ring->obj;
-	uint32_t head;
+	u32 head;
 
 	/* Stop the ring if it's running. */
 	I915_WRITE_CTL(ring, 0);
@@ -300,7 +300,7 @@ static int init_ring_common(struct intel
 
 	/* G45 ring initialization fails to reset head to zero */
 	if (head != 0) {
-		DRM_DEBUG("%s head not reset to zero "
+		DRM_DEBUG_KMS("%s head not reset to zero "
 			      "ctl %08x head %08x tail %08x start %08x\n",
 			      ring->name,
 			      I915_READ_CTL(ring),
@@ -410,6 +410,7 @@ cleanup_pipe_control(struct intel_ring_b
 		return;
 
 	obj = pc->obj;
+
 	pmap_qremove((vm_offset_t)pc->cpu_page, 1);
 	kva_free((uintptr_t)pc->cpu_page, PAGE_SIZE);
 	i915_gem_object_unpin(obj);
@@ -439,7 +440,6 @@ static int init_render_ring(struct intel
 			return ret;
 	}
 
-
 	if (IS_GEN6(dev)) {
 		/* From the Sandybridge PRM, volume 1 part 3, page 24:
 		 * "If this bit is set, STCunit will have LRA as replacement
@@ -473,8 +473,8 @@ static void render_ring_cleanup(struct i
 
 static void
 update_mboxes(struct intel_ring_buffer *ring,
-	    u32 seqno,
-	    u32 mmio_offset)
+	      u32 seqno,
+	      u32 mmio_offset)
 {
 	intel_ring_emit(ring, MI_SEMAPHORE_MBOX |
 			      MI_SEMAPHORE_GLOBAL_GTT |
@@ -643,7 +643,7 @@ gen6_ring_get_seqno(struct intel_ring_bu
 	return intel_read_status_page(ring, I915_GEM_HWS_INDEX);
 }
 
-static uint32_t
+static u32
 ring_get_seqno(struct intel_ring_buffer *ring)
 {
 	if (ring->status_page.page_addr == NULL)
@@ -651,7 +651,7 @@ ring_get_seqno(struct intel_ring_buffer 
 	return intel_read_status_page(ring, I915_GEM_HWS_INDEX);
 }
 
-static uint32_t
+static u32
 pc_render_get_seqno(struct intel_ring_buffer *ring)
 {
 	struct pipe_control *pc = ring->private;
@@ -764,7 +764,7 @@ void intel_ring_setup_status_page(struct
 {
 	struct drm_device *dev = ring->dev;
 	drm_i915_private_t *dev_priv = dev->dev_private;
-	uint32_t mmio = 0;
+	u32 mmio = 0;
 
 	/* The ring status page addresses are no longer next to the rest of
 	 * the ring registers as of gen7.
@@ -793,8 +793,8 @@ void intel_ring_setup_status_page(struct
 
 static int
 bsd_ring_flush(struct intel_ring_buffer *ring,
-	       uint32_t     invalidate_domains,
-	       uint32_t     flush_domains)
+	       u32     invalidate_domains,
+	       u32     flush_domains)
 {
 	int ret;
 
@@ -871,7 +871,8 @@ gen6_ring_put_irq(struct intel_ring_buff
 }
 
 static int
-i965_dispatch_execbuffer(struct intel_ring_buffer *ring, u32 offset, u32 length)
+i965_dispatch_execbuffer(struct intel_ring_buffer *ring,
+			 u32 offset, u32 length)
 {
 	int ret;
 
@@ -910,7 +911,7 @@ i830_dispatch_execbuffer(struct intel_ri
 
 static int
 i915_dispatch_execbuffer(struct intel_ring_buffer *ring,
-				u32 offset, u32 len)
+			 u32 offset, u32 len)
 {
 	int ret;
 
@@ -974,7 +975,7 @@ static int init_status_page(struct intel
 	memset(ring->status_page.page_addr, 0, PAGE_SIZE);
 
 	intel_ring_setup_status_page(ring);
-	DRM_DEBUG("i915: init_status_page %s hws offset: 0x%08x\n",
+	DRM_DEBUG_DRIVER("%s hws offset: 0x%08x\n",
 			ring->name, ring->status_page.gfx_addr);
 
 	return 0;
@@ -1078,28 +1079,6 @@ void intel_cleanup_ring_buffer(struct in
 	cleanup_status_page(ring);
 }
 
-static int intel_wrap_ring_buffer(struct intel_ring_buffer *ring)
-{
-	uint32_t *virt;
-	int rem = ring->size - ring->tail;
-
-	if (ring->space < rem) {
-		int ret = intel_wait_ring_buffer(ring, rem);
-		if (ret)
-			return ret;
-	}
-
-	virt = (uint32_t *)((char *)ring->virtual_start + ring->tail);
-	rem /= 4;
-	while (rem--)
-		*virt++ = MI_NOOP;
-
-	ring->tail = 0;
-	ring->space = ring_space(ring);
-
-	return 0;
-}
-
 static int intel_ring_wait_seqno(struct intel_ring_buffer *ring, u32 seqno)
 {
 	struct drm_i915_private *dev_priv = ring->dev->dev_private;
@@ -1222,6 +1201,28 @@ int intel_wait_ring_buffer(struct intel_
 	return -EBUSY;
 }
 
+static int intel_wrap_ring_buffer(struct intel_ring_buffer *ring)
+{
+	uint32_t *virt;
+	int rem = ring->size - ring->tail;
+
+	if (ring->space < rem) {
+		int ret = intel_wait_ring_buffer(ring, rem);
+		if (ret)
+			return ret;
+	}
+
+	virt = (uint32_t *)((char *)ring->virtual_start + ring->tail);
+	rem /= 4;
+	while (rem--)
+		*virt++ = MI_NOOP;
+
+	ring->tail = 0;
+	ring->space = ring_space(ring);
+
+	return 0;
+}
+
 int intel_ring_begin(struct intel_ring_buffer *ring,
 		     int num_dwords)
 {
@@ -1283,7 +1284,7 @@ static void gen6_bsd_ring_write_tail(str
 }
 
 static int gen6_ring_flush(struct intel_ring_buffer *ring,
-			   uint32_t invalidate, uint32_t flush)
+			   u32 invalidate, u32 flush)
 {
 	uint32_t cmd;
 	int ret;
@@ -1305,7 +1306,7 @@ static int gen6_ring_flush(struct intel_
 
 static int
 gen6_ring_dispatch_execbuffer(struct intel_ring_buffer *ring,
-			      uint32_t offset, uint32_t len)
+			      u32 offset, u32 len)
 {
 	int ret;
 
@@ -1326,7 +1327,7 @@ gen6_ring_dispatch_execbuffer(struct int
 static int blt_ring_flush(struct intel_ring_buffer *ring,
 			  u32 invalidate, u32 flush)
 {
-	u32 cmd;
+	uint32_t cmd;
 	int ret;
 
 	ret = intel_ring_begin(ring, 4);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511011955.tA1JtWo5005897>