391,10 → 391,8 |
{ |
struct drm_device *dev = crtc->dev; |
|
if (crtc->gamma_store) { |
kfree(crtc->gamma_store); |
crtc->gamma_store = NULL; |
} |
|
drm_mode_object_put(dev, &crtc->base); |
list_del(&crtc->head); |
476,16 → 474,17 |
INIT_LIST_HEAD(&connector->probed_modes); |
INIT_LIST_HEAD(&connector->modes); |
connector->edid_blob_ptr = NULL; |
connector->status = connector_status_unknown; |
|
list_add_tail(&connector->head, &dev->mode_config.connector_list); |
dev->mode_config.num_connector++; |
|
if (connector_type != DRM_MODE_CONNECTOR_VIRTUAL) |
drm_connector_attach_property(connector, |
drm_object_attach_property(&connector->base, |
dev->mode_config.edid_property, |
0); |
|
drm_connector_attach_property(connector, |
drm_object_attach_property(&connector->base, |
dev->mode_config.dpms_property, 0); |
|
out: |
2199,6 → 2198,8 |
|
for (i = 0; i < num_planes; i++) { |
unsigned int width = r->width / (i != 0 ? hsub : 1); |
unsigned int height = r->height / (i != 0 ? vsub : 1); |
unsigned int cpp = drm_format_plane_cpp(r->pixel_format, i); |
|
if (!r->handles[i]) { |
DRM_DEBUG_KMS("no buffer object handle for plane %d\n", i); |
2205,7 → 2206,13 |
return -EINVAL; |
} |
|
if (r->pitches[i] < drm_format_plane_cpp(r->pixel_format, i) * width) { |
if ((uint64_t) width * cpp > UINT_MAX) |
return -ERANGE; |
|
if ((uint64_t) height * r->pitches[i] + r->offsets[i] > UINT_MAX) |
return -ERANGE; |
|
if (r->pitches[i] < width * cpp) { |
DRM_DEBUG_KMS("bad pitch %u for plane %d\n", r->pitches[i], i); |
return -EINVAL; |
} |
2242,6 → 2249,11 |
if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
return -EINVAL; |
|
if (r->flags & ~DRM_MODE_FB_INTERLACED) { |
DRM_DEBUG_KMS("bad framebuffer flags 0x%08x\n", r->flags); |
return -EINVAL; |
} |
|
if ((config->min_width > r->width) || (r->width > config->max_width)) { |
DRM_DEBUG_KMS("bad framebuffer width %d, should be >= %d && <= %d\n", |
r->width, config->min_width, config->max_width); |
2839,27 → 2851,6 |
} |
EXPORT_SYMBOL(drm_property_destroy); |
|
void drm_connector_attach_property(struct drm_connector *connector, |
struct drm_property *property, uint64_t init_val) |
{ |
drm_object_attach_property(&connector->base, property, init_val); |
} |
EXPORT_SYMBOL(drm_connector_attach_property); |
|
int drm_connector_property_set_value(struct drm_connector *connector, |
struct drm_property *property, uint64_t value) |
{ |
return drm_object_property_set_value(&connector->base, property, value); |
} |
EXPORT_SYMBOL(drm_connector_property_set_value); |
|
int drm_connector_property_get_value(struct drm_connector *connector, |
struct drm_property *property, uint64_t *val) |
{ |
return drm_object_property_get_value(&connector->base, property, val); |
} |
EXPORT_SYMBOL(drm_connector_property_get_value); |
|
void drm_object_attach_property(struct drm_mode_object *obj, |
struct drm_property *property, |
uint64_t init_val) |
3100,7 → 3091,7 |
/* Delete edid, when there is none. */ |
if (!edid) { |
connector->edid_blob_ptr = NULL; |
ret = drm_connector_property_set_value(connector, dev->mode_config.edid_property, 0); |
ret = drm_object_property_set_value(&connector->base, dev->mode_config.edid_property, 0); |
return ret; |
} |
|
3107,8 → 3098,10 |
size = EDID_LENGTH * (1 + edid->extensions); |
connector->edid_blob_ptr = drm_property_create_blob(connector->dev, |
size, edid); |
if (!connector->edid_blob_ptr) |
return -EINVAL; |
|
ret = drm_connector_property_set_value(connector, |
ret = drm_object_property_set_value(&connector->base, |
dev->mode_config.edid_property, |
connector->edid_blob_ptr->base.id); |
|
3135,7 → 3128,7 |
|
/* store the property value if successful */ |
if (!ret) |
drm_connector_property_set_value(connector, property, value); |
drm_object_property_set_value(&connector->base, property, value); |
return ret; |
} |
|
3453,10 → 3446,13 |
if (encoder->funcs->reset) |
encoder->funcs->reset(encoder); |
|
list_for_each_entry(connector, &dev->mode_config.connector_list, head) |
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
connector->status = connector_status_unknown; |
|
if (connector->funcs->reset) |
connector->funcs->reset(connector); |
} |
} |
EXPORT_SYMBOL(drm_mode_config_reset); |
/* |
* Just need to support RGB formats here for compat with code that doesn't |