summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-05-13dixChangeGC callers: Use ChangeGCVal instead of XID almost everywhere.Jamey Sharp22-164/+181
The exceptions are ProcChangeGC and CreateGC. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Don't statically allocate the ChangeGC parameter array.Jamey Sharp1-17/+12
Because that's insane. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Simplify miFillPolyHelper and miLineArc.Jamey Sharp1-52/+27
Both functions compute a set of spans and either fill them immediately or accumulate them into a caller-provided buffer. Computing the spans used only the miTranslate and lineWidth fields of pGC, and neither could have been changed by the initial ChangeGC/ValidateGC pair, so it's safe to compute the spans first. Then both functions consume the spans the same way, so factor that into a new fillSpans function. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13miwideline: Factor out span buffer allocation.Jamey Sharp1-74/+32
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-13xselinux: Remove use of devPrivates init/free callbacks.Eamon Walsh2-46/+5
Commit eb9210097efea81065c301e5b6b4da7a566deb4a removed the sidget/sidput calls which were the major reason for using the callbacks. The remaining operations can be skipped or worked around. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURNJeremy Huddleston5-44/+24
Use the values from xproto rather than duplicating the effort Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13dri2: Send out event when auxillary buffers are invalidatedKristian Høgsberg5-11/+106
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-13Remove ResNoAvoid definition, missed in the RAC removalAlan Coopersmith1-3/+0
ResNoAvoid is #defined to ResBios, but ResBios was removed from xf86str.h in 4b42448a2388d40f257774fbffdccaea87bd0347 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-12CreateGC: Pass current client on to ChangeGC.Jamey Sharp1-1/+1
Otherwise we can't check that the XIDs this GC is being initialized with are accessible to this client. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2010-05-12Kill ChangeGC in favor of dixChangeGC.Jamey Sharp9-33/+18
This doesn't change any behavior, but it isn't clear whether NullClient is correct in all cases. As ajax says, > For most of these changes, I think it's correct to use NullClient, > since they are server-initiated changes and should not fail for (eg) > xace reasons. ... At any rate, you're certainly not changing any > semantics by leaving them all as NullClient, so this patch can't be > more wrong than before. The call in CreateGC is particularly questionable. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-12Kill DoChangeGC in favor of dixChangeGC.Jamey Sharp14-92/+40
This doesn't change any behavior, but it isn't clear whether NullClient is correct in all cases. As ajax says, > For most of these changes, I think it's correct to use NullClient, > since they are server-initiated changes and should not fail for (eg) > xace reasons. ... At any rate, you're certainly not changing any > semantics by leaving them all as NullClient, so this patch can't be > more wrong than before. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-12doPolyText needs UseAccess to each font, not ReadAccess.Jamey Sharp1-1/+1
In commit 42d6112ec21949a336ee8b34469f2695273ee2d6, Eamon changed dixChangeGC to require DixUseAccess on any GCFont XID. I think doPolyText needs to require the same level of access. Otherwise dixChangeGC could fail when it does the same lookup, which doPolyText doesn't check for. Signed-off-by: Jamey Sharp <jamey@minilop.net> Cc: Eamon Walsh <ewalsh@tycho.nsa.gov> Reviewed-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2010-05-12Merge remote branch 'dottedmag/for-keithp'Keith Packard7-35/+40
2010-05-13Misc coding style cleanupMikhail Gusarov1-4/+4
Use a[b] instead of *(a+b), fix whitespace. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Remove useless castsMikhail Gusarov1-12/+13
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Fix code style: extra whitespace before ()Mikhail Gusarov1-1/+1
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Fix warning: it's safe to pass atom strings > XA_LAST_PREDEFINED to free(3)Mikhail Gusarov1-2/+7
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-13Mark OsAbort as noreturn function to make gcc happier.Mikhail Gusarov1-1/+1
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13Introduce X_NORETURN macro defined as __attribute__((noreturn)) for gccMikhail Gusarov3-7/+9
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13Do not jump through the hoops to deallocate xkbbasedirflag variableMikhail Gusarov1-5/+3
Fixes gcc warning as well. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13Turn sprintf argument into literaral string, shutting up gcc warningMikhail Gusarov1-3/+2
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13Do not use deprecated Xalloc functionMikhail Gusarov1-1/+1
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-12SetFontPath: set client->errorValue on failure.Jamey Sharp4-22/+11
Previously the callers were only setting errorValue on Success, when it's ignored, and leaving it alone on failure, when it's sent to the client. Since SetFontPath takes the ClientPtr, let it set client->errorValue instead of letting the callers continue to get it wrong. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-13Removed outdated comments obsoleted by documentation in headersMikhail Gusarov1-27/+0
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13Use lowercase variant of XNFalloc and XstrdupMikhail Gusarov2-2/+2
Using one variant of function/macro makes it easier to fix the code later. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov345-3011/+3011
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-13Deprecate allocation functions which are plain wrappers for C stdlibMikhail Gusarov1-4/+5
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13Document allocation functions, noting deviations from C libraryMikhail Gusarov1-0/+36
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-13Clean {X,XNF}{alloc,calloc,realloc,free,strdup} from pre-C89 baggageMikhail Gusarov2-71/+51
C89 guarantees alignment of pointers returned from malloc/calloc/realloc, so stop fiddling with alignment manually and just pass the arguments to library functions. Also convert silent error when negative size is passed into function into warning in log file. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-12dri2: Copy front to fake front in swapbufferKristian Høgsberg1-0/+10
If we don't have a fake front, nothing will happen. The fix was extracted from a bigger patch from Francisco Jerez. https://bugs.freedesktop.org/show_bug.cgi?id=27305 Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Pauli Nieminen <suokkos@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-11XQuartz GL: Fix __glXAquaScreenCreateDrawable prototypeJeremy Huddleston1-4/+6
Fixes regression introduced in 9de0e31746d5f0d9d39d11c94ec3cbc04a9935fc Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-11Remember drawable ID used to find damage target for use in events. Bug 5730.Keith Packard2-1/+3
Using Composite, window pixmaps are given names in the client resource namespace and yet may not have any XID recorded in the drawable structure. As such, we need to remember the XID used to lookup the pixmap in the resource database so that we can report the correct XID back to the client in damage events. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-11Merge remote branch 'krh/dri2-resource-fixes'Keith Packard10-48/+182
2010-05-11Fix null pointer dereference in xf86_reload_cursors().Cyril Brulebois1-1/+1
Upon resume, X may try to dereference a null pointer, which has been reported in Debian bug #507916 (http://bugs.debian.org/507916). Jim Paris came up with a patch which solves the problem for him. Here's a (hopefully) fixed version of his patch (without the typo). Cc: Jim Paris <jim@jtan.com> Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-By: Matthias Hopf <mhopf@suse.de> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-11dri2: Take an XID for tracking the DRI2 drawableKristian Høgsberg8-44/+164
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-11list.h: Add list_for_each_entry_safe()Kristian Høgsberg1-0/+6
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
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-05-11dix: Update element count in FreeResource*()Kristian Høgsberg1-1/+9
FreeResource() keeps clientTable[cid].elements up to date with the number of resources allocated to the client. The other free resource functions (FreeResourceByType(), FreeClientNeverRetainResources() and FreeClientResources()) don't maintain this invariant. Typically, the only consequence is that the element count is too high and we end up allocating the hash table bigger than necessary. However, FreeResource() also relies on the element count to restart the search if the list of resources has been changed during a resource destruction callback. Since FreeResourceByType() doesn't update the count, if we call that from a resource destruction callback from FreeResource(), the loop isn't restarted and we end up following an invalid next pointer. Furthermore, LookupClientResourceComplex() and FreeClientNeverRetainResources() don't use the element count to detect if a callback deleted a resource and may end up following an invalid next pointer if the resource system is called into recursively. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-11xfree86: dga needs to use the master keyboard state (#27573)Peter Hutterer1-1/+3
GetPairedDevice() may not always return the keyboard, resulting in a null-pointer dereference when accessing the XKB state. For floating devices, the GetMaster() returns the device itself. X.Org Bug 27573 <http://bugs.freedesktop.org/show_bug.cgi?id=27573> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Tested-by: Ben Hutchings <ben@decadent.org.uk>
2010-05-10Fix wrong bracket values when startOver = FALSE.David James1-11/+8
Currently, SyncComputeBracketValues reuses old values of bracket_greater and bracket_less when startOver = FALSE. This can result in incorrect bracket values. To fix this issue, the startOver parameter is removed, and we do not reuse old values of bracket_greater and bracket_less. X.Org Bug 27023 <http://bugs.freedesktop.org/show_bug.cgi?id=27023> Signed-off-by: David James <davidjames@google.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-10Merge remote branch 'jamey/for-keith'Keith Packard4-146/+120
2010-05-10Simplify error-handling in dixChangeGC.Jamey Sharp1-71/+46
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-10miPolyPoint bugfix: Check memory allocation before changing the GC.Jamey Sharp1-2/+3
miPolyPoint ought to leave the GC unchanged even if it fails. ajax says: > We have a new winner for the oldest-bug competition! It's actually > been like that since X11R1: > > -rw-r--r--. 1 ajax ajax 2817 1987-09-12 01:20 ddx/mi/mipolypnt.c Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-10Move AppendSpanGroup from miwideline.h to miwideline.c.Jamey Sharp2-27/+30
Also make it stop being a macro. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-10Expand macros that are used only in miFillPolyHelper.Jamey Sharp2-46/+41
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Keith Packard <keithp@keithp.com>
2010-05-08dmxBERestoreRenderGlyph was passing wrong value to freeKeith Packard1-1/+1
Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-07mi: Delete wide ellipse arc cacheAdam Jackson1-107/+11
This does make wide ellipses slower, by a factor of twoish: 946000.0 521000.0 ( 0.55) 10-pixel wide ellipse 98300.0 49900.0 ( 0.51) 100-pixel wide ellipse 17700.0 9310.0 ( 0.53) 500-pixel wide ellipse 16900.0 7980.0 ( 0.47) 100-pixel wide dashed ellipse 16100.0 5370.0 ( 0.33) 100-pixel wide double-dashed ellipse But no one cares, and it's a modest size win: text data bss dec hex filename 1773824 69552 59288 1902664 1d0848 hw/vfb/Xvfb.before 1773112 69552 58648 1901312 1d0300 hw/vfb/Xvfb Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07Return BadPicture, not BadPixmap, if alpha-map is invalid.Jamey Sharp1-1/+1
I believe this is what was intended. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07VERIFY_PICTURE always returns BadPicture. Don't bother specifying.Jamey Sharp4-98/+53
Same goes for VERIFY_ALPHA, VERIFY_XIN_PICTURE, and VERIFY_XIN_ALPHA. Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-05-07Introduce dixLookupFontable for "FONT or GC" parameters.Jamey Sharp5-48/+33
Signed-off-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>