diff options
author | Dave Airlie <airlied@linux.ie> | 2009-09-15 07:29:02 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2009-09-15 07:30:22 +1000 |
commit | cdd325b59a17a614b90fc2f8b388175e6d79e3cf (patch) | |
tree | d92f297c233cb49aa65851a650fc230547847a9f | |
parent | 67e4172394a88d4922fb8d9c7c3d96ce7e02c5a6 (diff) |
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 <airlied@redhat.com>
-rw-r--r-- | libdrm/radeon/radeon_cs_gem.c | 12 |
1 files 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)); |