aboutsummaryrefslogtreecommitdiffstats
path: root/src/gbm/main/gbm.h
Commit message (Collapse)AuthorAgeFilesLines
* gbm: Export a get modifiersBen Widawsky2017-03-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This patch originally had i965 specific code and was named: commit 61cd3c52b868cf8cb90b06e53a382a921eb42754 Author: Ben Widawsky <[email protected]> Date: Thu Oct 20 18:21:24 2016 -0700 gbm: Get modifiers from DRI To accomplish this, two new query tokens are added to the extension: __DRI_IMAGE_ATTRIB_MODIFIER_UPPER __DRI_IMAGE_ATTRIB_MODIFIER_LOWER The query extension only supported 32b queries, and modifiers are 64b, so we needed two of them. NOTE: The extension version is still set to 13, so none of this will actually be called. v2: Error handling of queryImage (Emil) Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gbm: Introduce modifiers into surface/bo creationBen Widawsky2017-03-151-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea behind modifiers like this is that the user of GBM will have some mechanism to query what properties the hardware supports for its BO or surface. This information is directly passed in (and stored) so that the DRI implementation can create an image with the appropriate attributes. A getter() will be added later so that the user GBM will be able to query what modifier should be used. Only in surface creation, the modifiers are stored until the BO is actually allocated. In regular buffer allocation, the correct modifier can (will be, in future patches be chosen at creation time. v2: Make sure to check if count is non-zero in addition to testing if calloc fails. (Daniel) v3: Remove "usage" and "flags" from modifier creation. Requested by Kristian. v4: Take advantage of the "INVALID" modifier added by the GET_PLANE2 series. v5: Don't bother with storing modifiers for gbm_bo_create because that's a synchronous operation and we can actually select the correct modifier at create time (done in a later patch) (Jason) v6: Make modifier condition outside the check so that dri_use will work properly (Jason) Cc: Kristian Høgsberg <[email protected]> References (v4): https://lists.freedesktop.org/archives/intel-gfx/2017-January/116636.html Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v1) Reviewed-by: Jason Ekstrand <[email protected]> Acked-by: Daniel Stone <[email protected]>
* gbm: Export a per plane getter for offsetBen Widawsky2017-03-091-0/+3
| | | | | | | | | | | | | | | | | | | | | Unlike stride, there was no previous offset getter, so it can be right on the first try. v2: Return EINVAL when plane is greater than total planes to make it match the similar APIs. Avoid leak after fromPlanar (Daniel) Make sure when getting offsets we consider dumb images (Daniel) v3: Use Jason's recommendation for handling the non-planar case. v4: Return int64_t so we can get real errors v5: Add an assertion for dumb BOs (Jason) Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Acked-by: Daniel Stone <[email protected]>
* gbm: Export a per plane getter for strideBen Widawsky2017-03-091-0/+3
| | | | | | | | | | | | | | | | | | | | v2: Preserve legacy behavior when plane is 0 (Jason Ekstrand) EINVAL when input plane is greater than total planes (Jason Ekstrand) Don't leak the image after fromPlanar (Daniel) Move bo->image check below plane count preventing bad index succeeding (Daniel) v3: Fix DRIimage leak (using Jason's recommended change) Make plane 0 return planar stride. This might break legacy behavior (Jason) v4: Move bogus hunk for get_handle_for_plane to the right patch (Jason) Fix error handling path to be cleaner (Jason) v5: Add assert for dumb BOs to make sure plane == 0 (Jason) Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v1) Reviewed-by: Jason Ekstrand <[email protected]> Acked-by: Daniel Stone <[email protected]>
* gbm: Export a getter for per plane handlesBen Widawsky2017-03-091-0/+3
| | | | | | | | | | | | | | | | | | | | v2: Make the error return be -1 instead of 0 because I think 0 is actually valid. v3: Set errno to EINVAL when the specified plane is above the total planes. (Jason Ekstrand) Return the bo's handle if there is no image ie. for dumb images like cursor (Daniel) v4: - Add assertions about plane == 0 (Jason) - Add a comment about new restriction on planar dumb bo which is not an earlier patch in the series. - Correctly refactor from v2 in this patch; it ended up rebased into the wrong patch. Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Acked-by: Daniel Stone <[email protected]>
* gbm: Export a plane getter functionBen Widawsky2017-03-091-0/+3
| | | | | | | | | | | | | | This will be used by clients that need to know the number of planes allocated for them on behalf of the GL or other API. The best current example of this is when an extra "plane" is allocated to store compression data for the primary plane. v2: Return 1 for cases where there is no image, ie. dumb bo (Daniel) Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Acked-by: Daniel Stone <[email protected]>
* gbm: add missing R8 and GR88 formatsRob Clark2016-09-071-0/+6
| | | | | Reviewed-by: Eric Engestrom <[email protected]> Signed-off-by: Rob Clark <[email protected]>
* gbm: doc fixesEric Engestrom2016-06-231-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* gbm: Add map/unmap functionsRob Herring2016-05-231-0/+35
| | | | | | | | | | | | | | | This adds map and unmap functions to GBM utilizing the DRIimage extension mapImage/unmapImage functions or existing internal mapping for dumb buffers. Unlike prior attempts, this version provides a region to map and usage flags for the mapping. The operation follows the same semantics as the gallium transfer_map() function. This was tested with GBM based gralloc on Android. Signed-off-by: Rob Herring <[email protected]> [Emil Velikov: drop no longer relevant hunk from commit message.] Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* gbm: do not wrap header inclusion in extern "C"Emil Velikov2016-03-091-5/+5
| | | | Signed-off-by: Emil Velikov <[email protected]>
* gbm.h: Add a missing stddef.h include for size_t.Emmanuel Gil Peyrot2015-10-301-0/+1
| | | | | | | | This was causing compilation issues when one of its providers wasn’t already included before gbm.h. Cc: "11.0" <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gbm: Add GBM_BO_USE_LINEAR flagFlora Cui2015-04-161-0/+4
| | | | | | | Signed-off-by: Flora Cui <[email protected]> Reviewed-by: Jammy Zhou <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* Add support for swrast to the DRM EGL platformGiovanni Campagna2014-07-301-0/+3
| | | | | | | | | | | | | | | | | | | | Turn GBM into a swrast loader (providing putimage/getimage backed by a dumb KMS buffer). This allows to run KMS+DRM GL applications (such as weston or mutter-wayland) unmodified on cards that don't have any client side HW acceleration component but that can do modeset (examples include simpledrm and qxl) [Emil Velikov] - Fix make check. - Split dri_open_driver() from dri_load_driver(). - Don't try to bind the swrast extensions when using dri. - Handle swrast->CreateNewScreen() failure. - strdup the driver_name, as it's free'd at destruction. - s/LIBGL_ALWAYS_SOFTWARE/GBM_ALWAYS_SOFTWARE/ - Move gbm_dri_bo_map/unmap to gbm_driiint.h. - Correct swrast fallback logic. Signed-off-by: Emil Velikov <[email protected]>
* gbm: Remove 64x64 restriction from GBM_BO_USE_CURSORMichel Dänzer2014-06-121-5/+7
| | | | | | | | | | GBM_BO_USE_CURSOR_64X64 is kept so that existing users of GBM continue to build, but it no longer rejects widths or heights other than 64. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79809 Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* gbm: Add import from fdKristian Høgsberg2014-04-011-0/+9
| | | | | | | Add a new import type that lets us create a gbm bo from a DMA-BUF file descriptor. Signed-off-by: Kristian Høgsberg <[email protected]>
* gbm: Add gbm_bo_get_fd()Kristian Høgsberg2014-04-011-0/+3
| | | | | | Add gbm function to get a DMA-BUF file descriptor for a gbm bo. Signed-off-by: Kristian Høgsberg <[email protected]>
* gbm: Rename gbm_bo_get_pitch to gbm_bo_get_strideKristian Høgsberg2012-07-161-1/+1
| | | | | We use pitch for 'pixels per row' and stride for 'bytes per row' pretty consistently in mesa and most other places, so rename the gbm API.
* gbm: Add new gbm_bo_import entry pointKristian Høgsberg2012-07-161-4/+5
| | | | | This generalizes and replaces gbm_bo_create_for_egl_image. gbm_bo_import will create a gbm_bo from either an EGLImage or a struct wl_buffer.
* gbm: Add gbm_bo_write entry pointKristian Høgsberg2012-05-031-0/+9
| | | | | | | | | | | | | | | | This new gbm entry point allows writing data into a gbm bo. The bo has to be created with the GBM_BO_USE_WRITE flag, and it's only required to work for GBM_BO_USE_CURSOR_64X64 bos. The gbm API is designed to be the glue layer between EGL and KMS, but there was never a mechanism initialize a buffer suitable for use with KMS hw cursors. The hw cursor bo is typically not compatible with anything EGL can render to, and thus there's no way to get data into such a bo. gbm_bo_write() fills that gap while staying out of the efficient cpu->gpu pixel transfer business. Reviewed-by: Ander Conselvan de Oliveira <[email protected]>
* gbm: add gbm_bo_get_device() functionAnder Conselvan de Oliveira2012-04-301-0/+3
|
* gbm: add gbm_bo_get/set_user_data()Ander Conselvan de Oliveira2012-04-301-0/+7
| | | | | This allows the user to associate some data to a gbm_bo and get a callback when the bo is destroyed.
* gbm: Add gbm_surface interfaceAnder Conselvan de Oliveira2012-03-281-0/+18
| | | | | | | | | | | | The idea here is to be able to create an egl window surface from a gbm_surface. This avoids the need for the surfaceless extension and lets the EGL platform handle buffer allocation, while keeping the user in charge of somehow presenting the buffers (using kms page flipping, for example). gbm_surface_lock_front_buffer() locks a surface's front buffer and returns a gbm bo representing it. This bo should later be returned to the gbm surface using gbm_surface_release_buffer().
* gbm: track buffer format through DRI driversJesse Barnes2012-02-221-3/+107
| | | | | | | | | | | | GBM needs the buffer format in order to communicate with DRM and clients for things like scanout. So track the DRI format requested in the various back ends and use it to return the DRI format back to GBM when requested. GBM will then map this into the GBM surface type (which is in turn based on the DRM fb format list). Signed-off-by: Jesse Barnes <[email protected]>
* gbm: Add documentation for the public facing APIRob Bradford2012-01-131-2/+43
|
* Make it possible to use gbm with c++Jørgen Lind2011-07-191-0/+9
| | | | NOTE: This is a candiate for 7.11
* Add gbm (generic/graphics buffer manager)Benjamin Franzke2011-06-231-0/+100