summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/common/dri_util.h
Commit message (Collapse)AuthorAgeFilesLines
* android: support swrastWuZhen2016-11-011-1/+1
| | | | | | | | | | System boots up with gles_mesa/softpipe/llvmpipe. NO_REF_TASK Tested: local run Change-Id: I629ed0ca9fad12e32270eb8e8bfa9f7681b68474 Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
* dri/common: remove unused drm_version variableEmil Velikov2015-07-221-5/+0
| | | | | | | | | | | | As of last commit the only user of it (radeon/r200) no longer uses it. As such let's remove it and cleanup the nasty hacks that we had in place to support this. v2: Leave LIBDRM_CFLAGS around. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1) Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
* dri_util: cleanup dri extension handlingEmil Velikov2014-04-281-4/+4
| | | | | | | | | Explicitly set the version that is implemented, as that may differ from the one defined in dri_interface.h. The remaining __DRI*Extensions are treated as constants, so got ahead and declare them as such. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* mesa: change gl_format to mesa_formatMark Mueller2014-01-271-2/+2
| | | | s/\bgl_format\b/mesa_format/g. Use better name for Mesa Formats enum
* dri_util: Don't assume __DRIcontext->driverPrivate is a gl_contextKristian Høgsberg2013-12-131-0/+3
| | | | | | | | | | | | | | | | | The driverPrivate pointer is opaque to the driver and we can't assume it's a struct gl_context in dri_util.c. Instead provide a helper function to set the struct gl_context flags from the incoming DRI context flags. v2 (idr): Modify the other classic drivers to also use driContextSetFlags. I ran all the piglit GLX_ARB_create_context tests with i965 and classic swrast without regressions. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1] Reviewed-by: Eric Anholt <eric@anholt.net> Tested-by: Ilia Mirkin <imirkin@alum.mit.edu> [v1 on Gallium nouveau] Cc: "10.0" <mesa-stable@lists.freedesktop.org>
* swrast* (gallium, classic): add MESA_copy_sub_buffer support (v3)Dave Airlie2013-12-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | 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 <jfonseca@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com> swrast: add support for copy_sub_buffer
* dri: add __DRIimageLoaderExtension and __DRIimageDriverExtensionKeith Packard2013-11-071-0/+6
| | | | | | | | | | | | | | | | | | | | | These provide an interface between the driver and the loader to allocate color buffers through the DRIimage extension interface rather than through a loader-specific extension (as is used by DRI2, for instance). The driver uses the loader 'getBuffers' interface to allocate color buffers. The loader uses the createNewScreen2, createNewDrawable, createNewContext, getAPIMask and createContextAttribs APIS (mostly shared with DRI2). This interface will work with the DRI3 loader, and should also work with GBM and other loaders so that drivers need not be customized for each new loader interface, as long as they provide this image interface. v2: Fix build of i915 and i965 together (by anholt) Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Eric Anholt <eric@anholt.net>
* dri/common: Add functions mapping MESA_FORMAT_* <-> __DRI_IMAGE_FORMAT_*Keith Packard2013-11-071-0/+6
| | | | | | | | | | The __DRI_IMAGE_FORMAT codes are used by the image extension, drivers need to be able to translate between them. Instead of duplicating this translation in each driver, create a shared version. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
* mesa/dri: Add basic plumbing for GLX_ARB_robustness reset notification strategyIan Romanick2013-11-071-0/+2
| | | | | | | | | | | No drivers advertise the DRI2 extension yet, so no driver should ever see a value other than false for notify_reset. The changes in nouveau use tabs because nouveau seems to have it's own indentation rules. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* i965: Build the driver into a shared mesa_dri_drivers.so .Eric Anholt2013-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we've split things such that mesa core is in libdricore, exposing the whole Mesa core interface in the global namespace, and the i965_dri.so code all links against that. Along with polluting application namespace terribly, it requires extra PLT indirections and prevents LTO. Instead, we can build all of the driver contents into the same .so with just a few symbols exposed to be referenced from the actual driver .so file, allowing LTO and reducing our exposed symbol count massively. FPS improvement on GLB2.7 with INTEL_NO_HW=1: 2.61061% +/- 1.16957% (n=50) (without LTO, just the PLT reductions from this commit) Note that the X Server requires commit 7ecfab47eb221dbb996ea6c033348b8eceaeb893 to successfully load this driver! v2: Set a global driverAPI variable so loaders don't have to update to createNewScreen2() (though they may want to for thread safety). v3: Drop AM_CPPFLAGS addition (Emil pointed out I'd missed some cflags that would be necessary, though only if we actually relied on them). v4: Fix install with DESTDIR set. Reviewed-by: Matt Turner <mattst88@gmail.com> (v1) Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (v2)
* dri: Reference the global driver vtable once at screen init..Eric Anholt2013-10-101-0/+6
| | | | | | | | | | | This is part of the prep for megadrivers, which won't allow using a single global symbol due to the fact that there will be multiple drivers built into the same dri.so file. For that, we'll need screen init to take a reference to the driver to set up this vtable. v2: Fix two missed references to driDriverAPI. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
* dri: Move API version validation into dri/common.Eric Anholt2013-10-101-0/+5
| | | | | | | | | | | | | | | | | i965, i915, radeon, r200, swrast, and nouveau were mostly trying to do the same logic, except where they failed to. Notably, swrast had code that appeared to try to enable GLES1/2 but forgot to set api_mask (thus preventing any gles context from being created), and the non-intel drivers didn't support MESA_GL_VERSION_OVERRIDE. nouveau still relies on _mesa_compute_version(), because I don't know what its limits actually are, and gallium drivers don't declare limits up front at all. I think I've heard talk about doing so, though. v2: Compat max version should be 30 (noted by Ken) Drop r100's custom max version check, too (noted by Emil Velikov) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* dri2: Add plumbing to get context version requirements and flags to driversIan Romanick2012-01-021-0/+4
| | | | | | This adds support for DRI_DRI2 version 3 to all of the DRI2 drivers. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
* dri: drop drisw_util.hGeorge Sapountzis2011-11-041-1/+7
|
* dri: reorder as driver,screen,context,drawableGeorge Sapountzis2011-11-041-65/+65
|
* dri: unify __DRIcontextRec, __DRIdrawableRecGeorge Sapountzis2011-11-041-17/+17
|
* dri: unify __DRIscreenRecGeorge Sapountzis2011-11-041-19/+14
| | | | | Also drop DriverAPI field, this is a static symbol and I don't see why it should be accessed through __DRIscreenRec
* dri: unify __DriverAPIRecGeorge Sapountzis2011-11-041-37/+13
| | | | I dropped the comments because they don't add much.
* dri: Move driUpdateFramebufferSize to dri_util.cKristian Høgsberg2011-11-021-0/+3
| | | | drirenderbuffer.[ch] is going bye-bye.
* dri: Remove unnecessary timestamp pointer indirectionKristian Høgsberg2011-11-021-7/+4
|
* dri: Remove unused fields from __DriverAPIRecKristian Høgsberg2011-11-021-34/+0
|
* dri: Remove dri2.enabled flagKristian Høgsberg2011-11-021-1/+0
| | | | DRI2 is always enabled now.
* dri: Remove DRI1 fields from DRI structsKristian Høgsberg2011-11-021-105/+0
|
* dri: Remove cliprect information from __DRIdrawableKristian Høgsberg2011-11-021-27/+1
|
* dri: Drop unused driCalculateSwapUsageKristian Høgsberg2011-11-021-4/+0
|
* dri: Remove unused driIntersectAreaKristian Høgsberg2011-11-021-3/+0
|
* dri: Drop __driUtilUpdateDrawableInfo and helper macrosKristian Høgsberg2011-11-021-57/+0
|
* dri: Remove unused __DRIswapInfoRecKristian Høgsberg2011-11-021-40/+0
|
* dri: Remove driMediaStreamCounterExtensionKristian Høgsberg2011-11-021-1/+0
| | | | Also DRI1-only.
* dri: Remove driSwapControlExtensionKristian Høgsberg2011-11-021-1/+0
| | | | DRI1-only as well.
* dri: Drop driCopySubBufferExtensionKristian Høgsberg2011-11-021-1/+0
| | | | Another DRI1-only extension.
* dri: Drop driReadDrawableExtensionKristian Høgsberg2011-11-021-1/+0
| | | | All DRI2 drivers support setting a separate read drawable.
* dri: Drop driLegacyExtensionKristian Høgsberg2011-11-021-1/+0
| | | | There are no DRI1 drivers left.
* Add dri2::{Allocate,Release}Buffer extensionBenjamin Franzke2011-02-071-0/+6
|
* Rename GLvisual and __GLcontextModes to struct gl_configKristian Høgsberg2010-10-131-2/+2
|
* Get rid of GL/internal/glcore.hKristian Høgsberg2010-10-131-1/+0
| | | | | | | __GLcontextModes is always only used as an implementation internal struct at this point and we shouldn't install glcore.h anymore. Anything that needs __GLcontextModes should just include the struct in its headers files directly.
* dri: Pass the __DRIscreen and the __DRIscreen private back to image lookupKristian Høgsberg2010-09-221-0/+1
| | | | | We will typically have a current context when we need to lookup the image, but the lookup implementation don't need it so drop it.
* dri2: Clean up the common dri2 options at screen destroy.Eric Anholt2010-08-181-0/+1
|
* mesa: Avoid using c++ keyword in dri_util.h when compiled with c++.Eric Anholt2010-08-131-0/+4
|
* glx: Remove support for MESA_swap_frame_usageKristian Høgsberg2010-07-191-1/+0
| | | | | The extension never worked, the implementation returns GLX_BAD_CONTEXT when enabling the frame tracking.
* intel: Drop viewport hack when we canKristian Høgsberg2010-05-111-0/+1
|
* Merge branch 'gles2-2'Kristian Høgsberg2010-05-021-2/+5
|\ | | | | | | | | Conflicts: src/mesa/drivers/dri/common/dri_util.h
| * dri: Add DRI entrypoints to create a context for a given APIKristian Høgsberg2010-04-281-2/+6
| |
* | DRI2: add config query extensionJesse Barnes2010-04-221-0/+4
|/ | | | | Add a new DRI2 configuration query extension. Allows for DRI2 client code to query for common DRI2 configuration options.
* dri: Drop another unused __DRIscreen fieldKristian Høgsberg2010-03-301-5/+0
|
* dri: Drop the unused dummyContextKristian Høgsberg2010-03-301-12/+0
|
* dri: Drop an unused __DRIcontext fieldKristian Høgsberg2010-03-301-5/+0
|
* dri/common: mv __driUtilMessage to utils.cGeorge Sapountzis2010-03-151-4/+0
| | | | allows to link with xmlconfig without dri_util, and has nothing drm-specific.
* intel: Implement DRI image extensionKristian Høgsberg2010-02-241-0/+1
|
* intel: Implement the DRI2 invalidate function properlyKristian Høgsberg2010-02-171-0/+5
| | | | | | | | | | | | | | | | | | | This uses a stamp mechanisms to mark the DRI drawable as invalid. Instead of immediately updating the buffers we just bump the drawable stamp and call out to DRI2GetBuffers "later". "Later" used to be at LOCK_HARDWARE time, and this patch brings back callouts at the points where we used to call LOCK_HARDWARE. A new function, intel_prepare_render(), is called where we used to call LOCK_HARDWARE, and if the buffers are invalid, we call out to DRI2GetBuffers there. This lets us invalidate buffers only when notified instead of on every glViewport() call. If the loader calls the DRI invalidate entrypoint, we disable viewport triggered buffer invalidation. Additionally, we can clean up the old viewport mechanism a bit, since we can just invalidate the buffers and not worry about reentrancy and whatnot.