Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ttm: device address space != CPU address space

We need to store device offsets in 64 bit as the device
address space may be larger than the CPU's.

Fixes GPU init failures on radeons with 4GB or more of
vram on 32 bit kernels. We put vram at the start of the
GPU's address space so the gart aperture starts at 4 GB
causing all GPU addresses in the gart aperture to get
truncated.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=89072

[airlied: fix warning on nouveau build]

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: thellstrom@vmware.com
Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Alex Deucher and committed by
Dave Airlie
54c4cd68 440fd528

+4 -4
+1 -1
drivers/gpu/drm/nouveau/nouveau_fbcon.c
··· 418 418 nouveau_fbcon_zfill(dev, fbcon); 419 419 420 420 /* To allow resizeing without swapping buffers */ 421 - NV_INFO(drm, "allocated %dx%d fb: 0x%lx, bo %p\n", 421 + NV_INFO(drm, "allocated %dx%d fb: 0x%llx, bo %p\n", 422 422 nouveau_fb->base.width, nouveau_fb->base.height, 423 423 nvbo->bo.offset, nvbo); 424 424
+1 -1
drivers/gpu/drm/ttm/ttm_bo.c
··· 74 74 pr_err(" has_type: %d\n", man->has_type); 75 75 pr_err(" use_type: %d\n", man->use_type); 76 76 pr_err(" flags: 0x%08X\n", man->flags); 77 - pr_err(" gpu_offset: 0x%08lX\n", man->gpu_offset); 77 + pr_err(" gpu_offset: 0x%08llX\n", man->gpu_offset); 78 78 pr_err(" size: %llu\n", man->size); 79 79 pr_err(" available_caching: 0x%08X\n", man->available_caching); 80 80 pr_err(" default_caching: 0x%08X\n", man->default_caching);
+1 -1
include/drm/ttm/ttm_bo_api.h
··· 249 249 * either of these locks held. 250 250 */ 251 251 252 - unsigned long offset; 252 + uint64_t offset; /* GPU address space is independent of CPU word size */ 253 253 uint32_t cur_placement; 254 254 255 255 struct sg_table *sg;
+1 -1
include/drm/ttm/ttm_bo_driver.h
··· 277 277 bool has_type; 278 278 bool use_type; 279 279 uint32_t flags; 280 - unsigned long gpu_offset; 280 + uint64_t gpu_offset; /* GPU address space is independent of CPU word size */ 281 281 uint64_t size; 282 282 uint32_t available_caching; 283 283 uint32_t default_caching;