summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/sw
Commit message (Collapse)AuthorAgeFilesLines
* meson: build gallium winsys for dri, null, and wrapperDylan Baker2017-10-164-0/+110
| | | | | Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Anholt <eric at anholt.net>
* winsys/sw/dri: don't use GNU void pointer arithmeticEmil Velikov2017-04-191-1/+1
| | | | | | | | | | | | | | | Resolves build issues like the following: src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:31: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith] data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize; ^ src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:62: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith] data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize; ^ Cc: <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* haiku/winsys: fix dt prototype argsJerome Duval2017-02-241-1/+2
|
* gallium: fix return value checkMartina Kollarova2016-09-141-6/+6
| | | | | | | | | A possible error (-1) was being lost because it was first converted to an unsigned int and only then checked. Reviewed-by: Nicolai Hähnle <[email protected]> Signed-off-by: Martina Kollarova <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* Introduce .editorconfigEric Engestrom2016-08-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | A few weeks ago, Jose Fonseca suggested [0] we use .editorconfig files to try and enforce the formatting of the code, to which Michel Dänzer suggested [1] we start by importing the existing .dir-locals.el settings. The first draft was discussed in the RFC [2]. These .editorconfig are a first step, one that has the advantage of requiring little to no intervention from the devs once the settings files are in place, but the settings are very limited. This does have the advantage of applying while the code is being written. This doesn't replace the need for more comprehensive formatting tools such as clang-format & clang-tidy, but those reformat the code after the fact. [0] https://lists.freedesktop.org/archives/mesa-dev/2016-June/121545.html [1] https://lists.freedesktop.org/archives/mesa-dev/2016-June/121639.html [2] https://lists.freedesktop.org/archives/mesa-dev/2016-July/123431.html Acked-by: Nicolai Hähnle <[email protected]> Acked-by: Eric Anholt <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* gallium: add a pipe_context parameter to resource_get_handleMarek Olšák2016-08-251-1/+1
| | | | | | | | radeonsi needs to do some operations (DCC decompression) for OpenGL-OpenCL interop and this is the only way to make it coherent with the current context. It can optionally be set to NULL. Reviewed-by: Brian Paul <[email protected]>
* gallium/winsys/kms: Look up the GEM handle after importing a prime FDTomasz Figa2016-08-241-0/+4
| | | | | | | | | | | | | | | | | | | | drmPrimeHandleToFD() will return the same GEM handle every time the same buffer is imported, even from a different prime FD. Since GEM handles are not reference counted, we need to make sure that each GEM handle is referenced only by one display target struct, by looking it up in kms_sw->bo_list first and bumping the refcount of the found dt on hit and falling back to creating a new dt only on miss. v2: Split into separate function. Use helper function for lookup. v3 [Emil Velikov]: Rename kms_sw_displaytarget_{lookup,find_and_ref} (Jordan) Signed-off-by: Tomasz Figa <[email protected]> CC: <[email protected]> Reviewed-by: Hans de Goede <[email protected]> (v2) Signed-off-by: Emil Velikov <[email protected]>
* gallium/winsys/kms: Move display target handle lookup to separate functionTomasz Figa2016-08-241-9/+24
| | | | | | | | | | | | | | | | | As a preparation to use the lookup in more than once place, move the code that looks up given KMS/GEM handle to a separate function. This change should not introduce any functional changes. v2: Split into separate patch. Move lookup code into separate function. v3 [Emil Velikov]: Rename kms_sw_displaytarget_{lookup,find_and_ref} (Jordan) Signed-off-by: Tomasz Figa <[email protected]> CC: <[email protected]> Reviewed-by: Hans de Goede <[email protected]> (v2) Signed-off-by: Emil Velikov <[email protected]>
* gallium/winsys/kms: Fully initialize kms_sw_dt at prime import time (v2)Tomasz Figa2016-08-241-7/+11
| | | | | | | | | | | | | | | Currently kms_sw_displaytarget_add_from_prime() allocates the struct and fills in only some of the fields, resulting in a half-baked struct that needs to be further completed by the caller. To make this a bit more consistent, pass width, height and stride to this function and fill in everything there, so that caller can take the returned struct as is. v2: Split from one big patch into four fixing one thing at a time. Signed-off-by: Tomasz Figa <[email protected]> CC: <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallium/winsys/kms: Fix double refcount when importing from prime FD (v2)Tomasz Figa2016-08-241-1/+0
| | | | | | | | | | | | | Currently the code creates a display target struct with refcount field initialized to 1 and then the caller again increments it, leading to a leaked reference. Let's remove the unnecessary increment. v2: Split from one big patch into four fixing one thing at a time. Signed-off-by: Tomasz Figa <[email protected]> CC: <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* gallium: push offset down to driverStanimir Varbanov2016-05-301-0/+6
| | | | | | | | | | | | | Push offset down to drivers when importing dmabuf. This is needed to more fully support EGL_EXT_image_dma_buf_import when a non-zero offset is specified. Tesing has been done for freedreno, and compile tested following gallium drivers: nouveau,svga,virgl,r600,r300,radeonsi,swrast,i915,ilo Signed-off-by: Stanimir Varbanov <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* winsys/sw/xlib: use correct free function for xlib_dt->dataJose Fonseca2016-05-011-1/+1
| | | | | | | Analogous to previous commit. Cc: "11.2 11.1" <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* winsys/sw/dri: use correct free function for dri_sw_dt->dataWuZhen2016-05-011-1/+1
| | | | | | | | | | | align_malloc() is used to allocate dri_sw_dt->data, thus we should not be using FREE() but align_free(). Cc: "11.2 11.1" <[email protected]> Signed-off-by: Chih-Wei Huang <[email protected]> [Emil Velikov: tweak commit summary/shortlog] Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* gallium/winsys/drm: add offset to struct winsys_handleChristian König2016-03-171-0/+3
| | | | | | | We are going to need this for EGL_EXT_image_dma_buf_import. Signed-off-by: Christian König <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: add external usage flags to resource_from(get)_handle (v2)Marek Olšák2016-03-091-2/+4
| | | | | | | | | This will allow drivers to make better decisions about texture sharing for DRI2, DRI3, Wayland, and OpenCL. v2: add read/write flags, take advantage of __DRI_IMAGE_USE_BACKBUFFER Reviewed-by: Axel Davy <[email protected]>
* gallium/swrast: fixup build breakage and warningsDave Airlie2015-10-315-0/+5
| | | | | | | The front buffer rendering changes broke an interface, I didn't fix up all of them. Signed-off-by: Dave Airlie <[email protected]>
* gallium/swrast: fix front buffer blitting. (v2)Dave Airlie2015-10-311-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So I've known this was broken before, cogl has a workaround for it from what I know, but with the gallium based swrast drivers BlitFramebuffer from back to front or vice-versa was pretty broken. The legacy swrast driver tracks when a front buffer is used and does the get/put images when it is mapped/unmapped, so this patch attempts to add the same functionality to the gallium drivers. It creates a new context interface to denote when a front buffer is being created, and passes a private pointer to it, this pointer is then used to decide on map/unmap if the contents should be updated from the real frontbuffer using get/put image. This is primarily to make gtk's gl code work, the only thing I've tested so far is the glarea test from https://github.com/ebassi/glarea-example.git v2: bump extension version, check extension version before calling get image. (Ian) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91930 Cc: <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium: add flags parameter to pipe_screen::context_createMarek Olšák2015-08-261-1/+1
| | | | | | | | This allows creating compute-only and debug contexts. Reviewed-by: Brian Paul <[email protected]> Acked-by: Christian König <[email protected]> Acked-by: Alex Deucher <[email protected]>
* winsys/sw/kms-dri: don't attempt to bundle the sconscriptEmil Velikov2015-08-221-2/+0
| | | | | | | | The build/file was removed with an earlier commit while the EXTRA_DIST was forgotten. Fixes: 66d77cd71c6 (scons: don't build the kms-dri winsys) Signed-off-by: Emil Velikov <[email protected]>
* scons: don't build the kms-dri winsysEmil Velikov2015-07-221-23/+0
| | | | | | | | | Same as previous commit - unused (gbm is not a thing outside the autotools build). v2: Remove trailing HAVE_LIBDRM. Signed-off-by: Emil Velikov <[email protected]>
* android: don't build the kms-dri winsysEmil Velikov2015-07-221-37/+0
| | | | | | | | | | GBM (the only user of kms-dri) is currently not available under Android. Considering we have no way of testing/using this let's not bother building it for now. Cc: Chih-Wei Huang <[email protected]> Cc: Eric Anholt <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* gallium: replace INLINE with inlineIlia Mirkin2015-07-216-9/+9
| | | | | | | | | | | | | | | | Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Marek Olšák <[email protected]>
* gallium: Drop the gallium-specific Android sw winsys.Eric Anholt2015-06-153-346/+0
| | | | | | | This was part of gallium_egl, and we now have the normal libEGL Android winsys support to handle it. Reviewed-by: Emil Velikov <[email protected]>
* android: add rules to build a gallium_dri.soChih-Wei Huang2015-06-092-0/+72
| | | | | | | This single .so includes all of the enabled gallium drivers. Signed-off-by: Chih-Wei Huang <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* winsys/hgl: Add needed extern "C" to hgl winsysAlexander von Gluck IV2015-05-151-0/+7
| | | | Reviewed-by: Brian Paul <[email protected]>
* util: Move gallium's linked list to utilJason Ekstrand2015-05-081-1/+1
| | | | | | | | | The linked list in gallium is pretty much the kernel list and we would like to have a C-based linked list for all of mesa. Let's not duplicate and just steal the gallium one. Acked-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* winsys/sw/fbdev: remove unused software winsysEmil Velikov2015-03-215-339/+0
| | | | | | | st/egl was its only user. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]>
* winsys/sw/wayland: remove unused winsysEmil Velikov2015-03-214-363/+0
| | | | | | | st/egl was its only user. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Matt Turner <[email protected]>
* gallium/sw/kms: trivial cleanupsEmil Velikov2015-03-161-4/+2
| | | | | | | | Remove the forward declaration and make use of the DEBUG_PRINT macro for debug builds. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/sw/kms: fix a type-mismatch warningMarek Olšák2015-02-211-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium/sw/kms: don't redefine DEBUGMarek Olšák2015-02-211-7/+7
| | | | Reviewed-by: Brian Paul <[email protected]>
* gallium/state_tracker: Rewrite Haiku's state trackerAlexander von Gluck IV2015-01-011-4/+20
| | | | | * More gallium-like * Leverage stamps properly and don't call mesa functions
* winsys/sw/wrapper: implement is_displaytarget_format_supported for swrastChristoph Bumiller2014-11-181-0/+14
| | | | | Acked-by: Jose Fonseca <[email protected]> Signed-off-by: David Heidelberg <[email protected]>
* dri/kms: Always zero out struct drm_mode_create_dumbThierry Reding2014-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The DRM_IOCTL_MODE_CREATE_DUMB (and others) IOCTL isn't very rigorously specified, which has the effect that some kernel drivers do not consider the .pitch and .size fields of struct drm_mode_create_dumb outputs only. Instead they will use these as lower bounds and overwrite them only if the values that they compute are larger than what userspace provided. This works if and only if userspace initializes the fields explicitly to either 0 or some meaningful value. However, if userspace just leaves the values uninitialized and the struct drm_mode_create_dumb is allocated on the stack for example, the driver may try to overallocate buffers. Fortunately most userspace does zero out the structure before passing it to the IOCTL, but there are rare exceptions. Mesa is one of them. In an attempt to rectify this situation, kernel drivers are being updated to not use the .pitch and .size fields as inputs. However in order to fix the issue with older kernels, make sure that Mesa always zeros out the structure as well. Future IOCTLs should be more rigorously defined so that structures can be validated and IOCTLs rejected if output fields aren't set to zero. Signed-off-by: Thierry Reding <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* kms-swrast: Support Prime fd handlingAndreas Pokorny2014-09-051-11/+71
| | | | | | | | Allows using prime fds as display target and from display target. Test for PRIME capability after initializing kms_swrast screen. Cc: [email protected] Signed-off-by: Andreas Pokorny <[email protected]>
* sw/hgl: struct haiku_displaytarget is not public structEmil Velikov2014-08-282-23/+21
| | | | | | | | It is meant to be private within the actual winsys. Remove it from the exported header, and fold it into it's only user. Cc: Alexander von Gluck IV <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* gallium/targets: Break haiku state_tracker out to own directoryAlexander von Gluck IV2014-08-283-209/+1
| | | | Ack'ed by Emil Velikov <[email protected]>
* winsys/sw: add the final files to the tarballEmil Velikov2014-08-286-0/+12
| | | | | | | | Add the final remaining files into the tarball (make dist), namely: - SConscripts - Non-autotooled winsys' - android, gdi and hgl. Signed-off-by: Emil Velikov <[email protected]>
* winsys/sw: automake: consistently use Makefile.sourcesEmil Velikov2014-08-2820-31/+41
| | | | | | | | - Include the headers within. - Update scons to use them. - Drop useless include (gallium/drivers) from scons. Signed-off-by: Emil Velikov <[email protected]>
* dri: Add a new capabilities for drivers that can't share buffersGiovanni Campagna2014-07-301-3/+9
| | | | | | | | | | | | | | | | | | | The kms-dri swrast driver cannot share buffers using the GEM, so it must tell the loader to disable extensions relying on that, without disabling the image DRI extension altogether (which would prevent the loader from working at all). This requires a new gallium capability (which is queried on the pipe_screen and for swrast drivers it's forwarded to the winsys), and requires a new version of the DRI image extension. [Emil Velikov] - Rebased on top of gallium-dri megadrivers. - Drop PIPE_CAP_BUFFER_SHARE and sw_winsys::get_param hook. The can_share_buffer cap is set at InitScreen. We use a different InitScreen (and thus value for the cap) function for kms_dri, due to deeper differences originating from dri megadrivers. Signed-off-by: Emil Velikov <[email protected]>
* gallium: Add a dumb drm/kms winsys backed swrast providerGiovanni Campagna2014-07-304-0/+407
| | | | | | | | | | | | | | | | | | | | | | Add a new winsys and target that can be used with a dri2 state tracker and loader instead of drisw. This allows to use gbm as a dri2/image loader and avoid the extra copy from the backbuffer to the shadow frontbuffer. The new driver is called "kms_swrast", and is loaded by gbm as a fallback, because it is only useful with the gbm platform (as no buffer sharing is possible) To force select the driver set the environment variable GBM_ALWAYS_SOFTWARE [Emil Velikov] - Rebase on top of gallium megadriver. - s/text/test/ in configure.ac (Spotted by Andreas Pokorny). - Add scons support for winsys/sw/kms-dri and fix the build. - Provide separate DriverAPI, due to different InitScreen hook. Signed-off-by: Emil Velikov <[email protected]>
* winsys/xlib: move xlib_create_sw_winsys within the winsysEmil Velikov2014-02-222-1/+12
| | | | | | v2: Rebase on top of vl_winsys_xsp.c removal Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jakob Bornecrantz <[email protected]> (v1)
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/[email protected]/[email protected]/ s/[email protected]/[email protected]/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\[email protected]/[email protected]/g s/keithw\[email protected]/[email protected]/g s/[email protected]/[email protected]/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/[email protected]/[email protected]/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <[email protected]>
* swrast* (gallium, classic): add MESA_copy_sub_buffer support (v3)Dave Airlie2013-12-138-11/+26
| | | | | | | | | | | | | | | | | | | | | | | This patches add MESA_copy_sub_buffer support to the dri sw loader and then to gallium state tracker, llvmpipe, softpipe and other bits. It reuses the dri1 driver extension interface, and it updates the swrast loader interface for a new putimage which can take a stride. I've tested this with gnome-shell with a cogl hacked to reenable sub copies for llvmpipe and the one piglit test. I could probably split this patch up as well. v2: pass a pipe_box, to reduce the entrypoints, as per Jose's review, add to p_screen doc comments. v3: finish off winsys interfaces, add swrast classic support as well. Reviewed-by: Jose Fonseca <[email protected]> Signed-off-by: Dave Airlie <[email protected]> swrast: add support for copy_sub_buffer
* gallium/winsys: compact compiler flags into Automake.incEmil Velikov2013-11-166-13/+12
| | | | | | | | | | | | | | | | Cleanup the duplicating flags and consolidate into a sigle variable. Note: this patch adds VISIBILITY_CFLAGS to the following targets * freedreno/drm * i915/{drm,sw} * nouveau/drm * sw/fbdev * sw/null * sw/wayland * sw/wrapper * sw/xlib Signed-off-by: Emil Velikov <[email protected]>
* winsys: Correct Haiku winsys display target codeAlexander von Gluck IV2013-10-294-8/+41
| | | | | | | | | * Instead of assuming the displaytarget is the same stride / colorspace as the destination, lets actually check the source bitmap. * Fixes random stride issues in rendering Acked-by: Brian Paul <[email protected]>
* gallium/swrast: don't export any private symbolsMarek Olšák2013-10-081-1/+2
| | | | Reviewed-by: Tom Stellard <[email protected]>
* haiku: Add first Haiku renderer (softpipe)Alexander von Gluck IV2013-10-041-1/+0
| | | | | * This shared library gets parsed by the system as a system "add-on"
* winsys/sw/xlib: fix compile error in xlib_sw_winsys.c.Gaetan Nadon2013-09-191-1/+1
| | | | | | | | | | | | | | | | | xlib_sw_winsys.h:5:22: fatal error: X11/Xlib.h: No such file or directory The compiler cannot find the Xlib.h in the installed system headers. All supplied include directives point to inside the mesa module. The X11_CFLAGS variable is undefined (not defined in config.status). It appears the intent was to use X11_INCLUDES defined in configure.ac. The Xlib.h file is not installed on my workstation. It is supplied in the libx11-dev package. This allows an X developer control over which version of this file is used for X development. Signed-off-by: Gaetan Nadon <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove outdated version lines in commentsRico Schüller2013-06-056-6/+0
| | | | Signed-off-by: Brian Paul <[email protected]>