Commit Graph

145 Commits

Author SHA1 Message Date
Sylvain Munaut 4a97b3e5d0 fosphor: Add the concept of "channels" which are overlaid on the display
These are purely display things that allow to highligh chunks of spectrum
of interest. (like currently selected channel)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 88227fea7f fosphor/cl: Properly release the FFT window memory buffer
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 8fb8606c38 fosphor: Drawing code overhaul + Introduce 'render options'
There is a lot of parameters that have no influence on the internal
computations but solely affect the rendering call. The height / width
are the only two that were supported previously.

This commit re-structures the drawing code and introduces a lot more
of those parameters. Instead of just passing them all as arguments, a
'struct fosphor_render' is introduced to hold them.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:38 +02:00
Sylvain Munaut a6a5ad8616 fosphor/cl: Fix tex coordinate in bicubic color mapping shader
The texture coordinates didn't match what the normal OpenGL bilinear
mapper does. It was off by half a texel.

This is needed because the color in the texture is considered to be a
sample at the center of the texel. (hence 0.5f, 0.5f offset removed)

For more details on bilinear from OpenGL :

http://hacksoflife.blogspot.be/2009/12/texture-coordinate-system-for-opengl.html

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:38 +02:00
Sylvain Munaut 3dd8d53490 gr-fosphor: Introduce a new glctx_update call back to refresh context
This is required for OSX where you need to tell the GL context when resize
has occured and stuff like that.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-01-12 11:01:38 +01:00
Sylvain Munaut 4ca8954908 fosphor/main: Improve the error handling path of the benchmark utility
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-11 23:54:50 +01:00
Konstanty Bialkowski dadc1d14fa fosphor/build: Make clean target compatible with BSD
Author: Konstanty Bialkowski <konstanty@ieee.org>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-11 23:54:49 +01:00
Sylvain Munaut 4913fd79d9 fosphor/cl: Prefer AMD/NVidia GPUs
On system with an integrated gpu + external gpu, the integrated one looks
great "on paper". Plenty of local ram, plenty of compute units, ...

But in practice, it sucks against the external one. So here, we prefer
NVidia / AMD.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-11 23:54:49 +01:00
Sylvain Munaut d58643fa89 gr-fosphor: Add proper dependency tracking in resource_data.c generation
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-06 13:28:44 +01:00
Sylvain Munaut f5cee5f826 fosphor: Fix double free in the init failure case
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-13 23:57:15 +01:00
Sylvain Munaut fd3d6cf77d gr-fosphor: Allow to select custom FFT window from the gr::fft:window list
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut ce907419c7 fosphor: Make the FFT window dynamic
- It's not longer hardcoded / computed in the kernel, but computed
   once and read from constant memory
 - By default it uses a periodic Hamming window
 - But you can load any window as a simple array of float
 - Different types of window is deemed out-of-scope here. The default
   is provided just for convenience to have something valid.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut 3779600868 gr-fosphor/cmake: Switch to the new recommended GnuradioConfig
Rather than using our own copy of FindGnuradioRuntine

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut 8378696eea gr-fosphor/lib: Add the new source file "axis.c" to source list
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut 6d9396f686 gr-fosphor: Add frequency range (center/span) awareness
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut ba6024ee5f gr-fosphor: Setup a mechanism to apply settings in the processing thread
The setters can be called from any thrad and will just set the
member variables and a flag asking the main processing thread to apply
the new settings on the next iteration.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut 010face67b fosphor/gl: Add a proper "smart" frequency axis
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:07 +01:00
Sylvain Munaut 8e89f9cd8b fosphor/gl: Use the new glf_printf instead of manual sprintf/glf_draw_str
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut 7e12d64a69 fosphor/gl_font: Introduce new glf_printf convenience function
This avoids having to do a sprintf then a draw_str myself every time.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut 81a9ad16fd fopshor: Add frequency range (center/span) awareness
Although this is not actually used anywhere yet, but will be used in the
drawing routines to draw a proper scale.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut a2318a5994 gr-fosphor: Use the new fosphor_set_power_range call
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut ca3f391976 fosphor: Store the selected power range in the top level 'struct fosphor'
The CL code keeps its own copy since those values are tweaked to be
applied in the kernel. We may also need the callback in the future if
instead of storing them we reconfigure the kernel at that point.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut 3ccf1aa52d fosphor: Refactor to introduce more shared state between global/cl/gl
Originally I wanted the CL/GL part to be as separate as possible and
have no shared data. But it's too inconvenient since a beside the
CL / GL objects there is also configuration data that should be shared
and distributed between the two.

So instead we still have separate gl/cl state that are restricted but
the function act on a shared 'struct fosphor' object that contains
everything that's shared and exposed to both cl.c and gl.c

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut 68f0302bce fosphor: Misc typo & whitespace fixes
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-10 22:24:06 +01:00
Sylvain Munaut dfb5081b91 gr-fosphor: Link to python libraries if python is enabled
This is required for OSX. And although not strictly required for linux,
it doesn't hurt.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-06 18:53:34 +01:00
Sylvain Munaut 0ea1177108 gr-fosphor: Submit data for processing in adaptative batch sizes
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-04 22:24:22 +01:00
Sylvain Munaut 3e35c83ded fosphor/gl_cmap_gen: Use the float version of round
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-04 22:01:48 +01:00
Sylvain Munaut 4066201ca8 fosphor/fft: Fix the window formula
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-04 22:01:27 +01:00
Sylvain Munaut 869ba4d156 fosphor/cl: Use OpenCL 1.1 API for everything except OSX
It seems that some linux distro ship OpenCL 1.2 headers but a OpenCL 1.1
ICD ...

So we just use OpenCL 1.1 API everywhere and disable 1.1 deprecated
warnings.

OSX OTOH doesn't allow to disable the deprecated but at least ships
consistent headers/ICD so we use 1.2 is available.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-11-04 22:00:48 +01:00
Sylvain Munaut 180fd0042a gr-fosphor: Make the different GUI version optional
You'd don't have to have glfw, qt and wx all at once, you can select
which variant you want built.

Python support is also make fully optional

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 21:09:50 +02:00
Sylvain Munaut 6183eefc9a gr-fosphor: Add Qt widget version of the fosphor sink
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 21:07:14 +02:00
Sylvain Munaut e3732c0609 gr-fosphor: Add WX widget version of the fosphor sink
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 21:06:04 +02:00
Sylvain Munaut b056fcc1a8 gr-fosphor: Split block into base function and UI specific part
It's split into:

 - A generic "base" sink that handles pretty much everything except
   managing a GL context and getting the UI interaction for it
 - The GLFW specific part

This is preparation for for WX and QT widget implementations of a
fosphor sink.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 21:05:08 +02:00
Sylvain Munaut 062040ae70 gr-fosphor: Move to the _impl paradigm
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 21:03:03 +02:00
Sylvain Munaut 4f102ee334 fosphor: Add AMD include path to the standalone benchmark tool Makefile
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 17:54:52 +02:00
Sylvain Munaut bbbd9986a4 fosphor/gl_cmap: Use an explicit 'context' object rather than static var
I originally thought that even with multiple fosphor instance, the shaders
could just be shared. But if those instances are binded to different
GL Contexts, shaders aren't shared and so need to be recreated.

So all the gl_cmap shader stuff is now stored inside a fosphor_gl_cmap_ctx
struct and the latter is stored in fosphor_gl_state

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 17:52:43 +02:00
Sylvain Munaut 6b93698f16 fosphor/gl_cmap: Prefix enum with fosphor_ for consitency
Since all the cmap stuff is fosphor-specific and can't be really
reused, use the fosphor_ prefix for stuff exposed outside gl_cmap.c
itself.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 17:52:11 +02:00
Sylvain Munaut 36d05cfc57 fosphor/cl: Make the batch size dynamic and up to FOSPHOR_FFT_MAX_BATCH
Basically need to :
 - Set the kernel parameter at each kernel invocation
 - Modify the kernel to deal with wrap-around when writing the
   waterfall texture

The batch size still must meet some constraint :
 - Be a multiple of FOSPHOR_FFT_MULT_BATCH
 - Be less than FOSPHOR_FFT_MAX_BATCH

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 17:49:48 +02:00
Sylvain Munaut 020f5b1c6f fosphor: Make sure the FFT len is from #define everywhere
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 17:49:19 +02:00
Sylvain Munaut e828e7faff fosphor/cl: Add a debug block allowing to save compile CL binary for debug
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-26 17:48:25 +02:00
Sylvain Munaut 20fd7fac53 fosphor/cl: Allow the use of cl_khr_local_int32_base_atomics extension
Apparently there are some cards that are neither Nvidia SM1.1, nor
OpenCL 1.1 but that do have cl_khr_local_int32_base_atomics extension.

This is enough for fosphor to implement the histogram so add the
required code to test for it and enable its use in the kernel if
required.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-18 11:43:06 +02:00
Sylvain Munaut 6db631c466 fosphor/cl: Add a workaround for OSX hiding the NVidia attributes
OSX doesn't allow query of NV attributes even on NVidia cards so we just
assume any non-opencl 1.1 nvidia card that does OpenCL is a SM1.1 one.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-16 09:12:59 +02:00
Sylvain Munaut 32e410a8c8 fosphor/cl: Remove extraneous CL/xxx includes
Those are taken care of by the cl_platform.h wrapper now

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-16 09:12:32 +02:00
Sylvain Munaut aabc21b7f2 fosphor: Initial import of the core code
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-13 22:05:38 +02:00
Sylvain Munaut edfee19c61 Initial import of the GNURadio block
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-13 22:02:56 +02:00