From 0bf52a95383acfff21d2c2ffa35c1418c7a3b79b Mon Sep 17 00:00:00 2001 From: Bram Oosterhuis Date: Mon, 15 Jan 2024 16:19:25 +0100 Subject: [PATCH 1/2] CompositorBufferType: EventFrame should be 64bit also on 32bit --- .../include/compositorbuffer/CompositorBufferType.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Source/compositorbuffer/include/compositorbuffer/CompositorBufferType.h b/Source/compositorbuffer/include/compositorbuffer/CompositorBufferType.h index 1ce17c4..cf2fdcf 100644 --- a/Source/compositorbuffer/include/compositorbuffer/CompositorBufferType.h +++ b/Source/compositorbuffer/include/compositorbuffer/CompositorBufferType.h @@ -37,14 +37,10 @@ namespace Compositor { template 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 { From e688d9b0211b8280aa5c728cb944dfcd596c1b8f Mon Sep 17 00:00:00 2001 From: Bram Oosterhuis Date: Wed, 17 Jan 2024 10:27:31 +0100 Subject: [PATCH 2/2] CompositorBuffer: Add initialization --- .../include/compositorbuffer/CompositorBufferType.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/compositorbuffer/include/compositorbuffer/CompositorBufferType.h b/Source/compositorbuffer/include/compositorbuffer/CompositorBufferType.h index cf2fdcf..7d5603c 100644 --- a/Source/compositorbuffer/include/compositorbuffer/CompositorBufferType.h +++ b/Source/compositorbuffer/include/compositorbuffer/CompositorBufferType.h @@ -68,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)