From cdd325b59a17a614b90fc2f8b388175e6d79e3cf Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 15 Sep 2009 07:29:02 +1000 Subject: radeon: fix 32/64 bit issue with sign extension Not sure what intptr_t was up to here. Reported and tested by: Kevin DeKorte Signed-off-by: Dave Airlie --- libdrm/radeon/radeon_cs_gem.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libdrm/radeon/radeon_cs_gem.c b/libdrm/radeon/radeon_cs_gem.c index a0db53bb..e42ec48f 100644 --- a/libdrm/radeon/radeon_cs_gem.c +++ b/libdrm/radeon/radeon_cs_gem.c @@ -100,10 +100,10 @@ static struct radeon_cs *cs_gem_create(struct radeon_cs_manager *csm, } csg->chunks[0].chunk_id = RADEON_CHUNK_ID_IB; csg->chunks[0].length_dw = 0; - csg->chunks[0].chunk_data = (uint64_t)(intptr_t)csg->base.packets; + csg->chunks[0].chunk_data = (uint64_t)(uintptr_t)csg->base.packets; csg->chunks[1].chunk_id = RADEON_CHUNK_ID_RELOCS; csg->chunks[1].length_dw = 0; - csg->chunks[1].chunk_data = (uint64_t)(intptr_t)csg->relocs; + csg->chunks[1].chunk_data = (uint64_t)(uintptr_t)csg->relocs; return (struct radeon_cs*)csg; } @@ -184,7 +184,7 @@ static int cs_gem_write_reloc(struct radeon_cs *cs, } cs->relocs = csg->relocs = tmp; csg->nrelocs += 1; - csg->chunks[1].chunk_data = (uint64_t)(intptr_t)csg->relocs; + csg->chunks[1].chunk_data = (uint64_t)(uintptr_t)csg->relocs; } csg->relocs_bo[csg->base.crelocs] = bo; idx = (csg->base.crelocs++) * RELOC_SIZE; @@ -269,11 +269,11 @@ static int cs_gem_emit(struct radeon_cs *cs) csg->chunks[0].length_dw = cs->cdw; - chunk_array[0] = (uint64_t)(intptr_t)&csg->chunks[0]; - chunk_array[1] = (uint64_t)(intptr_t)&csg->chunks[1]; + chunk_array[0] = (uint64_t)(uintptr_t)&csg->chunks[0]; + chunk_array[1] = (uint64_t)(uintptr_t)&csg->chunks[1]; csg->cs.num_chunks = 2; - csg->cs.chunks = (uint64_t)(intptr_t)chunk_array; + csg->cs.chunks = (uint64_t)(uintptr_t)chunk_array; r = drmCommandWriteRead(cs->csm->fd, DRM_RADEON_CS, &csg->cs, sizeof(struct drm_radeon_cs)); -- cgit v1.2.3