2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2022-02-15 23:07:01 +08:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2018-09-18 15:11:08 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-07-06 15:07:42 +08:00
|
|
|
#pragma once
|
2021-06-29 01:36:16 +08:00
|
|
|
#include "shared/source/gmm_helper/client_context/gmm_client_context.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-07-06 15:07:42 +08:00
|
|
|
class MockGmmClientContextBase : public GmmClientContext {
|
|
|
|
public:
|
2022-04-12 01:13:44 +08:00
|
|
|
struct MockPatIndex {
|
|
|
|
static constexpr uint32_t uncached = 1;
|
|
|
|
static constexpr uint32_t cached = 2;
|
|
|
|
static constexpr uint32_t error = GMM_PAT_ERROR;
|
|
|
|
};
|
|
|
|
|
2018-07-06 15:07:42 +08:00
|
|
|
MEMORY_OBJECT_CONTROL_STATE cachePolicyGetMemoryObject(GMM_RESOURCE_INFO *pResInfo, GMM_RESOURCE_USAGE_TYPE usage) override;
|
2022-02-15 23:07:01 +08:00
|
|
|
uint32_t cachePolicyGetPATIndex(GMM_RESOURCE_INFO *gmmResourceInfo, GMM_RESOURCE_USAGE_TYPE usage) override;
|
2018-07-06 15:07:42 +08:00
|
|
|
GMM_RESOURCE_INFO *createResInfoObject(GMM_RESCREATE_PARAMS *pCreateParams) override;
|
|
|
|
GMM_RESOURCE_INFO *copyResInfoObject(GMM_RESOURCE_INFO *pSrcRes) override;
|
|
|
|
void destroyResInfoObject(GMM_RESOURCE_INFO *pResInfo) override;
|
2019-10-09 23:32:35 +08:00
|
|
|
uint8_t getSurfaceStateCompressionFormat(GMM_RESOURCE_FORMAT format) override;
|
|
|
|
uint8_t getMediaSurfaceStateCompressionFormat(GMM_RESOURCE_FORMAT format) override;
|
2021-09-08 07:30:06 +08:00
|
|
|
void setGmmDeviceInfo(GMM_DEVICE_INFO *deviceInfo) override;
|
2019-10-09 23:32:35 +08:00
|
|
|
|
|
|
|
GMM_RESOURCE_FORMAT capturedFormat = GMM_FORMAT_INVALID;
|
|
|
|
uint8_t compressionFormatToReturn = 1;
|
|
|
|
uint32_t getSurfaceStateCompressionFormatCalled = 0u;
|
|
|
|
uint32_t getMediaSurfaceStateCompressionFormatCalled = 0u;
|
2022-04-12 01:13:44 +08:00
|
|
|
bool returnErrorOnPatIndexQuery = false;
|
2018-07-06 15:07:42 +08:00
|
|
|
|
|
|
|
protected:
|
2019-12-19 23:24:26 +08:00
|
|
|
using GmmClientContext::GmmClientContext;
|
2018-07-06 15:07:42 +08:00
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|