Commit Graph

54 Commits

Author SHA1 Message Date
Adam Jackson 1e5f478b7e dix: Fix undefined shift in HashResourceID
Again, we need all of the bits of an unsigned int to make this work.
2019-10-15 14:06:21 -04:00
Olivier Fourdan c74c074d8e dix: export ResourceClientBits()
ResourceClientBits() might be used by the modules as well, need to
mark the symbol as visible to that the linker can resolve it at
run time.

/usr/bin/X: symbol lookup error:
/usr/lib64/xorg/modules/extensions/libglx.so: undefined symbol:
ResourceClientBits

bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91763
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-09-01 20:11:26 -07:00
Olivier Fourdan d206c240c0 configurable maximum number of clients
Make the maximum number of clients user configurable, either from the command
line or from xorg.conf

This patch works by using the MAXCLIENTS (raised to 512) as the maximum
allowed number of clients, but allowing the actual limit to be set by the
user to a lower value (keeping the default of 256).

There is a limit size of 29 bits to be used to store both the client ID and
the X resources ID, so by reducing the number of clients allowed to connect to
the X server, the user can increase the number of X resources per client or
vice-versa.

Parts of this patch are based on a similar patch from Adam Jackson
<ajax@redhat.com>

This now requires at least xproto 7.0.28

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2015-08-24 00:00:18 -07:00
Peter Hutterer 732fd7e571 Drop trailing whitespaces
sed -i "s/[ ]\+$//g" **/*.(c|h)

happy reviewing...
git diff -w is an empty diff.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Peter Harris 5eb77697ea Avoid starting a comment with */*
Even though -Wcomment doesn't mind it (in gcc or clang), the appearance
of */* confuses the syntax highlighter of some editors (eg. vim), and
causes warnings in MSVC.

Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-07-17 10:19:52 -07:00
Keith Packard 60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Michal Suchanek 1927e5ab25 xserver: Remove duplicate declaration in resource.h
Signed-off-by: Michal Suchanek <hramrach@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-14 13:17:08 +01:00
Erkki Seppälä 233eab4d05 dix: add reference count of the resource to ResourceSizeRec
The ResourceSizeRec now contains the number of references to the
resource. For example a Pixmap knows this value and it can be useful
for determining the "weight" of the resource. Typically this value
is 1.

Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
2012-04-18 12:49:11 +03:00
Erkki Seppälä a2ac01a8ea dix: don't use a local wrapper for calling HashResourceID
Calls to Hash(client, id) were replaced with calls directly to
HashResourceID(id, clientTable[client].hashsize) and the Hash-function
was removed.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
2012-04-18 12:44:49 +03:00
Erkki Seppälä a0b0fb83f9 dix: add hashing functions to resource.h for others to use.
The public hashing function HashResourceID uses the same hashing
hashing algorithm as resource.c uses internally, but it provides an
interface that will is usable by external modules. It provides a
parameter for the number of bits for the hash, instead of finding the
size from its internal hash table.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
2012-04-18 12:43:54 +03:00
Erkki Seppälä 3ba0decb4b dix: add a mechanism for iterating through all subresources
The mechanism allows iterating even through subresources that don't
have specific XID's. When such 'resources' are iterated, the XID for
them will be zero. A resource type can assign an iteration function
for its subresources with SetResourceTypeFindSubResFunc; by default
resources are assumed not to contain subresources.

The purpose of this extension is to enable accurate accounting of
the resources a resource consumes or uses.

This patch provides the subresource iteration functions for Windows
and GCs.

Reviewed-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
2012-04-18 12:36:25 +03:00
Rami Ylimäki e83388cc70 render: Report pixmap usage of pictures to resource extension.
Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2012-04-18 12:31:24 +03:00
Keith Packard 9838b7032e Introduce a consistent coding style
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>
2012-03-21 13:54:42 -07:00
Alan Coopersmith 2ddae8f0bd constify strings in resource name registry
LookupResourceName already returned a const char *, so just needed
to change the variable we're storing the list in to be a const char **
and then add const to the name argument to RegisterResourceName
(which just stores name in the array) and CreateNewResourceType
(which just passes name to RegisterResourceName).

Clears a bunch of gcc warnings of the form:
registry.c:319:5: warning: passing argument 2 of 'RegisterResourceName' discards qualifiers from pointer target type
registry.c:200:1: note: expected 'char *' but argument is of type 'const char *'

and from all the extensions:
damageext.c: In function 'DamageExtensionInit':
damageext.c:490:5: warning: passing argument 2 of 'CreateNewResourceType' discards qualifiers from pointer target type
../include/resource.h:159:26: note: expected 'char *' but argument is of type 'const char *'

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-12-12 17:03:08 -08:00
Adam Jackson 016edc1751 dix: Define RESTYPE as uint32_t
long is needlessly long on LP64.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-14 13:57:20 -04:00
Adam Jackson 82a8677d91 dix: Remove deprecated.c
No more internal users, this can be dropped now.

Reviewed-by: Soren Sandmann <ssp@redhat.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-03-08 13:17:24 -05:00
Daniel Stone f7d8ade3c5 Resources: Move rClient to resource.h
The definition of rClient was duplicated across three source files, so
move it to resource.h.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-12-31 12:36:44 +00:00
Jamey Sharp c38552d115 Add typed resource-lookup errors for non-core resource types.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-05-19 12:32:48 -07:00
Jeremy Huddleston bca85e2e12 Use _X_ATTRIBUTE_PRINTF _X_DEPRECATED _X_NORETURN
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-13 10:03:23 -07:00
Keith Packard 7dde50c649 Move X_DEPRECATED to misc.h so it can be used outside resource.h
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-04-30 12:50:31 -07:00
Alan Coopersmith 895f40792a Add type name argument to CreateNewResourceType
Convert all calls of CreateNewResourceType to pass name argument

Breaks DIX ABI.

ABI versions bumped:

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-18 17:44:12 -08:00
Peter Hutterer 9005ec4ce1 dix: remove dixLookupResource - we don't have any users left.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
2009-09-07 10:51:16 +10:00
Keith Packard f8dd80d13b Replace dixLookupResource by dixLookupResourceBy{Type,Class}
dixLookupResource attempted to automatically detect whether the caller
wanted a lookup by-type or by-class, unfortunately, it guessed wrong for
RT_NONE. Instead of trying to make the guess better, this patch just reverts
the unification and creates separate functions for each operation.
2009-03-09 13:08:09 -07:00
Paulo Cesar Pereira de Andrade 49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00
Eamon Walsh c8feb73f58 Merge branch 'master' into XACE-SELINUX
Conflicts:

	Xext/EVI.c
	Xext/bigreq.c
	Xext/cup.c
	Xext/dpms.c
	Xext/fontcache.c
	Xext/mitmisc.c
	Xext/xcmisc.c
	Xext/xf86bigfont.c
	Xext/xtest.c
	configure.ac
	dbe/dbe.c
	hw/darwin/darwin.h
	hw/darwin/darwinEvents.c
	hw/darwin/iokit/xfIOKit.h
	hw/darwin/iokit/xfIOKitCursor.c
	hw/darwin/quartz/fullscreen/fullscreen.c
	hw/darwin/quartz/fullscreen/quartzCursor.c
	hw/darwin/quartz/quartz.c
	hw/darwin/quartz/quartzCommon.h
	hw/darwin/quartz/quartzCursor.c
	hw/darwin/quartz/xpr/dri.c
	hw/darwin/quartz/xpr/dristruct.h
	hw/darwin/quartz/xpr/xprCursor.c
	hw/darwin/quartz/xpr/xprFrame.c
	hw/xfree86/modes/xf86RandR12.c
	include/cursor.h
	miext/rootless/rootlessCommon.h
	miext/rootless/rootlessScreen.c
	miext/rootless/rootlessWindow.c
	render/picturestr.h

Trying to pick up the pieces from the darwin churn here...
2007-12-13 18:38:25 -05:00
Jeremy Huddleston 0ad1c359c5 Darwin: Use __APPLE__ instead of __DARWIN__
(cherry picked from commit 54654815fa)
2007-12-07 18:54:58 -08:00
Eamon Walsh 6adeba1730 dix: Add a new "registry" mechanism for registering string names of things.
Supports protocol requests, events, and errors, and resource names.
Modify XRES extension to use it.
2007-10-11 14:18:59 -04:00
Eamon Walsh 9a183d7ba5 dix: remove caching of drawables and graphics contexts. The security checks
simply bypass the cached values so they are unused.
2007-08-14 11:39:26 -04:00
Eamon Walsh ed75b05651 dix: add new, combined resource lookup function. Move all dix lookup API
deprecated so far to a new file dix/deprecated.c.  Remove the deprecation
warnings for the time being.
2007-04-04 16:00:15 -04:00
Eamon Walsh c9fb8a3533 dix: move access codes to separate header file, add DixCreateAccess. 2007-03-22 17:23:26 -04:00
Eamon Walsh b9cff1670f Add ResourceStateCallback similar in function to ClientStateCallback. 2007-03-08 12:13:52 -05:00
Eamon Walsh 2fcb45eb5d devPrivates rework: redo field offset registration, drop RC_PRIVATES class. 2007-03-08 12:13:36 -05:00
Eamon Walsh e684824709 devPrivates rework: redo interface and implementation. 2007-03-05 11:50:45 -05:00
Eamon Walsh 74f1de1de9 devPrivates rework: unhook resource system; will try a different approach. 2007-03-01 12:17:29 -05:00
Eamon Walsh 81372f9096 devPrivates rework: hook up new interface in resource system; add new
resource-adding function that takes an additional ScreenPtr argument.
2007-02-23 13:23:12 -05:00
Eamon Walsh 9a3eb0357e devPrivates rework: add RC_PRIVATES class, make ResourceRec visible in
the API, and add extra fields and structure supporting private storage.
2007-02-21 07:46:44 -05:00
Eamon Walsh 6c46645cfc Naming change: Security*Access -> Dix*Access 2006-12-14 14:45:42 -05:00
Eamon Walsh 52ba722e4c Merge branch 'XACE-modular' into my-XACE-modular 2006-08-21 18:49:31 -04:00
Alan Coopersmith c2535f6792 Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into XACE-modular 2006-08-10 10:37:59 -07:00
Eamon Walsh 9138d5a51e Make SecurityLookupIDBy* part of the base functionality. 2006-08-03 18:24:04 -04:00
Adam Jackson 0aaac95b0d Remove RCS tags. Fix Xprint makefile braindamage. 2006-07-21 17:56:00 -04:00
Eamon Walsh 37f0ae0245 Replace XC-SECURITY code with XACE security hooks
(cherry picked from 8526cd6395 commit)
2006-06-19 17:09:37 -07:00
Daniel Stone 825a95a1fa Remove use of dix-config and xorg-config.h from public headers. 2005-08-24 11:18:35 +00:00
Daniel Stone 0bb669638f Change <X11/misc.h> and <X11/os.h> to "misc.h" and "os.h". 2005-07-03 08:53:54 +00:00
Daniel Stone e03198972c Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.
Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings.
Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all
    source files in the xserver/xorg tree, predicated on defines of
    HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to
    <X11/fonts/foo.h>.
2005-07-03 07:02:09 +00:00
Daniel Stone 657b4cb8aa Change all misc.h and os.h references to <X11/foo.h>. 2005-07-01 22:32:34 +00:00
Egbert Eich 2fb5886200 Merging XORG-CURRENT into trunk 2004-04-23 19:54:30 +00:00
Egbert Eich dae90c3af9 Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 2004-03-14 08:34:49 +00:00
Egbert Eich 867451f1ab Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 2004-03-03 12:12:50 +00:00
Egbert Eich df0313d35b readding XFree86's cvs IDs 2004-02-26 13:36:15 +00:00