Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 1 Feb 2010 18:46:49 +0000 (10:46 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 1 Feb 2010 18:46:49 +0000 (10:46 -0800)
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm/radeon/kms: Fix oops after radeon_cs_parser_init() failure.
  drm/radeon/kms: move radeon KMS on/off switch out of staging.
  drm/radeon/kms: Bailout of blit if error happen & protect with mutex V3
  drm/vmwgfx: Don't send bad flags to the host
  drm/vmwgfx: Request SVGA version 2 and bail if not found
  drm/vmwgfx: Correctly detect 3D
  drm/ttm: remove unnecessary save_flags and ttm_flag_masked in ttm_bo_util.c
  drm/kms: Remove incorrect comment in struct drm_mode_modeinfo
  drm/ttm: remove padding from ttm_ref_object on 64bit builds
  drm/radeon/kms: release agp on error.
  drm/kms/radeon/agp: Move the check of the aper_size after drm_acp_acquire and drm_agp_info
  drm/kms/radeon/agp: Fix warning, format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
  drm/ttm: Avoid conflicting reserve_memtype during ttm_tt_set_page_caching.
  drm/kms/radeon: pick digitial encoders smarter. (v3)
  drm/radeon/kms: use active device to pick connector for encoder
  drm/radeon/kms: fix incorrect logic in DP vs eDP connector checking.

1  2 
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/rv770.c
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/staging/Kconfig

index da9aa3c31bcf03833b4bdc23093e09c44f52b00f,b833b4b9716242c859385027567f77d44886b584..1b6d0001b20e86fad42fa10bd2b6483200088397
@@@ -674,11 -674,11 +674,11 @@@ int r600_mc_init(struct radeon_device *
                 * AGP so that GPU can catch out of VRAM/AGP access
                 */
                if (rdev->mc.gtt_location > rdev->mc.mc_vram_size) {
 -                      /* Enought place before */
 +                      /* Enough place before */
                        rdev->mc.vram_location = rdev->mc.gtt_location -
                                                        rdev->mc.mc_vram_size;
                } else if (tmp > rdev->mc.mc_vram_size) {
 -                      /* Enought place after */
 +                      /* Enough place after */
                        rdev->mc.vram_location = rdev->mc.gtt_location +
                                                        rdev->mc.gtt_size;
                } else {
@@@ -1788,23 -1788,24 +1788,24 @@@ void r600_fence_ring_emit(struct radeon
        radeon_ring_write(rdev, RB_INT_STAT);
  }
  
- int r600_copy_dma(struct radeon_device *rdev,
-                 uint64_t src_offset,
-                 uint64_t dst_offset,
-                 unsigned num_pages,
-                 struct radeon_fence *fence)
- {
-       /* FIXME: implement */
-       return 0;
- }
  int r600_copy_blit(struct radeon_device *rdev,
                   uint64_t src_offset, uint64_t dst_offset,
                   unsigned num_pages, struct radeon_fence *fence)
  {
-       r600_blit_prepare_copy(rdev, num_pages * RADEON_GPU_PAGE_SIZE);
+       int r;
+       mutex_lock(&rdev->r600_blit.mutex);
+       rdev->r600_blit.vb_ib = NULL;
+       r = r600_blit_prepare_copy(rdev, num_pages * RADEON_GPU_PAGE_SIZE);
+       if (r) {
+               if (rdev->r600_blit.vb_ib)
+                       radeon_ib_free(rdev, &rdev->r600_blit.vb_ib);
+               mutex_unlock(&rdev->r600_blit.mutex);
+               return r;
+       }
        r600_kms_blit_copy(rdev, src_offset, dst_offset, num_pages * RADEON_GPU_PAGE_SIZE);
        r600_blit_done_copy(rdev, fence);
+       mutex_unlock(&rdev->r600_blit.mutex);
        return 0;
  }
  
@@@ -1860,26 -1861,19 +1861,19 @@@ int r600_startup(struct radeon_device *
                        return r;
        }
        r600_gpu_init(rdev);
-       if (!rdev->r600_blit.shader_obj) {
-               r = r600_blit_init(rdev);
+       /* pin copy shader into vram */
+       if (rdev->r600_blit.shader_obj) {
+               r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
+               if (unlikely(r != 0))
+                       return r;
+               r = radeon_bo_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM,
+                               &rdev->r600_blit.shader_gpu_addr);
+               radeon_bo_unreserve(rdev->r600_blit.shader_obj);
                if (r) {
-                       DRM_ERROR("radeon: failed blitter (%d).\n", r);
+                       dev_err(rdev->dev, "(%d) pin blit object failed\n", r);
                        return r;
                }
        }
-       r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
-       if (unlikely(r != 0))
-               return r;
-       r = radeon_bo_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM,
-                       &rdev->r600_blit.shader_gpu_addr);
-       radeon_bo_unreserve(rdev->r600_blit.shader_obj);
-       if (r) {
-               dev_err(rdev->dev, "(%d) pin blit object failed\n", r);
-               return r;
-       }
        /* Enable IRQ */
        r = r600_irq_init(rdev);
        if (r) {
@@@ -2051,6 -2045,12 +2045,12 @@@ int r600_init(struct radeon_device *rde
        r = r600_pcie_gart_init(rdev);
        if (r)
                return r;
+       r = r600_blit_init(rdev);
+       if (r) {
+               r600_blit_fini(rdev);
+               rdev->asic->copy = NULL;
+               dev_warn(rdev->dev, "failed blitter (%d) falling back to memcpy\n", r);
+       }
  
        rdev->accel_working = true;
        r = r600_startup(rdev);
index 55f6ffc4e58b24fc4f1a37eb012de1864b00656c,2d465768ac719ea24ab4371fbc1f4d7acdd2f885..afd9e8213c297adbe1ba5467bbf3b1e58b794708
@@@ -829,11 -829,11 +829,11 @@@ int rv770_mc_init(struct radeon_device 
                 * AGP so that GPU can catch out of VRAM/AGP access
                 */
                if (rdev->mc.gtt_location > rdev->mc.mc_vram_size) {
 -                      /* Enought place before */
 +                      /* Enough place before */
                        rdev->mc.vram_location = rdev->mc.gtt_location -
                                                        rdev->mc.mc_vram_size;
                } else if (tmp > rdev->mc.mc_vram_size) {
 -                      /* Enought place after */
 +                      /* Enough place after */
                        rdev->mc.vram_location = rdev->mc.gtt_location +
                                                        rdev->mc.gtt_size;
                } else {
@@@ -887,26 -887,19 +887,19 @@@ static int rv770_startup(struct radeon_
                        return r;
        }
        rv770_gpu_init(rdev);
-       if (!rdev->r600_blit.shader_obj) {
-               r = r600_blit_init(rdev);
+       /* pin copy shader into vram */
+       if (rdev->r600_blit.shader_obj) {
+               r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
+               if (unlikely(r != 0))
+                       return r;
+               r = radeon_bo_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM,
+                               &rdev->r600_blit.shader_gpu_addr);
+               radeon_bo_unreserve(rdev->r600_blit.shader_obj);
                if (r) {
-                       DRM_ERROR("radeon: failed blitter (%d).\n", r);
+                       DRM_ERROR("failed to pin blit object %d\n", r);
                        return r;
                }
        }
-       r = radeon_bo_reserve(rdev->r600_blit.shader_obj, false);
-       if (unlikely(r != 0))
-               return r;
-       r = radeon_bo_pin(rdev->r600_blit.shader_obj, RADEON_GEM_DOMAIN_VRAM,
-                       &rdev->r600_blit.shader_gpu_addr);
-       radeon_bo_unreserve(rdev->r600_blit.shader_obj);
-       if (r) {
-               DRM_ERROR("failed to pin blit object %d\n", r);
-               return r;
-       }
        /* Enable IRQ */
        r = r600_irq_init(rdev);
        if (r) {
@@@ -1062,6 -1055,12 +1055,12 @@@ int rv770_init(struct radeon_device *rd
        r = r600_pcie_gart_init(rdev);
        if (r)
                return r;
+       r = r600_blit_init(rdev);
+       if (r) {
+               r600_blit_fini(rdev);
+               rdev->asic->copy = NULL;
+               dev_warn(rdev->dev, "failed blitter (%d) falling back to memcpy\n", r);
+       }
  
        rdev->accel_working = true;
        r = rv770_startup(rdev);
index 2ecf7d0c64f63102bc512a80b2a340011bff8eec,3f72fe1ddf8bb4c722be312462c4606399d72711..5ca37a58a98c80be24beb227cef980f2cdbf7abf
@@@ -53,7 -53,6 +53,6 @@@ int ttm_bo_move_ttm(struct ttm_buffer_o
  {
        struct ttm_tt *ttm = bo->ttm;
        struct ttm_mem_reg *old_mem = &bo->mem;
-       uint32_t save_flags = old_mem->placement;
        int ret;
  
        if (old_mem->mem_type != TTM_PL_SYSTEM) {
@@@ -62,7 -61,6 +61,6 @@@
                ttm_flag_masked(&old_mem->placement, TTM_PL_FLAG_SYSTEM,
                                TTM_PL_MASK_MEM);
                old_mem->mem_type = TTM_PL_SYSTEM;
-               save_flags = old_mem->placement;
        }
  
        ret = ttm_tt_set_placement_caching(ttm, new_mem->placement);
@@@ -77,7 -75,7 +75,7 @@@
  
        *old_mem = *new_mem;
        new_mem->mm_node = NULL;
-       ttm_flag_masked(&save_flags, new_mem->placement, TTM_PL_MASK_MEMTYPE);
        return 0;
  }
  EXPORT_SYMBOL(ttm_bo_move_ttm);
@@@ -219,7 -217,6 +217,6 @@@ int ttm_bo_move_memcpy(struct ttm_buffe
        void *old_iomap;
        void *new_iomap;
        int ret;
-       uint32_t save_flags = old_mem->placement;
        unsigned long i;
        unsigned long page;
        unsigned long add = 0;
@@@ -270,7 -267,6 +267,6 @@@ out2
  
        *old_mem = *new_mem;
        new_mem->mm_node = NULL;
-       ttm_flag_masked(&save_flags, new_mem->placement, TTM_PL_MASK_MEMTYPE);
  
        if ((man->flags & TTM_MEMTYPE_FLAG_FIXED) && (ttm != NULL)) {
                ttm_tt_unbind(ttm);
@@@ -428,7 -424,7 +424,7 @@@ static int ttm_bo_kmap_ttm(struct ttm_b
  
                /*
                 * We need to use vmap to get the desired page protection
 -               * or to make the buffer object look contigous.
 +               * or to make the buffer object look contiguous.
                 */
                prot = (mem->placement & TTM_PL_FLAG_CACHED) ?
                        PAGE_KERNEL :
@@@ -537,7 -533,6 +533,6 @@@ int ttm_bo_move_accel_cleanup(struct tt
        struct ttm_mem_type_manager *man = &bdev->man[new_mem->mem_type];
        struct ttm_mem_reg *old_mem = &bo->mem;
        int ret;
-       uint32_t save_flags = old_mem->placement;
        struct ttm_buffer_object *ghost_obj;
        void *tmp_obj = NULL;
  
  
        *old_mem = *new_mem;
        new_mem->mm_node = NULL;
-       ttm_flag_masked(&save_flags, new_mem->placement, TTM_PL_MASK_MEMTYPE);
        return 0;
  }
  EXPORT_SYMBOL(ttm_bo_move_accel_cleanup);
diff --combined drivers/staging/Kconfig
index 94eb86319ff34a91ed781d2f7ddfbe990f9d7d0b,28e9b04aee159019689f33ee4381d74f3a24d4a6..fc2e963e65e9ec187086078744b60e32da68a0ea
@@@ -65,6 -65,8 +65,6 @@@ source "drivers/staging/rt2860/Kconfig
  
  source "drivers/staging/rt2870/Kconfig"
  
 -source "drivers/staging/rt3090/Kconfig"
 -
  source "drivers/staging/comedi/Kconfig"
  
  source "drivers/staging/asus_oled/Kconfig"
@@@ -77,16 -79,18 +77,16 @@@ source "drivers/staging/rtl8187se/Kconf
  
  source "drivers/staging/rtl8192su/Kconfig"
  
 +source "drivers/staging/rtl8192u/Kconfig"
 +
  source "drivers/staging/rtl8192e/Kconfig"
  
  source "drivers/staging/mimio/Kconfig"
  
  source "drivers/staging/frontier/Kconfig"
  
 -source "drivers/staging/android/Kconfig"
 -
  source "drivers/staging/dream/Kconfig"
  
 -source "drivers/staging/dst/Kconfig"
 -
  source "drivers/staging/pohmelfs/Kconfig"
  
  source "drivers/staging/b3dfg/Kconfig"
@@@ -99,8 -103,6 +99,6 @@@ source "drivers/staging/line6/Kconfig
  
  source "drivers/gpu/drm/vmwgfx/Kconfig"
  
- source "drivers/gpu/drm/radeon/Kconfig"
  source "drivers/gpu/drm/nouveau/Kconfig"
  
  source "drivers/staging/octeon/Kconfig"
@@@ -125,25 -127,5 +123,25 @@@ source "drivers/staging/sep/Kconfig
  
  source "drivers/staging/iio/Kconfig"
  
 +source "drivers/staging/ramzswap/Kconfig"
 +
 +source "drivers/staging/wlags49_h2/Kconfig"
 +
 +source "drivers/staging/wlags49_h25/Kconfig"
 +
 +source "drivers/staging/batman-adv/Kconfig"
 +
 +source "drivers/staging/samsung-laptop/Kconfig"
 +
 +source "drivers/staging/strip/Kconfig"
 +
 +source "drivers/staging/arlan/Kconfig"
 +
 +source "drivers/staging/wavelan/Kconfig"
 +
 +source "drivers/staging/netwave/Kconfig"
 +
 +source "drivers/staging/sm7xx/Kconfig"
 +
  endif # !STAGING_EXCLUDE_BUILD
  endif # STAGING