Commit Graph

155 Commits

Author SHA1 Message Date
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
Sylvain Munaut 9433e60478 fosphor/cl: Handle CL 1.1 vs 1.2 differently
The OpenCL 1.2 is nicer but we can't always use it and on linux,
even if the CL_VERSION_1_2 exists, we can't trust it because distrib
sometimes have CL 1.2 headers with a CL 1.1 dispatcher.

So instead, we only assume we have 1.1 header and lib at compile time.
Then at run-time we do a dynamic lookup of the 1.2 symbols from the lib.
We also check if the actual selected platform does support 1.2 (you
could have a 1.2 dispatcher with a 1.1 platform implementation).

If both conditions are satisfied, then we dispatch the call to the 1.2
implementation and if not, then we dispatch them to a local fallback
implementation of the functions (but limited to the functions we need)

It's not pretty but it should work and it isolates all the hack magic
inside cl_compat.{c,h} and you just use the CL1.2 API normally outside
of it.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut cc9f988a20 fosphor/cl: Increase the length of the 'vendor' field
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut 4cc7461c09 fosphor/cl: Use the _WIN32 conditional instead of __WIN32__
cl_platform.h will convert any sign of windows to this symbol and this
is also the one use for the include at the top, so use it everywhere.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut 02e0db8fdb fosphor/main: Fix the render option initialization sequence
Since the width/height will be set as part of the initial reshape
callback and this is done in glfw_init, we need to make sure we
do the first init of the render option _before_ that, or we'll
undo what glfw_init did.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:06 +02:00
Sylvain Munaut 65a19326d4 fosphor: Minor doc fix in fosphor.h
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:05 +02:00
Sylvain Munaut 5ca19a2667 gr-fosphor: Update year in copyright notice
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:05 +02:00
Sylvain Munaut 0af84185f5 fosphor: Update year in copyright notice
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-24 22:34:05 +02:00
Sylvain Munaut 30dbdbde79 gr-fosphor/cmake: Fix FindFreetype2 to properly cache the include dir var
Without caching, this would cause a problem with headers not being found
if you did the cmake step twice because the FREETYPE2_FOUND var is cached
and so it wouldn't run through that script again and wouldn't set
FREETYPE2_INCLUDE_DIRS.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut b24ba23784 fosphor: Fix layout routing to avoid half pixel offset
'over' variable needs to be an integer or we'll end up shifting stuff
by half a pixel which causes weird render, especially for fonts.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut 5d9665c000 fosphor/gl_cmap_gen: Introduce a helper to set RGBA values from float R,G,B
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut 4c08178d89 fosphor/cl: Fix wrong length param when fetching CL_PROGRAM_BINARIES
This would cause a crash when using AMD's CPU OpenCL implementation

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut 4254a3a714 gr-fosphor: Export method to retrieve the underying QWidget
This is to allow usage in pure c++ flow graph

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:40 +02:00
Sylvain Munaut 2140ef7bb1 gr-fosphor: Add 'SPACE' as a 'freeze' control to pause the processing
In background samples are just discarded.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 2fa5b6cf67 fosphor/gl: Fix the frequency axis when freq_{start,stop} are used
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 223968ad8e fosphor: Automatically select the number of division depending on width
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut aa5b1de867 fosphor/gl_font: Add a method to compute the total width of a given string
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 36cc3e2341 fosphor/axis: Allow variable number of divisions
Need to have an _even_ number of divisions though !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut a176de27b8 fosphor/axis: Fix scaling of largest frequency
The largest frequency can be negative, make sure to account for this !

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut 351af1f7e5 gr-fosphor: Update to fosphor new 'render options' model and add zoom
Note that the d_zoom_* vars are kept as double to avoid error build-up
when changing them a lot from the UI.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
Sylvain Munaut affd1a3eb7 fosphor: Update the test software to showcase the new display functions
Note that the zoom_* vars are kept as double to avoid error build-up
when changing them a lot from the UI.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-07-22 10:16:39 +02:00
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