Skip to contentSkip to conversation

nouveau: put cursor BO in GART

PATCH In review Marcin Slusarz 2 participants 2 messages Jan 20, 2013 – Jan 22, 2013 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nouveau: put cursor BO in GART

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(-)
src/drmmode_display.c +1 -1
index 4d2d09d..ee0805d 100644
@@ -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);
 

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 11 lines · Marcin Slusarz

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

Quoted 2 lines

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!

Quoted 22 lines
---
 src/drmmode_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/drmmode_display.c +1 -1
index 4d2d09d..ee0805d 100644
@@ -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);
 
Signature · 4 lines
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau