From owner-svn-src-head@freebsd.org Sun Oct 4 07:45:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E986A0E304; Sun, 4 Oct 2015 07:45:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6EDC19EF; Sun, 4 Oct 2015 07:45:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t947jdQJ082820; Sun, 4 Oct 2015 07:45:39 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t947jbp7082807; Sun, 4 Oct 2015 07:45:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510040745.t947jbp7082807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 4 Oct 2015 07:45:37 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Oct 2015 07:45:40 -0000 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: 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