summaryrefslogtreecommitdiff
path: root/src/gbm
AgeCommit message (Collapse)AuthorFilesLines
2018-11-20meson: Add tests to suitesDylan Baker1-1/+2
Meson test has a concepts of suites, which allow tests to be grouped together. This allows for a subtest of tests to be run only (say only the tests for nir). A test can be added to more than one suite, but for the most part I've only added a test to a single suite, though I've added a compiler group that includes nir, glsl, and glcpp tests. To use this you'll need to invoke meson test directly, instead of ninja test (which always runs all targets). it can be invoked as: `meson test -C builddir --suite $suitename` (meson test has addition options that are pretty useful). Tested-By: Gert Wollny <gert.wollny@collabora.com> Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2018-11-19gbm: add missing comma between stringsEric Engestrom1-1/+1
Fixes: d971a4230d54069c996bc "loader: Factor out the common driver opening logic from each loader." Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Eric Anholt <eric@anholt.net>
2018-11-16loader: Factor out the common driver opening logic from each loader.Eric Anholt3-74/+12
I copied the code from egl_dri2.c, but the functionality was equivalent between all the loaders other than their particular environment variables. v2: Drop the logging function equivalent to loader_default_logger() (requested by Eric, Emil). Move the SCons workaround across. Drop the now-unused driGetDriverExtensions() declaration that was lost in a rebase. Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> (v1) Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (v1)
2018-11-16gbm: Clarify acceptable formats for gbm_boDaniel Stone1-2/+2
gbm_bo_create() was presumably meant to originally accept gbm_bo_format enums, but it's accepted GBM_FORMAT_* tokens since the dawn of time. This is good, since gbm_bo_format is rarely used and covers a lot less ground than GBM_FORMAT_*. Change the documentation to refer to both; this involves removing a 'see also' for gbm_bo_format, since we can't also use \sa to refer to a family of anonymous #defines. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Eric Anholt <eric@anholt.net>
2018-11-15gbm: add new entrypoint to symbols checkEric Engestrom1-0/+1
Fixes: 6328536ff28ca26f2ad4e "gbm: Introduce a helper function for printing GBM format names." Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2018-11-13gbm: remove unnecessary meson includeEric Engestrom1-1/+0
`inc_wayland_drm` is only used if wayland is built, and it's already added in that case a few lines below. Fixes: a29869e8720b385d3692f "gbm: Don't traverse backwards for includes" Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-11-12gbm: Introduce a helper function for printing GBM format names.Eric Anholt2-0/+26
This requires that the caller make a little (stack) allocation to store the string. v2: Use gbm_format_canonicalize (suggested by Daniel) Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-11-12gbm: Move gbm_format_canonicalize() to the core.Eric Anholt3-16/+19
I want it for the format name debugging code. Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-10-09gbm: Add GBM_FORMAT_ARGB1555 supportMichel Dänzer1-0/+4
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2018-08-01gbm: Add support for 10bpp BGR formatsDaniel Stone1-0/+8
Add support for XBGR2101010 and ABGR2101010 formats. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com> Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com> Tested-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2018-06-13meson: Remove various completed todosDylan Baker1-2/+0
v3: - Remove "won't do" todos, so only completed todo's are now removed. Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> (v2)
2018-03-28gbm: remove never-implemented functionEric Engestrom2-3/+0
I assume this was implemented in a previous version of that commit, but was removed in the version that actually landed. Fixes: 8430af5ebe1ee8119e14 "Add support for swrast to the DRM EGL platform" Cc: Giovanni Campagna <gcampagna@src.gnome.org> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-07meson: Use include directory variables instead of traversingDylan Baker1-1/+1
Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Tested-by: Julien Isorce <julien.isorce@gmail.com> Tested-by: Karol Herbst <kherbst@redhat.com>
2018-03-05gbm: give a name to rgba fieldsEric Engestrom1-1/+6
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-02-26*-symbol-check: use correct `nm` path when cross-compilingEric Engestrom2-2/+2
Inspired-by: a similar patch for libdrm by Heiko Becker Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-02-23gbm: Fix the alpha masks in the GBM format table.Eric Anholt1-2/+2
Once GBM started looking at the values of the alpha masks, ARGB/ABGR wouldn't match any more because we had both A and R in the low bits. Fixes: 2ed344645d65 ("gbm/dri: Add RGBA masks to GBM format table") Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-02-15dri: fromPlanar() can return NULL as a valid resultLouis-Francis Ratté-Boulianne1-0/+1
It was assumed that fromPlanar() could return NULL to mean that the planar image is the same as the parent DRI image. That assumption wasn't made everywhere though. Let's fix things and make sure that all callers understand a NULL result Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-02-09gbm/dri: Expose visuals table through gbm_dri_deviceDaniel Stone2-11/+19
Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
2018-02-09gbm/dri: Add RGBA masks to GBM format tableDaniel Stone1-9/+37
Eventually, we can replace the visuals list inside GBM EGL driver with this one. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
2018-02-02meson: Don't confuse the install and search paths for dri driversDylan Baker1-1/+1
Currently there is not a separate option for setting the search path of DRI drivers in meson, like there is in scons and autotools. This is an oversight and needs to be fixed. This adds an extra option `dri-search-path`, which will default to the value of `dri-drivers-path`, like autotools does. v2: - Split input list before joining. v3: - use : instead of ; as the delimiter. The autotools help string incorrectly says ; but the code uses : v4: - Take list in pre : delimited form (Ilia) - Ensure that the dri-search-path is absolute when using dri_drivers_path Fixes: db9788420d4bc7b4 ("meson: Add support for configuring dri drivers directory.") Reported-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> (v2) Reviewed-by: Eric Engestrom <eric@engestrom.ch> (v3)
2018-01-19autotools: include meson build files in tarballDylan Baker1-1/+1
This adds the meson.build, meson_options.txt, and a few scripts that are used exclusively by the meson build. v2: - Remove accidentally included changes needed to test make dist with LLVM > 3.9 Signed-off-by: Dylan Baker <dylan.c.baker@intel.com> Acked-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-01-17mesa: remove unneeded semicolonsGrazvydas Ignotas1-1/+1
Trivial. Found by Coccinelle. Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2018-01-11meson: Use consistent style for testsDylan Baker1-1/+2
Don't use intermediate variables, use consistent whitespace. Acked-by: Eric Engestrom <eric.engestrom@imgtec.com> Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
2017-12-07meson: add dep_thread to every lib that includes threads.hEric Engestrom1-1/+1
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104141 Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2017-11-08wayland-drm: static inline wayland_drm_buffer_getEmil Velikov2-4/+2
The function is effectively a direct function call into libwayland-server.so. Thus GBM no longer depends on the wayland-drm static library, making the build more straight forward. And the resulting binary is a bit smaller. Note: we need to move struct wayland_drm_callbacks further up, otherwise we'll get an error since the type is incomplete. v2: Rebase, beef-up commit message, update meson, move struct wayland_drm_callbacks. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> (v1) Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> # meson bit only Acked-by: Eric Engestrom <eric.engestrom@imgtec.com> # for the rest Reviewed-by: Dylan Baker <dylan@pnwbakers.com> # meson
2017-11-07meson: standardize .so version to major.minor.patchEric Engestrom1-1/+1
This `version` field defines the filename for the .so. The plan .so as well as .so.$major are always symlinks to this. Unless I'm mistaken, only the major is ever used, so this shouldn't matter, but for consistency with autotools (and in case it does matter), let's always have all 3 major.minor.patch components. (The soname isn't affected, and is always .so.$major) Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2017-11-02gbm: Don't traverse backwards for includesDylan Baker3-5/+10
This is just a bad idea and should be avoided. Instead, make the #include flat and fix the build systems to pass the proper -I flags v2: - add an inc_wayland_drm instead passing a path to include_directories (Emil) - update commit message (Emil) Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> (v1) Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
2017-10-31meson: pass correct args to gbm symbol testEric Engestrom1-2/+4
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-31gbm: fail symbol check if lib is missingEric Engestrom1-1/+10
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-31meson: set visibility flags on gbmDylan Baker1-1/+1
This is done in autotools, and is an oversight in the meson build. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Tested-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-31meson: Don't link gbm with threadsDylan Baker1-1/+1
It's supposed to be linked with pthread-stubs (if the platform needs pthread-stubs). Pthread stubs support isn't (yet) implemented in the meson build, so add a TODO. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-20meson: build libEGLDylan Baker1-2/+10
This is based heavily on Daniel Stone's work for the same, rebased on master and with a number of TODO's fixed. This does not implement glvnd (which is coming in a later patch) Meson builds egl slightly differently than autotools, namely it doesn't build an intermediate shared library. It doesn't do this because meson doesn't have problems with the name of the library being dynamically generated, so the glvnd and non-glvnd code can follow the same path. v2: - Don't reuse variable (Eric E.) Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Tested-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-10-09meson: build gbmDylan Baker1-0/+67
This doesn't include egl support, just dri support. v2: - when gbm is set to 'auto', only build if a dri driver is also enabled - Fix conditional to check for x11 modules with vulkan as well as with dri drivers v3: - Set pkgconfig libraries.private value Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2017-09-19configure.ac: split the wayland client/server confusionEmil Velikov1-2/+2
At the moment wayland-clients, such as the Vulkan drivers were over-linking against libwayland-server.so. That went unnoticed, since both client and server code uses the wl*interface symbols, which are present in both libwayland-client.so and libwayland-server.so. I've looked at correcting that, although that's orthogonal to this fix. Note: wayland-egl does _not_ depend on wayland-client, although it does need wayland-egl.h. There's no distinct package that provides it (I have a WIP on the topic) so current solution will do for now. v2: Rebase with the "...inline wayland_drm_buffer_get" patch removed. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-09-17gbm: Add gbm_device_get_format_modifier_plane_count to testGert Wollny1-0/+1
Adding gbm_device_get_format_modifier_plane_count made the test gbm-symbols-check fail, this patch adds the according function name to the test. Fixes: 8824141b8d48d9120ddbf542d6fb661046c41c62 (gbm: Add a gbm_device_get_format_modifier_plane_count function) Signed-off-by: Gert Wollny <gw.fossdev@gmail.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Andres Gomez <agomez@igalia.com>
2017-09-14gbm: Add a gbm_device_get_format_modifier_plane_count functionJason Ekstrand4-0/+48
This allows the user to query the number of planes required by a given format+modifier combination without having to create a bo or surface. Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-09-12gbm: turn GBM_ALWAYS_SOFTWARE into a booleanEric Engestrom3-3/+9
Instead of setting based on set/unset, allow users to use boolean values. Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-08-04loader: rework xmlconfig dependencyEmil Velikov1-0/+1
Currently xmlconfig is conditionally used, only when --enable-dri is available. As the library has moved to src/util and has wider wisebase, this guard is no longer correct. Strictly speaking - it wasn't since the introduction of xmlconfig into st/nine a while ago. Unconditionally enable xmlconfig and drop the linking. As said before there's other users of the library, so depending on the configure options we will get multiple definitions of said symbols. NOTE: To avoid breaking other combinations, this commit adds the xmlconfig link to the required places - throughout gallium and the DRI loaders. Cc: Aaron Watry <awatry@gmail.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
2017-08-01gbm: add gbm_bo_get_bpp()Eric Engestrom3-0/+70
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-19gbm: fix typoEric Engestrom1-1/+1
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-07-19gbm: fix typo in doxygen commentGwan-gyeong Mun1-2/+2
This fixes the misspelling of gbm_bo_import api param. Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18gbm: Remove is_planar_format dead codeDaniel Stone1-30/+0
This was only used in create_dumb() to blacklist planar formats. However, the start of the function already whitelists ARGB8888 (cursor) and XRGB8888 (scanout), and nothing else. So this entire function can be removed. Reviewed-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18gbm: Check harder for supported formatsDaniel Stone1-15/+26
Luckily no-one really used the is_format_supported() call, because it only supported three formats. Also, since buffers with alpha can be displayed on planes, stop banning them from use. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18gbm: Pull out FourCC <-> DRIimage format tableDaniel Stone2-85/+70
Rather than duplicated (yet asymmetric) open-coded tables, pull them out to a common structure. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-18gbm: Axe buffer import format conversion tableDaniel Stone2-40/+28
Wayland buffers coming from wl_drm use the WL_DRM_FORMAT_* enums, which are identical to GBM_FORMAT_*. Similarly, FD imports do not need to convert between GBM and DRI FourCC, since they are (almost) completely compatible. This widens the formats accepted by gbm_bo_import() when importing wl_buffers; previously, only XRGB8888, ARGB8888, RGB565 and YUYV were supported. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-06-30gbm: add XBGR8888 support for dumb buffersRob Herring1-1/+1
Add GBM_FORMAT_XBGR8888 format support which is needed for Android. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-06-29Android: use symlinks for driver loadingRob Herring1-9/+0
Instead of having special driver loading logic for Android, create symlinks to gallium_dri.so so we can use the standard loading logic. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Rob Herring <robh@kernel.org>
2017-06-15gbm: implement FD import with modifierLucas Stach1-0/+54
This implements a way to import FDs with modifiers on plain GBM devices, without the need to go through EGL. This is mostly to the benefit of gbm_gralloc, which can keep its dependencies low. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Tested-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-06-15gbm: add API to to import FD with modifierLucas Stach1-0/+12
This allows to import an FD with an explicit modifier passed through userspace protocols. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Tested-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-05-29gbm: manage only the required set of DRI extensionsEmil Velikov2-2/+0
Currently GBM attempts to know all the extensions that might be required by EGL/DRM [at some later stage]. That is a bit unclear and we often forget to update GBM as EGL gets attention. To avoid that, simply let EGL manage it's own required extensions based on the base primitive (screen) we provide it. v2: Rework the approach - GBM should not dive into EGL/DRM. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Tested-by: Rob Herring <robh@kernel.org>