diff options
author | adrian <adrian@FreeBSD.org> | 2015-10-04 07:45:36 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2015-10-04 07:45:36 +0000 |
commit | 63f765030dc055a1eef961f7f5741217efb534a9 (patch) | |
tree | 87c1942bf24a957c46e7c666f3ec5b23bca341f5 | |
parent | 15bc65f144a8e7501d5b41594aa7436b28858d6f (diff) | |
download | FreeBSD-src-63f765030dc055a1eef961f7f5741217efb534a9.zip FreeBSD-src-63f765030dc055a1eef961f7f5741217efb534a9.tar.gz |
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
-rw-r--r-- | sys/dev/drm2/drmP.h | 6 | ||||
-rw-r--r-- | sys/dev/drm2/drm_crtc.c | 20 | ||||
-rw-r--r-- | sys/dev/drm2/drm_fops.c | 2 | ||||
-rw-r--r-- | sys/dev/drm2/drm_pci.c | 2 | ||||
-rw-r--r-- | sys/dev/drm2/drm_stub.c | 6 | ||||
-rw-r--r-- | sys/dev/drm2/i915/i915_dma.c | 2 | ||||
-rw-r--r-- | sys/dev/drm2/i915/i915_drv.c | 1 | ||||
-rw-r--r-- | sys/dev/drm2/i915/intel_opregion.c | 4 |
8 files changed, 19 insertions, 24 deletions
diff --git a/sys/dev/drm2/drmP.h b/sys/dev/drm2/drmP.h index 32c3fcd..b3633c3 100644 --- a/sys/dev/drm2/drmP.h +++ b/sys/dev/drm2/drmP.h @@ -1782,12 +1782,6 @@ void drm_driver_irq_preinstall(struct drm_device *dev); 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); diff --git a/sys/dev/drm2/drm_crtc.c b/sys/dev/drm2/drm_crtc.c index 318a764..79f66aa 100644 --- a/sys/dev/drm2/drm_crtc.c +++ b/sys/dev/drm2/drm_crtc.c @@ -663,7 +663,7 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane, 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_device *dev, struct drm_mode_group *group) 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 *dev, void *data, 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_device *dev, 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(struct drm_device *dev, int flags, 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_property *property, int index, } 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_property_create_blob(struct drm_device *dev 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 drm_crtc *crtc, 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_device *dev, 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; diff --git a/sys/dev/drm2/drm_fops.c b/sys/dev/drm2/drm_fops.c index b73cec6..3b3be06 100644 --- a/sys/dev/drm2/drm_fops.c +++ b/sys/dev/drm2/drm_fops.c @@ -136,7 +136,7 @@ int drm_open(struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p) 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++) diff --git a/sys/dev/drm2/drm_pci.c b/sys/dev/drm2/drm_pci.c index f2c5bbd..ecbfcb7 100644 --- a/sys/dev/drm2/drm_pci.c +++ b/sys/dev/drm2/drm_pci.c @@ -225,7 +225,7 @@ int drm_pci_set_unique(struct drm_device *dev, 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; diff --git a/sys/dev/drm2/drm_stub.c b/sys/dev/drm2/drm_stub.c index d7ec6cb..06663ac 100644 --- a/sys/dev/drm2/drm_stub.c +++ b/sys/dev/drm2/drm_stub.c @@ -94,9 +94,9 @@ static int drm_minor_get_id(struct drm_device *dev, int type) 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; } diff --git a/sys/dev/drm2/i915/i915_dma.c b/sys/dev/drm2/i915/i915_dma.c index 2265ac0..dddc03e 100644 --- a/sys/dev/drm2/i915/i915_dma.c +++ b/sys/dev/drm2/i915/i915_dma.c @@ -1452,6 +1452,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) } } + pci_enable_busmaster(dev->dev); + intel_opregion_init(dev); callout_init(&dev_priv->hangcheck_timer, 1); diff --git a/sys/dev/drm2/i915/i915_drv.c b/sys/dev/drm2/i915/i915_drv.c index 3109827..e9cf3a4 100644 --- a/sys/dev/drm2/i915/i915_drv.c +++ b/sys/dev/drm2/i915/i915_drv.c @@ -894,6 +894,7 @@ int intel_gpu_reset(struct drm_device *dev) case 4: ret = i965_do_reset(dev); break; + case 3: case 2: ret = i8xx_do_reset(dev); break; diff --git a/sys/dev/drm2/i915/intel_opregion.c b/sys/dev/drm2/i915/intel_opregion.c index 411e530..397c559 100644 --- a/sys/dev/drm2/i915/intel_opregion.c +++ b/sys/dev/drm2/i915/intel_opregion.c @@ -533,11 +533,9 @@ void intel_opregion_fini(struct drm_device *dev) opregion->vbt = NULL; } #else -int +void intel_opregion_init(struct drm_device *dev) { - - return (0); } void |