From c2b56e285d9bc59d22271e111a4c0b1de2b69f73 Mon Sep 17 00:00:00 2001 From: Denis Oliver Kropp Date: Tue, 14 Jan 2014 10:38:53 +0100 Subject: [PATCH 1/7] dfbtest_fillrect: less rectangles per flip --- tests/dfbtest_fillrect.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/dfbtest_fillrect.c b/tests/dfbtest_fillrect.c index a10601f75..b3693b8da 100644 --- a/tests/dfbtest_fillrect.c +++ b/tests/dfbtest_fillrect.c @@ -197,9 +197,13 @@ main( int argc, char *argv[] ) dest->Clear( dest, 0, 0, 0, 0 ); - for (i=0; i<100000; i++) { - dest->SetColor( dest, rand()%256, rand()%256, rand()%256, rand()%256 ); - dest->FillRectangle( dest, rand()%100, rand()%100, rand()%100, rand()%100 ); + for (i=0; i<1000; i++) { + dest->SetColor( dest, rand()%256, rand()%256, rand()%256, 0xff ); + + int w = rand()%100; + int h = rand()%100; + + dest->FillRectangle( dest, rand()%(desc.width-w), rand()%(desc.height-h), w, h ); } dest->Flip( dest, NULL, DSFLIP_NONE ); From b6e2e0594d382618b0c60b199b4e131dd6855ca7 Mon Sep 17 00:00:00 2001 From: Denis Oliver Kropp Date: Fri, 17 Jan 2014 02:28:33 +0100 Subject: [PATCH 2/7] Core: Include direct/Types++.h earlier. --- src/core/CoreSurface_includes.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/CoreSurface_includes.h b/src/core/CoreSurface_includes.h index ec00010ab..9377111b9 100644 --- a/src/core/CoreSurface_includes.h +++ b/src/core/CoreSurface_includes.h @@ -1,6 +1,8 @@ #include "CoreDFB_includes.h" #ifdef __cplusplus +#include + extern "C" { #endif From edd2b8c134290add504567242cba559f49cb1a2d Mon Sep 17 00:00:00 2001 From: Denis Oliver Kropp Date: Fri, 17 Jan 2014 13:24:10 +0100 Subject: [PATCH 3/7] dfbtest_eglblit: link against libdfbegl --- tests/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 2733f558a..28794085a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -130,7 +130,7 @@ bin_PROGRAMS = \ direct_test \ dfbtest_alloc \ dfbtest_layer \ - dfbtest_stereo \ + dfbtest_stereo \ $(ONE_PROGS) \ $(VOODOO_PROGS) \ $(SAWMAN_PROGS) \ @@ -193,7 +193,7 @@ dfbtest_egl_LDADD = $(DFB_BASE_LIBS) $(GL_DFB_BASE_LIBS) $(GLES2_DFB_BASE_LIBS dfbtest_eglblit_SOURCES = dfbtest_eglblit.c dfbtest_eglblit_CFLAGS = $(GLES2_CFLAGS) -dfbtest_eglblit_LDADD = $(DFB_BASE_LIBS) $(GL_DFB_BASE_LIBS) $(GLES2_DFB_BASE_LIBS) $(LIBM) $(libegl) +dfbtest_eglblit_LDADD = $(DFB_BASE_LIBS) $(GL_DFB_BASE_LIBS) $(GLES2_DFB_BASE_LIBS) $(LIBM) $(libegl) $(libdfbegl) dfbtest_eglimage_SOURCES = dfbtest_eglimage.cpp ../examples/++dfb/dfbapp.cpp dfbtest_eglimage_CFLAGS = $(GLES2_CFLAGS) From e000416a557b27a99cbd2e87d3daacddf55b3dd9 Mon Sep 17 00:00:00 2001 From: Denis Oliver Kropp Date: Mon, 20 Jan 2014 19:43:51 +0100 Subject: [PATCH 4/7] C++: fix some includes --- lib/direct/Types++.h | 2 ++ lib/fusion/object.h | 1 - src/core/surface_allocation.cpp | 4 ++-- src/media/DataBuffer_real.cpp | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/direct/Types++.h b/lib/direct/Types++.h index 744c2d609..62fc7f3e6 100644 --- a/lib/direct/Types++.h +++ b/lib/direct/Types++.h @@ -38,6 +38,8 @@ extern "C" { #include } +#include + namespace Direct { // NOTE: if build fails here we most likely have the above error due to nested extern "C" diff --git a/lib/fusion/object.h b/lib/fusion/object.h index 9176810d0..4f5e438a1 100644 --- a/lib/fusion/object.h +++ b/lib/fusion/object.h @@ -56,7 +56,6 @@ typedef u32 FusionObjectID; #ifdef __cplusplus } -#include namespace Fusion { typedef std::map ObjectMap; } diff --git a/src/core/surface_allocation.cpp b/src/core/surface_allocation.cpp index 5853e5d4c..0c9c7d495 100644 --- a/src/core/surface_allocation.cpp +++ b/src/core/surface_allocation.cpp @@ -34,10 +34,10 @@ #include -#include // include here to prevent it being included indirectly causing nested extern "C" - #include +#include // include here to prevent it being included indirectly causing nested extern "C" + extern "C" { #include diff --git a/src/media/DataBuffer_real.cpp b/src/media/DataBuffer_real.cpp index 129c6d843..fe5134c0d 100644 --- a/src/media/DataBuffer_real.cpp +++ b/src/media/DataBuffer_real.cpp @@ -32,6 +32,8 @@ #include +#include + #include "DataBuffer.h" extern "C" { From 429bf34ef5538598a945e8682359e8265a95d095 Mon Sep 17 00:00:00 2001 From: Denis Oliver Kropp Date: Mon, 20 Jan 2014 19:49:27 +0100 Subject: [PATCH 5/7] DataBuffer: include --- src/media/DataBuffer_includes.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/media/DataBuffer_includes.h b/src/media/DataBuffer_includes.h index 042b9b57e..32033e6ee 100644 --- a/src/media/DataBuffer_includes.h +++ b/src/media/DataBuffer_includes.h @@ -2,6 +2,8 @@ #define __DataBuffer_includes_h__ #ifdef __cplusplus +#include + extern "C" { #endif From 74a63b329938e9b4428b29ebc8beb0ccb3d01ba1 Mon Sep 17 00:00:00 2001 From: Denis Oliver Kropp Date: Mon, 20 Jan 2014 20:04:07 +0100 Subject: [PATCH 6/7] x11: fix check for config values in egl impl --- systems/x11/X11EGLImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systems/x11/X11EGLImpl.cpp b/systems/x11/X11EGLImpl.cpp index 858d33273..eb0d44f8e 100644 --- a/systems/x11/X11EGLImpl.cpp +++ b/systems/x11/X11EGLImpl.cpp @@ -526,7 +526,7 @@ X11EGLConfig::CheckOptions( const Graphics::Options &options ) } } else { - if (val > check && check != 0) + if (val > check)// && check != 0) D_DEBUG_AT( DFBX11_EGLConfig, " > local '%ld' greater than '%ld'\n", val, check ); else if (val == check) D_DEBUG_AT( DFBX11_EGLConfig, " = local '%ld' equals\n", val ); From 040380b8f28969994a1519d1ccb91e6ffdb2eac9 Mon Sep 17 00:00:00 2001 From: Denis Oliver Kropp Date: Mon, 20 Jan 2014 20:36:31 +0100 Subject: [PATCH 7/7] Options: Add "fusion-shm-populate" to enable usage of MAP_POPULATE for shm buffers. --- src/core/shared_secure_surface_pool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/shared_secure_surface_pool.c b/src/core/shared_secure_surface_pool.c index 1875c5036..fdca5a29d 100644 --- a/src/core/shared_secure_surface_pool.c +++ b/src/core/shared_secure_surface_pool.c @@ -187,6 +187,7 @@ sharedSecureAllocateBuffer( CoreSurfacePool *pool, SharedAllocationData *alloc = alloc_data; char buf[FUSION_SHM_TMPFS_PATH_NAME_LEN + 99]; int fd; + int flags = MAP_SHARED; D_DEBUG_AT( Core_SharedSecure, "%s()\n", __FUNCTION__ ); @@ -216,7 +217,10 @@ sharedSecureAllocateBuffer( CoreSurfacePool *pool, return DFB_IO; } - alloc->master_map = mmap( NULL, alloc->size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 ); + if (direct_config_get_int_value_with_default( "fusion-shm-populate", 0 )) + flags |= MAP_POPULATE; + + alloc->master_map = mmap( NULL, alloc->size, PROT_READ | PROT_WRITE, flags, fd, 0 ); close( fd );