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
This commit is contained in:
parent
bd2ebb612d
commit
fe8e65ae3d
@ -663,7 +663,7 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane,
|
|||||||
plane->dev = dev;
|
plane->dev = dev;
|
||||||
plane->funcs = funcs;
|
plane->funcs = funcs;
|
||||||
plane->format_types = malloc(sizeof(uint32_t) * format_count,
|
plane->format_types = malloc(sizeof(uint32_t) * format_count,
|
||||||
DRM_MEM_KMS, M_NOWAIT);
|
DRM_MEM_KMS, M_WAITOK);
|
||||||
if (!plane->format_types) {
|
if (!plane->format_types) {
|
||||||
DRM_DEBUG_KMS("out of memory when allocating plane\n");
|
DRM_DEBUG_KMS("out of memory when allocating plane\n");
|
||||||
drm_mode_object_put(dev, &plane->base);
|
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;
|
total_objects += dev->mode_config.num_encoder;
|
||||||
|
|
||||||
group->id_list = malloc(total_objects * sizeof(uint32_t),
|
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)
|
if (!group->id_list)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@ -1998,7 +1998,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
|
|||||||
|
|
||||||
connector_set = malloc(crtc_req->count_connectors *
|
connector_set = malloc(crtc_req->count_connectors *
|
||||||
sizeof(struct drm_connector *),
|
sizeof(struct drm_connector *),
|
||||||
DRM_MEM_KMS, M_NOWAIT);
|
DRM_MEM_KMS, M_WAITOK);
|
||||||
if (!connector_set) {
|
if (!connector_set) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto out;
|
goto out;
|
||||||
@ -2523,7 +2523,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
|
|||||||
goto out_err1;
|
goto out_err1;
|
||||||
}
|
}
|
||||||
clips = malloc(num_clips * sizeof(*clips), DRM_MEM_KMS,
|
clips = malloc(num_clips * sizeof(*clips), DRM_MEM_KMS,
|
||||||
M_NOWAIT | M_ZERO);
|
M_WAITOK | M_ZERO);
|
||||||
if (!clips) {
|
if (!clips) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto out_err1;
|
goto out_err1;
|
||||||
@ -2774,13 +2774,13 @@ struct drm_property *drm_property_create(struct drm_device *dev, int flags,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
property = malloc(sizeof(struct drm_property), DRM_MEM_KMS,
|
property = malloc(sizeof(struct drm_property), DRM_MEM_KMS,
|
||||||
M_NOWAIT | M_ZERO);
|
M_WAITOK | M_ZERO);
|
||||||
if (!property)
|
if (!property)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (num_values) {
|
if (num_values) {
|
||||||
property->values = malloc(sizeof(uint64_t)*num_values, DRM_MEM_KMS,
|
property->values = malloc(sizeof(uint64_t)*num_values, DRM_MEM_KMS,
|
||||||
M_NOWAIT | M_ZERO);
|
M_WAITOK | M_ZERO);
|
||||||
if (!property->values)
|
if (!property->values)
|
||||||
goto fail;
|
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,
|
prop_enum = malloc(sizeof(struct drm_property_enum), DRM_MEM_KMS,
|
||||||
M_NOWAIT | M_ZERO);
|
M_WAITOK | M_ZERO);
|
||||||
if (!prop_enum)
|
if (!prop_enum)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@ -3104,7 +3104,7 @@ static struct drm_property_blob *drm_property_create_blob(struct drm_device *dev
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
blob = malloc(sizeof(struct drm_property_blob)+length, DRM_MEM_KMS,
|
blob = malloc(sizeof(struct drm_property_blob)+length, DRM_MEM_KMS,
|
||||||
M_NOWAIT | M_ZERO);
|
M_WAITOK | M_ZERO);
|
||||||
if (!blob)
|
if (!blob)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -3434,7 +3434,7 @@ int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
|
|||||||
crtc->gamma_size = gamma_size;
|
crtc->gamma_size = gamma_size;
|
||||||
|
|
||||||
crtc->gamma_store = malloc(gamma_size * sizeof(uint16_t) * 3,
|
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) {
|
if (!crtc->gamma_store) {
|
||||||
crtc->gamma_size = 0;
|
crtc->gamma_size = 0;
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -3632,7 +3632,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
|
|||||||
file_priv->event_space -= sizeof e->event;
|
file_priv->event_space -= sizeof e->event;
|
||||||
mtx_unlock(&dev->event_lock);
|
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) {
|
if (e == NULL) {
|
||||||
mtx_lock(&dev->event_lock);
|
mtx_lock(&dev->event_lock);
|
||||||
file_priv->event_space += sizeof e->event;
|
file_priv->event_space += sizeof e->event;
|
||||||
|
@ -225,7 +225,7 @@ int drm_pci_set_unique(struct drm_device *dev,
|
|||||||
|
|
||||||
master->unique_len = u->unique_len;
|
master->unique_len = u->unique_len;
|
||||||
master->unique_size = u->unique_len + 1;
|
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) {
|
if (!master->unique) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user