Commit Graph

52 Commits

Author SHA1 Message Date
Daniel Martin
d5379b350f Use ARRAY_SIZE all over the tree
Roundhouse kick replacing the various (sizeof(foo)/sizeof(foo[0])) with
the ARRAY_SIZE macro from dix.h when possible. A semantic patch for
coccinelle has been used first. Additionally, a few macros have been
inlined as they had only one or two users.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-10-30 13:45:20 -04:00
Adam Jackson
70b402be26 render: Hide/unexport some implementation details
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-08 16:40:57 -04: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
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
Daniel Stone
7cef23a6dd Render: Remove unused glyphDepths
No-one has used this since 0a71e154.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-10 00:42:09 -07:00
Dave Airlie
9d17981829 dix: introduce gpu screens. (v5)
This patch introduces gpu screens into screenInfo. It adds interfaces
for adding and removing gpu screens, along with adding private fixup,
block handler support, and scratch pixmap init.

GPU screens have a myNum that is offset by GPU_SCREEN_OFFSET (256),
this is used for logging etc.

RemoveGPUScreen isn't used until "xfree86: add platform bus hotplug support".

v2: no glyph pictures for GPU screens for now.
v3: introduce MAXGPUSCREENS, fix return value check
v4: fixup myNum when renumbering screens (ajax)
v5: drop cursor privates for now.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-06 10:35:13 +01:00
Dave Airlie
cc4fe613d0 render/exa: use glyph picture accessors
use the glyph picture accessors in the X server, render and EXA code.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:20 +01:00
Dave Airlie
a45e1d6cc6 render: add GetGlyphPicture accessor.
This is a new API to stop the drivers directly looking up the glyph pictures
in a global array. It provides a define GLYPH_HAS_GLYPH_PICTURE_ACCESSOR for
drivers to work in a compat way.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-21 12:59:20 +01: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
Keith Packard
f03be727d6 Place glyph privates at correct location within the allocate storage
A glyph allocation consists of :

  GlyphRec
  numScreens * PicturePtr
  glyph privates

Tell the dix private bits to start past the picture pointers.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-06 16:22:12 -07:00
Keith Packard
faeebead7b Change the devPrivates API to require dixRegisterPrivateKey
This patch only changes the API, not the implementation of the
devPrivates infrastructure. This will permit a new devPrivates
implementation to be layed into the server without requiring
simultaneous changes in every devPrivates user.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
2010-06-05 19:23:03 -07:00
Mikhail Gusarov
3f3ff971ec Replace X-allocation functions with their C89 counterparts
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-13 00:22:37 +07:00
Keith Packard
40858960c0 Delete loop with no effect from GlyphUninit
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-04-30 13:05:45 -07:00
Peter Harris
185185eeb4 Fix crash when all glyphs of a given depth are freed, but not all glyphsets
This is how the crash can be triggered with only two clients on the system:
Client A: (already running)
Client B: Connect
Client B: CreateGlyphSet(depthN)
Client A: Disconnect
Server: free globalGlyphs(depthN)
Client B: AddGlyphs(depthN)
Server: SEGV

This crash was introduced with the FindGlyphsByHash function
in 516b96387b. Before that revision,
ResizeGlyphSet was always called before FindGlyphRef, which would
re-create globalGlyphs(depthN) if necessary.

X.Org Bug 20718 <http://bugs.freedesktop.org/show_bug.cgi?id=20718>

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Peter Harris <pharris@opentext.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-03-24 13:02:13 +01:00
Julien Cristau
5551609494 Move SHA1 computation from render/glyph.c to os/
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Rémi Cardona <remi@gentoo.org>
2009-10-15 01:17:44 +02:00
Peter Hutterer
758ab55d2d render: set the glyph picture to NULL by default.
In a follow-up patch we may have glyphs with a NULL picture. To cope with
that, always set the pictures for glyphs to NULL at creation time and cope
with cleaning up such glyphs. Also, since compositing a NULL source doesn't
do a lot anyway, skip trying to do so.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2009-10-01 16:00:13 +10:00
Peter Hutterer
f772014c43 render: Plug a memory leak in AddGlyph. (#23286)
AddGlyph was missing the FreePicture() call that DeleteGlyph used, resulting
in a memory leak when more than one Glyph was added in a RenderAddGlyphs
request.

Since the code in AddGlyph and DeleteGlyph is identical, move into a static
function to avoid such mistakes in the future.

X.Org Bug 23286 <http://bugs.freedesktop.org/show_bug.cgi?id=23286>
2009-09-28 12:59:27 +10: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
Paulo Cesar Pereira de Andrade
d6cbd4511e Export symbols defined in the sdk.
This is the biggest "visibility" patch. Instead of doing a "export"
symbol on demand, export everything in the sdk, so that if some module
fails due to an unresolved symbol, it is because it is using a symbol
not in the sdk.

  Most exported symbols shouldn't really be made visible, neither
advertised in the sdk, as they are only used by a single shared object.

  Symbols in the sdk (or referenced in sdk macros), but not defined
anywhere include:
XkbBuildCoreState()
XkbInitialMap
XkbXIUnsupported
XkbCheckActionVMods()
XkbSendCompatNotify()
XkbDDXFakePointerButton()
XkbDDXApplyConfig()
_XkbStrCaseCmp()
_XkbErrMessages[]
_XkbErrCode
_XkbErrLocation
_XkbErrData
XkbAccessXDetailText()
XkbNKNDetailMaskText()
XkbLookupGroupAndLevel()
XkbInitAtoms()
XkbGetOrderedDrawables()
XkbFreeOrderedDrawables()
XkbConvertXkbComponents()
XkbWriteXKBSemantics()
XkbWriteXKBLayout()
XkbWriteXKBKeymap()
XkbWriteXKBFile()
XkbWriteCFile()
XkbWriteXKMFile()
XkbWriteToServer()
XkbMergeFile()
XkmFindTOCEntry()
XkmReadFileSection()
XkmReadFileSectionName()
InitExtInput()
xf86CheckButton()
xf86SwitchCoreDevice()
RamDacSetGamma()
RamDacRestoreDACValues()
xf86Bpp
xf86ConfigPix24
xf86MouseCflags[]
xf86SupportedMouseTypes[]
xf86NumMouseTypes
xf86ChangeBusIndex()
xf86EntityEnter()
xf86EntityLeave()
xf86WrapperInit()
xf86RingBell()
xf86findOptionBoolean()
xf86debugListOptions()
LoadSubModuleLocal()
LoaderSymbolLocal()
getInt10Rec()
xf86CurrentScreen
xf86ReallocatePciResources()
xf86NewSerialNumber()
xf86RandRSetInitialMode()
fbCompositeSolidMask_nx1xn
fbCompositeSolidMask_nx8888x0565C
fbCompositeSolidMask_nx8888x8888C
fbCompositeSolidMask_nx8x0565
fbCompositeSolidMask_nx8x0888
fbCompositeSolidMask_nx8x8888
fbCompositeSrc_0565x0565
fbCompositeSrc_8888x0565
fbCompositeSrc_8888x0888
fbCompositeSrc_8888x8888
fbCompositeSrcAdd_1000x1000
fbCompositeSrcAdd_8000x8000
fbCompositeSrcAdd_8888x8888
fbGeneration
fbIn
fbOver
fbOver24
fbOverlayGeneration
fbRasterizeEdges
fbRestoreAreas
fbSaveAreas
composeFunctions
VBEBuildVbeModeList()
VBECalcVbeModeIndex()
TIramdac3030CalculateMNPForClock()
shadowBufPtr
shadowFindBuf()
miRRGetScreenInfo()
RRSetScreenConfig()
RRModePruneUnused()
PixmanImageFromPicture()
extern int miPointerGetMotionEvents()
miClipPicture()
miRasterizeTriangle()
fbPush1toN()
fbInitializeBackingStore()
ddxBeforeReset()
SetupSprite()
InitSprite()
DGADeliverEvent()

  SPECIAL CASES
o defined as _X_INTERNAL
	xf86NewInputDevice()
o defined as static
	fbGCPrivateKey
	fbOverlayScreenPrivateKey
	fbScreenPrivateKey
	fbWinPrivateKey
o defined in libXfont.so, but declared in xorg/dixfont.h
	GetGlyphs()
	QueryGlyphExtents()
	QueryTextExtents()
	ParseGlyphCachingMode()
	InitGlyphCaching()
	SetGlyphCachingMode()
2008-11-29 23:56:06 -02:00
Adam Jackson
8a5b89e8e1 xalloc+memset(0) -> xcalloc 2008-10-06 15:36:51 -04:00
Adam Jackson
0b7b89fbac xalloc+bzero -> xcalloc 2008-10-06 14:19:30 -04:00
Keith Packard
a39377cbcb Revert "Render: Use built-in SHA1 library"
This reverts commit d3bd31fddf.

X.org should not be providing a custom SHA1 implementation.
2008-09-23 09:22:07 -07:00
John Tapsell
d3bd31fddf Render: Use built-in SHA1 library
Getting an external library for SHA1 is a mess, so just use our own,
regrettably.  Public domain implementation.
2008-09-23 18:56:32 +03:00
Eamon Walsh
8689849149 Remove unused GetGlyphPrivatesForScreen. 2008-08-27 19:17:15 -04:00
Alan Coopersmith
b6a0c6d486 Allow using libmd instead of libcrypto for SHA1 hashing in render/glyph.c
Builders can force one or the other by passing SHA1_LIB & SHA1_CFLAGS
to configure
2008-05-06 17:06:34 -07:00
Eamon Walsh
a52c9b2a59 Merge branch 'master' into XACE-SELINUX
Conflicts:

	dix/dispatch.c
	dix/property.c
	hw/xfree86/common/xf86VidMode.c
	include/xkbsrv.h
	render/glyph.c
	xkb/xkbActions.c
2007-11-05 19:08:36 -05:00
Aaron Plattner
f2e310132f Add CreatePixmap allocation hints.
These hints allow an acceleration architecture to optimize allocation of certain
types of pixmaps, such as pixmaps that will serve as backing pixmaps for
redirected windows.
2007-11-04 16:11:28 -08:00
Aaron Plattner
2251572062 Restore the CompositeGlyphs -> ps->Glyphs -> miGlyphs callchain to allow acceleration architectures to wrap above miGlyphs. 2007-10-26 15:14:03 -07:00
Bernardo Innocenti
0e749ceab4 Include stddef.h for size_t.
This is required by a buggy version of the openssl/sha.h header
which is distributed with Fedora 7.
2007-10-26 10:55:48 -04:00
Eamon Walsh
b633d54b94 Merge branch 'master' into XACE-SELINUX
Conflicts:

	GL/glx/glxscreens.c
	hw/xnest/Screen.c
	render/glyph.c
	render/glyphstr.h
	render/render.c
2007-10-25 12:19:30 -04:00
Eric Anholt
4b14c9a9cd Replace calls to Glyphs screen hook with CompositeGlyphs and remove dead code.
Not all of the DDX/miext Glyphs hook implementations have been removed, but
they should be.
2007-10-19 16:34:54 -07:00
Eamon Walsh
4017d31902 devPrivates rework: since API is already broken, switch everything
over to new system.

Need to update documentation and address some remaining vestiges of
old system such as CursorRec structure, fb "offman" structure, and
FontRec privates.
2007-08-28 09:28:25 -04:00
Carl Worth
0a71e1542a Create a Picture as well as a Pixmap at the time of AllocateGlyph
This avoids some inefficiency in creating a temporary Picture
for every glyph at rendering time. My measurements with an i965
showed the previous patch causing a 10-15% slowdown for NoAccel
and XAA cases, (while providing an 18% speedup for EXA).

With this change, the NoAccel and XAA performance regression is
eliminated, and the overall EXA speedup, (before any of the
glyphs-as-pixmaps work), is now 32%.
2007-08-02 22:49:56 -07:00
Carl Worth
a2af34d5a8 Use per-screen Pixmaps for glyphs
Instead of system-memory data which prevents accelerated
compositing of glyphs, (at least without forcing an upload
of the glyph data before compositing).
2007-08-02 22:49:56 -07:00
Carl Worth
19b3b1fd8f Use strong hash (SHA1) for glyphs
Using a cryptographically strong hash means that comparing the
hash alone is sufficient for determining glyph equality (no need
to compare the glyph bits directly). This will allow us to replace
system-memory copies of the glyph bits, (which we've only been
holding onto for comparisons), with Pixmaps.
2007-08-02 22:49:56 -07:00
Carl Worth
516b96387b ProcRenderAddGlyphs: Avoid allocating a glyph just to find it cached
This is a cleanup without any real savings (yet). Previously, the
implementation would allocate a new glyph, then (often) find it in
the cache, and immediately discard the allocated object. This
re-organization first uses a new FindGlyphByHash function and only
allocates the glyph if nothing is found.

This isn't a real savings yet, since FindGlyphByHash currently still
does a temporary glyph allocation, but this is expected to be replaced
immediately as we switch to an alternate hashing mechanism (SHA1).
2007-08-02 22:49:56 -07:00
Carl Worth
4c6abe1c7c Split HashGlyph functionality out into HashGlyphInfoAndBits
This is in preparation for a future change that will take advantage
of being able to compute a hash for a separate xGlyphInfo and chunk
of bits without a combined Glyph object.
2007-08-02 22:49:56 -07:00
Stefan Huehner
1f6741db19 Bug #10560: Code-Cleanup: function declarations () -> (void)
X.Org Bugzilla #10560: <https://bugs.freedesktop.org/show_bug.cgi?id=10560>
Patch #9511 <https://bugs.freedesktop.org/attachment.cgi?id=9511>
2007-04-09 14:33:15 -07:00
Adam Jackson
9a0f25de7c Static cleanups, dead code deletion. 2007-03-25 12:27:01 -04:00
Adam Jackson
0aaac95b0d Remove RCS tags. Fix Xprint makefile braindamage. 2006-07-21 17:56:00 -04:00
Eric Anholt
601ab861b4 Add glyph privates for Xgl, which uses them to implement a glyph cache. EXA
would probably also like to do this. This breaks module ABI for EXA and
    XAA, and likely breaks proprietary drivers as well.
2006-01-03 22:06:23 +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
9b1debcdb6 Change all misc.h and os.h references to <X11/foo.h>. 2005-07-01 22:43:43 +00:00
Markus Kuhn
44f4713a05 Encoding of numerous files changed to UTF-8 2004-12-04 00:43:13 +00:00
Kevin E Martin
7976ee51af Add Distributed Multihead X (DMX) support 2004-06-30 20:06:56 +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