summaryrefslogtreecommitdiff
path: root/glx/glxdri2.c
AgeCommit message (Collapse)AuthorFilesLines
2012-07-13glx: Fix checking GL versionBartosz Brachaczek1-1/+1
Signed-off-by: Bartosz Brachaczek <b.brachaczek@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Dave Airlie <airlied@gmail.com>
2012-07-13glx/dri2: don't return NULL in a function with no return.Dave Airlie1-1/+1
Reported by gcc. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-13glx/dri2: use correct define from dri attribs.Dave Airlie1-1/+1
Looks like idr renamed this and pushed the wrong one. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-13glx/dri2: fix incorrect == vs =Dave Airlie1-1/+1
glxdri2.c:486: warning: statement with no effect Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-13glx/dri2: fix typo in the notification reset for robustness.Dave Airlie1-1/+1
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-13glx: pass screen into the convert functionDave Airlie1-2/+3
when robustness is enabled, this is required. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-12glx: Free DRI2 drawable reference to destroyed GLX drawable.Michel Dänzer1-2/+6
Otherwise the reference can lead to use after free in __glXDRIinvalidateBuffers(). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50019 Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-09Use C99 designated initializers in extension EventsAlan Coopersmith1-2/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-07dri2: add initial prime support. (v1.2)Dave Airlie1-1/+1
This adds the initial prime support for dri2 offload. The main thing is when we get a connection from a prime client, we stored the information and mark all drawables from that client as prime. We then create all buffers for that drawable on the prime device dri2screen. Then DRI2UpdatePrime is provided which drivers can call to get a shared pixmap which they can use as the front buffer. The driver is then responsible for doing the back->front copy to the shared buffer. prime requires a compositing manager be run, but it handles the case where a window get un-redirected by allocating a new pixmap and pointing the crtc at it while the client is in that state. Currently prime can't handle pageflipping, so always does straight copy swap, v1.1: renumber on top of master. v1.2: fix auth on top of master. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-05glx/dri2: Enable GLX_ARB_create_context_robustnessIan Romanick1-3/+58
If the driver supports __DRI2_ROBUSTNESS, then enable GLX_ARB_create_cotnext_robustness as well. If robustness values are passed to glXCreateContextAttribsARB and the driver doesn't support __DRI2_ROBUSTNESS, existing drivers will already generate the correct error values (so that the correct GLX errors are generated). Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-05glx: Implement GLX_EXT_create_context_es2_profileIan Romanick1-0/+7
This patch builds on the infrastucture put in place for GLX_ARB_create_context_profile. If GLX_CONTEXT_ES2_PROFILE_BIT_EXT is specified and the requested version is 2.0, create a context with the __DRI_API_GLES2 API. This change assumes that any DRI2 driver can handle (possibly by saying "no seeing an API setting other than __DRI_API_OPENGL or __DRI_API_OPENGL_CORE. This allows enabling the extension any time GLX_ARB_create_context (and GLX_ARB_create_context_profile) is enabled. v2: Clean up some comments. Note that our behavior for GLX_CONTEXT_ES2_PROFILE_BIT_EXT w/version != 2.0 matches NVIDIA's. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-05glx: Implement GLX_ARB_create_context_profileIan Romanick1-3/+30
Most of the infrastructure was already in place. This just adds: * Validate values specified with the GLX_CONTEXT_PROFILE_MASK_ARB attribute. * Select a DRI2 "api" based on the setting of GLX_CONTEXT_PROFILE_MASK_ARB. * Enable GLX_ARB_create_context_profile extension. This change assumes that any DRI2 driver can handle (possibly by saying "no") seeing an API setting other than __DRI_API_OPENGL. This allows enabling this extension any time GLX_ARB_create_context is enabled. Also, the validation code in __glXDisp_CreateContextAttribsARB is structured in a very verbose manner (using a switch-statement) to ease the addition of GLX_EXT_create_context_es2_profile. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2012-06-14Merge remote-tracking branch 'idr/GLX_ARB_create_context'Keith Packard1-6/+155
2012-06-05api: rework the X server driver API to avoid global arrays.Dave Airlie1-8/+6
This is a squash merge containing all the API changes, as well as the video ABI bump. Its been squashed to make bisection easier. Full patch log below: commit b202738bbf0c5a1c1172767119c2c71f1e7f8070 Author: Aaron Plattner <aplattner@nvidia.com> Date: Mon May 14 15:16:11 2012 -0700 xfree86: Bump video ABI to 13.0 The ABI was broken by changes to convert from screen index numbers to ScreenPtr / ScrnInfoPtr in various structures and function signatures. Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3 Author: Dave Airlie <airlied@redhat.com> Date: Thu May 24 10:56:57 2012 +0100 xf86: xf86ClearEntityListForScreen should take a pScrn When adding GPU screens this make life easier. (also fix comment, as pointed out by Alan) Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dave Airlie <airlied@redhat.com> commit afee8b5ab4501597ecc1ade34124d7ca227ab055 Author: Dave Airlie <airlied@redhat.com> Date: Thu May 24 07:07:32 2012 +0100 xf86i2c: add pscrn for drivers to use This just adds a pScrn pointer into the struct for the drivers to use instead of scrnIndex. Mostly scrnIndex is used for logging, but some drivers use it to lookup xf86Screens, so let them stash a pScrn instead. Removing the scrnIndex is a bit more involved and I'm not sure its worth the effort. Doing i2c in the X server is legacy code as far as I'm concerned. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit ea5092f1f679691d187f1eee9427e6057beec56e Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 19:25:20 2012 +0100 dix/gc: consolidate GC object creation in one place The standard GC create and scratch GC create were 90% the same really, and I have a need in the future for creating GC objects without the other bits, so wanted to avoid a third copy. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 10:24:06 2012 +0100 xf86: add a define to denote the new non-index interfaces are being used This can be used by drivers to provide compatible APIs. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 15:09:12 2012 +0100 dix: make Create/Free scratch pixmaps take a ScreenPtr While technically an API/ABI change I doubt anyone uses it, but it helps in splitting screens up. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 14:57:55 2012 +0100 xf86/xv: remove scrnIndexfrom xf86FindXvOptions. Move this interface to taking an ScrnInfoPtr. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 14:53:59 2012 +0100 xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2) stop passing indices into this function. v2: drop flags argument. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 58824e414f35682435f15bfe6c4b656bd90b9235 Author: Dave Airlie <airlied@redhat.com> Date: Wed May 23 14:48:09 2012 +0100 xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI) Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:18:59 2012 +0100 xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2) Instead of passing an index, pass the actual ScreenPtr. This allows more moving towards not abusing xf86Screens + screenInfo. v2: drop the blockData/wakeupData args as per ajax's suggestion., fix docs. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 790d003de20fb47674420a24dadd92412d78620d Author: Dave Airlie <airlied@gmail.com> Date: Wed Apr 11 09:53:14 2012 +0100 xf86/common: remove some more pScrn->pScreen uses remove some more conversions that appeared after api cleanups. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 16:34:53 2012 +0100 ddc: change API to take ScrnInfoPtr (v2) This removes all xf86Screens usage from ddc code, it modifies the API for some functions to avoid taking indices. v2: address Alan's comments about dropping DDC2Init parameter. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit fe3f57b6eaf6860a33876a54f9439f69578f03a5 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 16:31:26 2012 +0100 vbe: don't use index for VBEInterpretPanelID (API) Remove use of xf86screens from vbe module. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit abf1965f4ed91529036d3fdb470d6a3ce6f29675 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 16:25:11 2012 +0100 int10/vbe: don't use xf86Screens. (ABI) (v3) Pass the ScrnInfoPtr instead of the index in the int10 struct. This saves us using it to dereference xf86Screens. v2: address Alan's comment to fix struct alignment. v3: squash in all the int10 fixes, test the vm86 code builds, after comments by Keith. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 23cca612b4fb5efc33683c7624b803b457387e3d Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:30:18 2012 +0100 xserver: drop index argument to ScreenInit (ABI/API) (v2) This drops the index argument, its the same as pScreen->myNum, and its the last major index abuse I can find. v2: address Alan's review - update docs, fix xwin/xnest/darwin Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:23:01 2012 +0100 xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API) This migrates PointerMoved from an index to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:20:46 2012 +0100 xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API) This migrates the PMEvent from index to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:18:30 2012 +0100 xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API) This migrates the SetDGAMode callback from an index to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit baf5e4818a74f2b68c3dfdcc56f54322351039a0 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:14:11 2012 +0100 xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2) This migrates the ChangeGamma interface to avoid passing a index. v2: fix xf86RandR12.c + xf86cmap.c call Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 51e5f90ada929d6b23176090badbb42fdb3fa550 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:11:09 2012 +0100 xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API) The EXA interface migrates to ScreenPtr, and the xf86 interface migrated to ScrnInfoPtr. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 94f1f21d17e86f96d4a54292a399160950087675 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 15:02:11 2012 +0100 xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API) This migrates the ValidMode to passing a ScrnInfoPtr instead of an index. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 3f8f18198fed4f39ec805b508a3482e91eea26b2 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:59:46 2012 +0100 xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2) This migrate the SwitchMode interface to take a ScrnInfoPtr instead of an index. v2: drop flags. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit d06a038a5c49328ab3a8d969d24f9fcd22c63202 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:50:37 2012 +0100 xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2) This converts AdjustFrame code paths to passing a ScrnInfoPtr instead of an integer index. v2: drop flags args. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:41:27 2012 +0100 xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2) Another index->pScrn conversion. v2: drop flags arg. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3 Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:35:41 2012 +0100 xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2) This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr instead of an index into xf86Screens. This allows dropping more public dereferences of the xf86Screens and screenInfo. v2: drop flags args as suggested by Keith, fix docs. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> commit 06729dbbc804a20242e6499f446acb5d94023c3c Author: Dave Airlie <airlied@gmail.com> Date: Tue Apr 10 14:04:59 2012 +0100 xserver: remove index from CloseScreen (API/ABI breakage) This drops the index from the CloseScreen callback, its always been useless really, since the pScreen contains it. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-23glx: Optionally call DRI2 createContextAttribs from __glXDRIscreenCreateContextIan Romanick1-5/+151
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-05-23glx: Extend __GLXscreen::createContext to take attributesIan Romanick1-1/+4
The attributes will be used for glXCreateContextAttribsARB additions in follow-on patches. v2: Add missing 'int *error' parameters noticed by Christopher James Halse Rogers. v3: Remove redundant 'int err;' declaration noticed by Christopher James Halse Rogers. This was supposed to be in v2, but I missed it. v4: Add comma missing from additions in v2. Ugh. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-05-21xf86: migrate to using xf86ScreenToScrn wrapper (v2)Dave Airlie1-1/+1
migrate to new helper API. This just wraps all the obvious uses of xf86Screens[pScreen->myNum], and should be fairly simple to review. v2: remove commented out lines. Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-21Introduce a consistent coding styleKeith Packard1-230/+218
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-19dri2: Invalidate window pixmapsVille Syrjälä1-1/+1
While a redirected window is flipped, its pixmap may still be used as and EGL image and should also get invalidated. When sending invalidate events for a window, also send the events for its pixmap. Signed-off-by: Ville Syrjälä <syrjala@sci.fi> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-11-24glx: don't leak driConfigsPaulo Zanoni1-3/+11
For dri, dri2 and driswrast. 12,968 (584 direct, 12,384 indirect) bytes in 1 blocks are definitely lost in loss record 569 of 570 at 0x4C2779D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x7821E3B: driConcatConfigs (utils.c:560) by 0x7827CF2: dri_fill_in_modes (dri_screen.c:224) by 0x782831E: dri_init_screen_helper (dri_screen.c:405) by 0x7826C03: drisw_init_screen (drisw.c:266) by 0x782225F: driCreateNewScreen (drisw_util.c:69) by 0x4826E2: __glXDRIscreenProbe (glxdriswrast.c:451) by 0x4812FA: GlxExtensionInit (glxext.c:327) by 0x41FB14: InitExtensions (miinitext.c:471) by 0x568622: main (main.c:208) Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-06-29DRI2/GLX: use new swap event typesJesse Barnes1-4/+3
Use the new event types so we can pass a valid SBC value to clients. Fix up the completion calls to use CARD32 instead of CARD64 to match the new field size. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-06-29GLX/DRI2: pass drawable correctly for indirect swap eventsJesse Barnes1-1/+1
Pass the right drawable pointer as data to the swap complete function. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2011-04-15glx: Use 0 rather than garbage for unknown INTEL_swap_event typesAdam Jackson1-0/+1
Otherwise the garbage you return could well be numerically identical to one of the swap type tokens, and apps which rely on us to tell the truth would be in trouble. Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-28glx: Remove ->forceCurrent from the context vtableAdam Jackson1-14/+0
All the implementations of makeCurrent and forceCurrent are identical, so just use makeCurrent everywhere. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-14glx: Factor out glxProbeDriver function.Christopher James Halse Rogers1-36/+3
DRI, DRI2 and swrast all had near-identical driver probing logic. Pull it into glxdricommon. [ajax: warning fix] Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2010-12-31GLX: DRI2: Fix mismatched-types warningDaniel Stone1-1/+1
All the DRI extension types have a base extension type as their first member to avoid exactly these types of warning. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Cyril Brulebois <kibi@debian.org>
2010-11-30glx: Remove swap barrier and hyperpipe supportAdam Jackson1-1/+0
Never implemented in any open source driver. The implementation assumed explicit DDX driver knowledge of how the client-side driver worked, since at the time the server's GL renderer was not a DRI driver. But now, it is, so any implementation of these should be done with additional DRI driver API, like the swap control extension. Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-11-11Remove more superfluous if(p!=NULL) checks around free(p).Cyril Brulebois1-3/+1
This patch has been generated by the following Coccinelle semantic patch: @@ expression E; @@ - if (E != NULL) { - free(E); - } + free(E); Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-07-13Unwrap/rewrap EnterVT/LeaveVT completely, Fixes 28998Keith Packard1-2/+15
Because some EnterVT code needs to remove it self from the call chain, we need to fix all of the wrappers to correctly unwrap/rewrap during the call chain. This is a follow-on to the fix for bug 27114 in commit 68a9ee8370e6f9b38218376ac92d5130a5b0ef1e. Signed-off-by: Keith Packard <keithp@keithp.com> Tested-by: Jesse Barnes <jesse.barnes@intel.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-22dri2: avoid crash with old dri drivers.Dave Airlie1-1/+2
I built latest server and copied over a mesa 7.8 dri2 driver to use with it, and it crashed in here starting compiz. Looks like we need to validate the flush extension is registered before calling invalidate. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Michel Dänzer <michel@daenzer.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-05Rename region macros to eliminate screen argumentKeith Packard1-3/+3
This is a combination of a huge mechanical patch and a few small fixups required to finish the job. They were reviewed separately, but because the server does not build without both pieces, I've merged them together at this time. The mechanical changes were performed by running the included 'fix-region' script over the whole tree: $ git ls-files | grep -v '^fix-' | xargs ./fix-region And then, the white space errors in the resulting patch were fixed using the provided fix-patch-whitespace script. $ sh ./fix-patch-whitespace Thanks to Jamey Sharp for the mighty fine sed-generating sed script. The hand-done changes involve removing functions from dix/region.c that duplicate inline functions in include/regionstr.h, along with their declarations in regionstr.h, mi.h and mispans.h. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-19Set event sequence number in WriteEventsToClient instead of at callers.Jamey Sharp1-1/+0
TryClientEvents already did this; this commit just moves the assignment one level down so that no event source has to worry about sequence numbers. ...No event source, that is, except XKB, which inexplicably calls WriteToClient directly for several events. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-13dri2: Send out event when auxillary buffers are invalidatedKristian Høgsberg1-1/+22
This lets the DRI2 clients rely on the server to notify them when they need to get new buffers. Without this, OpenGL clients poll the server in glViewport() which can be a performance problems and also isn't completely correct behaviour. We bump the DRI2 protocol minor to indicate the availability of the event, which the DRI2 clients can use to avoid polling. This speeds up various piglit and oglc test cases as well as real applications. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov1-11/+11
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-11dri2: Take an XID for tracking the DRI2 drawableKristian Høgsberg1-4/+6
Some pixmaps (window pixmaps and scratch pixmaps) don't have the drawable->id set and thus DRI2 gets confused when using that field for looking up the DRI2 drawable. Go back to using privates for getting at the DRI2 drawable from a DrawablePtr. We need to keep the resource tracking in place so we can remove the DRI2 drawable when the X resource it was created for goes away. Additionally, we also now track the DRI2 drawable using a client XID so we can reclaim the DRI2 drawable even if the client goes before the drawable and doesn't destroy the DRI2 drawable. Tested-by: Owen W. Taylor <otaylor@fishsoup.net> Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
2010-05-11glxdri2: Hard-code the extension version we needKristian Høgsberg1-3/+3
If we use the #define'd version from dri_interface.h, the server will require at least that version of the extension. If we're compiling against a dri_interface.h with a newer version we don't really require, glxdri2 will require a too high version of the extension. The right approach is to just hard-code the version we need instead of using the #defines. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-04-16DRI2: Track DRI2 drawables as resources, not privatesKristian Høgsberg1-5/+0
The main motivation here is to have the resource system clean up the DRI2 drawable automatically so glx doesn't have to. Right now, the glx drawable resource must be destroyed before the X drawable, so that calling DRI2DestroyDrawable doesn't crash. By making the DRI2 drawable a resource, GLX doesn't have to worry about that and the resource destruction order becomes irrelevant. https://bugs.freedesktop.org/show_bug.cgi?id=26394 Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-12glx: Set the pbuffer bit for dri2 fbconfigsKristian Høgsberg1-1/+4
They've been implemented for a while, but we never advertised them. All we need to do is set the GLX_PBUFFER_BIT in the drawable type fbconfig field when we're using DRI2. https://bugs.freedesktop.org/show_bug.cgi?id=26581 Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-29GLX/DRI2: expose swap control extensions if DDX support is presentJesse Barnes1-14/+9
Export DDX swap control status from the DRI2 module and check for it in GLX when initializing extensions. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-24glx: Compile fix to let server compile with new and old mesaKristian Høgsberg1-0/+7
We broke the __DRI2_FLUSH API since it was never released, but since it's taking a little longer than expected to get the X server side of the changes ready, fix things up so it compiles. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27dri2: Fix order of operations issue in __glXdriSwapEvent test.Eric Anholt1-1/+1
Clients would have received swap events regardless of asking for it. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-11GLX/DRI2: add INTEL_swap_event supportJesse Barnes1-1/+42
This allows clients to easily check for swap completion status in their main loop. Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@nwnk.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-01-11DRI2: add support for new DRI2 protocol requestsJesse Barnes1-11/+50
Support the new DRI2 2.2 protocol requests: DRI2SwapBuffers, DRI2GetMSC, DRI2WaitMSC, DRI2WaitSBC and DRI2SwapInterval. These requests allow the server to support the SGI_video_sync, SGI_swap_interval, and OML_sync_control GLX extensions if DDX support is present. The new DDX APIs are documented in dri2.h. Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@nwnk.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-10-01GLX: More clearly document the GLX protocol version handlingIan Romanick1-4/+2
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-09-29GLX: Enable GLX 1.4 on DRI2Ian Romanick1-0/+14
Return the minimum GLX version supported by all screens. Assume that DRI2 screens have all the required features for GLX 1.4. Assume that everyone else can only support GLX 1.2. Reviewed-by: Kristian Høgsberg <krh@redhat.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-07-05dri2: Enable GLX_SGI_make_current_read when the DRI driver supports it.Eric Anholt1-0/+9
This matches idr's 82f150d73cc9a7d8eaf7241a51b03af05bcec159 for DRI1.
2009-04-24DRI2: Implement protocol for DRI2GetBuffersWithFormatIan Romanick1-7/+52
This change implements the protocol for DRI2GetBuffersWithFormat, but the bulk of the differences are the changes to the extension / driver interface to make this function work. The old CreateBuffers and DeleteBuffers routines are replaced with CreateBuffer and DeleteBuffer (both singular). This allows drivers to allocate buffers for a drawable one at a time. As a result, 3D drivers can now allocate the (fake) front-buffer for a window only when it is needed. Since 3D drivers only ask for the front-buffer on demand, the real front-buffer is always created. This allows CopyRegion impelemenations of SwapBuffers to continue working. As with previous version of this code, if the client asks for the front-buffer for a window, we instead give it the fake front-buffer. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kristian Høgsberg <krh@redhat.com>
2009-04-20DRI2: Add missing front-buffer flush callback.Ian Romanick1-0/+8
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-15DRI2: Don't leave empty entries in private->buffersIan Romanick1-8/+9
This should fix bug #21130. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2009-04-13glx: Fix drawable private leak on destroyKristian Høgsberg1-0/+2
When a drawable goes away, we don't destroy the GLX drawable in full, since it may be current for a context. This means that when the drawable is destroyed in full later, the backend doesn't get a chance to destroy resources associated with the drawable (the DRI2Drawable). With this patch, we destroy the GLX drawable in full when it goes away and then track down all contexts that reference it and NULL their pointers.