X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fstate_trackers%2Fxorg%2Fxorg_crtc.c;h=82dae194c4bd434f478849d036674895907605b2;hb=a087eb590d780cb82b49464e05ffc85123adce7e;hp=ddcaedde37e4dbbc920cf6440cd49fc814307df2;hpb=8fc433fa0f8c5364454858f9be919387feda440c;p=mesa.git diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index ddcaedde37e..82dae194c4b 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -196,11 +196,10 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image) templat.tex_usage |= PIPE_TEXTURE_USAGE_PRIMARY; templat.target = PIPE_TEXTURE_2D; templat.last_level = 0; - templat.depth[0] = 1; + templat.depth0 = 1; templat.format = PIPE_FORMAT_A8R8G8B8_UNORM; - templat.width[0] = 64; - templat.height[0] = 64; - pf_get_block(templat.format, &templat.block); + templat.width0 = 64; + templat.height0 = 64; crtcp->cursor_tex = ms->screen->texture_create(ms->screen, &templat); @@ -216,7 +215,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image) PIPE_TRANSFER_WRITE, 0, 0, 64, 64); ptr = ms->screen->transfer_map(ms->screen, transfer); - util_copy_rect(ptr, &crtcp->cursor_tex->block, + util_copy_rect(ptr, crtcp->cursor_tex->format, transfer->stride, 0, 0, 64, 64, (void*)image, 64 * 4, 0, 0); ms->screen->transfer_unmap(ms->screen, transfer); @@ -257,7 +256,7 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image) return; err_bo_destroy: - kms_bo_destroy(crtcp->cursor_bo); + kms_bo_destroy(&crtcp->cursor_bo); } #endif @@ -305,10 +304,8 @@ xorg_crtc_cursor_destroy(xf86CrtcPtr crtc) pipe_texture_reference(&crtcp->cursor_tex, NULL); #ifdef HAVE_LIBKMS if (crtcp->cursor_bo) - kms_bo_destroy(crtcp->cursor_bo); + kms_bo_destroy(&crtcp->cursor_bo); #endif - - xfree(crtcp); } /* @@ -320,11 +317,12 @@ crtc_destroy(xf86CrtcPtr crtc) { struct crtc_private *crtcp = crtc->driver_private; - if (crtcp->cursor_tex) - pipe_texture_reference(&crtcp->cursor_tex, NULL); + xorg_crtc_cursor_destroy(crtc); drmModeFreeCrtc(crtcp->drm_crtc); + xfree(crtcp); + crtc->driver_private = NULL; } static const xf86CrtcFuncsRec crtc_funcs = {