diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-08-14 15:38:07 -0700 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-08-14 15:38:07 -0700 |
commit | 4475dfb541c988ad19b177e60f31f333e2fb3355 (patch) | |
tree | 49c0eda03e15da82b030bb38b91e519613ca06c0 /src/drmmode_display.c | |
parent | cb217d4bfd941d0fa9ceae3e483dd1ca1d768e86 (diff) |
Use pwrite for cursor updates
Don't open code map/memcpy/unmap, let libdrm do that for us if necessary.
Diffstat (limited to 'src/drmmode_display.c')
-rw-r--r-- | src/drmmode_display.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index a65e948a..5154b423 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -216,16 +216,13 @@ drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image) drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; ScrnInfoPtr pScrn = crtc->scrn; I830Ptr pI830 = I830PTR(pScrn); - void *ptr; + int ret; /* cursor should be mapped already */ - if (dri_bo_map(pI830->cursor_mem->bo, 1)) + ret = dri_bo_subdata(pI830->cursor_mem->bo, 0, 64*64*4, image); + if (ret) xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, - "failed to map cursor"); - - ptr = pI830->cursor_mem->bo->virtual; - - memcpy (ptr, image, 64 * 64 * 4); + "failed to set cursor: %s", strerror(-ret)); return; } |