Skip to content

Commit

Permalink
Merge pull request #29 from WebPlatformForEmbedded/fix/CompositorBuff…
Browse files Browse the repository at this point in the history
…er--EventFrame-should-be-64bit-also-on-32bit

CompositorBufferType: EventFrame should be 64bit also on 32bit
  • Loading branch information
bramoosterhuis authored Jan 17, 2024
2 parents 23a3590 + c5c0991 commit ae32d9b
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@ namespace Compositor {
template <const uint8_t PLANES>
class CompositorBufferType : public Exchange::ICompositionBuffer, public Core::IResource {
private:
// We need to test this on a 32 bit platform. On 64 bits platforms we do need
// the data to be written into the eventfd to be 64 bits otherwise it does not
// respond!
#if defined(__SIZEOF_POINTER__) && (__SIZEOF_POINTER__ == 8)
/***
* We need a 64bit according: https://github.com/torvalds/linux/blob/v6.1/fs/eventfd.c#L275
*/
using EventFrame = uint64_t;
#else
using EventFrame = uint32_t;
#endif

// We need some shared space for data to exchange, and to create a lock..
class SharedStorage {
Expand Down Expand Up @@ -72,6 +68,13 @@ namespace Compositor {
SharedStorage& operator=(const SharedStorage&) = delete;

SharedStorage()
: _width(0)
, _height(0)
, _format(0)
, _modifier(0)
, _type(Exchange::ICompositionBuffer::TYPE_INVALID)
, _dirty()
, _copyOfDirty(false)
{
}
SharedStorage(const uint32_t width, const uint32_t height, const uint32_t format, const uint64_t modifier, const Exchange::ICompositionBuffer::DataType type)
Expand Down

0 comments on commit ae32d9b

Please sign in to comment.