Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Oct 2015 07:45:37 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r288653 - in head/sys/dev/drm2: . i915
Message-ID:  <201510040745.t947jbp7082807@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Sun Oct  4 07:45:36 2015
New Revision: 288653
URL: https://svnweb.freebsd.org/changeset/base/288653

Log:
  drm2: a few minor fixes after r280183
  
  * Remove obsolete drm_agp_*_memory() prototypes.
  * Fix comment in drm_fops.c (outisde -> outside).
  * Fix some formatting issues in drm_stub.c (spaces -> tabs).
  * Add missing case statement (gen == 3) in intel_gpu_reset().
  * Restore pci_enable_busmaster() call in the init path (fixes gpu hang on i945GM).
  * Replace M_WAITOK with M_NOWAIT when the return value of malloc is checked (may be incorrect).
  
  Submitted by:	<s3erios@gmail.com>
  Reviewed by:	dumbbell
  Approved by:	dumbbell
  Differential Revision:	https://reviews.freebsd.org/D3413

Modified:
  head/sys/dev/drm2/drmP.h
  head/sys/dev/drm2/drm_crtc.c
  head/sys/dev/drm2/drm_fops.c
  head/sys/dev/drm2/drm_pci.c
  head/sys/dev/drm2/drm_stub.c
  head/sys/dev/drm2/i915/i915_dma.c
  head/sys/dev/drm2/i915/i915_drv.c
  head/sys/dev/drm2/i915/intel_opregion.c

Modified: head/sys/dev/drm2/drmP.h
==============================================================================
--- head/sys/dev/drm2/drmP.h	Sun Oct  4 07:02:17 2015	(r288652)
+++ head/sys/dev/drm2/drmP.h	Sun Oct  4 07:45:36 2015	(r288653)
@@ -1782,12 +1782,6 @@ void	drm_driver_irq_preinstall(struct dr
 void	drm_driver_irq_postinstall(struct drm_device *dev);
 void	drm_driver_irq_uninstall(struct drm_device *dev);
 
-/* AGP/PCI Express/GART support (drm_agpsupport.c) */
-void	*drm_agp_allocate_memory(size_t pages, u32 type);
-int	drm_agp_free_memory(void *handle);
-int	drm_agp_bind_memory(void *handle, off_t start);
-int	drm_agp_unbind_memory(void *handle);
-
 /* sysctl support (drm_sysctl.h) */
 extern int		drm_sysctl_init(struct drm_device *dev);
 extern int		drm_sysctl_cleanup(struct drm_device *dev);

Modified: head/sys/dev/drm2/drm_crtc.c
==============================================================================
--- head/sys/dev/drm2/drm_crtc.c	Sun Oct  4 07:02:17 2015	(r288652)
+++ head/sys/dev/drm2/drm_crtc.c	Sun Oct  4 07:45:36 2015	(r288653)
@@ -663,7 +663,7 @@ int drm_plane_init(struct drm_device *de
 	plane->dev = dev;
 	plane->funcs = funcs;
 	plane->format_types = malloc(sizeof(uint32_t) * format_count,
-	    DRM_MEM_KMS, M_WAITOK);
+	    DRM_MEM_KMS, M_NOWAIT);
 	if (!plane->format_types) {
 		DRM_DEBUG_KMS("out of memory when allocating plane\n");
 		drm_mode_object_put(dev, &plane->base);
@@ -1010,7 +1010,7 @@ int drm_mode_group_init(struct drm_devic
 	total_objects += dev->mode_config.num_encoder;
 
 	group->id_list = malloc(total_objects * sizeof(uint32_t),
-	    DRM_MEM_KMS, M_WAITOK | M_ZERO);
+	    DRM_MEM_KMS, M_NOWAIT | M_ZERO);
 	if (!group->id_list)
 		return -ENOMEM;
 
@@ -1998,7 +1998,7 @@ int drm_mode_setcrtc(struct drm_device *
 
 		connector_set = malloc(crtc_req->count_connectors *
 					sizeof(struct drm_connector *),
-					DRM_MEM_KMS, M_WAITOK);
+					DRM_MEM_KMS, M_NOWAIT);
 		if (!connector_set) {
 			ret = -ENOMEM;
 			goto out;
@@ -2523,7 +2523,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_de
 			goto out_err1;
 		}
 		clips = malloc(num_clips * sizeof(*clips), DRM_MEM_KMS,
-		    M_WAITOK | M_ZERO);
+		    M_NOWAIT | M_ZERO);
 		if (!clips) {
 			ret = -ENOMEM;
 			goto out_err1;
@@ -2774,13 +2774,13 @@ struct drm_property *drm_property_create
 	int ret;
 
 	property = malloc(sizeof(struct drm_property), DRM_MEM_KMS,
-	    M_WAITOK | M_ZERO);
+	    M_NOWAIT | M_ZERO);
 	if (!property)
 		return NULL;
 
 	if (num_values) {
 		property->values = malloc(sizeof(uint64_t)*num_values, DRM_MEM_KMS,
-		    M_WAITOK | M_ZERO);
+		    M_NOWAIT | M_ZERO);
 		if (!property->values)
 			goto fail;
 	}
@@ -2908,7 +2908,7 @@ int drm_property_add_enum(struct drm_pro
 	}
 
 	prop_enum = malloc(sizeof(struct drm_property_enum), DRM_MEM_KMS,
-	    M_WAITOK | M_ZERO);
+	    M_NOWAIT | M_ZERO);
 	if (!prop_enum)
 		return -ENOMEM;
 
@@ -3104,7 +3104,7 @@ static struct drm_property_blob *drm_pro
 		return NULL;
 
 	blob = malloc(sizeof(struct drm_property_blob)+length, DRM_MEM_KMS,
-	    M_WAITOK | M_ZERO);
+	    M_NOWAIT | M_ZERO);
 	if (!blob)
 		return NULL;
 
@@ -3434,7 +3434,7 @@ int drm_mode_crtc_set_gamma_size(struct 
 	crtc->gamma_size = gamma_size;
 
 	crtc->gamma_store = malloc(gamma_size * sizeof(uint16_t) * 3,
-	    DRM_MEM_KMS, M_WAITOK | M_ZERO);
+	    DRM_MEM_KMS, M_NOWAIT | M_ZERO);
 	if (!crtc->gamma_store) {
 		crtc->gamma_size = 0;
 		return -ENOMEM;
@@ -3632,7 +3632,7 @@ int drm_mode_page_flip_ioctl(struct drm_
 		file_priv->event_space -= sizeof e->event;
 		mtx_unlock(&dev->event_lock);
 
-		e = malloc(sizeof *e, DRM_MEM_KMS, M_WAITOK | M_ZERO);
+		e = malloc(sizeof *e, DRM_MEM_KMS, M_NOWAIT | M_ZERO);
 		if (e == NULL) {
 			mtx_lock(&dev->event_lock);
 			file_priv->event_space += sizeof e->event;

Modified: head/sys/dev/drm2/drm_fops.c
==============================================================================
--- head/sys/dev/drm2/drm_fops.c	Sun Oct  4 07:02:17 2015	(r288652)
+++ head/sys/dev/drm2/drm_fops.c	Sun Oct  4 07:45:36 2015	(r288653)
@@ -136,7 +136,7 @@ int drm_open(struct cdev *kdev, int flag
 	sx_xlock(&drm_global_mutex);
 
 	/*
-	 * FIXME Linux<->FreeBSD: On Linux, counter updated outisde
+	 * FIXME Linux<->FreeBSD: On Linux, counter updated outside
 	 * global mutex.
 	 */
 	if (!dev->open_count++)

Modified: head/sys/dev/drm2/drm_pci.c
==============================================================================
--- head/sys/dev/drm2/drm_pci.c	Sun Oct  4 07:02:17 2015	(r288652)
+++ head/sys/dev/drm2/drm_pci.c	Sun Oct  4 07:45:36 2015	(r288653)
@@ -225,7 +225,7 @@ int drm_pci_set_unique(struct drm_device
 
 	master->unique_len = u->unique_len;
 	master->unique_size = u->unique_len + 1;
-	master->unique = malloc(master->unique_size, DRM_MEM_DRIVER, M_WAITOK);
+	master->unique = malloc(master->unique_size, DRM_MEM_DRIVER, M_NOWAIT);
 	if (!master->unique) {
 		ret = -ENOMEM;
 		goto err;

Modified: head/sys/dev/drm2/drm_stub.c
==============================================================================
--- head/sys/dev/drm2/drm_stub.c	Sun Oct  4 07:02:17 2015	(r288652)
+++ head/sys/dev/drm2/drm_stub.c	Sun Oct  4 07:45:36 2015	(r288653)
@@ -94,9 +94,9 @@ static int drm_minor_get_id(struct drm_d
 
 	if (type == DRM_MINOR_CONTROL) {
 		new_id += 64;
-        } else if (type == DRM_MINOR_RENDER) {
-                new_id += 128;
-        }
+	} else if (type == DRM_MINOR_RENDER) {
+		new_id += 128;
+	}
 
 	return new_id;
 }

Modified: head/sys/dev/drm2/i915/i915_dma.c
==============================================================================
--- head/sys/dev/drm2/i915/i915_dma.c	Sun Oct  4 07:02:17 2015	(r288652)
+++ head/sys/dev/drm2/i915/i915_dma.c	Sun Oct  4 07:45:36 2015	(r288653)
@@ -1452,6 +1452,8 @@ int i915_driver_load(struct drm_device *
 		}
 	}
 
+	pci_enable_busmaster(dev->dev);
+
 	intel_opregion_init(dev);
 
 	callout_init(&dev_priv->hangcheck_timer, 1);

Modified: head/sys/dev/drm2/i915/i915_drv.c
==============================================================================
--- head/sys/dev/drm2/i915/i915_drv.c	Sun Oct  4 07:02:17 2015	(r288652)
+++ head/sys/dev/drm2/i915/i915_drv.c	Sun Oct  4 07:45:36 2015	(r288653)
@@ -894,6 +894,7 @@ int intel_gpu_reset(struct drm_device *d
 	case 4:
 		ret = i965_do_reset(dev);
 		break;
+	case 3:
 	case 2:
 		ret = i8xx_do_reset(dev);
 		break;

Modified: head/sys/dev/drm2/i915/intel_opregion.c
==============================================================================
--- head/sys/dev/drm2/i915/intel_opregion.c	Sun Oct  4 07:02:17 2015	(r288652)
+++ head/sys/dev/drm2/i915/intel_opregion.c	Sun Oct  4 07:45:36 2015	(r288653)
@@ -533,11 +533,9 @@ void intel_opregion_fini(struct drm_devi
 	opregion->vbt = NULL;
 }
 #else
-int
+void
 intel_opregion_init(struct drm_device *dev)
 {
-
-	return (0);
 }
 
 void



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