aboutsummaryrefslogtreecommitdiffstats
path: root/src/gbm
Commit message (Collapse)AuthorAgeFilesLines
* gbm/dri: Propagate queryDmaBufModifiers return valueMichel Dänzer2020-04-161-4/+2
| | | | | | | | | | | | | | | | | | | | We were treating count == 0 as the format not being supported at all, but queryDmaBufModifiers would return false in that case. Fixes spuriously reporting all formats as unsupported with radeonsi (which doesn't support modifiers yet), which would e.g. cause mutter to think the HW cursor format isn't supported and fall back to SW cursor. Suggested-by: Daniel Stone <daniels@collabora.com> Fixes: 4e3a7dcf6ee4 "gallium: enable EGL_EXT_image_dma_buf_import_modifiers unconditionally" Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Simon Ser <contact@emersion.fr> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4532>
* meson: move the generic symbols check arguments to a common variableEric Engestrom2019-11-051-1/+1
| | | | | Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviwed-by: Dylan Baker <dylan@pnwbakers>
* meson: add variable to control the symbols checksEric Engestrom2019-11-051-1/+1
| | | | | Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviwed-by: Dylan Baker <dylan@pnwbakers>
* gbm: Add GBM_MAX_PLANES definitionLepton Wu2019-10-181-3/+5
| | | | | | | This removed hard coded "4". Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Signed-off-by: Lepton Wu <lepton@chromium.org>
* gbm: use size_t for array indexesEric Engestrom2019-10-131-10/+5
| | | | | Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Eric Anholt <eric@anholt.net>
* gbm: replace NULL sentinel with explicit ARRAY_SIZE()Eric Engestrom2019-10-131-9/+12
| | | | | Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Eric Anholt <eric@anholt.net>
* gbm: replace 1/0 bool with true/falseEric Engestrom2019-10-131-8/+8
| | | | | Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Eric Anholt <eric@anholt.net>
* gbm: turn 0/-1 bool into true/falseEric Engestrom2019-10-131-6/+7
| | | | | Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Eric Anholt <eric@anholt.net>
* libgbm: Wire up getCapability for the image loaderAdam Jackson2019-09-201-1/+2
|
* gbm: Add buffer handling and visuals for fp16 formatsKevin Strasser2019-08-213-1/+38
| | | | | | | | | | Define and set a new loader cap DRI_LOADER_CAP_FP16, indicating that gbm can handle fp16 formats. Signed-off-by: Kevin Strasser <kevin.strasser@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* egl: Handle dri configs with floating point pixel dataKevin Strasser2019-08-211-0/+1
| | | | | | | | | | | | In the case that __DRI_ATTRIB_FLOAT_BIT is set in the dri config, set EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT in the egl config. Add a field to the platform driver visual to indicate if it has components that are in floating point form. Signed-off-by: Kevin Strasser <kevin.strasser@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* egl: Convert configs to use shifts and sizes instead of masksKevin Strasser2019-08-212-17/+35
| | | | | | | | | | | | Change dri2_add_config to take arrays of shifts and sizes, and compare with those set in the dri config. Convert all platform driver masks to shifts and sizes. In order to handle older drivers, where shift attributes aren't available, we fall back to the mask attributes and compute the shifts with ffs. Signed-off-by: Kevin Strasser <kevin.strasser@intel.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* meson: replace last uses of libxmlconfig with idep_xmlconfigEric Engestrom2019-08-031-2/+2
| | | | | | Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Acked-by: Eric Anholt <eric@anholt.net> Tested-by: Vinson Lee <vlee@freedesktop.org>
* meson: replace libmesa_util with idep_mesautilEric Engestrom2019-08-031-2/+2
| | | | | | | | | | | This automates the include_directories and dependencies tracking so that all users of libmesa_util don't need to add them manually. Next commit will remove the ones that were only added for that reason. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Acked-by: Eric Anholt <eric@anholt.net> Tested-by: Vinson Lee <vlee@freedesktop.org>
* gbm: sort symbolsEric Engestrom2019-07-101-22/+22
| | | | Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
* gbm: use new symbols check scriptEric Engestrom2019-07-102-22/+6
| | | | | | | | | Note: the list in gbm-symbols.txt is the same as the one that was in gbm-symbols-check, I just took the opportunity to sort it. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* gbm: gbm_bo_get_handle_for_plane fallback to nonplanar handleAlex Villacís Lasso2019-05-151-0/+6
| | | | | | | | | | | | | | | | | | Commit f9567ab435217a72cbae628336ead84dc0b2a803 (gbm: Export a getter for per plane handles) contains an API version check that fails on i915 (API version 7 vs. check for minimum API version 13). Any client that migrates to the planar API will start failing on i915 (see https://gitlab.gnome.org/GNOME/mutter/issues/127 for mutter, and https://bugs.freedesktop.org/show_bug.cgi?id=108487 for weston). This commit adds a fallback for plane 0 when the API check fails and returns the non-planar handle in this scenario, making the call equivalent to gbm_bo_get_handle(). This is enough for weston 6.0.0 to start working again on an i915 system. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=108487 Signed-off-by: Alex Villacís Lasso <a_villacis@palosanto.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* meson: make nm binary optionalDylan Baker2019-05-031-1/+1
| | | | | | | | | | | This makes nm not required, but used if found. In general I imagine that this means that on windows nm wont be found, and on other platforms it will. v2: - fix gbm and egl symbols check tests to only be run if nm is found - reword commit message to reflect the code change Reviewed-by: Eric Anholt <eric@anholt.net>
* gbm: Improve documentation of BO importHeinrich2019-05-021-3/+5
| | | | | | | | | | | | | - Add GBM_BO_IMPORT_FD_MODIFIER to documentation of supported foreign object types - Add newline before documentation block - Improve language Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Daniel Stone <daniels@collabora.com>
* delete autotools input filesEric Engestrom2019-04-291-12/+0
| | | | | | | Leftovers from when autotools was deleted. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
* gbm: don't return voidcoypu2019-04-261-1/+1
| | | | | Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
* Delete autotoolsDylan Baker2019-04-151-56/+0
| | | | | | | | | | Acked-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Jason Ekstrand <jason@jlekstrand.net> Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Acked-by: Matt Turner <mattst88@gmail.com>
* gbm: drop duplicate #definesEric Engestrom2019-02-141-8/+0
| | | | | Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
* drm-uapi: use local files, not system libdrmEric Engestrom2019-02-141-1/+1
| | | | | | | | | There was an issue recently caused by the system header being included by mistake, so let's just get rid of this include path and always explicitly #include "drm-uapi/FOO.h" Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
* meson: Add tests to suitesDylan Baker2018-11-201-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>
* gbm: add missing comma between stringsEric Engestrom2018-11-191-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>
* loader: Factor out the common driver opening logic from each loader.Eric Anholt2018-11-163-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)
* gbm: Clarify acceptable formats for gbm_boDaniel Stone2018-11-161-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>
* gbm: add new entrypoint to symbols checkEric Engestrom2018-11-151-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>
* gbm: remove unnecessary meson includeEric Engestrom2018-11-131-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>
* gbm: Introduce a helper function for printing GBM format names.Eric Anholt2018-11-122-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>
* gbm: Move gbm_format_canonicalize() to the core.Eric Anholt2018-11-123-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>
* gbm: Add GBM_FORMAT_ARGB1555 supportMichel Dänzer2018-10-091-0/+4
| | | | Reviewed-by: Marek Olšák <marek.olsak@amd.com>
* gbm: Add support for 10bpp BGR formatsDaniel Stone2018-08-011-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>
* meson: Remove various completed todosDylan Baker2018-06-131-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)
* gbm: remove never-implemented functionEric Engestrom2018-03-282-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>
* meson: Use include directory variables instead of traversingDylan Baker2018-03-071-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>
* gbm: give a name to rgba fieldsEric Engestrom2018-03-051-1/+6
| | | | | Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* *-symbol-check: use correct `nm` path when cross-compilingEric Engestrom2018-02-262-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>
* gbm: Fix the alpha masks in the GBM format table.Eric Anholt2018-02-231-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>
* dri: fromPlanar() can return NULL as a valid resultLouis-Francis Ratté-Boulianne2018-02-151-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>
* gbm/dri: Expose visuals table through gbm_dri_deviceDaniel Stone2018-02-092-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>
* gbm/dri: Add RGBA masks to GBM format tableDaniel Stone2018-02-091-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>
* meson: Don't confuse the install and search paths for dri driversDylan Baker2018-02-021-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)
* autotools: include meson build files in tarballDylan Baker2018-01-191-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>
* mesa: remove unneeded semicolonsGrazvydas Ignotas2018-01-171-1/+1
| | | | | | Trivial. Found by Coccinelle. Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
* meson: Use consistent style for testsDylan Baker2018-01-111-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>
* meson: add dep_thread to every lib that includes threads.hEric Engestrom2017-12-071-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>
* wayland-drm: static inline wayland_drm_buffer_getEmil Velikov2017-11-082-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
* meson: standardize .so version to major.minor.patchEric Engestrom2017-11-071-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>