Templatize MQDescriptor and rename to fmq_sync/fmq_unsync
Bug: 33948735
Test: builds, FMQ unit tests and benchmarks pass.
Change-Id: I5c3beff2c6a69e151e0cb11af299956638cc441b
diff --git a/graphics/composer/2.1/IComposerClient.hal b/graphics/composer/2.1/IComposerClient.hal
index 1a82215..b0bd837 100644
--- a/graphics/composer/2.1/IComposerClient.hal
+++ b/graphics/composer/2.1/IComposerClient.hal
@@ -554,7 +554,7 @@
* @return error is NONE upon success. Otherwise,
* NO_RESOURCES when failed to set the queue temporarily.
*/
- setInputCommandQueue(MQDescriptorSync descriptor)
+ setInputCommandQueue(fmq_sync<uint32_t> descriptor)
generates (Error error);
/*
@@ -568,7 +568,7 @@
*/
getOutputCommandQueue()
generates (Error error,
- MQDescriptorSync descriptor);
+ fmq_sync<uint32_t> descriptor);
/*
* Executes commands from the input command message queue. Return values
diff --git a/graphics/composer/2.1/default/HwcClient.cpp b/graphics/composer/2.1/default/HwcClient.cpp
index ce6c480..8c2dd6d 100644
--- a/graphics/composer/2.1/default/HwcClient.cpp
+++ b/graphics/composer/2.1/default/HwcClient.cpp
@@ -497,7 +497,7 @@
}
Return<Error> HwcClient::setInputCommandQueue(
- const MQDescriptorSync& descriptor)
+ const MQDescriptorSync<uint32_t>& descriptor)
{
std::lock_guard<std::mutex> lock(mCommandMutex);
return mReader.setMQDescriptor(descriptor) ?
@@ -514,7 +514,7 @@
if (outDescriptor) {
hidl_cb(Error::NONE, *outDescriptor);
} else {
- hidl_cb(Error::NO_RESOURCES, MQDescriptorSync(0, nullptr, 0));
+ hidl_cb(Error::NO_RESOURCES, MQDescriptorSync<uint32_t>());
}
return Void();
diff --git a/graphics/composer/2.1/default/HwcClient.h b/graphics/composer/2.1/default/HwcClient.h
index a9bc4cd..c719774 100644
--- a/graphics/composer/2.1/default/HwcClient.h
+++ b/graphics/composer/2.1/default/HwcClient.h
@@ -97,7 +97,7 @@
Return<Error> setClientTargetSlotCount(Display display,
uint32_t clientTargetSlotCount) override;
Return<Error> setInputCommandQueue(
- const MQDescriptorSync& descriptor) override;
+ const MQDescriptorSync<uint32_t>& descriptor) override;
Return<void> getOutputCommandQueue(
getOutputCommandQueue_cb hidl_cb) override;
Return<void> executeCommands(uint32_t inLength,
diff --git a/graphics/composer/2.1/default/IComposerCommandBuffer.h b/graphics/composer/2.1/default/IComposerCommandBuffer.h
index 8f133fe..7e14f19 100644
--- a/graphics/composer/2.1/default/IComposerCommandBuffer.h
+++ b/graphics/composer/2.1/default/IComposerCommandBuffer.h
@@ -120,7 +120,7 @@
return true;
}
- const MQDescriptorSync* getMQDescriptor() const
+ const MQDescriptorSync<uint32_t>* getMQDescriptor() const
{
return (mQueue) ? mQueue->getDesc() : nullptr;
}
@@ -626,7 +626,7 @@
reset();
}
- bool setMQDescriptor(const MQDescriptorSync& descriptor)
+ bool setMQDescriptor(const MQDescriptorSync<uint32_t>& descriptor)
{
mQueue = std::make_unique<CommandQueueType>(descriptor, false);
if (mQueue->isValid()) {