Author: dumbbell
Date: Wed Jan 13 20:35:02 2016
New Revision: 293851
URL: https://svnweb.freebsd.org/changeset/base/293851

Log:
  drm: Revert the part of r288653 about M_WAITOK vs M_NOWAIT
  
  Using M_NOWAIT could lead to transient failures with ioctls.
  
  Suggested by: kib

Modified:
  head/sys/dev/drm2/drm_crtc.c
  head/sys/dev/drm2/drm_pci.c

Modified: head/sys/dev/drm2/drm_crtc.c
==============================================================================
--- head/sys/dev/drm2/drm_crtc.c        Wed Jan 13 20:16:53 2016        
(r293850)
+++ head/sys/dev/drm2/drm_crtc.c        Wed Jan 13 20:35:02 2016        
(r293851)
@@ -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_NOWAIT);
+           DRM_MEM_KMS, M_WAITOK);
        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_NOWAIT | M_ZERO);
+           DRM_MEM_KMS, M_WAITOK | 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_NOWAIT);
+                                       DRM_MEM_KMS, M_WAITOK);
                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_NOWAIT | M_ZERO);
+                   M_WAITOK | 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_NOWAIT | M_ZERO);
+           M_WAITOK | M_ZERO);
        if (!property)
                return NULL;
 
        if (num_values) {
                property->values = malloc(sizeof(uint64_t)*num_values, 
DRM_MEM_KMS,
-                   M_NOWAIT | M_ZERO);
+                   M_WAITOK | 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_NOWAIT | M_ZERO);
+           M_WAITOK | 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_NOWAIT | M_ZERO);
+           M_WAITOK | 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_NOWAIT | M_ZERO);
+           DRM_MEM_KMS, M_WAITOK | 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_NOWAIT | M_ZERO);
+               e = malloc(sizeof *e, DRM_MEM_KMS, M_WAITOK | M_ZERO);
                if (e == NULL) {
                        mtx_lock(&dev->event_lock);
                        file_priv->event_space += sizeof e->event;

Modified: head/sys/dev/drm2/drm_pci.c
==============================================================================
--- head/sys/dev/drm2/drm_pci.c Wed Jan 13 20:16:53 2016        (r293850)
+++ head/sys/dev/drm2/drm_pci.c Wed Jan 13 20:35:02 2016        (r293851)
@@ -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_NOWAIT);
+       master->unique = malloc(master->unique_size, DRM_MEM_DRIVER, M_WAITOK);
        if (!master->unique) {
                ret = -ENOMEM;
                goto err;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to