Rev 6937 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6937 | Rev 7144 | ||
---|---|---|---|
Line 428... | Line 428... | ||
428 | 428 | ||
429 | /* dev->mode_config.fb_lock must be held! */ |
429 | /* dev->mode_config.fb_lock must be held! */ |
430 | static void __drm_framebuffer_unregister(struct drm_device *dev, |
430 | static void __drm_framebuffer_unregister(struct drm_device *dev, |
431 | struct drm_framebuffer *fb) |
431 | struct drm_framebuffer *fb) |
432 | { |
- | |
433 | mutex_lock(&dev->mode_config.idr_mutex); |
432 | { |
434 | idr_remove(&dev->mode_config.crtc_idr, fb->base.id); |
- | |
Line 435... | Line 433... | ||
435 | mutex_unlock(&dev->mode_config.idr_mutex); |
433 | drm_mode_object_put(dev, &fb->base); |
436 | 434 | ||
Line 437... | Line 435... | ||
437 | fb->base.id = 0; |
435 | fb->base.id = 0; |
Line 1148... | Line 1146... | ||
1148 | return ret; |
1146 | return ret; |
1149 | } |
1147 | } |
1150 | EXPORT_SYMBOL(drm_encoder_init); |
1148 | EXPORT_SYMBOL(drm_encoder_init); |
Line 1151... | Line 1149... | ||
1151 | 1149 | ||
- | 1150 | /** |
|
- | 1151 | * drm_encoder_index - find the index of a registered encoder |
|
- | 1152 | * @encoder: encoder to find index for |
|
- | 1153 | * |
|
- | 1154 | * Given a registered encoder, return the index of that encoder within a DRM |
|
- | 1155 | * device's list of encoders. |
|
- | 1156 | */ |
|
- | 1157 | unsigned int drm_encoder_index(struct drm_encoder *encoder) |
|
- | 1158 | { |
|
- | 1159 | unsigned int index = 0; |
|
- | 1160 | struct drm_encoder *tmp; |
|
- | 1161 | ||
- | 1162 | drm_for_each_encoder(tmp, encoder->dev) { |
|
- | 1163 | if (tmp == encoder) |
|
- | 1164 | return index; |
|
- | 1165 | ||
- | 1166 | index++; |
|
- | 1167 | } |
|
- | 1168 | ||
- | 1169 | BUG(); |
|
- | 1170 | } |
|
- | 1171 | EXPORT_SYMBOL(drm_encoder_index); |
|
- | 1172 | ||
1152 | /** |
1173 | /** |
1153 | * drm_encoder_cleanup - cleans up an initialised encoder |
1174 | * drm_encoder_cleanup - cleans up an initialised encoder |
1154 | * @encoder: encoder to cleanup |
1175 | * @encoder: encoder to cleanup |
1155 | * |
1176 | * |
1156 | * Cleans up the encoder but doesn't free the object. |
1177 | * Cleans up the encoder but doesn't free the object. |
Line 1529... | Line 1550... | ||
1529 | "MODE_ID", 0); |
1550 | "MODE_ID", 0); |
1530 | if (!prop) |
1551 | if (!prop) |
1531 | return -ENOMEM; |
1552 | return -ENOMEM; |
1532 | dev->mode_config.prop_mode_id = prop; |
1553 | dev->mode_config.prop_mode_id = prop; |
Line -... | Line 1554... | ||
- | 1554 | ||
- | 1555 | prop = drm_property_create(dev, |
|
- | 1556 | DRM_MODE_PROP_BLOB, |
|
- | 1557 | "DEGAMMA_LUT", 0); |
|
- | 1558 | if (!prop) |
|
- | 1559 | return -ENOMEM; |
|
- | 1560 | dev->mode_config.degamma_lut_property = prop; |
|
- | 1561 | ||
- | 1562 | prop = drm_property_create_range(dev, |
|
- | 1563 | DRM_MODE_PROP_IMMUTABLE, |
|
- | 1564 | "DEGAMMA_LUT_SIZE", 0, UINT_MAX); |
|
- | 1565 | if (!prop) |
|
- | 1566 | return -ENOMEM; |
|
- | 1567 | dev->mode_config.degamma_lut_size_property = prop; |
|
- | 1568 | ||
- | 1569 | prop = drm_property_create(dev, |
|
- | 1570 | DRM_MODE_PROP_BLOB, |
|
- | 1571 | "CTM", 0); |
|
- | 1572 | if (!prop) |
|
- | 1573 | return -ENOMEM; |
|
- | 1574 | dev->mode_config.ctm_property = prop; |
|
- | 1575 | ||
- | 1576 | prop = drm_property_create(dev, |
|
- | 1577 | DRM_MODE_PROP_BLOB, |
|
- | 1578 | "GAMMA_LUT", 0); |
|
- | 1579 | if (!prop) |
|
- | 1580 | return -ENOMEM; |
|
- | 1581 | dev->mode_config.gamma_lut_property = prop; |
|
- | 1582 | ||
- | 1583 | prop = drm_property_create_range(dev, |
|
- | 1584 | DRM_MODE_PROP_IMMUTABLE, |
|
- | 1585 | "GAMMA_LUT_SIZE", 0, UINT_MAX); |
|
- | 1586 | if (!prop) |
|
- | 1587 | return -ENOMEM; |
|
- | 1588 | dev->mode_config.gamma_lut_size_property = prop; |
|
1533 | 1589 | ||
1534 | return 0; |
1590 | return 0; |
Line 1535... | Line 1591... | ||
1535 | } |
1591 | } |
1536 | 1592 | ||
Line 2745... | Line 2801... | ||
2745 | if (ret) { |
2801 | if (ret) { |
2746 | DRM_DEBUG_KMS("Invalid mode\n"); |
2802 | DRM_DEBUG_KMS("Invalid mode\n"); |
2747 | goto out; |
2803 | goto out; |
2748 | } |
2804 | } |
Line 2749... | Line -... | ||
2749 | - | ||
2750 | drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); |
- | |
2751 | 2805 | ||
2752 | /* |
2806 | /* |
2753 | * Check whether the primary plane supports the fb pixel format. |
2807 | * Check whether the primary plane supports the fb pixel format. |
2754 | * Drivers not implementing the universal planes API use a |
2808 | * Drivers not implementing the universal planes API use a |
2755 | * default formats list provided by the DRM core which doesn't |
2809 | * default formats list provided by the DRM core which doesn't |
Line 3287... | Line 3341... | ||
3287 | mutex_unlock(&file_priv->fbs_lock); |
3341 | mutex_unlock(&file_priv->fbs_lock); |
Line 3288... | Line 3342... | ||
3288 | 3342 | ||
3289 | return 0; |
3343 | return 0; |
Line -... | Line 3344... | ||
- | 3344 | } |
|
- | 3345 | ||
- | 3346 | struct drm_mode_rmfb_work { |
|
- | 3347 | struct work_struct work; |
|
- | 3348 | struct list_head fbs; |
|
- | 3349 | }; |
|
- | 3350 | ||
- | 3351 | static void drm_mode_rmfb_work_fn(struct work_struct *w) |
|
- | 3352 | { |
|
- | 3353 | struct drm_mode_rmfb_work *arg = container_of(w, typeof(*arg), work); |
|
- | 3354 | ||
- | 3355 | while (!list_empty(&arg->fbs)) { |
|
- | 3356 | struct drm_framebuffer *fb = |
|
- | 3357 | list_first_entry(&arg->fbs, typeof(*fb), filp_head); |
|
- | 3358 | ||
- | 3359 | list_del_init(&fb->filp_head); |
|
- | 3360 | drm_framebuffer_remove(fb); |
|
- | 3361 | } |
|
3290 | } |
3362 | } |
3291 | 3363 | ||
3292 | /** |
3364 | /** |
3293 | * drm_mode_rmfb - remove an FB from the configuration |
3365 | * drm_mode_rmfb - remove an FB from the configuration |
3294 | * @dev: drm device for the ioctl |
3366 | * @dev: drm device for the ioctl |
Line 3480... | Line 3552... | ||
3480 | drm_framebuffer_unreference(fb); |
3552 | drm_framebuffer_unreference(fb); |
Line 3481... | Line 3553... | ||
3481 | 3553 | ||
3482 | return ret; |
3554 | return ret; |
Line 3483... | Line -... | ||
3483 | } |
- | |
3484 | 3555 | } |
|
3485 | 3556 | ||
3486 | /** |
3557 | /** |
3487 | * drm_fb_release - remove and free the FBs on this file |
3558 | * drm_fb_release - remove and free the FBs on this file |
3488 | * @priv: drm file for the ioctl |
3559 | * @priv: drm file for the ioctl |