Created
          June 30, 2015 13:46 
        
      - 
      
- 
        Save mthierry/a39b7f77351aa8c811a9 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c | |
| index 3427b11..facb5f5 100644 | |
| --- a/drivers/gpu/drm/drm_mm.c | |
| +++ b/drivers/gpu/drm/drm_mm.c | |
| @@ -260,6 +260,8 @@ static void drm_mm_insert_helper_range(struct drm_mm_node *hole_node, | |
| u64 adj_start = hole_start; | |
| u64 adj_end = hole_end; | |
| + DRM_DEBUG_DRIVER("hole_start=0x%llx, hole_end=0x%llx, adj_start=0x%llx, adj_end=0x%llx, start=0x%llx, end=0x%llx, alignment=%u\n", | |
| + hole_start, hole_end, adj_start, adj_end, start, end, alignment); | |
| BUG_ON(!hole_node->hole_follows || node->allocated); | |
| if (adj_start < start) | |
| @@ -270,6 +272,9 @@ static void drm_mm_insert_helper_range(struct drm_mm_node *hole_node, | |
| if (flags & DRM_MM_CREATE_TOP) | |
| adj_start = adj_end - size; | |
| + DRM_DEBUG_DRIVER("adj_start=0x%llx, adj_end=0x%llx\n", | |
| + adj_start, adj_end); | |
| + | |
| if (mm->color_adjust) | |
| mm->color_adjust(hole_node, color, &adj_start, &adj_end); | |
| @@ -284,6 +289,9 @@ static void drm_mm_insert_helper_range(struct drm_mm_node *hole_node, | |
| else | |
| adj_start += alignment - rem; | |
| } | |
| + | |
| + DRM_DEBUG_DRIVER("rem=0x%x, adj_start=0x%llx\n", | |
| + rem, adj_start); | |
| } | |
| if (adj_start == hole_start) { | |
| @@ -338,15 +346,20 @@ int drm_mm_insert_node_in_range_generic(struct drm_mm *mm, struct drm_mm_node *n | |
| { | |
| struct drm_mm_node *hole_node; | |
| + DRM_DEBUG_DRIVER("====\n"); | |
| + DRM_DEBUG_DRIVER("start=0x%llx, end=0x%llx\n", start, end); | |
| hole_node = drm_mm_search_free_in_range_generic(mm, | |
| size, alignment, color, | |
| start, end, sflags); | |
| - if (!hole_node) | |
| + if (!hole_node) { | |
| + DRM_DEBUG_DRIVER("!hole_node\n"); | |
| return -ENOSPC; | |
| + } | |
| drm_mm_insert_helper_range(hole_node, node, | |
| size, alignment, color, | |
| start, end, aflags); | |
| + DRM_DEBUG_DRIVER("====\n"); | |
| return 0; | |
| } | |
| EXPORT_SYMBOL(drm_mm_insert_node_in_range_generic); | |
| @@ -475,6 +488,8 @@ static struct drm_mm_node *drm_mm_search_free_in_range_generic(const struct drm_ | |
| flags & DRM_MM_SEARCH_BELOW) { | |
| u64 hole_size = adj_end - adj_start; | |
| + DRM_DEBUG_DRIVER("hole_size=0x%llx, adj_start=0x%llx, adj_end=0x%llx\n", | |
| + hole_size, adj_start, adj_end); | |
| if (adj_start < start) | |
| adj_start = start; | |
| if (adj_end > end) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment