Commit Graph

128 Commits

Author SHA1 Message Date
Sylvain Munaut e1eb11b2d8 gr-fosphor: Use FindOpenCL from cmake git master
Author: Martin Hauke <mardnh@gmx.de>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2016-01-25 16:27:00 +01:00
Sylvain Munaut 3a35735409 fosphor/cl: Allow to use APIs deprecated in CL >= 1.2
Really this fixes a2d35f201843c10cceddfbb64c6ed58bdeb03a88 ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2016-01-25 16:27:00 +01:00
Sylvain Munaut b17258f1fc fosphor: Don't redefine gettimeofday in mingw build
Thanks to Martin Hauke <mardnh@gmx.de> for reporting

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2016-01-25 16:27:00 +01:00
Sylvain Munaut acdddf6e90 fosphor: Use lowercase for WIN32 includes
Apparently needed for mingw build and doesn't affect the MSVC ones.

Thanks to Martin Hauke <mardnh@gmx.de> for reporting

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2016-01-25 16:27:00 +01:00
Sylvain Munaut 12c1a6d3f8 Revert "fosphor/gl_cmap_gen: Add new function to generate GL colormap from a PNG"
This reverts commit 585bac0316983286830f3bc50fce8247bad142f9.

This is causing issue with Ubuntu and its lack of libpng 1.6 ... so
removed for now.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-11-21 00:19:58 +01:00
Sylvain Munaut 4ae2f539df gr-fosphor: Add key bindings to the GRC blocks documentation tab
Thanks to Chris Kuethe for writing theses :p

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:23 +01:00
Sylvain Munaut 44465b9186 fosphor/cl: Retry context creation without CL/GL sharing if needed
This happens commonly on optimus laptop when CL is Nvidia and the GL
is the Intel card. They can't share data ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:23 +01:00
Sylvain Munaut a969e7fbb0 fosphor/cl: Don't fail fatally if a platform fails to return devices
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:23 +01:00
Sylvain Munaut 436b966b76 fosphor/mkresources: Don't generate string longer than 64k
Turns out some fucked up compilers (MSVC I'm looking at you) don't
support strings that are very long.

So in the resource compiler:
 - Change binary encoding to use a separate declaration and use array
   rather than string encoding
 - If a text file is > 64k, use the binary encoding method rather than
   string

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 48b7e9242c gr-fosphor: Make use of proper cmake commands to copy header in binary dir
This way it doesn't depend on platform specific 'cp' and 'mkdir' that
obviously won't work on WIN32.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 6d20a8f367 fosphor/gl_cmap_gen: Remove 'inline' qualifiers
Theses are not in header, and we don't really care about inlining, and
the compiler will most likely do it if it thinks its appropriate anyway.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut af9de650ac fosphor/gl_cmap_gen: Spacing fix in _set_rgba_from_hsv
Not sure where this came from ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 7944d0d976 fosphor/cl_compat: Fix goofs with calling convention
Doesn't matter on linux/osx because CL_API is nothing, but on Win32, it
changes things.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut f33ebdd28b fosphor/gl_cmap_gen: Add new function to generate GL colormap from a PNG
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 1780d4b43b fosphor/gl_cmap: Add a return value and void* arg to the generate func
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 773442b170 fosphor: Fix typo in headers MAXOSX vs MACOSX
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 484be3ccaa gr-fosphor: Remove shebang from wx_sink_c.py
Since this is not actually executable, don't need it and it apparently
creates some warning when making RPM packages ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 38c79bca9c fosphor/gl: Don't require a glFinish()
Since we always call swap buffer between a call to draw and
the next call to process(), we don't need it. In the future,
make this an option in case there is some usecase that require
it.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-10-25 21:41:22 +01:00
Sylvain Munaut 3fdfe7cf81 gr-fopshor: Add a MANIFEST for CGRAN
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-04-02 22:59:40 +02:00
Sylvain Munaut 985c78ffa7 fosphor/cl: Handle invalid (infinite/nan) data better so it recovers
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-20 21:54:52 +01:00
Sylvain Munaut 1603497411 fosphor/gl: Use the right cmap when drawing the histogram intensity scale
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-20 21:54:52 +01:00
Sylvain Munaut 7e195eea1b fosphor/cl: Allow to use APIs deprecated in 2.0 without warnings
This app is CL 1.1 compatible and so we're forced to use some API
that were deprecated in 2.0, no need to be constantly reminded of
it

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-20 21:54:52 +01:00
Sylvain Munaut 5aa7c2f7bd build: Fix CMake 3.x.x warnings
Corresponding commit in the cmake git tree :
2509c7678feb2efab79a384fd0b0b35cee8d02b0

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-20 21:54:52 +01:00
Sylvain Munaut 8c9d6a2152 gr-fosphor: Disable the color scale for the main view when zoomed
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 11f27973a9 fosphor: Add a color intensity scale on the right side
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 720e702ee9 fosphor/shaders: Use GLSL 1.3 instead of "1.5 compatibility"
I originally used 1.5 compatibility because it still allows immediate
mode / fixed pipeline without warning. But Intel Cards on linux and
OSX in general don't implement it.

Using 1.3 works fine since I don't need anything more recent, but
if you display the compilation results, it will for a deprecation
warning.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 95bb75593a fosphor/gl_font: Make sure to set GL_TEXTURE_ENV_MODE properly
GL_MODULATE is required and since it might be used in other mode for
other function, we need to set it explicitely.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 6da6cfe262 fosphor/gl: Allow fallback to GL_LUMINANCE32F_ARB internal format
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 64cf8a305b fosphor/gl: Use glTexSubImage2D for texture update
Much faster than glTexImage2D since it only updates the data
and doesn't delete/create a new storage space for the data.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 14:16:25 +01:00
Sylvain Munaut 1169b7efec fosphor/cl: Fix warning due to unused var
This should have been removed with a previous commit ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-19 00:23:58 +01:00
Sylvain Munaut 5510404207 fosphor/cl: Balance the score of local_mem size a bit more
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-18 23:35:51 +01:00
Sylvain Munaut 95f603cc51 fosphor/cl: Fix overflow when querying local_mem size
CL_DEVICE_LOCAL_MEM_SIZE is an unsigned long and can be quite large.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-18 23:35:51 +01:00
Sylvain Munaut b1ec76c2f4 fosphor/cl_compat: Blacklist POCL
POCL pretends to be OpenCL 1.2 but it doesn't implement some of the
required functions yet ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-18 23:35:51 +01:00
Sylvain Munaut f2ed7b07a3 fosphor: Acquire the GL objects before cleaning buffers in cl_finish
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-18 23:35:51 +01:00
Sylvain Munaut 36ce5e7843 gr-fosphor/qt: Explicitely set a size policy on the QGLSurface
Without it, some layout don't work and the widget ends up being zero sized

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-11-23 15:34:12 +01:00
Sylvain Munaut f16d0ffafb fosphor/cl: Make sure that all init is done before first render
If no data was processed, finished would return 0 and then the gl_refresh
would not be called which would lead to the GL deferred init to not be
executed which can crash the OpenGL driver.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-09-25 23:46:25 +02:00
Sylvain Munaut e1348d52aa gr-fosphor: Fix missing import in wx_sink error processing
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-09-25 23:46:25 +02:00
Sylvain Munaut 648937eda7 gr-fosphor: Remove useless .bak file
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-09-25 23:46:25 +02:00
Sylvain Munaut b7fc92ef58 gr-fosphor: CMake updates
- Update the GrXXX modules from the GNURadio counter parts
 - Remove the included FindGnuradio and rely on the installed one
   (force 3.7.3 since previous ones are broken)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-08-25 23:06:59 +02:00
Sylvain Munaut e2ce8e9a5c gr-fosphor: Prevent multiple thread from initializing fosphor in parallell
Although in theory there is nothing wrong with this and fosphor itself
should support it. However it seems some OpenCL implementation don't
really like having multiple context created in parallell, so we prevent
this manually here.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-08-25 21:20:32 +02:00
Sylvain Munaut a77d1950e3 gr-fosphor: Remove an old workaround for a swig bug
This has been removed of Gnuradio iteself in 2012 and this seems to
be causing issues for some OOT on some platforms ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-08-25 21:20:32 +02:00
Sylvain Munaut af2c08b571 fosphor/cl: Add missing stdlib.h include to cl_compat.c
Thanks to roox in IRC for pointing this out

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-08-25 21:20:31 +02:00
Sylvain Munaut dc1104a523 fosphor/cl: Properly set the 'err' variable when cl_load_program fails
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-08-25 21:20:31 +02:00
Sylvain Munaut 9aea19ae1b fosphor: Allow operation without CL/GL sharing extension
The basic idea is that we just create normal CL buffers, then whenever
we need to draw, we wait for CL completion, read the buffers into the
main memory and upload them as textures using plain GL.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:07 +02:00
Sylvain Munaut 566820e8b9 fosphor/cl: Pre-clears the various buffers before use
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut b717480e6e fosphor/cl: Track the current CL state to avoid doing useless stuff
When calling the process method several time without drawing, we don't
need to release the GL objects or even calling clFinish. So here we
internally keep track and only do the 'finishing up' of the CL process
when doing a drawing call.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut 35ec2209e4 fosphor/cl: Separate the buffer creation into separate helper
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut b94ca23981 fosphor/gl: Minor comment typo fix
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut 7e7387978c fosphor/cl: Add compatibility wrappers for more CL 1.2 functions
In particular clCreateImage, clEnqueueFillBuffer and clEnqueueFillImage

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut be1defecc4 gr-fosphor: Adapt the build to cope with the new CL compat system
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00