mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
panfrost: clean up mmap-diagnostics
Do not double-print the failure. While we're at it, make sure the diagnostic includes plenty of details for easier debugging. Reviewed-by: Eric R. Smith <eric.smith@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32428>
This commit is contained in:
parent
3006c2a7b6
commit
d5f4f918f3
2 changed files with 6 additions and 6 deletions
|
|
@ -341,11 +341,8 @@ panfrost_bo_mmap(struct panfrost_bo *bo)
|
|||
|
||||
bo->ptr.cpu = pan_kmod_bo_mmap(bo->kmod_bo, 0, panfrost_bo_size(bo),
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, NULL);
|
||||
if (bo->ptr.cpu == MAP_FAILED) {
|
||||
if (bo->ptr.cpu == MAP_FAILED)
|
||||
bo->ptr.cpu = NULL;
|
||||
mesa_loge("mmap failed: result=%p size=0x%llx\n", bo->ptr.cpu,
|
||||
(long long)panfrost_bo_size(bo));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
|
|
@ -617,8 +617,11 @@ pan_kmod_bo_mmap(struct pan_kmod_bo *bo, off_t bo_offset, size_t size, int prot,
|
|||
|
||||
host_addr = os_mmap(host_addr, size, prot, flags, bo->dev->fd,
|
||||
mmap_offset + bo_offset);
|
||||
if (host_addr == MAP_FAILED)
|
||||
mesa_loge("mmap() failed (err=%d)", errno);
|
||||
if (host_addr == MAP_FAILED) {
|
||||
mesa_loge("mmap(..., size=%zu, prot=%d, flags=0x%x) failed: %s",
|
||||
size, prot, flags, strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return host_addr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue