🆕 Take PRIVATE_BLOCKS in both kexts and pass a context's blocks through

The bundle needs a way to ask the host for a Private block and to give one
back. Both the x86-64 and the arm64e kexts now take PRIVATE_BLOCKS and set
kext feature bit 1 << 17 PrivateBlocks. They also answer two selectors:
- 18 PrivateTake: posts the context's PRIVATE_TAKE and waits for its
  PRIVATE_BLOCK with no deadline, as a pool take does. It answers the
  block's GPU address and length, or no memory where the host refused.
  An answer that does not cover the rounded ask is given back and fails.
- 22 PrivateGive: posts PRIVATE_GIVE and returns.

Selector 22 was picked over 19 because macOS 12's WebKit web-content
sandbox refuses 19 to 21; user_client_words_test checks both numbers
against that set.

The kexts map nothing for a block and keep no list of blocks: the host
holds each against its context and frees what is left at CONTEXT_CLOSE.
This commit is contained in:
Anees Iqbal committed 2026-11-19 02:30:57 -08:00
1 parent e840b34c6c
commit bdd2c7debe
11 files changed
+220 -11

No files matched your search

+14 -3
View File
@@ -96,8 +96,8 @@ enum {
// (RgfxRegionMapping.hpp), SurfaceSeeds, which Features leaves out where IOSurface exports no
// unlock seed (rgfxSurfaceUnlockSeedExported), SubmitBatch's publish of a queue's ring,
// OpenContext's doorbell page, on x86-64 CpuPats (RgfxPat.hpp), ZeroedBlocks (RgfxBlockZero.hpp),
// and on x86-64 Pool, which Features leaves out where the device has no pool (poolMemory). Each
// bit is set by the change that lands its call.
// on x86-64 Pool and PoolAddresses, which Features leaves out where the device has no pool
// (poolMemory), and PrivateBlocks. Each bit is set by the change that lands its call.
constexpr uint64_t kRgfxKextFeatureWord = kRgfxKextFeaturePagesBlock |
kRgfxKextFeaturePagesChunked |
kRgfxKextFeatureSubmitBatch |
@@ -112,7 +112,8 @@ constexpr uint64_t kRgfxKextFeatureWord = kRgfxKextFeaturePagesBlock |
kRgfxKextFeatureCpuPatsRead |
kRgfxKextFeatureZeroedBlocks |
kRgfxKextFeaturePoolCarried |
kRgfxKextFeaturePoolAddressesCarried;
kRgfxKextFeaturePoolAddressesCarried |
kRgfxKextFeaturePrivateBlocks;
class RgfxAccelerator;
class RgfxAcceleratorUserClient;
@@ -378,6 +379,16 @@ public:
IOReturn takePoolBlock(UInt32 context, task_t task, UInt64 length, RgfxHeldPoolBlock *block,
UInt64 *gpuAddress);
IOReturn givePoolBlock(UInt32 context, UInt64 offset, UInt64 length);
// Context `context`'s Private blocks (kRgfxAccelMethodPrivateTake, design.md, "Private
// blocks"), where the kext took RGFX_FEATURE_PRIVATE_BLOCKS: takePrivateBlock posts its
// PRIVATE_TAKE of `length` bytes and waits for the host's answer however long it takes, the
// block's GPU address and length in *gpuAddress and *blockLength. kIOReturnUnsupported where
// the kext did not take the feature; kIOReturnBadArgument for 0 bytes or past
// RGFX_PRIVATE_TAKE_MAX; kIOReturnNoMemory where the host had no block for it.
// givePrivateBlock posts the block's PRIVATE_GIVE and returns.
IOReturn takePrivateBlock(UInt32 context, UInt64 length, UInt64 *gpuAddress,
UInt64 *blockLength);
IOReturn givePrivateBlock(UInt32 context, UInt64 gpuAddress, UInt64 length);
// The region's first `size` bytes from RGFX_DEVICE_INFO_OFFSET (the device info, and the
// video caps after it), mapped read-only into the kernel: the map, which the caller
// releases, with *info its first byte; null where it cannot be mapped.
@@ -1195,6 +1195,72 @@ IOReturn RgfxAccelerator::givePoolBlock(UInt32 context, UInt64 offset, UInt64 le
0);
}
IOReturn RgfxAccelerator::takePrivateBlock(UInt32 context, UInt64 length, UInt64 *gpuAddress,
UInt64 *blockLength)
{
*gpuAddress = 0;
*blockLength = 0;
if (!(featureWord() & RGFX_FEATURE_PRIVATE_BLOCKS))
return kIOReturnUnsupported;
if (!rgfxPrivateTakeLength(length))
return kIOReturnBadArgument;
RgfxPrivateTake take = {};
take.context = context;
take.length = length;
RgfxPrivateBlock answer = {};
UInt32 answered = 0;
// The host answers each take of an open context, and the context's close waits for this ask
// (RgfxAskGate.hpp), as a pool take's: one whose block waits for device memory waits as long.
IOReturn r = postLifecycle(RGFX_CMD_PRIVATE_TAKE, &take, sizeof(take),
RGFX_EVT_PRIVATE_BLOCK, &answer, sizeof(answer), &answered,
nullptr, ReimsGraphics::kLifecycleNoDeadline);
if (r != kIOReturnSuccess)
return r;
if (answered < sizeof(answer)) {
IOLog("RgfxAccelerator: context %u's Private take of 0x%llx bytes: an answer of %u "
"bytes\n",
context, length, answered);
return kIOReturnInternalError;
}
switch (answer.status) {
case RGFX_STATUS_OK:
break;
case RGFX_STATUS_REFUSED:
return kIOReturnNoMemory;
case RGFX_STATUS_INVALID_ARGUMENT:
return kIOReturnBadArgument;
default:
IOLog("RgfxAccelerator: context %u's Private take of 0x%llx bytes: status %u\n", context,
length, answer.status);
return kIOReturnError;
}
if (!rgfxPrivateAnswerFits(length, answer.gpu_address, answer.length)) {
IOLog("RgfxAccelerator: context %u's Private take of 0x%llx bytes: answered 0x%llx bytes "
"at 0x%llx, which is no block for it: it is given back\n",
context, length, answer.length, answer.gpu_address);
givePrivateBlock(context, answer.gpu_address, answer.length);
return kIOReturnInternalError;
}
*gpuAddress = answer.gpu_address;
*blockLength = answer.length;
return kIOReturnSuccess;
}
IOReturn RgfxAccelerator::givePrivateBlock(UInt32 context, UInt64 gpuAddress, UInt64 length)
{
if (!(featureWord() & RGFX_FEATURE_PRIVATE_BLOCKS))
return kIOReturnUnsupported;
RgfxPrivateGive give = {};
give.context = context;
give.gpu_address = gpuAddress;
give.length = length;
// Its COMPLETE no thread waits for: the host takes the block back once the context's command
// buffers committed before it have finished, or refuses it, and the context's close gives
// back any block it kept.
return postLifecycle(RGFX_CMD_PRIVATE_GIVE, &give, sizeof(give), 0, nullptr, 0, nullptr,
nullptr, 0);
}
// MARK: - Doorbell pages
UInt32 RgfxAccelerator::openDoorbellPage(UInt32 context, task_t task, IOMemoryMap **map)
@@ -152,6 +152,10 @@ private:
IOReturn poolTakeMethod(IOExternalMethodArguments *arguments);
IOReturn poolGiveMethod(IOExternalMethodArguments *arguments);
void closePoolBlocks();
// The context's Private blocks (kRgfxAccelMethodPrivateTake, kRgfxAccelMethodPrivateGive):
// asks of the host alone, which knows each context's blocks and gives them back at its close.
IOReturn privateTakeMethod(IOExternalMethodArguments *arguments);
IOReturn privateGiveMethod(IOExternalMethodArguments *arguments);
// The surfaces a command buffer writes (kRgfxAccelMethodSurfaceWrites), and whether a queue is
// one of the client's open ones.
IOReturn surfaceWritesMethod(IOExternalMethodArguments *arguments);
@@ -379,6 +379,10 @@ IOReturn RgfxAcceleratorUserClient::contextMethod(uint32_t selector,
return poolTakeMethod(a);
case kRgfxAccelMethodPoolGive:
return poolGiveMethod(a);
case kRgfxAccelMethodPrivateTake:
return privateTakeMethod(a);
case kRgfxAccelMethodPrivateGive:
return privateGiveMethod(a);
case kRgfxAccelMethodFeatures: {
if (a->scalarInputCount != 0 || a->scalarOutputCount != 3)
return kIOReturnBadArgument;
@@ -1202,6 +1206,41 @@ IOReturn RgfxAcceleratorUserClient::poolGiveMethod(IOExternalMethodArguments *a)
return owner->givePoolBlock(ctx, block.offset, block.length);
}
// kRgfxAccelMethodPrivateTake (RgfxUserClientABI.hpp, RgfxPoolBlocks.hpp): a Private block's GPU
// address and length. An ask, so the close never posts its CONTEXT_CLOSE before the take, whose
// block the close then gives back.
IOReturn RgfxAcceleratorUserClient::privateTakeMethod(IOExternalMethodArguments *a)
{
if (a->scalarInputCount != 1 || a->scalarOutputCount != 2)
return kIOReturnBadArgument;
UInt32 ctx = 0;
Ask ask = {this, beginAsk(&ctx)};
if (!ask.begun)
return kIOReturnBadArgument;
UInt64 gpuAddress = 0;
UInt64 length = 0;
IOReturn r = owner->takePrivateBlock(ctx, a->scalarInput[0], &gpuAddress, &length);
if (r != kIOReturnSuccess)
return r;
a->scalarOutput[0] = gpuAddress;
a->scalarOutput[1] = length;
return kIOReturnSuccess;
}
// kRgfxAccelMethodPrivateGive (RgfxUserClientABI.hpp): the block's PRIVATE_GIVE, which the host
// checks against the context's blocks. An ask, as a take is, so the close never posts its
// CONTEXT_CLOSE between the process's last destroys and the give.
IOReturn RgfxAcceleratorUserClient::privateGiveMethod(IOExternalMethodArguments *a)
{
if (a->scalarInputCount != 2 || a->scalarOutputCount != 0)
return kIOReturnBadArgument;
UInt32 ctx = 0;
Ask ask = {this, beginAsk(&ctx)};
if (!ask.begun)
return kIOReturnBadArgument;
return owner->givePrivateBlock(ctx, a->scalarInput[0], a->scalarInput[1]);
}
void RgfxAcceleratorUserClient::closePoolBlocks()
{
if (!listLock)
+10 -2
View File
@@ -193,7 +193,14 @@
// - SURFACE_REFILL (bit 58), both kexts: the bundle tracks a cached surface's unlock seed from a
// commit made while a CPU held it locked for writing (kRgfxAccelMethodSurfaceSeeds), and has
// the next commit after the unlock ask the host to fill the surface's device cache again
// (RGFX_SURFACE_USE_REFILL), an op of its command buffers', which needs nothing of the kext.
// (RGFX_SURFACE_USE_REFILL), an op of its command buffers', which needs nothing of the kext;
// - POOL_ADDRESSES (bit 59), the x86-64 kext alone, with POOL: the kext answers the GPU address
// the host gives each pool block (kRgfxAccelMethodPoolTake's fourth output), where the bundle
// makes the block's heap;
// - PRIVATE_BLOCKS (bit 60), both kexts: the kext posts a context's PRIVATE_TAKE and PRIVATE_GIVE
// (kRgfxAccelMethodPrivateTake, kRgfxAccelMethodPrivateGive) and answers each block's GPU
// address and length, where the bundle places its Private buffers, its heaps that are not
// Shared and its Managed buffers' GPU copies.
//
// The accelerator answers the bundle's Features call with the feature word (rgfxFeatureWord), and
// grants a queue's flags (kRgfxAccelMethodQueueCreate's seventh input) only where their feature
@@ -240,7 +247,8 @@ constexpr uint64_t kRgfxCarriedFeatures =
(RGFX_GUEST_ARM64 ? RGFX_FEATURE_PAGES_16K | RGFX_FEATURE_VT_MESSAGES | RGFX_FEATURE_VT_RING |
RGFX_FEATURE_CURSOR_COLOR
: RGFX_FEATURE_DISPLAY_POWER | RGFX_FEATURE_POOL |
RGFX_FEATURE_POOL_ADDRESSES);
RGFX_FEATURE_POOL_ADDRESSES) |
RGFX_FEATURE_PRIVATE_BLOCKS;
// What the framebuffer writes to DRIVER_FEATURES, given the host's offer and, on arm64, the
// displays whose node the firmware placed under /arm-io, counted from display 0 (`mobileNodes`):
+24
View File
@@ -102,6 +102,30 @@ inline bool rgfxPoolAnswerFits(uint64_t poolLength, uint64_t asked, uint64_t off
offset <= poolLength && length <= poolLength - offset;
}
// A Private block (RGFX_FEATURE_PRIVATE_BLOCKS, design.md, "Private blocks") is a range of GPU
// addresses the host gives a context for its Private objects, with no memory a process maps: the
// kext posts the context's PRIVATE_TAKE and answers the block's address and length, and lists
// nothing, as the host knows each context's blocks and gives them back at its close.
//
// The length the host answers a Private take of `asked` bytes with at least: `asked` rounded up to
// RGFX_PRIVATE_BLOCK_ALIGN; 0 for 0 bytes or past RGFX_PRIVATE_TAKE_MAX, which the host refuses.
inline uint64_t rgfxPrivateTakeLength(uint64_t asked)
{
if (asked == 0 || asked > RGFX_PRIVATE_TAKE_MAX)
return 0;
return (asked + RGFX_PRIVATE_BLOCK_ALIGN - 1) & ~uint64_t(RGFX_PRIVATE_BLOCK_ALIGN - 1);
}
// Whether the host's OK answer to a Private take of `asked` bytes, a block of `length` bytes at
// GPU address `gpuAddress`, is one the kext hands out: at least the take's rounded length, a
// multiple of RGFX_PRIVATE_BLOCK_ALIGN, at an address other than 0 whose block does not wrap.
inline bool rgfxPrivateAnswerFits(uint64_t asked, uint64_t gpuAddress, uint64_t length)
{
const uint64_t want = rgfxPrivateTakeLength(asked);
return want != 0 && length >= want && length % RGFX_PRIVATE_BLOCK_ALIGN == 0 &&
gpuAddress != 0 && gpuAddress <= UINT64_MAX - length;
}
// The capacity the list grows to where it is full: kRgfxPoolBlocksFirst at first, then twice as
// many, up to kRgfxPoolBlocksMax; 0 where it holds that many already.
inline uint32_t rgfxPoolBlocksGrowTo(const RgfxPoolBlockList &list)
+24
View File
@@ -164,6 +164,25 @@ enum {
// object it holds (a heap) lies in it: the process destroys its objects over the block first.
// kIOReturnNotFound where the client holds no block at that offset.
kRgfxAccelMethodPoolGive = 17,
// A Private block for the client's context (kRgfxKextFeaturePrivateBlocks; the device's
// RGFX_FEATURE_PRIVATE_BLOCKS, design.md, "Private blocks"): in the bytes asked for; out the
// block's GPU address and its length, at least the bytes asked for rounded up to
// RGFX_PRIVATE_BLOCK_ALIGN. A block is a range of GPU addresses with no memory the process
// maps: the process places its Private buffers, its heaps that are not Shared and its Managed
// buffers' GPU copies in it, and gives it back through PrivateGive; the context's close gives
// back every block it still holds. The kext posts the context's PRIVATE_TAKE and waits for its
// answer however long the host takes, and lists no block: the host knows each context's.
// kIOReturnUnsupported where the device offers no Private blocks; kIOReturnBadArgument for 0
// bytes or past RGFX_PRIVATE_TAKE_MAX, or where the context is not open; kIOReturnNoMemory
// where the host had no block for it (RGFX_STATUS_REFUSED).
kRgfxAccelMethodPrivateTake = 18,
// Gives back the client's Private block at the GPU address scalarInput[0], of the length
// scalarInput[1] PrivateTake answered, and returns at once: its PRIVATE_GIVE is posted after
// every message the process posted before the call. The host takes the block back once the
// context's command buffers committed before have finished, and refuses it while an object it
// holds lies in it, and a block the context does not hold: the process destroys its objects in
// the block first. kIOReturnUnsupported where the device offers no Private blocks.
kRgfxAccelMethodPrivateGive = 22,
// A new selector takes the next number design.md's registry gives out.
};
@@ -299,6 +318,8 @@ static inline int rgfxAccelContextSelector(unsigned selector)
case kRgfxAccelMethodCpuPats:
case kRgfxAccelMethodPoolTake:
case kRgfxAccelMethodPoolGive:
case kRgfxAccelMethodPrivateTake:
case kRgfxAccelMethodPrivateGive:
case kRgfxAccelMethodSubmitBatch:
case kRgfxAccelMethodTakeAnswers:
case kRgfxAccelMethodSurfaceBlockRelease:
@@ -415,6 +436,9 @@ enum {
// PoolTake's (16) fourth output, the block's GPU address, which the bundle asks for where the
// feature word holds RGFX_FEATURE_POOL_ADDRESSES too; the x86-64 kext alone.
kRgfxKextFeaturePoolAddresses = 1 << 16,
// PrivateTake, 18, and PrivateGive, 22, which the bundle uses where the feature word holds
// RGFX_FEATURE_PRIVATE_BLOCKS too; the x86-64 and arm64e kexts.
kRgfxKextFeaturePrivateBlocks = 1 << 17,
};
// Where a cached block's header holds its surface's CPU generation, a 64-bit count the kext
+10 -6
View File
@@ -115,6 +115,9 @@ constexpr uint64_t kPoolCarried = RGFX_GUEST_ARM64 ? 0 : kPool;
// the host gave each block, and the arm64e kext does not.
constexpr uint64_t kPoolAddresses = RGFX_FEATURE_POOL_ADDRESSES;
constexpr uint64_t kPoolAddressesCarried = RGFX_GUEST_ARM64 ? 0 : kPoolAddresses;
// PRIVATE_BLOCKS, which both kexts carry, handing their processes the Private blocks the host
// gives their contexts.
constexpr uint64_t kPrivateBlocks = RGFX_FEATURE_PRIVATE_BLOCKS;
// A bit the wire does not name.
constexpr uint64_t kUnnamed = 1ull << 63;
// Every bit the wire names from bit 3 that the kext does not carry out yet.
@@ -210,7 +213,8 @@ constexpr uint64_t kCarried = kPages | kOrder | kIcb | kUnshared | kManaged | kH
kMultiDisplayCarried | kPointerOverCarried | kDisplayBoundsCarried |
kPointerMotion | k16KCarried | kVtMessagesCarried | kUploadsWritten |
kVtRingCarried | kCursorColorCarried | kBufferEscaped |
kPoolCarried | kSurfaceRefill | kPoolAddressesCarried;
kPoolCarried | kSurfaceRefill | kPoolAddressesCarried |
kPrivateBlocks;
// Every bit the wire names from bit 3.
constexpr uint64_t kNew = kNotCarried | kCarried;
} // namespace
@@ -226,9 +230,9 @@ int main()
// TEXTURE_DID_MODIFY_DATA, RATE_MAPS, FUNCTION_POINTERS, DYNAMIC_LIBRARIES, PIPELINE_KEYS,
// ICB_SLOTS_IN_PAGES, DOORBELL_ASKS, GUEST_TIMES, READ_ONLY_PAGES, DOORBELL_PAGES,
// PIPELINE_ANSWERS, POINTER_MOTION, MULTI_DISPLAY, POINTER_OVER, DISPLAY_BOUNDS,
// UPLOADS_WRITTEN, BUFFER_ESCAPED, SURFACE_REFILL and, the x86-64 kext, DISPLAY_POWER and POOL,
// or, the arm64e kext, PAGES_16K, VT_MESSAGES, VT_RING and CURSOR_COLOR, and writes each only
// where offered.
// UPLOADS_WRITTEN, BUFFER_ESCAPED, SURFACE_REFILL, PRIVATE_BLOCKS and, the x86-64 kext,
// DISPLAY_POWER, POOL and POOL_ADDRESSES, or, the arm64e kext, PAGES_16K, VT_MESSAGES, VT_RING
// and CURSOR_COLOR, and writes each only where offered.
check(kRgfxCarriedFeatures == kCarried,
"the kext takes PAGES_BUFFERS, SURFACE_ORDER, ICBs, UNSHARED_QUEUES, MANAGED_AT_OFFSET, "
"HEAP_OVER_PAGES, SUBMIT_ROOM, ICB slots, COMMIT_ORDER, SURFACE_DEFERRED, HOST_TIME, "
@@ -238,8 +242,8 @@ int main()
"DISPLAY_SCALE, TEXTURE_DID_MODIFY_DATA, RATE_MAPS, FUNCTION_POINTERS, DYNAMIC_LIBRARIES, "
"PIPELINE_KEYS, ICB_SLOTS_IN_PAGES, DOORBELL_ASKS, GUEST_TIMES, READ_ONLY_PAGES, "
"DOORBELL_PAGES, PIPELINE_ANSWERS, POINTER_MOTION, MULTI_DISPLAY, POINTER_OVER, "
"DISPLAY_BOUNDS, UPLOADS_WRITTEN, BUFFER_ESCAPED, SURFACE_REFILL and, on x86-64, "
"DISPLAY_POWER and POOL, on arm64e PAGES_16K, "
"DISPLAY_BOUNDS, UPLOADS_WRITTEN, BUFFER_ESCAPED, SURFACE_REFILL, PRIVATE_BLOCKS and, "
"on x86-64, DISPLAY_POWER, POOL and POOL_ADDRESSES, on arm64e PAGES_16K, "
"VT_MESSAGES, VT_RING and CURSOR_COLOR, from bit 3");
check(RGFX_FEATURE_PAGES_BUFFERS == (1u << 7), "PAGES_BUFFERS is bit 7");
check(RGFX_FEATURE_SURFACE_ORDER == (1u << 11), "SURFACE_ORDER is bit 11");
+19
View File
@@ -85,6 +85,25 @@ int main()
check(!rgfxPoolAnswerFits(pool, 0, 0, 0), "a take of nothing");
check(!rgfxPoolAnswerFits(0, kAlign, 0, kAlign), "no pool");
// A Private take's length: rounded up to 64 KiB; none for 0 bytes or past 1 TiB.
check(rgfxPrivateTakeLength(0) == 0, "0 bytes take no Private block");
check(rgfxPrivateTakeLength(1) == RGFX_PRIVATE_BLOCK_ALIGN, "a byte takes a Private block");
check(rgfxPrivateTakeLength(RGFX_PRIVATE_BLOCK_ALIGN + 1) == 2 * RGFX_PRIVATE_BLOCK_ALIGN,
"past a Private block takes two");
check(rgfxPrivateTakeLength(RGFX_PRIVATE_TAKE_MAX) == RGFX_PRIVATE_TAKE_MAX, "1 TiB at most");
check(rgfxPrivateTakeLength(RGFX_PRIVATE_TAKE_MAX + 1) == 0, "past 1 TiB takes nothing");
// The host's answer: at least the rounded length, a multiple of 64 KiB, at an address that
// is not 0 and does not wrap.
const uint64_t at = 1ull << 44;
const uint64_t p = RGFX_PRIVATE_BLOCK_ALIGN;
check(rgfxPrivateAnswerFits(1, at, p), "a Private block of the take's length");
check(rgfxPrivateAnswerFits(1, at + 0x8000, 256ull << 20), "a longer one, anywhere");
check(!rgfxPrivateAnswerFits(2 * p, at, p), "one short of the take");
check(!rgfxPrivateAnswerFits(p, at, p + 0x1000), "one not a multiple of 64 KiB");
check(!rgfxPrivateAnswerFits(p, 0, p), "one at address 0");
check(!rgfxPrivateAnswerFits(p, UINT64_MAX - p + 2, p), "one that wraps");
check(!rgfxPrivateAnswerFits(0, at, p), "a Private take of nothing");
// The list: empty, grown at its first block, each block listed once, taken by its offset.
std::vector<std::vector<RgfxHeldPoolBlock>> arrays;
RgfxPoolBlockList list = {nullptr, 0, 0};
+3
View File
@@ -145,6 +145,9 @@ int main()
check(!rgfxSubmitAdmitted(RGFX_CMD_POOL_TAKE) && !rgfxSubmitAdmitted(RGFX_CMD_POOL_GIVE),
"a pool take and give are the kext's");
check(rgfxSubmitAdmitted(RGFX_CMD_HEAP_OVER_POOL), "a heap over a pool block is accepted");
// And so are a Private block's (kRgfxAccelMethodPrivateTake and PrivateGive).
check(!rgfxSubmitAdmitted(RGFX_CMD_PRIVATE_TAKE) && !rgfxSubmitAdmitted(RGFX_CMD_PRIVATE_GIVE),
"a Private take and give are the kext's");
// The pipeline creates, which the device answers with a PIPELINE_REFLECTION and a client may
// post deferred: the render, mesh render and compute pipelines', and no other type.
@@ -137,6 +137,8 @@ static const Selector kSelectors[] = {
{"kRgfxAccelMethodCpuPats", kRgfxAccelMethodCpuPats, false},
{"kRgfxAccelMethodPoolTake", kRgfxAccelMethodPoolTake, false},
{"kRgfxAccelMethodPoolGive", kRgfxAccelMethodPoolGive, false},
{"kRgfxAccelMethodPrivateTake", kRgfxAccelMethodPrivateTake, false},
{"kRgfxAccelMethodPrivateGive", kRgfxAccelMethodPrivateGive, false},
{"kRgfxAccelMethodTakeAnswers", kRgfxAccelMethodTakeAnswers, false},
{"kRgfxAccelMethodSurfaceBlockRelease", kRgfxAccelMethodSurfaceBlockRelease, false},
{"kRgfxAccelMethodSurfaceRetire", kRgfxAccelMethodSurfaceRetire, false},
@@ -317,6 +319,7 @@ static void features()
kRgfxKextFeatureZeroedBlocks,
kRgfxKextFeaturePool,
kRgfxKextFeaturePoolAddresses,
kRgfxKextFeaturePrivateBlocks,
};
for (unsigned i = 0; i < sizeof(bits) / sizeof(bits[0]); i++)
CHECK(bits[i] == uint64_t(1) << i);
@@ -347,6 +350,10 @@ static void features()
// The Shared pool's take and give at the next two the sandbox allows.
CHECK(kRgfxAccelMethodPoolTake == 16);
CHECK(kRgfxAccelMethodPoolGive == 17);
// A Private block's take and give at the next two the sandbox allows: 19 to 21 are not.
CHECK(kRgfxAccelMethodPrivateTake == 18);
CHECK(kRgfxAccelMethodPrivateGive == 22);
CHECK(!sandboxAllows(19) && !sandboxAllows(20) && !sandboxAllows(21));
}
int main()