Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
vgaarb: trivial fix
drm: radeon cleanup fixes...
drm: fix trivial coding errors
drm: ttm sparse fixes.
drm/nouveau: fix panels using straps-based mode detection
drm/ttm: Clear the ghost cpu_writers flag on ttm_buffer_object_transfer.
drm/radeon: don't allow device to be opened if powered down

+19 -12
+3 -3
drivers/gpu/drm/drm_buffer.c
··· 98 * user_data: A pointer the data that is copied to the buffer. 99 * size: The Number of bytes to copy. 100 */ 101 - extern int drm_buffer_copy_from_user(struct drm_buffer *buf, 102 - void __user *user_data, int size) 103 { 104 int nr_pages = size / PAGE_SIZE + 1; 105 int idx; ··· 163 { 164 int idx = drm_buffer_index(buf); 165 int page = drm_buffer_page(buf); 166 - void *obj = 0; 167 168 if (idx + objsize <= PAGE_SIZE) { 169 obj = &buf->data[page][idx];
··· 98 * user_data: A pointer the data that is copied to the buffer. 99 * size: The Number of bytes to copy. 100 */ 101 + int drm_buffer_copy_from_user(struct drm_buffer *buf, 102 + void __user *user_data, int size) 103 { 104 int nr_pages = size / PAGE_SIZE + 1; 105 int idx; ··· 163 { 164 int idx = drm_buffer_index(buf); 165 int page = drm_buffer_page(buf); 166 + void *obj = NULL; 167 168 if (idx + objsize <= PAGE_SIZE) { 169 obj = &buf->data[page][idx];
+4 -2
drivers/gpu/drm/nouveau/nouveau_connector.c
··· 558 if (nv_encoder->dcb->type == OUTPUT_LVDS && 559 (nv_encoder->dcb->lvdsconf.use_straps_for_mode || 560 dev_priv->vbios.fp_no_ddc) && nouveau_bios_fp_mode(dev, NULL)) { 561 - nv_connector->native_mode = drm_mode_create(dev); 562 - nouveau_bios_fp_mode(dev, nv_connector->native_mode); 563 } 564 565 /* Find the native mode if this is a digital panel, if we didn't
··· 558 if (nv_encoder->dcb->type == OUTPUT_LVDS && 559 (nv_encoder->dcb->lvdsconf.use_straps_for_mode || 560 dev_priv->vbios.fp_no_ddc) && nouveau_bios_fp_mode(dev, NULL)) { 561 + struct drm_display_mode mode; 562 + 563 + nouveau_bios_fp_mode(dev, &mode); 564 + nv_connector->native_mode = drm_mode_duplicate(dev, &mode); 565 } 566 567 /* Find the native mode if this is a digital panel, if we didn't
+1 -1
drivers/gpu/drm/radeon/atombios.h
··· 4999 #define SW_I2C_CNTL_WRITE1BIT 6 5000 5001 //==============================VESA definition Portion=============================== 5002 - #define VESA_OEM_PRODUCT_REV '01.00' 5003 #define VESA_MODE_ATTRIBUTE_MODE_SUPPORT 0xBB //refer to VBE spec p.32, no TTY support 5004 #define VESA_MODE_WIN_ATTRIBUTE 7 5005 #define VESA_WIN_SIZE 64
··· 4999 #define SW_I2C_CNTL_WRITE1BIT 6 5000 5001 //==============================VESA definition Portion=============================== 5002 + #define VESA_OEM_PRODUCT_REV "01.00" 5003 #define VESA_MODE_ATTRIBUTE_MODE_SUPPORT 0xBB //refer to VBE spec p.32, no TTY support 5004 #define VESA_MODE_WIN_ATTRIBUTE 7 5005 #define VESA_WIN_SIZE 64
+1 -1
drivers/gpu/drm/radeon/r600.c
··· 2729 if (i < rdev->usec_timeout) { 2730 DRM_INFO("ib test succeeded in %u usecs\n", i); 2731 } else { 2732 - DRM_ERROR("radeon: ib test failed (sracth(0x%04X)=0x%08X)\n", 2733 scratch, tmp); 2734 r = -EINVAL; 2735 }
··· 2729 if (i < rdev->usec_timeout) { 2730 DRM_INFO("ib test succeeded in %u usecs\n", i); 2731 } else { 2732 + DRM_ERROR("radeon: ib test failed (scratch(0x%04X)=0x%08X)\n", 2733 scratch, tmp); 2734 r = -EINVAL; 2735 }
+4
drivers/gpu/drm/radeon/radeon_kms.c
··· 203 */ 204 int radeon_driver_firstopen_kms(struct drm_device *dev) 205 { 206 return 0; 207 } 208
··· 203 */ 204 int radeon_driver_firstopen_kms(struct drm_device *dev) 205 { 206 + struct radeon_device *rdev = dev->dev_private; 207 + 208 + if (rdev->powered_down) 209 + return -EINVAL; 210 return 0; 211 } 212
+1
drivers/gpu/drm/ttm/ttm_bo_util.c
··· 351 INIT_LIST_HEAD(&fbo->lru); 352 INIT_LIST_HEAD(&fbo->swap); 353 fbo->vm_node = NULL; 354 355 fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj); 356 kref_init(&fbo->list_kref);
··· 351 INIT_LIST_HEAD(&fbo->lru); 352 INIT_LIST_HEAD(&fbo->swap); 353 fbo->vm_node = NULL; 354 + atomic_set(&fbo->cpu_writers, 0); 355 356 fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj); 357 kref_init(&fbo->list_kref);
+4 -4
drivers/gpu/drm/ttm/ttm_page_alloc.c
··· 69 spinlock_t lock; 70 bool fill_lock; 71 struct list_head list; 72 - int gfp_flags; 73 unsigned npages; 74 char *name; 75 unsigned long nfrees; ··· 475 * This function is reentrant if caller updates count depending on number of 476 * pages returned in pages array. 477 */ 478 - static int ttm_alloc_new_pages(struct list_head *pages, int gfp_flags, 479 int ttm_flags, enum ttm_caching_state cstate, unsigned count) 480 { 481 struct page **caching_array; ··· 666 { 667 struct ttm_page_pool *pool = ttm_get_pool(flags, cstate); 668 struct page *p = NULL; 669 - int gfp_flags = GFP_USER; 670 int r; 671 672 /* set zero flag for page allocation if required */ ··· 818 return 0; 819 } 820 821 - void ttm_page_alloc_fini() 822 { 823 int i; 824
··· 69 spinlock_t lock; 70 bool fill_lock; 71 struct list_head list; 72 + gfp_t gfp_flags; 73 unsigned npages; 74 char *name; 75 unsigned long nfrees; ··· 475 * This function is reentrant if caller updates count depending on number of 476 * pages returned in pages array. 477 */ 478 + static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags, 479 int ttm_flags, enum ttm_caching_state cstate, unsigned count) 480 { 481 struct page **caching_array; ··· 666 { 667 struct ttm_page_pool *pool = ttm_get_pool(flags, cstate); 668 struct page *p = NULL; 669 + gfp_t gfp_flags = GFP_USER; 670 int r; 671 672 /* set zero flag for page allocation if required */ ··· 818 return 0; 819 } 820 821 + void ttm_page_alloc_fini(void) 822 { 823 int i; 824
+1 -1
drivers/gpu/vga/vgaarb.c
··· 598 pr_debug("vgaarb: decoding count now is: %d\n", vga_decode_count); 599 } 600 601 - void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace) 602 { 603 struct vga_device *vgadev; 604 unsigned long flags;
··· 598 pr_debug("vgaarb: decoding count now is: %d\n", vga_decode_count); 599 } 600 601 + static void __vga_set_legacy_decoding(struct pci_dev *pdev, unsigned int decodes, bool userspace) 602 { 603 struct vga_device *vgadev; 604 unsigned long flags;