libdrm: explicitly convert values to __u64

Prevent errors like follows.

  error: invalid cast from type ‘size_t’ {aka ‘long unsigned int’} to type ‘__u64’ {aka ‘long long unsigned int’}

Issue 
This commit is contained in:
Christian Helmuth 2025-01-24 15:39:37 +01:00
parent b5a074dba1
commit e90a4a905a
2 changed files with 7 additions and 7 deletions
repos/libports/src/lib/libdrm

@ -163,7 +163,7 @@ void Etnaviv::serialize(drm_etnaviv_gem_submit *submit, char *content)
}; };
for_each_object((drm_etnaviv_gem_submit_bo*)submit->bos, for_each_object((drm_etnaviv_gem_submit_bo*)submit->bos,
submit->nr_bos, copy_bos); submit->nr_bos, copy_bos);
submit->bos = reinterpret_cast<__u64>(new_start); submit->bos = __u64(new_start);
} }
/* next are the relocs */ /* next are the relocs */
@ -177,7 +177,7 @@ void Etnaviv::serialize(drm_etnaviv_gem_submit *submit, char *content)
}; };
for_each_object((drm_etnaviv_gem_submit_reloc*)submit->relocs, for_each_object((drm_etnaviv_gem_submit_reloc*)submit->relocs,
submit->nr_relocs, copy_relocs); submit->nr_relocs, copy_relocs);
submit->relocs = reinterpret_cast<__u64>(new_start); submit->relocs = __u64(new_start);
} }
/* next are the pmrs */ /* next are the pmrs */
@ -190,7 +190,7 @@ void Etnaviv::serialize(drm_etnaviv_gem_submit *submit, char *content)
}; };
for_each_object((drm_etnaviv_gem_submit_pmr*)submit->pmrs, for_each_object((drm_etnaviv_gem_submit_pmr*)submit->pmrs,
submit->nr_pmrs, copy_pmrs); submit->nr_pmrs, copy_pmrs);
submit->pmrs = reinterpret_cast<__u64>(new_start); submit->pmrs = __u64(new_start);
} }
/* next is the cmd stream */ /* next is the cmd stream */
@ -200,7 +200,7 @@ void Etnaviv::serialize(drm_etnaviv_gem_submit *submit, char *content)
char * const dst = content + offset; char * const dst = content + offset;
Genode::memcpy(dst, reinterpret_cast<void const*>(submit->stream), submit->stream_size); Genode::memcpy(dst, reinterpret_cast<void const*>(submit->stream), submit->stream_size);
offset += submit->stream_size; offset += submit->stream_size;
submit->stream = reinterpret_cast<__u64>(new_start); submit->stream = __u64(new_start);
} }
/* copy submit object last but into the front */ /* copy submit object last but into the front */

@ -166,7 +166,7 @@ void Lima::serialize(drm_lima_gem_submit *submit, char *content)
}; };
for_each_object((drm_lima_gem_submit_bo*)submit->bos, for_each_object((drm_lima_gem_submit_bo*)submit->bos,
submit->nr_bos, copy_bos); submit->nr_bos, copy_bos);
submit->bos = reinterpret_cast<__u64>(new_start); submit->bos = __u64(new_start);
} }
/* next is the frame */ /* next is the frame */
@ -176,7 +176,7 @@ void Lima::serialize(drm_lima_gem_submit *submit, char *content)
char * const dst = content + offset; char * const dst = content + offset;
Genode::memcpy(dst, reinterpret_cast<void const*>(submit->frame), submit->frame_size); Genode::memcpy(dst, reinterpret_cast<void const*>(submit->frame), submit->frame_size);
offset += submit->frame_size; offset += submit->frame_size;
submit->frame = reinterpret_cast<__u64>(new_start); submit->frame = __u64(new_start);
} }
/* copy submit object last but into the front */ /* copy submit object last but into the front */
@ -730,7 +730,7 @@ class Lima::Call
(void)_apply_handle(arg.handle, [&] (Vram &b) { (void)_apply_handle(arg.handle, [&] (Vram &b) {
if (!b.mmap(_env)) if (!b.mmap(_env))
return; return;
arg.offset = reinterpret_cast<::uint64_t>(b.mmap_addr()); arg.offset = __u64(b.mmap_addr());
Gpu::Virtual_address const va = b.va; Gpu::Virtual_address const va = b.va;
if (va.value == (Gpu::addr_t)-1) if (va.value == (Gpu::addr_t)-1)