summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-04-14common: Give cmdline parameter for forcing modifiersmod-prepBen Widawsky3-10/+33
2017-04-14common: use drmModeAddFB2* API over the legacy drmModeAddFB oneBen Widawsky3-11/+41
Note: nothing happens here yet since LINEAR == 0.
2017-04-14common: Use the create with modifiers interfaceBen Widawsky1-0/+22
2017-04-13configure: Check for the GBM modifiersBen Widawsky1-0/+16
2017-04-13drm: Provide a failure path when getting the fbBen Widawsky2-0/+17
This is helpful for debugging as you will bail early with an error message instead of a random SIGSEGV (or something more obscure).
2017-04-13usage: Add missing -V to usage() (trivial)Ben Widawsky1-1/+1
2017-04-13drm-common: Fix typo in commentBen Widawsky1-1/+1
2017-04-08kmscube: map --atomic to atomic modesetting :)Eric Engestrom1-1/+1
Fixes: 87e3ff5683ee54228b3e ("add atomic kms support") Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2017-04-07drm-legacy: Use correct DRM event context versionDaniel Stone1-1/+1
DRM_EVENT_CONTEXT_VERSION is the latest context version supported by whatever version of libdrm is present. kmscube was blindly asserting it supported whatever version that may be, even if it actually didn't. With libdrm 2.4.78, setting a higher context version than 2 will attempt to call the page_flip_handler2 vfunc if it was non-NULL, which being a random chunk of stack memory, it might well have been. Set the version as 2, which should be bumped only with the appropriate version checks. Signed-off-by: Daniel Stone <daniels@collabora.com>
2017-04-05Fix GBM image formats v2Thomas Hellstrom2-8/+6
When the GBM BOs are created, they are created using a bo with a correct memory requirement but with an incorrect channel layout. This makes drivers that are picky about matching formats (svga/vmwgfx) complain. Use the correct GBM formats and require GBM >= 13.0 to make sure they are available. v2: Remove a couple of stale comments Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-03-27add video cubeRob Clark7-4/+782
Uses gstreamer for a simple decoder. If decoder can give us dma-buf's directly, we'll directly use that as a texture (zero copy), otherwise memcpy into a buffer from gbm. This should work with both hw and sw decoders. Probably room for improvement. And the interface between gl and the decoder is pretty simple so I suppose other decoders would be possible. (But hopefully they could already be supported via gstreamer.) Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-27cube-tex: make a couple things staticRob Clark1-2/+2
(otherwise there will be symbol conflicts in the next patch.. also these should be const) Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-03-27add license fileRob Clark1-0/+18
Signed-off-by: Rob Clark <robdclark@gmail.com> Acked-by: Eric Engestrom <eric@engestrom.ch> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-21Makefile.am: Add -std=c99 to CFLAGSFabio Estevam1-0/+1
Currently the following build errors are seen on mips64el: cube-tex.c: In function 'get_fd_rgba': cube-tex.c:230:2: error: 'for' loop initial declarations are only allowed in C99 mode for (uint32_t i = 0; i < texh; i++) { ^ cube-tex.c:230:2: note: use option -std=c99 or -std=gnu99 to compile your code cube-tex.c: In function 'get_fd_y': cube-tex.c:261:2: error: 'for' loop initial declarations are only allowed in C99 mode for (uint32_t i = 0; i < texh; i++) { ^ cube-tex.c: In function 'get_fd_uv': cube-tex.c:292:2: error: 'for' loop initial declarations are only allowed in C99 mode for (uint32_t i = 0; i < texh/2; i++) { ^ Add the -std=c99 option in CFLAGS to fix this problem. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-03-21drm-legacy: Include <sys/select.h>Fabio Estevam1-0/+1
Include <sys/select.h> to fix the following build error seen on mips64el: drm-legacy.c: In function 'legacy_run': drm-legacy.c:45:2: error: unknown type name 'fd_set' fd_set fds; ^ drm-legacy.c:55:2: warning: implicit declaration of function 'FD_ZERO' [-Wimplicit-function-declaration] FD_ZERO(&fds); ^ drm-legacy.c:56:2: warning: implicit declaration of function 'FD_SET' [-Wimplicit-function-declaration] FD_SET(0, &fds); ^ drm-legacy.c:94:4: warning: implicit declaration of function 'select' [-Wimplicit-function-declaration] ret = select(drm.fd + 1, &fds, NULL, NULL, NULL); ^ drm-legacy.c:101:4: warning: implicit declaration of function 'FD_ISSET' [-Wimplicit-function-declaration] } else if (FD_ISSET(0, &fds)) { ^ Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-03-19kmscube: Remove unneeded bracketsFabio Estevam1-3/+2
There is no need to use brackets for single line if statements, so simply remove them. Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-18cube-tex: Handle SMOOTH switch caseFabio Estevam1-0/+3
In kmscube.c there is the following logic: if (mode == SMOOTH) { egl = init_cube_smooth(gbm); } else { egl = init_cube_tex(gbm, mode); } ,which makes init_cube_tex() to be never called on the SMOOTH case. Handle the SMOOTH switch case inside init_tex() to fix the following build warning: cube-tex.c: In function 'init_tex': cube-tex.c:438:2: warning: enumeration value 'SMOOTH' not handled in switch [-Wswitch] switch (mode) { ^ Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch> [Eric: add assert()] Signed-off-by: Eric Engestrom <eric@engestrom.ch>
2017-03-15drm-legacy.c: suppress 'unused parameter' warningsEric Engestrom1-0/+3
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-15drm-common.c: remove unused variable `gbm`Eric Engestrom1-1/+0
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-15drm-atomic.c: remove unused variables `gpu_fence_fd`, `kms_fence_fd`Eric Engestrom1-4/+0
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-15drm-atomic.c: remove unused variables `i`Eric Engestrom1-2/+1
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-15drm-atomic.c: fix signed comparisonEric Engestrom1-1/+1
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-15cube-tex.c: fix signed comparisonEric Engestrom1-3/+3
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-15kmscube.c: don't return uninitialized variableEric Engestrom1-2/+2
`ret` isn't used by anything, so remove it as well. Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-15.gitignore: cleanups no-longer applicable filesEmil Velikov1-17/+0
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-15configure.ac: remove no-longer applicable m4 folderEmil Velikov3-8/+0
With the removal of libtool as of last commit we no longer need the m4 folder or any of the related infra. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-15configure.ac: remove unused AC_PROG_LIBTOOLEmil Velikov2-6/+2
We're creating a single binary with no static/shared libraries. We implicitly relied on the macro to pull AC_PROG_CC, so we should add it now, otherwise configure will fail. As a nice bonus, with the last three commits combined the execution time of autogen.sh drops by more than half. before after real 0m7.965s 0m3.661s user 0m4.530s 0m1.280s sys 0m0.280s 0m0.070s Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-15configure.ac: remove useless AC_CONFIG_* macrosEmil Velikov1-2/+0
Namely: AC_CONFIG_SRCDIR - it's used to "help" people who deliberatelly override --srcdir. Nobody should be doing this to begin with, so just let them get what they're asking for. AC_CONFIG_HEADERS - we don't have any conditionals, function or macro checks. Hence we don't need the header. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-15configure.ac: wire -Wall -Wextra directly into the buildEmil Velikov2-38/+1
Both flags are widely available and the rest of MAYBE_WARN are of little interest. Since atm no flags were passed, we might as well not bother with anything but the former two. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> --- This will prompt some warnings, but we can sort this at a later stage.
2017-03-14drm-common.h: forward-declare needed structsEric Engestrom1-0/+3
drm-common.h:63:49: warning: ‘struct egl’ declared inside parameter list will not be visible outside of this definition or declaration int (*run)(const struct gbm *gbm, const struct egl *egl); ^~~ drm-common.h:63:26: warning: ‘struct gbm’ declared inside parameter list will not be visible outside of this definition or declaration int (*run)(const struct gbm *gbm, const struct egl *egl); ^~~ Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-03-13fix compile break with old EGL headersRob Clark1-0/+17
We would fall-back to eglGetDisplay() if EGL_EXT_platform_base is not supported, but that still required at least compiling against recent EGL headers.
2017-03-13Remove unneeded GL_GLEXT_PROTOTYPES defineEmil Velikov1-1/+0
The define itself is sort of a hack for cases where one wants to static link against extensions. Instead one should be calling {egl,glX}GetProcAddress as clearly documented. Since our code is sane enough to not depend on the static link, simply drop the quirky define. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-13Rename drm.[ch] to drm-common.[ch]Emil Velikov6-9/+9
Depending on the moon cycle and other factors we might end up including the local or libdrm version of drm.h. Simply rename the files to make it distinct and easy to track and manage. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-13Remove hacky "drm/" prefix in include pathEmil Velikov1-1/+1
The file is provided by the libdrm which knows about the location. Since we already honour the Cflags provided by libdrm, any potential build issues are most likely due to broken package shipped by the distro. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-13Resolve link issue due to unresolved symbol sqrtfEmil Velikov1-1/+1
Due to a missing trailing \ the -lm was not added to the LDADD and we'd fail at link time. Fixes: 1cdfb660a67 ("Move link against libm to LDADD") Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-13Add all source files to kmscube_SOURCESEmil Velikov1-2/+3
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-13configure.ac: fix project urlEric Engestrom1-1/+1
As announced by Rob Clark [1], the project has moved to fd.o [1] https://lists.freedesktop.org/archives/mesa-dev/2017-February/145745.html Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-03-13Move link against libm to LDADDEmil Velikov1-1/+2
Having -lm in CFLAGS might work, but is the wrong thing to do. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-13autogen.sh: set default sendemail.to/format.subjectPrefixEmil Velikov1-0/+6
Provide some sane defaults for patch submission. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-13autogen.sh: use exec to invoke configureEmil Velikov1-1/+1
There's no point in hanging in waitpid. Just exec the configure script. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-13autogen.sh: quote string variables, honour NOCONFIGUREEmil Velikov1-5/+7
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-13Add m4/.gitignoreEmil Velikov4-2/+7
It picks more components, from the autotools build system, allows us to remove the autogen.sh workaround. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-13configure: Stop using AM_MAINTAINER_MODEEmil Velikov2-2/+1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-03-10drm-atomic: Include <stdlib.h> header fileFabio Estevam1-0/+1
Include <stdlib.h> header file to fix the following build warning: CC kmscube-drm.o drm-atomic.c: In function 'init_drm_atomic': drm-atomic.c:346:14: warning: implicit declaration of function 'calloc' [-Wimplicit-function-declaration] drm.plane = calloc(1, sizeof(*drm.plane)); ^ drm-atomic.c:346:14: warning: incompatible implicit declaration of built-in function 'calloc' drm-atomic.c:346:14: note: include '<stdlib.h>' or provide a declaration of 'calloc' Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-02-25add atomic kms supportRob Clark7-4/+445
Based mostly on original atomic conversion from Gustavo Padovan.
2017-02-22split out legacy (pageflip) kmsRob Clark7-271/+387
Preping to add new atomic alternative path.
2017-02-21add yuv/rgb tex modeRob Clark5-4/+617
2017-02-21add nv12/rgba texture frame dataRob Clark3-0/+45128
2017-02-21split out smooth-shaded cubeRob Clark5-317/+382
2017-02-21split out get_program() helperRob Clark3-69/+98