dev-amdgpu: Fix issues with PM4 queue map, fences

The PM4 release_mem packet is used as a DMA fence in the driver. It
specifies which queue the interrupt came from by encoding the me, pipe,
and queue fields from the map_queue packet into the interrupt ring ID.
Currently these fields are incorrect because (1) the order in the
bitfield is backwards, (2) the queue constructor assigns a pointer to
the PM4MapQueue packet containing this data to the dmaBuffer which gets
deleted in short order, and (3) the order of the encoding of ring ID is

This change fixes these issues by (1) placing the struct vales in
correct order, (2) creating a const copy of the dmaBuffer on
construction, and (3) using the ring ID encoding expected by the driver:

Change-Id: I72c382980e57573f8a8a6879912c4139c7e2f505
Tested-by: kokoro <>
Reviewed-by: Matt Sinclair <>
Maintainer: Matt Sinclair <>
4 files changed