pvr_fw_objec...eate_and_map(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pvr_fw_objec...eate_and_map β€” from the Kernel API Manual ✨

okay bestie, buckle up, because this one's a two-for-one deal: we're creating a firmware object and mapping it to both the firmware and the CPU in one single glow-up. no cap. πŸŽ€


✨ NAME ✨

pvr_fw_object_create_and_map β€” literally creates a FW object and maps it to firmware and CPU. both. at once. main character energy, honestly.


πŸ¦‹ SYNOPSIS πŸ¦‹

void * pvr_fw_object_create_and_map (struct pvr_device *pvr_dev , size_t
size , u64 flags , void (*init)(void *cpu_ptr, void *priv) , void
*init_priv , struct pvr_fw_object **fw_obj_out );

like, six whole arguments. she's got range. πŸ’œ


🌸 ARGUMENTS 🌸

  • pvr_dev β€” the PowerVR device pointer. your fave device, the one we're doing all this for 🫢
  • size β€” how big the object is, in bytes. measure twice, cut once, iykyk.
  • flags β€” the options that affect, and i quote, both this operation and future mapping operations performed on the returned object. it must be a combination of DRM_PVR_BO_* and/or PVR_BO_* flags. no mixing random stuff in, she's picky πŸ’…
  • init β€” the initialisation callback. signature is void (*init)(void *cpu_ptr, void *priv) β€” like, that exact shape, mwah.
  • init_priv β€” a private pointer that gets passed straight into the initialisation callback. secret little handoff 🀫
  • fw_obj_out β€” pointer to the location where the created object pointer gets stored. so it comes back out, bestie.

πŸ”₯ DESCRIPTION πŸ”₯

so like, DRM_PVR_BO_DEVICE_PM_FW_PROTECT is implied for all FW objects. like it's just the vibe, it's built in, you don't ask for it.

and consequently (ugh, love that word), this function will straight-up fail if flags has DRM_PVR_BO_CPU_ALLOW_USERSPACE_ACCESS set. 😭 so don't do that. fr fr. that combo is not it.

⚠️ also, and this one's important: the caller is responsible for calling pvr_fw_object_vunmap to release the CPU mapping. you made the map, you clean up the map. no leaving it for someone else, that's not very slay of you πŸ’€

🌈 RETURN 🌈

  • a pointer to the CPU mapping of the newly created object, or
  • any error returned by pvr_fw_object_create, or
  • any error returned by pvr_fw_object_vmap.

like, three possible outcomes. it's giving ✨mystery✨. check your return values, bestie, always.


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/gpu/drm/imagination/pvr_fw.c, plus the whole friend group:


and that's the page, bestie! πŸ§šβ€β™€οΈ this absolute banger lives over in ./drivers/gpu/drm/imagination, and it's dated October 2026 β€” yes, the future, she's ahead of her time. mwah, go forth and map responsibly πŸ’–

πŸ“¦ where this page comes from