drm_crtc.c (786b99ed13223d8ac58a937dd348aead45eb8191) | drm_crtc.c (362063619cf67c2c2fc2eb90951b2623cbb69a7c) |
---|---|
1/* 2 * Copyright (c) 2006-2008 Intel Corporation 3 * Copyright (c) 2007 Dave Airlie <airlied@linux.ie> 4 * Copyright (c) 2008 Red Hat Inc. 5 * 6 * DRM core CRTC related functions 7 * 8 * Permission to use, copy, modify, distribute, and sell this software and its --- 54 unchanged lines hidden (view full) --- 63{ 64 struct drm_crtc *crtc; 65 66 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) 67 mutex_unlock(&crtc->mutex); 68 69 mutex_unlock(&dev->mode_config.mutex); 70} | 1/* 2 * Copyright (c) 2006-2008 Intel Corporation 3 * Copyright (c) 2007 Dave Airlie <airlied@linux.ie> 4 * Copyright (c) 2008 Red Hat Inc. 5 * 6 * DRM core CRTC related functions 7 * 8 * Permission to use, copy, modify, distribute, and sell this software and its --- 54 unchanged lines hidden (view full) --- 63{ 64 struct drm_crtc *crtc; 65 66 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) 67 mutex_unlock(&crtc->mutex); 68 69 mutex_unlock(&dev->mode_config.mutex); 70} |
71 |
|
71EXPORT_SYMBOL(drm_modeset_unlock_all); 72 73/* Avoid boilerplate. I'm tired of typing. */ 74#define DRM_ENUM_NAME_FN(fnname, list) \ 75 char *fnname(int val) \ 76 { \ 77 int i; \ 78 for (i = 0; i < ARRAY_SIZE(list); i++) { \ --- 346 unchanged lines hidden (view full) --- 425void drm_framebuffer_reference(struct drm_framebuffer *fb) 426{ 427 DRM_DEBUG("FB ID: %d\n", fb->base.id); 428 kref_get(&fb->refcount); 429} 430EXPORT_SYMBOL(drm_framebuffer_reference); 431 432/** | 72EXPORT_SYMBOL(drm_modeset_unlock_all); 73 74/* Avoid boilerplate. I'm tired of typing. */ 75#define DRM_ENUM_NAME_FN(fnname, list) \ 76 char *fnname(int val) \ 77 { \ 78 int i; \ 79 for (i = 0; i < ARRAY_SIZE(list); i++) { \ --- 346 unchanged lines hidden (view full) --- 426void drm_framebuffer_reference(struct drm_framebuffer *fb) 427{ 428 DRM_DEBUG("FB ID: %d\n", fb->base.id); 429 kref_get(&fb->refcount); 430} 431EXPORT_SYMBOL(drm_framebuffer_reference); 432 433/** |
434 * drm_framebuffer_unregister_private - unregister a private fb from the lookup idr 435 * @fb: fb to unregister 436 * 437 * Drivers need to call this when cleaning up driver-private framebuffers, e.g. 438 * those used for fbdev. Note that the caller must hold a reference of it's own, 439 * i.e. the object may not be destroyed through this call (since it'll lead to a 440 * locking inversion). 441 */ 442void drm_framebuffer_unregister_private(struct drm_framebuffer *fb) 443{ 444} 445EXPORT_SYMBOL(drm_framebuffer_unregister_private); 446 447/** |
|
433 * drm_framebuffer_cleanup - remove a framebuffer object 434 * @fb: framebuffer to remove 435 * | 448 * drm_framebuffer_cleanup - remove a framebuffer object 449 * @fb: framebuffer to remove 450 * |
436 * Scans all the CRTCs in @dev's mode_config. If they're using @fb, removes 437 * it, setting it to NULL. | 451 * Cleanup references to a user-created framebuffer. This function is intended 452 * to be used from the drivers ->destroy callback. 453 * 454 * Note that this function does not remove the fb from active usuage - if it is 455 * still used anywhere, hilarity can ensue since userspace could call getfb on 456 * the id and get back -EINVAL. Obviously no concern at driver unload time. 457 * 458 * Also, the framebuffer will not be removed from the lookup idr - for 459 * user-created framebuffers this will happen in in the rmfb ioctl. For 460 * driver-private objects (e.g. for fbdev) drivers need to explicitly call 461 * drm_framebuffer_unregister_private. |
438 */ 439void drm_framebuffer_cleanup(struct drm_framebuffer *fb) 440{ 441 struct drm_device *dev = fb->dev; 442 443 /* 444 * This could be moved to drm_framebuffer_remove(), but for 445 * debugging is nice to keep around the list of fb's that are --- 9 unchanged lines hidden (view full) --- 455} 456EXPORT_SYMBOL(drm_framebuffer_cleanup); 457 458/** 459 * drm_framebuffer_remove - remove and unreference a framebuffer object 460 * @fb: framebuffer to remove 461 * 462 * Scans all the CRTCs and planes in @dev's mode_config. If they're | 462 */ 463void drm_framebuffer_cleanup(struct drm_framebuffer *fb) 464{ 465 struct drm_device *dev = fb->dev; 466 467 /* 468 * This could be moved to drm_framebuffer_remove(), but for 469 * debugging is nice to keep around the list of fb's that are --- 9 unchanged lines hidden (view full) --- 479} 480EXPORT_SYMBOL(drm_framebuffer_cleanup); 481 482/** 483 * drm_framebuffer_remove - remove and unreference a framebuffer object 484 * @fb: framebuffer to remove 485 * 486 * Scans all the CRTCs and planes in @dev's mode_config. If they're |
463 * using @fb, removes it, setting it to NULL. | 487 * using @fb, removes it, setting it to NULL. Then drops the reference to the 488 * passed-in framebuffer. |
464 */ 465void drm_framebuffer_remove(struct drm_framebuffer *fb) 466{ 467 struct drm_device *dev = fb->dev; 468 struct drm_crtc *crtc; 469 struct drm_plane *plane; 470 struct drm_mode_set set; 471 int ret; --- 3482 unchanged lines hidden --- | 489 */ 490void drm_framebuffer_remove(struct drm_framebuffer *fb) 491{ 492 struct drm_device *dev = fb->dev; 493 struct drm_crtc *crtc; 494 struct drm_plane *plane; 495 struct drm_mode_set set; 496 int ret; --- 3482 unchanged lines hidden --- |