summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-06-23kmscube: turn buf_to_fd() into a helper reused by cube-texHEADmasterAndrew Davis4-140/+69
Do as the TODO comment in gst-decoder.c suggests and turn this function into a common helper. Signed-off-by: Andrew Davis <afd@ti.com>
2025-06-04kmscube: factor out FPS reportingAndrew Davis5-88/+69
The FPS code is common for each run loop. Factor this out into and put in perfcntrs.c. Signed-off-by: Andrew Davis <afd@ti.com>
2025-06-04kmscube: factor out init_egl() from each cube initAndrew Davis12-68/+73
The call to init_egl() can be made before calling the cube init function. This allows it to be factored out into a common location. struct egl is then passed in to each init() for use as needed; the same as struct gbm. As the cube init function no longer needs to modify struct egl outside of setting the draw function, to keep egl const move the draw call out of egl. It didn't make much sense in here to begin with and seems to have been placed in this struct out of convenience. Move the draw function to a new struct of cube specific data. Signed-off-by: Andrew Davis <afd@ti.com>
2025-06-04kmscube: refactor init_egl() to return a new egl instanceAndrew Davis7-67/+64
This matches init_gbm() and allows for more refactoring in later patches. Signed-off-by: Andrew Davis <afd@ti.com>
2025-06-04kmscube: store width and height instead of gbmAndrew Davis2-7/+8
For a couple cubes we only store the gbm struct to get access to the screen buffer resolution. Just store the resolution directly. Signed-off-by: Andrew Davis <afd@ti.com>
2025-06-04cube-gears: Remove unneeded extension checksAndrew Davis1-5/+0
These EGL extension are not used in this cube, remove these checks. Signed-off-by: Andrew Davis <afd@ti.com>
2024-11-06kmscube: gears: use only GLES2Erico Nunes1-3/+1
The gears mode currently depends on either GLES3 or desktop GL to build, but in both cases without a proper meson dependency check. It also doesn't really use any features which would require those GL versions over GLES2, which is already a global dependency of kmscube. So just change it to use symbols which are available in GLES2 and it can be built and run in all platforms. Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2024-09-26common: fix cast type in init_egl()Eric Engestrom1-1/+1
On some platforms, `EGLNativeDisplayType` is an int instead of a pointer, in which case the void pointer will raise a `-Wint-conversion`. Let's cast it to the correct type directly. Closes: https://gitlab.freedesktop.org/mesa/kmscube/-/issues/16
2024-09-26gst-decoder.c: switch to decodebin3Hugues Fruchet2-2/+2
decodebin3 is no more experimental since GStreamer-1.22: https://gstreamer.freedesktop.org/releases/1.22 decodebin3 is now prefered to decodebin till GStreamer-1.24: https://gstreamer.freedesktop.org/releases/1.24 This solves negotiation issues encountered with V4L2 stateless hardware video decoders when using kmscube video playback option. Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2024-09-24kmscube: warn of missing mode argument in offscreen rendersAdrian Larumbe1-0/+5
Offscreen renders need an explicit video mode to be passed by the user. However, when it's missing, current error handling just says that initialising a DRM device failed, which sounds a bit misleading. Add a warning message asking for a video mode command line parameter. Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com> Apply 1 suggestion(s) to 1 file(s) Co-authored-by: Eric Engestrom <eric@engestrom.ch>
2024-05-07Allow running in background with STDIN set to O_NONBLOCKINGMarkus Niebel6-23/+33
Since commit 38986c1 (kmscube: add option to run for specified # of frames) we have the option of running for a given number of frames. This allows usage for instance in automatic system tests like climate chamber etc. To allow starting in background without termination from STDIN add a new option that prevents polling / selecting for console input. Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
2024-02-26kmscube: Fix incorrect modifier check in create_framebuffer functionChristopher Michael1-9/+7
When importing an egl image from a linux dma buf fd, we need to pass the proper image attributes to eglCreateImageKHR. The modifier check here should not ignore DRM_FORMAT_MOD_LINEAR when setting EGL_DMA_BUF_PLANE0_MODIFIER_LO/HI_EXT else the ordering of samples within a plane will be incorrect, resulting in incorrect/garbled pixels being presented. v2: Update code changes to set EGL_DMA_BUF_PLANE0_MODIFIER_LO/HI whenever an extension exposes modifiers so that INVALID modifiers are accepted (Daniel Stone)
2023-09-26kmscube: Add gears modeScott Moreau4-3/+797
Use gears mode with -g or --gears to render gears on each cube face. Renders gears to texture once and then renders the texture on each face. Based on cube-tex.c and of course, gears.
2023-09-26es: Update to prepare for gears modeScott Moreau2-51/+87
- Add esInvert() function - Add esTranspose() function - Rewrite esRotate() function - Set identity matrix at beginning of esFrustum()
2023-09-26ci: enable MR pipelinesEric Engestrom1-0/+8
2023-08-02Revert "ci: use gitlab proxy to avoid hitting dockerhub every time"Eric Engestrom1-2/+2
This reverts commit f296635648ba31454bfe6a9ff7495f6b28af26ec
2023-07-26kmscube: Add [-n N] option to specify connector IDRalph Campbell6-22/+51
Kmscube currently selects the first connector that has a link status of connected. Add a command line option to use a specific connector if more than one connector has a connected link status. Signed-off-by: Ralph Campbell <ralphcampbell1@gmail.com>
2023-07-12kmscube: add offscreen rendering supportDmitry Baryshkov5-3/+200
It is useful to be able to render the kube without touching the KMS. For example, this allows us to utilise DRM render devices or to measure the performance without waiting for vblank. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
2023-07-08ci: use gitlab proxy to avoid hitting dockerhub every timeEric Engestrom1-2/+2
Signed-off-by: Eric Engestrom <eric@igalia.com>
2023-07-07ci: stop using the deprecated implicit `setup` commandEric Engestrom1-1/+1
Signed-off-by: Eric Engestrom <eric@igalia.com>
2023-07-07ci: extend from a common job instead of using a bunch of yaml anchorsEric Engestrom1-15/+11
Signed-off-by: Eric Engestrom <eric@igalia.com>
2023-07-07ci: bump meson to 0.48Eric Engestrom1-1/+1
Because 0.47 is not compatible with python 3.10 that debian now ships. Signed-off-by: Eric Engestrom <eric@igalia.com>
2023-07-07ci: force installation of python packagesEric Engestrom1-1/+1
debian's python is now also marked as EXTERNALLY-MANAGED (see PEP 668), which means that if we still want to install packages through pip we need to either create a venv (overkill here), or add `--break-system-packages`. Signed-off-by: Eric Engestrom <eric@igalia.com>
2023-07-07ci: drop wheel & setuptools install now that they are includedEric Engestrom1-1/+0
Signed-off-by: Eric Engestrom <eric@igalia.com>
2023-05-19perfcntrs.c: remove include GLES3/gl3.hErico Nunes1-2/+0
This is not needed to build, and the functionality is also compatible with GLES2 only. Fixes build in environment with only GLES2 headers. Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
2023-04-13meson: check GLES3 header within GLESv2 include dirsJan Beich1-1/+1
Run-time dependency glesv2 found: YES 3.2 Check usable header "GLES3/gl3.h" : NO meson.build:65: WARNING: GLES3 not supported; shadertoy & texturator are NOT included in this build Fixes: 61fb902a021e ("meson: replace gles version check with a header presence check")
2023-03-28fix typosHarri Nieminen2-3/+3
found by codespell
2022-11-10meson: upgrade the "GLES3 not supported" message into a warningEric Engestrom1-1/+1
2022-11-10meson: replace gles version check with a header presence checkEric Engestrom1-3/+4
As explained in #8, there are GLES implementations out there that report bogus version numbers for the GLESv2 lib, so we can't actually use that version number reliably. Closes: https://gitlab.freedesktop.org/mesa/kmscube/-/issues/8
2022-09-02drm-common: fix return type of find_crtc_for_connector() & ↵Eric Engestrom1-4/+4
find_crtc_for_encoder() They return -1 on error, so it needs to be signed. Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2022-09-02make GLES3 optionalEric Engestrom2-10/+30
This means that `shadertoy` & `texturator` might not be supported in a given build. Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2022-09-02texturator: Use correct GL extension headerDamian Hobson-Garcia1-1/+1
gl2ext.h is the extenstion header for OpenGL ES 2.0 and all later versions according to the Khronos documentation [1]. gl3ext.h is either an empty stub, or may not even exist on some platforms. [1]: https://www.khronos.org/registry/OpenGL/index_es.php#headers
2022-09-02Returns -1 when shaders creation failsFang Tan1-2/+9
2022-09-02drm-common.c: do not use invalid modifierAlexander Kanavin1-1/+1
Prior to kernel 5.19 this was a soft failure, but 5.19 adds checks that result in a hard syscall fail.
2022-09-02kmscube: check return value when creating GBM deviceAdrián Larumbe1-1/+4
In the off-chance that gbm_create_device fails and returns a NULL value, further down the line a segfault will be triggered when dereferencing gbm.dev. Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
2022-09-02drm: fix crtc not found conditionalTom Stokes1-1/+1
find_crtc_for_connector returns -1 if no crtc found, not 0
2022-09-02ci/latest: use image with base-devel pre-installedEric Engestrom1-2/+1
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2022-09-02ci/latest: fix build as dockerhub image was renamedEric Engestrom1-1/+1
This should've been done a year and a half ago, but I didn't look at this repo... Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2021-02-07Revert "Multiple GL_ TRIANGLE_ STRIP draw merge."Kristian H. Kristensen1-1/+6
This reverts commit 2418cfe7e7af581698b85f51e849d20c876b17e3
2021-02-07Multiple GL_ TRIANGLE_ STRIP draw merge.Fang Tan1-6/+1
2020-10-28drm: grab correct handle for plane != 0Lucas Stach1-3/+7
Multiplanar formats can have different BOs for each plane, so call the correct GBM function to get the handle for a specific plane.
2020-09-02surfaceless supportRob Clark6-20/+205
2020-09-02gbm: split out helper to initialize surfaceRob Clark1-8/+15
2020-03-31texturator: Fix float to bool conversion warningFabio Estevam1-1/+1
The following build warning is seen: ../texturator.c:603:45: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context] *complemented = (((float)rgba[2]) / 255.0) / 0.25; Fix it by using the != 0.0f construction to properly convert from float to bool. Signed-off-by: Fabio Estevam <festevam@gmail.com>
2020-03-31texturator: Only define png variable when libpng is presentFabio Estevam1-0/+2
When libpng is not present the following build warning is seen: ../texturator.c:98:13: warning: 'png' defined but not used [-Wunused-variable] static bool png; Fix it by only defining the png variable when HAVE_LIBPNG is defined. Signed-off-by: Fabio Estevam <festevam@gmail.com>
2020-03-31meson.build: Change c_std to gnu99Fabio Estevam1-3/+3
Since commit 301a556b8ece ("add fps reporting") the <time.h> header is included, which causes build failures with c99 extension on ARM32: ../common.c: In function 'get_time_ns': ../common.c:376:18: error: storage size of 'tv' isn't known struct timespec tv; ^~ ../common.c:377:16: error: 'CLOCK_MONOTONIC' undeclared (first use in this function) clock_gettime(CLOCK_MONOTONIC, &tv); Change c_std to gnu99 to fix the build error as explained at: https://gcc-help.gcc.gnu.narkive.com/8xCaKI6r/problem-with-struct-timespec-and-c99-standard c99 has been used since commit 6cbd03ab9406 ("Makefile.am: Add -std=c99 to CFLAGS") to fix the following mips64el build failure: "cube-tex.c:230:2: note: use option -std=c99 or -std=gnu99 to compile your code" Use c_std=gnu99 to make both mips64el and ARM32 happy. Signed-off-by: Fabio Estevam <festevam@gmail.com>
2020-03-07kmscube: add AMD_performance_monitor supportRob Clark8-2/+542
Only wired up for shadertoy mode, other modes aren't likely to be interesting.
2020-03-07kmscube: also print final fps stat at exitRob Clark2-0/+12
2020-03-07kmscube: add option to run for specified # of framesRob Clark6-14/+27
2020-03-07add fps reportingRob Clark4-0/+54