mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 09:30:20 +01:00
Add composition support to the end2end test framework
... so that we can start to test GL->VK->Host-Compositor flows. Adds a fake render control lib that basically just exposes some of the render control functions with scoped host connection inside of a `RenderControlDevice`. 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:
parent
c2d57b76be
commit
d0a4d3f3bc
6 changed files with 43 additions and 0 deletions
|
|
@ -218,6 +218,16 @@ uint32_t EmulatedGralloc::getFormatDrmFourcc(const AHardwareBuffer* handle) {
|
|||
return ahb->getDrmFormat();
|
||||
}
|
||||
|
||||
uint32_t EmulatedGralloc::getWidth(const AHardwareBuffer* handle) {
|
||||
const auto* ahb = reinterpret_cast<const EmulatedAHardwareBuffer*>(handle);
|
||||
return ahb->getWidth();
|
||||
}
|
||||
|
||||
uint32_t EmulatedGralloc::getHeight(const AHardwareBuffer* handle) {
|
||||
const auto* ahb = reinterpret_cast<const EmulatedAHardwareBuffer*>(handle);
|
||||
return ahb->getHeight();
|
||||
}
|
||||
|
||||
size_t EmulatedGralloc::getAllocatedSize(const native_handle_t*) {
|
||||
ALOGE("Unimplemented.");
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@ class EmulatedGralloc : public Gralloc {
|
|||
|
||||
uint32_t getFormatDrmFourcc(const AHardwareBuffer* handle) override;
|
||||
|
||||
uint32_t getWidth(const AHardwareBuffer* ahb) override;
|
||||
uint32_t getHeight(const AHardwareBuffer* ahb) override;
|
||||
|
||||
size_t getAllocatedSize(const native_handle_t*) override;
|
||||
size_t getAllocatedSize(const AHardwareBuffer*) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -79,6 +79,18 @@ int GoldfishGralloc::getFormat(const AHardwareBuffer* ahb) {
|
|||
return getFormat(handle);
|
||||
}
|
||||
|
||||
uint32_t GoldfishGralloc::getWidth(const AHardwareBuffer* ahb) {
|
||||
AHardwareBuffer_Desc desc = {};
|
||||
AHardwareBuffer_describe(ahb, &desc);
|
||||
return desc.width;
|
||||
}
|
||||
|
||||
uint32_t GoldfishGralloc::getHeight(const AHardwareBuffer* ahb) {
|
||||
AHardwareBuffer_Desc desc = {};
|
||||
AHardwareBuffer_describe(ahb, &desc);
|
||||
return desc.height;
|
||||
}
|
||||
|
||||
size_t GoldfishGralloc::getAllocatedSize(const native_handle_t* handle) {
|
||||
return static_cast<size_t>(cb_handle_t::from(handle)->allocatedSize());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@ class GoldfishGralloc : public Gralloc {
|
|||
int getFormat(const native_handle_t* handle) override;
|
||||
int getFormat(const AHardwareBuffer* handle) override;
|
||||
|
||||
uint32_t getWidth(const AHardwareBuffer* ahb) override;
|
||||
uint32_t getHeight(const AHardwareBuffer* ahb) override;
|
||||
|
||||
size_t getAllocatedSize(const native_handle_t* handle) override;
|
||||
size_t getAllocatedSize(const AHardwareBuffer* handle) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -221,6 +221,18 @@ uint32_t MinigbmGralloc::getFormatDrmFourcc(const AHardwareBuffer* ahb) {
|
|||
return getFormatDrmFourcc(handle);
|
||||
}
|
||||
|
||||
uint32_t MinigbmGralloc::getWidth(const AHardwareBuffer* ahb) {
|
||||
AHardwareBuffer_Desc desc = {};
|
||||
AHardwareBuffer_describe(ahb, &desc);
|
||||
return desc.width;
|
||||
}
|
||||
|
||||
uint32_t MinigbmGralloc::getHeight(const AHardwareBuffer* ahb) {
|
||||
AHardwareBuffer_Desc desc = {};
|
||||
AHardwareBuffer_describe(ahb, &desc);
|
||||
return desc.height;
|
||||
}
|
||||
|
||||
size_t MinigbmGralloc::getAllocatedSize(const native_handle_t* handle) {
|
||||
struct drm_virtgpu_resource_info info;
|
||||
if (!getVirtioGpuResourceInfo(m_fd, handle, &info)) {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,9 @@ class MinigbmGralloc : public Gralloc {
|
|||
uint32_t getFormatDrmFourcc(const native_handle_t* handle) override;
|
||||
uint32_t getFormatDrmFourcc(const AHardwareBuffer* handle) override;
|
||||
|
||||
uint32_t getWidth(const AHardwareBuffer* ahb) override;
|
||||
uint32_t getHeight(const AHardwareBuffer* ahb) override;
|
||||
|
||||
size_t getAllocatedSize(const native_handle_t* handle) override;
|
||||
size_t getAllocatedSize(const AHardwareBuffer* handle) override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue