Check i915 version at runtime

Related-To: NEO-6510

Check which prelim version is being used.
Select proper IoctlHelper based on that version.
If no version found, switch to upstream instead.

Source of prelim headers:
https://github.com/intel-gpu/drm-uapi-helper


Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2021-12-08 10:10:27 +00:00
committed by Compute-Runtime-Automation
parent abb91a7dae
commit 5a3fd1dc94
28 changed files with 3116 additions and 1133 deletions

View File

@ -20,7 +20,8 @@ extern IoctlHelper *ioctlHelperFactory[IGFX_MAX_PRODUCT];
class IoctlHelper {
public:
static IoctlHelper *get(PRODUCT_FAMILY product);
virtual ~IoctlHelper() {}
static IoctlHelper *get(Drm *product);
static uint32_t ioctl(Drm *drm, unsigned long request, void *arg);
virtual uint32_t createGemExt(Drm *drm, void *data, uint32_t dataSize, size_t allocSize, uint32_t &handle) = 0;
@ -38,12 +39,14 @@ class IoctlHelperImpl : public IoctlHelper {
std::unique_ptr<uint8_t[]> translateIfRequired(uint8_t *dataQuery, int32_t length) override;
};
class IoctlHelperDefault : public IoctlHelper {
class IoctlHelperUpstream : public IoctlHelper {
public:
uint32_t createGemExt(Drm *drm, void *data, uint32_t dataSize, size_t allocSize, uint32_t &handle) override;
std::unique_ptr<uint8_t[]> translateIfRequired(uint8_t *dataQuery, int32_t length) override;
};
class IoctlHelperPrelim20 : public IoctlHelper {
public:
static IoctlHelper *get() {
static IoctlHelperDefault instance;
return &instance;
}
uint32_t createGemExt(Drm *drm, void *data, uint32_t dataSize, size_t allocSize, uint32_t &handle) override;
std::unique_ptr<uint8_t[]> translateIfRequired(uint8_t *dataQuery, int32_t length) override;
};