Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Aug 2015 22:19:54 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r287177 - head/sys/dev/drm2/i915
Message-ID:  <201508262219.t7QMJsB9084521@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Wed Aug 26 22:19:53 2015
New Revision: 287177
URL: https://svnweb.freebsd.org/changeset/base/287177

Log:
  Merge i915_emit_box_p and i915_emit_box as done in linux 3.8
  
  Reviewed by:	dumbbell
  Differential Revision:	https://reviews.freebsd.org/D3495

Modified:
  head/sys/dev/drm2/i915/i915_dma.c
  head/sys/dev/drm2/i915/i915_drv.h
  head/sys/dev/drm2/i915/i915_gem_execbuffer.c

Modified: head/sys/dev/drm2/i915/i915_dma.c
==============================================================================
--- head/sys/dev/drm2/i915/i915_dma.c	Wed Aug 26 22:09:12 2015	(r287176)
+++ head/sys/dev/drm2/i915/i915_dma.c	Wed Aug 26 22:19:53 2015	(r287177)
@@ -410,21 +410,8 @@ static int i915_emit_cmds(struct drm_dev
 	return 0;
 }
 
-int i915_emit_box(struct drm_device * dev,
-		  struct drm_clip_rect *boxes,
-		  int i, int DR1, int DR4)
-{
-	struct drm_clip_rect box;
-
-	if (DRM_COPY_FROM_USER_UNCHECKED(&box, &boxes[i], sizeof(box))) {
-		return -EFAULT;
-	}
-
-	return (i915_emit_box_p(dev, &box, DR1, DR4));
-}
-
 int
-i915_emit_box_p(struct drm_device *dev,
+i915_emit_box(struct drm_device *dev,
 	      struct drm_clip_rect *box,
 	      int DR1, int DR4)
 {
@@ -506,8 +493,8 @@ static int i915_dispatch_cmdbuffer(struc
 
 	for (i = 0; i < count; i++) {
 		if (i < nbox) {
-			ret = i915_emit_box_p(dev, &cmd->cliprects[i],
-			    cmd->DR1, cmd->DR4);
+			ret = i915_emit_box(dev, &cliprects[i],
+					    cmd->DR1, cmd->DR4);
 			if (ret)
 				return ret;
 		}
@@ -542,8 +529,8 @@ static int i915_dispatch_batchbuffer(str
 	count = nbox ? nbox : 1;
 	for (i = 0; i < count; i++) {
 		if (i < nbox) {
-			int ret = i915_emit_box_p(dev, &cliprects[i],
-			    batch->DR1, batch->DR4);
+			ret = i915_emit_box(dev, &cliprects[i],
+					    batch->DR1, batch->DR4);
 			if (ret)
 				return ret;
 		}

Modified: head/sys/dev/drm2/i915/i915_drv.h
==============================================================================
--- head/sys/dev/drm2/i915/i915_drv.h	Wed Aug 26 22:09:12 2015	(r287176)
+++ head/sys/dev/drm2/i915/i915_drv.h	Wed Aug 26 22:19:53 2015	(r287177)
@@ -1120,11 +1120,8 @@ extern int i915_driver_device_is_agp(str
 extern long i915_compat_ioctl(struct file *filp, unsigned int cmd,
 			      unsigned long arg);
 extern int i915_emit_box(struct drm_device *dev,
-			 struct drm_clip_rect __user *boxes,
-			 int i, int DR1, int DR4);
-int i915_emit_box_p(struct drm_device *dev, struct drm_clip_rect *box,
-    int DR1, int DR4);
-
+			 struct drm_clip_rect *box,
+			 int DR1, int DR4);
 unsigned long i915_chipset_val(struct drm_i915_private *dev_priv);
 unsigned long i915_mch_val(struct drm_i915_private *dev_priv);
 void i915_update_gfx_val(struct drm_i915_private *dev_priv);

Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c
==============================================================================
--- head/sys/dev/drm2/i915/i915_gem_execbuffer.c	Wed Aug 26 22:09:12 2015	(r287176)
+++ head/sys/dev/drm2/i915/i915_gem_execbuffer.c	Wed Aug 26 22:19:53 2015	(r287177)
@@ -1372,7 +1372,7 @@ i915_gem_do_execbuffer(struct drm_device
 
 	if (cliprects) {
 		for (i = 0; i < args->num_cliprects; i++) {
-			ret = i915_emit_box_p(dev, &cliprects[i],
+			ret = i915_emit_box(dev, &cliprects[i],
 					    args->DR1, args->DR4);
 			if (ret)
 				goto err;



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