dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
  • [parent not found: <1490792146-2218-4-git-send-email-deathsimple@vodafone.de>]
  • [parent not found: <1490792146-2218-5-git-send-email-deathsimple@vodafone.de>]
  • [parent not found: <1490792146-2218-3-git-send-email-deathsimple@vodafone.de>]
  • * Re: CPU mapping of split VRAM buffers
           [not found] <1490792146-2218-1-git-send-email-deathsimple@vodafone.de>
                       ` (3 preceding siblings ...)
           [not found] ` <1490792146-2218-3-git-send-email-deathsimple@vodafone.de>
    @ 2017-03-30  6:42 ` Michel Dänzer
      4 siblings, 0 replies; 13+ messages in thread
    From: Michel Dänzer @ 2017-03-30  6:42 UTC (permalink / raw)
      To: Christian König; +Cc: dri-devel, amd-gfx
    
    On 29/03/17 09:55 PM, Christian König wrote:
    > Hi guys,
    > 
    > this set implements CPU mapping of split VRAM buffers and could
    > help with some performance issues regarding this.
    > 
    > Please review and/or comment,
    
    Patches 5 & 6 look mostly good to me, but I don't fully understand all
    changes in there, so I only feel comfortable giving
    
    Acked-by: Michel Dänzer <michel.daenzer@amd.com>
    
    for them.
    
    
    -- 
    Earthling Michel Dänzer               |               http://www.amd.com
    Libre software enthusiast             |             Mesa and X developer
    _______________________________________________
    dri-devel mailing list
    dri-devel@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/dri-devel
    
    ^ permalink raw reply	[flat|nested] 13+ messages in thread
  • * [PATCH 1/6] drm/ttm: cleanup and optimize ttm_bo_mem_compat v2
    @ 2017-03-31  9:47 Christian König
      2017-03-31  9:47 ` [PATCH 4/6] drm/amdgpu: drop alpha support Christian König
      0 siblings, 1 reply; 13+ messages in thread
    From: Christian König @ 2017-03-31  9:47 UTC (permalink / raw)
      To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
    	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
    
    From: Christian König <christian.koenig@amd.com>
    
    No need to implement the same logic twice. Also check if the busy placements
    are identical to the already scanned placements before checking them.
    
    v2: improve check even more as suggested by Michel.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    ---
     drivers/gpu/drm/ttm/ttm_bo.c | 45 ++++++++++++++++++++++++--------------------
     1 file changed, 25 insertions(+), 20 deletions(-)
    
    diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
    index 989b98b..348b17e 100644
    --- a/drivers/gpu/drm/ttm/ttm_bo.c
    +++ b/drivers/gpu/drm/ttm/ttm_bo.c
    @@ -1046,29 +1046,17 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo,
     	return ret;
     }
     
    -bool ttm_bo_mem_compat(struct ttm_placement *placement,
    -		       struct ttm_mem_reg *mem,
    -		       uint32_t *new_flags)
    +static bool ttm_bo_places_compat(const struct ttm_place *places,
    +				 unsigned num_placement,
    +				 struct ttm_mem_reg *mem,
    +				 uint32_t *new_flags)
     {
    -	int i;
    +	unsigned i;
     
    -	for (i = 0; i < placement->num_placement; i++) {
    -		const struct ttm_place *heap = &placement->placement[i];
    -		if (mem->mm_node &&
    -		    (mem->start < heap->fpfn ||
    -		     (heap->lpfn != 0 && (mem->start + mem->num_pages) > heap->lpfn)))
    -			continue;
    +	for (i = 0; i < num_placement; i++) {
    +		const struct ttm_place *heap = &places[i];
     
    -		*new_flags = heap->flags;
    -		if ((*new_flags & mem->placement & TTM_PL_MASK_CACHING) &&
    -		    (*new_flags & mem->placement & TTM_PL_MASK_MEM))
    -			return true;
    -	}
    -
    -	for (i = 0; i < placement->num_busy_placement; i++) {
    -		const struct ttm_place *heap = &placement->busy_placement[i];
    -		if (mem->mm_node &&
    -		    (mem->start < heap->fpfn ||
    +		if (mem->mm_node && (mem->start < heap->fpfn ||
     		     (heap->lpfn != 0 && (mem->start + mem->num_pages) > heap->lpfn)))
     			continue;
     
    @@ -1077,6 +1065,23 @@ bool ttm_bo_mem_compat(struct ttm_placement *placement,
     		    (*new_flags & mem->placement & TTM_PL_MASK_MEM))
     			return true;
     	}
    +	return false;
    +}
    +
    +bool ttm_bo_mem_compat(struct ttm_placement *placement,
    +		       struct ttm_mem_reg *mem,
    +		       uint32_t *new_flags)
    +{
    +	if (ttm_bo_places_compat(placement->placement, placement->num_placement,
    +				 mem, new_flags))
    +		return true;
    +
    +	if ((placement->busy_placement != placement->placement ||
    +	     placement->num_busy_placement > placement->num_placement) &&
    +	    ttm_bo_places_compat(placement->busy_placement,
    +				 placement->num_busy_placement,
    +				 mem, new_flags))
    +		return true;
     
     	return false;
     }
    -- 
    2.5.0
    
    _______________________________________________
    amd-gfx mailing list
    amd-gfx@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/amd-gfx
    
    ^ permalink raw reply related	[flat|nested] 13+ messages in thread
    * [PATCH 1/6] drm/ttm: cleanup and optimize ttm_bo_mem_compat
    @ 2017-03-29 17:43 Christian König
      2017-03-29 17:43 ` [PATCH 4/6] drm/amdgpu: drop alpha support Christian König
      0 siblings, 1 reply; 13+ messages in thread
    From: Christian König @ 2017-03-29 17:43 UTC (permalink / raw)
      To: dri-devel
    
    From: Christian König <christian.koenig@amd.com>
    
    No need to implement the same logic twice. Also check if the busy placements
    are identical to the already scanned placements before checking them.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    ---
     drivers/gpu/drm/ttm/ttm_bo.c | 45 ++++++++++++++++++++++++--------------------
     1 file changed, 25 insertions(+), 20 deletions(-)
    
    diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
    index 989b98b..96b1450 100644
    --- a/drivers/gpu/drm/ttm/ttm_bo.c
    +++ b/drivers/gpu/drm/ttm/ttm_bo.c
    @@ -1046,29 +1046,17 @@ static int ttm_bo_move_buffer(struct ttm_buffer_object *bo,
     	return ret;
     }
     
    -bool ttm_bo_mem_compat(struct ttm_placement *placement,
    -		       struct ttm_mem_reg *mem,
    -		       uint32_t *new_flags)
    +static bool ttm_bo_places_compat(const struct ttm_place *places,
    +				 unsigned num_placement,
    +				 struct ttm_mem_reg *mem,
    +				 uint32_t *new_flags)
     {
    -	int i;
    +	unsigned i;
     
    -	for (i = 0; i < placement->num_placement; i++) {
    -		const struct ttm_place *heap = &placement->placement[i];
    -		if (mem->mm_node &&
    -		    (mem->start < heap->fpfn ||
    -		     (heap->lpfn != 0 && (mem->start + mem->num_pages) > heap->lpfn)))
    -			continue;
    +	for (i = 0; i < num_placement; i++) {
    +		const struct ttm_place *heap = &places[i];
     
    -		*new_flags = heap->flags;
    -		if ((*new_flags & mem->placement & TTM_PL_MASK_CACHING) &&
    -		    (*new_flags & mem->placement & TTM_PL_MASK_MEM))
    -			return true;
    -	}
    -
    -	for (i = 0; i < placement->num_busy_placement; i++) {
    -		const struct ttm_place *heap = &placement->busy_placement[i];
    -		if (mem->mm_node &&
    -		    (mem->start < heap->fpfn ||
    +		if (mem->mm_node && (mem->start < heap->fpfn ||
     		     (heap->lpfn != 0 && (mem->start + mem->num_pages) > heap->lpfn)))
     			continue;
     
    @@ -1077,6 +1065,23 @@ bool ttm_bo_mem_compat(struct ttm_placement *placement,
     		    (*new_flags & mem->placement & TTM_PL_MASK_MEM))
     			return true;
     	}
    +	return false;
    +}
    +
    +bool ttm_bo_mem_compat(struct ttm_placement *placement,
    +		       struct ttm_mem_reg *mem,
    +		       uint32_t *new_flags)
    +{
    +	if (ttm_bo_places_compat(placement->placement, placement->num_placement,
    +				 mem, new_flags))
    +		return true;
    +
    +	if ((placement->busy_placement != placement->placement ||
    +	     placement->num_busy_placement != placement->num_placement) &&
    +	    ttm_bo_places_compat(placement->busy_placement,
    +				 placement->num_busy_placement,
    +				 mem, new_flags))
    +		return true;
     
     	return false;
     }
    -- 
    2.5.0
    
    _______________________________________________
    dri-devel mailing list
    dri-devel@lists.freedesktop.org
    https://lists.freedesktop.org/mailman/listinfo/dri-devel
    
    ^ permalink raw reply related	[flat|nested] 13+ messages in thread

    end of thread, other threads:[~2017-03-31  9:47 UTC | newest]
    
    Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <1490792146-2218-1-git-send-email-deathsimple@vodafone.de>
         [not found] ` <1490792146-2218-2-git-send-email-deathsimple@vodafone.de>
    2017-03-30  6:38   ` [PATCH 1/6] drm/ttm: cleanup and optimize ttm_bo_mem_compat Michel Dänzer
         [not found]     ` <0aeb9046-86c6-f14f-490e-cbf74079e107-otUistvHUpPR7s880joybQ@public.gmane.org>
    2017-03-30  8:41       ` Christian König
         [not found] ` <1490792146-2218-4-git-send-email-deathsimple@vodafone.de>
         [not found]   ` <1490792146-2218-4-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
    2017-03-30  6:39     ` [PATCH 3/6] drm/ttm: add TTM_PL_FLAG_CONTIGUOUS Michel Dänzer
         [not found] ` <1490792146-2218-5-git-send-email-deathsimple@vodafone.de>
    2017-03-30  6:39   ` [PATCH 4/6] drm/amdgpu: drop alpha support Michel Dänzer
    2017-03-30 13:09     ` Alex Deucher
    2017-03-30 13:22       ` Christian König
    2017-03-31  1:07       ` Michel Dänzer
    2017-03-31  7:09         ` Christian König
    2017-03-31  7:19           ` Michel Dänzer
         [not found] ` <1490792146-2218-3-git-send-email-deathsimple@vodafone.de>
    2017-03-30  6:39   ` [PATCH 2/6] drm/ttm: add io_mem_pfn callback Michel Dänzer
    2017-03-30  6:42 ` CPU mapping of split VRAM buffers Michel Dänzer
    2017-03-31  9:47 [PATCH 1/6] drm/ttm: cleanup and optimize ttm_bo_mem_compat v2 Christian König
    2017-03-31  9:47 ` [PATCH 4/6] drm/amdgpu: drop alpha support Christian König
      -- strict thread matches above, loose matches on Subject: below --
    2017-03-29 17:43 [PATCH 1/6] drm/ttm: cleanup and optimize ttm_bo_mem_compat Christian König
    2017-03-29 17:43 ` [PATCH 4/6] drm/amdgpu: drop alpha support Christian König
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox