include/touch/touch.h | 66 +++++++++++++++++++------------- sc/Module_sc.mk | 3 - sc/inc/platforminfo.hxx | 1 sc/source/core/opencl/openclwrapper.cxx | 33 +++++++++++++++- soltools/cpp/_include.c | 4 + soltools/cpp/_macro.c | 4 + sw/source/core/view/viewsh.cxx | 21 ++++++++-- 7 files changed, 97 insertions(+), 35 deletions(-)
New commits: commit 3f0f8d09645e7ab03c8757bca9af2e99731075c0 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun Nov 17 18:23:25 2013 +0100 enable opencl-test again on all platforms we have now a way to disable known bad OpenCL compilers based on vendor name and driver version diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index a60506c..7f0515a 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -59,8 +59,7 @@ $(eval $(call gb_Module_add_check_targets,sc,\ CppunitTest_sc_ucalc \ CppunitTest_sc_filters_test \ CppunitTest_sc_rangelst_test \ - $(if $(filter $(OS),MACOSX), \ - CppunitTest_sc_opencl_test) \ + CppunitTest_sc_opencl_test) \ )) $(eval $(call gb_Module_add_slowcheck_targets,sc, \ commit 8ab21b9c995c0f018055bb3355c3ebdd4deb48ca Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun Nov 17 18:17:48 2013 +0100 fix problem with retriving vendor information from opencl devices Change-Id: Iff9017b64159254c749fc2c3ddc9033d524f9395 diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx index 8ca70d0..9a056aa 100644 --- a/sc/source/core/opencl/openclwrapper.cxx +++ b/sc/source/core/opencl/openclwrapper.cxx @@ -731,7 +731,7 @@ void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo) aDeviceInfo.maName = OUString::createFromAscii(pName); char pVendor[DEVICE_NAME_LENGTH]; - nState = clGetDeviceInfo(aDeviceId, CL_DEVICE_VENDOR, DEVICE_NAME_LENGTH, pName, NULL); + nState = clGetDeviceInfo(aDeviceId, CL_DEVICE_VENDOR, DEVICE_NAME_LENGTH, pVendor, NULL); if(nState != CL_SUCCESS) return; commit 91e814f66f5561798902f767d64c4366b376a1d3 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun Nov 17 18:16:35 2013 +0100 add a way to blacklist known bad OpenCL compilers the blacklisted compiler hangs while compiling the opencl-test kernels on the @38 tinderbox. Change-Id: Ice80253a5fbb66eef4bfb4a3efd881fc83c379b4 diff --git a/sc/inc/platforminfo.hxx b/sc/inc/platforminfo.hxx index 7a48e11..71206e0 100644 --- a/sc/inc/platforminfo.hxx +++ b/sc/inc/platforminfo.hxx @@ -23,6 +23,7 @@ struct SC_DLLPUBLIC OpenclDeviceInfo void* device; OUString maName; OUString maVendor; + OUString maDriver; size_t mnMemory; size_t mnComputeUnits; size_t mnFrequency; diff --git a/sc/source/core/opencl/openclwrapper.cxx b/sc/source/core/opencl/openclwrapper.cxx index b7e1f91..8ca70d0 100644 --- a/sc/source/core/opencl/openclwrapper.cxx +++ b/sc/source/core/opencl/openclwrapper.cxx @@ -698,6 +698,26 @@ int OpenclDevice::getOpenclState() namespace { +// based on crashes and hanging during kernel compilation +bool checkForKnownBadCompilers(const OpenclDeviceInfo& rInfo) +{ + + struct { + const char* pVendorName; const char* pDriverVersion; + } aBadOpenCLCompilers[] = { + { "Intel(R) Corporation", "9.17.10.2884" } + }; + + for(size_t i = 0; i < SAL_N_ELEMENTS(aBadOpenCLCompilers); ++i) + { + if(rInfo.maVendor == OUString::createFromAscii(aBadOpenCLCompilers[i].pVendorName) && + rInfo.maDriver == OUString::createFromAscii(aBadOpenCLCompilers[i].pDriverVersion)) + return true; + } + + return false; +} + void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo) { OpenclDeviceInfo aDeviceInfo; @@ -736,6 +756,14 @@ void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo) if(nState != CL_SUCCESS) return; + char pDriver[DEVICE_NAME_LENGTH]; + nState = clGetDeviceInfo(aDeviceId, CL_DRIVER_VERSION, DEVICE_NAME_LENGTH, pDriver, NULL); + + if(nState != CL_SUCCESS) + return; + + aDeviceInfo.maDriver = OUString::createFromAscii(pDriver); + bool bKhrFp64 = false; bool bAmdFp64 = false; checkDeviceForDoubleSupport(aDeviceId, bKhrFp64, bAmdFp64); @@ -746,7 +774,8 @@ void createDeviceInfo(cl_device_id aDeviceId, OpenclPlatformInfo& rPlatformInfo) aDeviceInfo.mnComputeUnits = nComputeUnits; - rPlatformInfo.maDevices.push_back(aDeviceInfo); + if(!checkForKnownBadCompilers(aDeviceInfo)) + rPlatformInfo.maDevices.push_back(aDeviceInfo); } bool createPlatformInfo(cl_platform_id nPlatformId, OpenclPlatformInfo& rPlatformInfo) commit 3614d5546034eae34dd0cbf282e058e431ec7295 Author: Tor Lillqvist <t...@collabora.com> Date: Sun Nov 17 17:56:51 2013 +0200 WaE: 'PATH_MAX' : macro redefinition Change-Id: I153e34d24493bbbebf37422fb6382969153506a8 diff --git a/soltools/cpp/_include.c b/soltools/cpp/_include.c index 7a9044b..2d4b919 100644 --- a/soltools/cpp/_include.c +++ b/soltools/cpp/_include.c @@ -33,7 +33,9 @@ #if defined(__IBMC__) || defined(__EMX__) || defined(_MSC_VER) # include <fcntl.h> -# define PATH_MAX _MAX_PATH +# ifndef PATH_MAX +# define PATH_MAX _MAX_PATH +# endif #endif #include <limits.h> diff --git a/soltools/cpp/_macro.c b/soltools/cpp/_macro.c index b86af10..bd91141 100644 --- a/soltools/cpp/_macro.c +++ b/soltools/cpp/_macro.c @@ -24,7 +24,9 @@ #include <stdlib.h> #include <string.h> #if defined(__IBMC__) || defined(__EMX__) || defined(_MSC_VER) -# define PATH_MAX _MAX_PATH +# ifndef PATH_MAX +# define PATH_MAX _MAX_PATH +# endif #endif #include <limits.h> commit 8b60382f524e1e8b19d5e17d3b7b901ec65526cd Author: Tor Lillqvist <t...@collabora.com> Date: Sun Nov 17 14:34:39 2013 +0200 Make the tiled rendering code compile for Android again I just ifdeffed out iOS-specific code, no actual Android-specific code added. And if at some stage we have need and resources to really make the tiled rendering stuff saner and cross-platform, a lot will change of course. Change-Id: If45d98f301413e26372c611f8ffecf229061174d diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index eef0286..143ac40 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -17,12 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifdef IOS - #include <touch/touch.h> -#endif - #include <com/sun/star/accessibility/XAccessible.hpp> #include <sfx2/viewfrm.hxx> #include <sfx2/progress.hxx> @@ -1792,6 +1788,7 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex extern "C" void touch_lo_draw_tile(void *context, int contextWidth, int contextHeight, MLODpxPoint tileDpxPosition, MLODpxSize tileDpxSize) { +#ifdef IOS SAL_INFO("sw", "touch_lo_draw_tile(" << contextWidth << ", " << contextHeight << ", (" << tileDpxPosition.x << "," << tileDpxPosition.y << "), " << tileDpxSize.width << "x" << tileDpxSize.height << ")"); MLORipPoint tileRipPosition = MLORipPointByDpxPoint(tileDpxPosition); MLORipSize rileRipSize = MLORipSizeByDpxSize(tileDpxSize); @@ -1838,10 +1835,18 @@ void touch_lo_draw_tile(void *context, int contextWidth, int contextHeight, MLOD aBitmap.ReleaseAccess(readAccess); } Application::ReleaseSolarMutex(); +#else + (void) context; + (void) contextWidth; + (void) contextHeight; + (void) tileDpxPosition; + (void) tileDpxSize; +#endif } extern "C" MLODpxSize touch_lo_get_content_size() { +#ifdef IOS SwWrtShell *pViewShell = GetActiveWrtShell(); if (pViewShell) { @@ -1852,15 +1857,23 @@ MLODpxSize touch_lo_get_content_size() ((MLORip)documentSize.Height()) + HEIGHT_ADDITION); } return MLODpxSizeByDpxes(0,0); +#else + return MLODpxSize(); +#endif } extern "C" MLORipPoint MLORipPointByDpxPoint(MLODpxPoint mloDpxPoint) { +#ifdef IOS //MLODpxSize contentSize = touch_lo_get_content_size(); MLORip x = MLORipByDpx(mloDpxPoint.x /*- (contentSize.width/2.0f)*/); MLORip y = MLORipByDpx(mloDpxPoint.y); return MLORipPointByRips(x,y); +#else + (void) mloDpxPoint; + return MLORipPoint(); +#endif } extern "C" commit f3a59f58900cbf9827260b8db57c9be8d92b5aa7 Author: Tor Lillqvist <t...@collabora.com> Date: Sun Nov 17 14:34:25 2013 +0200 Make this compile for Android again Change-Id: I0b476873f76e6dd480868ec4d443718cab36cf24 diff --git a/include/touch/touch.h b/include/touch/touch.h index 594f962..72647da 100644 --- a/include/touch/touch.h +++ b/include/touch/touch.h @@ -28,7 +28,9 @@ #include <CoreGraphics/CoreGraphics.h> #include <postmac.h> #else -#include <basegfx/range/b2ibox.hxx> +#include <basegfx/range/b1drange.hxx> +#include <basegfx/range/b2drange.hxx> +#include <basegfx/tuple/b2dtuple.hxx> #endif #ifdef __cplusplus @@ -86,28 +88,23 @@ typedef enum { #ifdef IOS typedef CGRect MLORect; -#else -typedef basegfx::B2IBox MLORect; -#endif - -// MLODip - Device Independent Pixels - -typedef long long MLORip; typedef CGFloat MLODpx; typedef CGPoint MLODpxPoint; typedef CGSize MLODpxSize; -CG_INLINE MLODpxPoint -MLODpxPointByDpxes(MLODpx x, MLODpx y) -{ - return CGPointMake(x, y); -} +#else -CG_INLINE MLODpxSize -MLODpxSizeByDpxes(MLODpx width, MLODpx height) -{ - return CGSizeMake(width, height); -} +// Very much work in progress, just something to make this compile +typedef basegfx::B2DRange MLORect; +typedef float MLODpx; +typedef basegfx::B2DTuple MLODpxPoint; +typedef basegfx::B1DRange MLODpxSize; + +#endif + +// MLORip - tens of TWIPs, of questionable usefuless + +typedef long long MLORip; static const MLORip LO_TWIPS_TO_MLO_RIP_RATIO = 10L; @@ -125,31 +122,49 @@ struct MLORipPoint }; typedef struct MLORipPoint MLORipPoint; -CG_INLINE MLODpx +static inline MLODpx MLODpxByRip(MLORip rip) { return (MLODpx) (rip / LO_TWIPS_TO_MLO_RIP_RATIO); } -CG_INLINE MLORip +static inline MLORip MLORipByDpx(MLODpx dpx) { return (MLORip) (dpx * LO_TWIPS_TO_MLO_RIP_RATIO); } -CG_INLINE MLORipSize +static inline MLODpxPoint +MLODpxPointByDpxes(MLODpx x, MLODpx y) +{ +#ifdef IOS + return CGPointMake(x, y); +#else + return basegfx::B2DTuple(x, y); +#endif +} + +#ifdef IOS + +static inline MLODpxSize +MLODpxSizeByDpxes(MLODpx width, MLODpx height) +{ + return CGSizeMake(width, height); +} + +static inline MLORipSize MLORipSizeByRips(MLORip width, MLORip height) { MLORipSize ripSize; ripSize.width = width; ripSize.height = height; return ripSize; } -CG_INLINE MLORipPoint +static inline MLORipPoint MLORipPointByRips(MLORip x, MLORip y) { MLORipPoint point; point.x = x; point.y = y; return point; } -CG_INLINE MLORipSize +static inline MLORipSize MLORipSizeByDpxSize(MLODpxSize dpxSize) { MLORipSize ripSize; @@ -158,7 +173,7 @@ MLORipSizeByDpxSize(MLODpxSize dpxSize) return ripSize; } -CG_INLINE MLODpxSize +static inline MLODpxSize MLODpxSizeByRips(MLORip width, MLORip height) { CGFloat fWidth = MLODpxByRip(width); @@ -166,7 +181,7 @@ MLODpxSizeByRips(MLORip width, MLORip height) return CGSizeMake(fWidth, fHeight); } -CG_INLINE MLODpxSize +static inline MLODpxSize MLODpxSizeByRipSize(MLORipSize ripSize) { return MLODpxSizeByRips(ripSize.width, ripSize.height); @@ -176,6 +191,7 @@ MLORipPoint MLORipPointByDpxPoint(MLODpxPoint mloDpxPoint); MLODpxPoint MLODpxPointByMLORipPoint(MLORipPoint mloRipPoint); +#endif // selection _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits