Skip to content

Commit

Permalink
anv: Fix buf map failure in 32bits app and tiling issue
Browse files Browse the repository at this point in the history
1) fix buf map failure in 32bits app
2) and when has_tiling_uapi is false
   return I915_TILING_NONE which means ISL_TILING_LINEAR
   On mesa, it returns -1, will cause vulkan app always crash
   has_tiling_uapi is always false, because DRM_IOCTL_I915_GEM_SET_TILING
   is not supported in has_get_tiling() function

commit 1de5d2a
Signed-off-by: Chen, Yu <[email protected]>
Change-Id: I94fe62080909841aff2ec2d57f942453989e11e1
Signed-off-by: Marc Mao <[email protected]>
  • Loading branch information
Yu1984 authored and ShenghuaLinINTEL committed Jul 8, 2024
1 parent 6847b06 commit 8965608
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/intel/vulkan/i915/anv_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int
anv_i915_gem_get_tiling(struct anv_device *device, uint32_t gem_handle)
{
if (!device->info->has_tiling_uapi)
return -1;
return I915_TILING_NONE;

struct drm_i915_gem_get_tiling get_tiling = {
.handle = gem_handle,
Expand Down
7 changes: 6 additions & 1 deletion src/intel/vulkan/i915/anv_kmd_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,15 @@ i915_gem_mmap_offset(struct anv_device *device, struct anv_bo *bo,
};
if (intel_ioctl(device->fd, DRM_IOCTL_I915_GEM_MMAP_OFFSET, &gem_mmap))
return MAP_FAILED;

#ifdef __x86_64__
return mmap(placed_addr, size, PROT_READ | PROT_WRITE,
(placed_addr != NULL ? MAP_FIXED : 0) | MAP_SHARED,
device->fd, gem_mmap.offset);
#else
return mmap64(placed_addr, size, PROT_READ | PROT_WRITE,
(placed_addr != NULL ? MAP_FIXED : 0) | MAP_SHARED,
device->fd, gem_mmap.offset);
#endif
}

static void *
Expand Down

0 comments on commit 8965608

Please sign in to comment.