Revert "[guest] Check that the singleton VirtGpuDevice matches desired capset"

This reverts commit e08334cde39bbb8142caf42e716a5e11f772ce1a.

Reason for revert: breaks dEQP testing b/309836674

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
2023-11-08 21:18:23 +00:00
committed by Marge Bot
parent ade1fcea63
commit b0d19974f5
4 changed files with 4 additions and 12 deletions
-5
View File
@@ -15,7 +15,6 @@
*/
#include "VirtGpu.h"
#include <cutils/log.h>
namespace {
@@ -24,10 +23,6 @@ static VirtGpuDevice* sDevice = nullptr;
} // namespace
VirtGpuDevice* VirtGpuDevice::getInstance(enum VirtGpuCapset capset) {
if (sDevice && sDevice->capset() != capset) {
ALOGE("Requested VirtGpuDevice capset %u, already created capset %u", capset, sDevice->capset());
return nullptr;
}
if (!sDevice) {
sDevice = createPlatformVirtGpuDevice(capset);
}
@@ -145,11 +145,8 @@ class VirtGpuDevice {
static VirtGpuDevice* getInstance(enum VirtGpuCapset capset = kCapsetNone);
static void setInstanceForTesting(VirtGpuDevice* device);
VirtGpuDevice(enum VirtGpuCapset capset) : mCapset(capset) {}
virtual ~VirtGpuDevice() {}
enum VirtGpuCapset capset() { return mCapset; }
virtual int64_t getDeviceHandle(void) = 0;
virtual struct VirtGpuCaps getCaps(void) = 0;
@@ -159,9 +156,6 @@ class VirtGpuDevice {
virtual VirtGpuBlobPtr importBlob(const struct VirtGpuExternalHandle& handle) = 0;
virtual int execBuffer(struct VirtGpuExecBuffer& execbuffer, VirtGpuBlobPtr blob) = 0;
private:
enum VirtGpuCapset mCapset;
};
VirtGpuDevice* createPlatformVirtGpuDevice(enum VirtGpuCapset capset = kCapsetNone, int fd = -1);
@@ -74,4 +74,5 @@ class LinuxVirtGpuDevice : public VirtGpuDevice {
private:
int64_t mDeviceHandle;
struct VirtGpuCaps mCaps;
enum VirtGpuCapset mCapset;
};
@@ -39,7 +39,7 @@
#define VIRGL_BIND_CUSTOM (1 << 17)
#define PIPE_BUFFER 0
LinuxVirtGpuDevice::LinuxVirtGpuDevice(enum VirtGpuCapset capset, int fd) : VirtGpuDevice(capset) {
LinuxVirtGpuDevice::LinuxVirtGpuDevice(enum VirtGpuCapset capset, int fd) {
struct VirtGpuParam params[] = {
PARAM(VIRTGPU_PARAM_3D_FEATURES), PARAM(VIRTGPU_PARAM_CAPSET_QUERY_FIX),
PARAM(VIRTGPU_PARAM_RESOURCE_BLOB), PARAM(VIRTGPU_PARAM_HOST_VISIBLE),
@@ -110,6 +110,8 @@ LinuxVirtGpuDevice::LinuxVirtGpuDevice(enum VirtGpuCapset capset, int fd) : Virt
get_caps.size = 0;
}
mCapset = capset;
ret = drmIoctl(mDeviceHandle, DRM_IOCTL_VIRTGPU_GET_CAPS, &get_caps);
if (ret) {
// Don't fail get capabilities just yet, AEMU doesn't use this API