All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nouveau: put cursor BO in GART
@ 2013-01-20 23:15 Marcin Slusarz
       [not found] ` <20130120231538.GA5327-OI9uyE9O0yo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Slusarz @ 2013-01-20 23:15 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Keeping it in VRAM wastes CPU time, because cursor_set ioctl reads
handed BO back to RAM, just to write it to actual cursor BO.

Here (nv92/core i7), this patch decreases overall cpu usage of
drmmode_load_cursor_argb from 4.6ms to ~90us and lets nv50_crtc_cursor_set
disappear from perf traces.
---
I considered accelerating kernel-side copying with GPU, but it turns out that:
- it's slower (120-150us), with frequent bursts (up to 5ms)
- not applicable to <nv50 hw, which needs to transform cursor data

Putting cursor BO in GART does not conflict with accelarating kernel side
copying - times do not change, so it's safe to apply it.
---
 src/drmmode_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 4d2d09d..ee0805d 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -567,7 +567,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
 						 drmmode->mode_res->crtcs[num]);
 	drmmode_crtc->drmmode = drmmode;
 
-	ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_MAP, 0,
+	ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0,
 			     64*64*4, NULL, &drmmode_crtc->cursor);
 	assert(ret == 0);
 
-- 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nouveau: put cursor BO in GART
       [not found] ` <20130120231538.GA5327-OI9uyE9O0yo@public.gmane.org>
@ 2013-01-22 21:26   ` Ben Skeggs
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Skeggs @ 2013-01-22 21:26 UTC (permalink / raw)
  To: Marcin Slusarz; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, Jan 21, 2013 at 12:15:38AM +0100, Marcin Slusarz wrote:
> Keeping it in VRAM wastes CPU time, because cursor_set ioctl reads
> handed BO back to RAM, just to write it to actual cursor BO.
> 
> Here (nv92/core i7), this patch decreases overall cpu usage of
> drmmode_load_cursor_argb from 4.6ms to ~90us and lets nv50_crtc_cursor_set
> disappear from perf traces.
> ---
> I considered accelerating kernel-side copying with GPU, but it turns out that:
> - it's slower (120-150us), with frequent bursts (up to 5ms)
> - not applicable to <nv50 hw, which needs to transform cursor data
> 
> Putting cursor BO in GART does not conflict with accelarating kernel side
> copying - times do not change, so it's safe to apply it.
Pushed, thanks!

> ---
>  src/drmmode_display.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 4d2d09d..ee0805d 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -567,7 +567,7 @@ drmmode_crtc_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
>  						 drmmode->mode_res->crtcs[num]);
>  	drmmode_crtc->drmmode = drmmode;
>  
> -	ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_VRAM | NOUVEAU_BO_MAP, 0,
> +	ret = nouveau_bo_new(pNv->dev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0,
>  			     64*64*4, NULL, &drmmode_crtc->cursor);
>  	assert(ret == 0);
>  
> -- 
> _______________________________________________
> Nouveau mailing list
> Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-22 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-20 23:15 [PATCH] nouveau: put cursor BO in GART Marcin Slusarz
     [not found] ` <20130120231538.GA5327-OI9uyE9O0yo@public.gmane.org>
2013-01-22 21:26   ` Ben Skeggs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.