summaryrefslogtreecommitdiff
path: root/common.c
Commit message (Collapse)AuthorAgeFilesLines
* Returns -1 when shaders creation failsFang Tan2022-09-021-2/+9
|
* kmscube: check return value when creating GBM deviceAdrián Larumbe2022-09-021-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>
* surfaceless supportRob Clark2020-09-021-6/+148
|
* gbm: split out helper to initialize surfaceRob Clark2020-09-021-8/+15
|
* kmscube: add AMD_performance_monitor supportRob Clark2020-03-071-0/+12
| | | | | Only wired up for shadertoy mode, other modes aren't likely to be interesting.
* add fps reportingRob Clark2020-03-071-0/+8
|
* kmscube: make fb/gl config format settable on cmdlineIlia Mirkin2019-08-301-2/+2
| | | | | | | | Instead of changing the code each time, allow the fourcc to be passed in as an argument. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Rob Clark <robdclark@gmail.com>
* common: free temporary log bufferEric Engestrom2018-10-191-0/+3
|
* add MSAARob Clark2018-06-191-2/+3
| | | | | Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* gbm: fix fallback for drivers that don't support modifiersRob Clark2018-06-191-1/+4
| | | | | | | | | | Gallium drivers that do not implement resource_create_with_modifiers() will fail gbm_surface_create_with_modifiers() so fall back to the old way. Fixes: 4f7cec0 Use weak functions to handle lack of gbm modifiers Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* cube-tex: make use of modifiersChristian Gmeiner2018-04-031-0/+3
| | | | | | | | | | | | | | | | Fixes rendering issues with mode rgba on etnaviv. I have applied the same change for nv12 variants but they are not supported on etnaviv. v1 -> v2: - check if EGL_EXT_image_dma_buf_import_modifiers is supported - use weak function trick for gbm_bo_get_modifier(..) v2 -> v3: - check if modifier != DRM_FORMAT_MOD_INVALID Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* Use weak functions to handle lack of gbm modifiersEmil Velikov2018-04-021-11/+21
| | | | | | | | | | | | | | Add weak function declaration and check if they're valid prior to calling the functions. This allows us to remove conditional compilation, yet allowing the modifiers codepath to work if API is available. Cc: Christian Gmeiner <christian.gmeiner@gmail.com> Cc: Rob Clark <robdclark@gmail.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com>
* Rework default modifier handlingEmil Velikov2018-04-021-21/+2
| | | | | | | | | | | | | Currently the default modifier is MOD_INVALID. At a later stage, if the modifier is the same (the user may have explicit selected MOD_INVALID), we'll fallback to MOD_LINEAR. Simplify things to a) use MOD_LINEAR by default b) use the user modifier - even if they request MOD_INVALID. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com>
* formats: use weston's egl config matching logic, centralize formatIlia Mirkin2018-02-161-5/+73
| | | | | | | | | | The GBM surface format has to match the DRM mode. Both are used in a couple of places, so unify it so that it's only set in one place. Note that the GBM and DRM formats are identical. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* atomic: Use CPU-side KMS fence synchronisationDaniel Stone2017-05-021-0/+1
| | | | | | | | | | | | | | Atomic does not let us have multiple requests in flight at once; if we don't synchronise with the request completion on the CPU side, we can get -EBUSY from the atomic commit. We already have everything required to do this, namely the out-fence from the last commit. Block on that with a CPU-side wait before we call atomic commit, to make sure we'll never attempt to queue an atomic commit before the previous one has completed. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* common: Check for extensions before resolving symbolsDaniel Stone2017-05-021-12/+51
| | | | | | | | | | | | | | eglGetProcAddress is allowed to return any old garbage for symbols it doesn't know about. To avoid any mishaps, check for the appropriate extension presence (split into EGL client extension, EGL display extension, and GL extension, checks) before we look up any symbols through it. The walk through the extension list is taken from libepoxy. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* output more and improved information about EGL and OpenGL ES 2.xCarlos Rafael Giani2017-04-291-4/+13
| | | | Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
* common: Give cmdline parameter for forcing modifiersBen Widawsky2017-04-141-6/+12
| | | | | Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* common: use drmModeAddFB2* API over the legacy drmModeAddFB oneBen Widawsky2017-04-141-5/+5
| | | | | | | Note: nothing happens here yet since LINEAR == 0. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* common: Use the create with modifiers interfaceBen Widawsky2017-04-141-0/+22
| | | | | Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* add atomic kms supportRob Clark2017-02-251-0/+4
| | | | Based mostly on original atomic conversion from Gustavo Padovan.
* split out legacy (pageflip) kmsRob Clark2017-02-221-0/+3
| | | | Preping to add new atomic alternative path.
* add yuv/rgb tex modeRob Clark2017-02-211-0/+3
|
* split out smooth-shaded cubeRob Clark2017-02-211-0/+79
|
* split out get_program() helperRob Clark2017-02-211-0/+80
|
* split gbm outRob Clark2017-02-211-0/+44