Explicitly specify target/bind/bpp in resource creation

... instead of trying to guess it so that BLOB AHBs can be
distinguished from pipe buffers used for guest<->host communication
in VirtioGpuPipeStream.

Adds a test which allocates a BLOB AHB.

Reviewed-by: Aaron Ruby <aruby@blackberry.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
Jason Macnak
2024-04-02 10:25:53 -07:00
committed by Marge Bot
parent d0a61f5813
commit 70c695550a
7 changed files with 88 additions and 39 deletions

View File

@@ -26,7 +26,8 @@ using EGLClientBuffer = void*;
class EmulatedAHardwareBuffer {
public:
EmulatedAHardwareBuffer(uint32_t width, uint32_t height, VirtGpuResourcePtr resource);
EmulatedAHardwareBuffer(uint32_t width, uint32_t height, uint32_t drmFormat,
VirtGpuResourcePtr resource);
~EmulatedAHardwareBuffer();
@@ -56,6 +57,7 @@ class EmulatedAHardwareBuffer {
uint32_t mRefCount;
uint32_t mWidth;
uint32_t mHeight;
uint32_t mDrmFormat;
VirtGpuResourcePtr mResource;
std::optional<VirtGpuResourceMappingPtr> mMapped;
};