Commit Graph

42 Commits

Author SHA1 Message Date
Alan Coopersmith
23e83724df Fix spelling/wording issues
Most (but not all) of these were found by using
  codespell --builtin clear,rare,usage,informal,code,names
but not everything reported by that was fixed.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-07-05 13:07:33 -07:00
Adam Richter
9d25408a59 assert(a && b) --> assert(a); assert(b)
Separate each statement of the form "assert(a && b);" into "assert(a);"
and "assert(b);" for more precise diagnostics, except for this clever
use in drmmode_display.c where it was used to pass a hint to developers:

	assert(num_infos <= 32 && "update return type");
2019-05-02 15:02:36 -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
Dave Airlie
1f0e8bd5eb api: rework the X server driver API to avoid global arrays.
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-06-05 13:22:18 +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
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
Michel Dänzer
8754db77d8 EXA: Don't defragment offscreen memory at allocation time.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24300 .

Offscreen memory allocation can occur from various places, and apparently
doing defragmentation from at least some of them can confuse some driver
acceleration code.

There's still the regular background defragmentation in the WakeupHandler,
which should manage to keep fragmentation at a reasonable level.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-30 08:37:06 -08:00
Maarten Maathuis
a54c23fe64 exa: s/PixmapIsOffscreen/PixmapHasGpuCopy and s/pExaPixmap->offscreen/pExaPixmap->use_gpu_copy
- Fixup some variable names as well.

Signed-off-by: Maarten Maathuis <madman2003@gmail.com>
Acked-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-28 12:44:58 -08:00
Michel Dänzer
4addfcd633 EXA: Allocate from the end of free offscreen memory rather than from the start.
This way we don't always need to scan over previously allocated areas when
looking for an available one, and there might be less fragmentation.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-05-18 17:53:35 +02:00
Michel Dänzer
510cbd43cd EXA: Defragment offscreen memory.
At most once per second, under the following circumstances:

* We can't satisfy an offscreen memory allocation, but there seems to be enough
  offscreen memory available in total.

or

* The server has been idle for at least 100ms, and there is more than one
  available offscreen area.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-05-18 17:48:57 +02:00
Dave Airlie
9d684ba0bc exa: avoid offscreen pixmap swapped out flag for driver pixmaps 2009-04-23 11:42:53 +10:00
Michel Dänzer
de022f8e63 Revert "EXA: Handle separate alpha maps properly in Composite fallback."
This reverts commit 170cf1270d.

Conflicts:

	exa/exa_render.c
2009-02-27 16:37:27 +01:00
Michel Dänzer
170cf1270d EXA: Handle separate alpha maps properly in Composite fallback.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 .

As this can't work without new EXA_PREPARE_AUX* indices, this requires a major
version bump, so we can also drop the UploadToScratch driver hook and
ExaOffscreenSwap*(). So this also fixes
http://bugs.freedesktop.org/show_bug.cgi?id=20213 .

Moreover, introduce EXA_DRIVER_KNOWN_MAJOR to break compilation of drivers
which may not be able to handle EXA_PREPARE_AUX*, giving instructions how to
make them build again in the #error message.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
2009-02-24 09:22:09 +01: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
31285d063e Make visible symbols required by xorg modules.
This patch exports all symbols required by the compilable
(in a x86 linux computer) xorg/driver/* modules.
  Still missing symbols worth mentioning are:

sunleo
	miFindMaxBand no longer available

intel	(uxa/uxa-accel.c)
	fbShmPutImage no longer available (and should have been static)

mga
	MGAGetClientPointer (should come from matrox's libhal)

  This is not a definitive "visibility" patch, as all it does is to
export missing symbols, but the modules that current don't compile,
may require more symbols once fixed, and third party drivers should
also require more symbols exported.
  A "definitive" patch should export symbols defined in the sdk.
2008-11-28 01:55:11 -02:00
Michel Dänzer
6c95fae1e9 EXA: Offscreen memory eviction improvements.
* Make sure available areas are considered to have no eviction cost. This seems
  to help for https://bugs.freedesktop.org/show_bug.cgi?id=15513 but I'm afraid
  that may just be coincidence.
* Only calculate eviction cost of each area once for each eviction pass.
  Safeguard against potential (though unlikely) division by zero.
* Cosmetic enhancements: Name eviction cost related variables 'cost' instead of
  'score' to emphasize that smaller values are better, update Doxygen file
  comment to the way eviction works now.
2008-04-21 10:45:11 +02:00
Fredrik Höglund
8074676d2d EXA: Optimize the eviction scanning loop in exaOffscreenAlloc.
Reduce the cost of the inner loop, by keeping a set of pointers to the
first and the last areas in the series, subtracting the cost of the first
area from the score, and adding the cost of the last area while walking
the list.  This commit also moves the scanning loop from exaOffscreenAlloc
into a separate function.

Idea by Michel Dänzer.
2008-03-31 21:24:59 +02:00
Fredrik Höglund
93d876891d EXA: Improve the algorithm used for tracking offscreen pixmap use.
Replace the current score keeping algorithm with a rolling counter that's
incremented in ExaOffscreenMarkUsed, with the previous value being stored
in the area.  exaOffscreenAlloc uses the difference between the counter
value and the value in the area when deciding which area to evict.
It now also takes the size of the areas into account, and favors evicting
smaller areas.

The credit for these ideas goes to Michel Dänzer.
2008-03-31 21:15:50 +02:00
Dodji Seketeli
2a75c77497 ExaOffscreenMarkUsed: Don't crash when there's no offscreen memory. 2007-07-03 11:00:29 +02:00
Michel Dänzer
3c91a993e8 EXA: Fix OffscreenValidate build with DEBUG_OFFSCREEN enabled. 2007-04-29 23:49:41 +02:00
Michel Dänzer
d3f8667341 EXA: Fix exaEnableDisableFBAccess for nested disables and enables. 2007-04-29 23:44:27 +02:00
Eric Anholt
7a12952fd4 Bug #7639: Only swap out pixmaps (rather than everything) on VT switch in EXA.
This is a new behavior for version 2.1 of EXA, and only takes effect if the
driver has requested that.  Otherwise, the previous behavior remains the same.
2007-01-24 13:34:58 -08:00
Michel Dänzer
4334860e69 Merge branch 'master' into exa-damagetrack
Conflicts:

	exa/exa_accel.c
	exa/exa_migration.c
2006-12-19 16:29:26 +01:00
Eric Anholt
6aaf0e5b58 Add options to disable EXA acceleration for Composite/UTS/DFS, and always print
out how much memory EXA is managing for offscreen pixmaps.
2006-06-18 19:47:51 -07:00
Michel Dänzer
f9f33b72e3 Track per-drawable damage to minimize UTS and DFS transfers.
Based on work by Eric Anholt.
2006-06-12 20:19:11 +02:00
Eric Anholt
f480dc797b Revert mistaken commit to exa_unaccel.c. Should have been to
exa_offscreen.c: Correct a typo in debug-only offscreen validation
    code. (Wang Zhenyu)
2006-03-31 19:25:42 +00:00
Eric Anholt
ab35c3fbc1 Do a first pass of doxygen documentation of EXA. This removes the
corresponding pieces of exa-driver.txt, which were becoming stale.
    Hopefully the documentation will stay much more up-to-date this way.
    Many thanks to jbarnes for writing exa-driver.txt which was used a lot
    in writing this documentation.
2006-03-09 23:18:15 +00:00
Eric Anholt
2822cbc1fb Rearrange EXA driver structures so that there's a hope of maintaining ABI
when extending the driver interface. The card and accel structures are
    merged into the ExaDriverRec, which is to be allocated using
    exaDriverAlloc(). The driver structure also grows exa_major and
    exa_minor, which drivers fill in and have checked by EXA
    (double-checking that the driver really did check that the EXA version
    was correct). Removes exaInitCard(), which is replaced by the driver
    filling in the rec by hand, and the exaGetVersion() and related
    EXA_*VERSION which are replaced by always using the XFree86 loadable
    module versioning.
2006-03-09 06:04:07 +00:00
Eric Anholt
dc0354104c Move EXA implementation up to the top level and remove its XFree86
dependencies. It was nearly abstract enough already to be used by
    multiple DDXes. This will be useful for EXA development through
    providing a fake acceleration implementation within Xephyr, so that
    testing can be done on new EXA code without worrying about buggy
    drivers.
2006-02-16 00:14:11 +00:00
Alan Coopersmith
d6337c8324 <sys/limits.h> -> <limits.h> so we can compile on non-BSD OS'es 2006-02-11 17:42:31 +00:00
Eric Anholt
c3d1403672 Remove libcwrapper usage from xorg server modules. The libcwrapper is only
of (marginal) use in the drivers, and that usage remains.
2006-02-10 22:00:30 +00:00
Eric Anholt
3366b68365 Rearrange and rename EXA code to be a bit more logically organized. Also
removes a little bit of debugging leftovers. Summary:
exa.c -> exa.c (miscellaneous code) exa_accel.c (all acceleration code)
    exa_migration.c (migration logic) exaasync.c -> exa_unaccel.c (software
    fallbacks) exapict.c -> exa_render.c (render extension stuff)
    exaoffscreen.c -> exa_offscreen.c exaPriv.h -> exa_priv.h
2006-02-02 20:09:14 +00:00
Benjamin Herrenschmidt
35a767590e Fix stupid mistake in yesterday's allocator commit, would cause exa to
consider a random available memory size
2005-10-13 01:13:58 +00:00
Benjamin Herrenschmidt
12994b9afb Fix a couple of bugs in the offscreen allocator. One mostly harmless was
causing our search loop for evictable blocks to possibly skip a good
    candiate, and another was the allocator would occasionally use
    area->offset as if it was the base of the pixmap, while for a pixmap
    that is not in available state, it is not. This caused some funny
    miscalculation leading to overlapping pixmaps and accesses beyond the
    end of the framebuffer. To make things cleared, I renamed save_offset
    to base_offset, made sure it's the one used everywhere in the
    allocator, and only align "offset" for the client at the end of
    exaOffscreenAlloc().
2005-10-11 23:11:37 +00:00
Adam Jackson
aa74468aa5 sparse cleanups. s/0/NULL/ and mark a few things static. 2005-09-30 02:03:45 +00:00
Eric Anholt
361a9eb953 - Change migration-in rule slightly: previously, if your score was less
than the max, it was bumped, and then if you were above the threshhold
    you got moved in. Instead, do the above-threshhold check separate from
    score starting out less than max. While this will likely make thrashing
    cases worse, I hope it will fix some issues with long term performance
    (think of an xcompmgr with a backbuffer it's doing only accelerated
    operations to. If some new pixmap comes in and bumps it out, even once,
    it will never get a chance to re-migrate because its score will be
    maxed). Change migration-out to be the same way for symmetry, though it
    shouldn't ever affect anything.
- Fix a lot of debugging output, both in terms of printing quality, and
    completeness. The fallback debugging covers a lot more now, pointing
    out new areas for improvement. Debugging toggles are now centralized in
    exaPriv.h.
2005-09-21 10:27:53 +00:00
Eric Anholt
2261710fe0 Fix a bug where NULL could be dereferenced during the pixmap kick-out
process by referencing the correct offscreen area. Also drive-by the
    comments related to these for clarity.
2005-08-24 23:38:25 +00:00
Eric Anholt
ebedc8bbb5 - Fix the exa pixmap offset/pitch alignment to deal with non-POT alignment
requirements. MGA, notably, uses a multiple of 3 in some cases.
- Rename the pixmap offset/pitch alignment fields to more clearly state
    their meaning.
2005-08-14 19:46:55 +00:00
Zack Rusin
3c92389185 Patch from Thomas Winischhofer to kick out all pixmaps to system ram upon a
VT switch and vice versa when returning.
2005-07-09 14:15:35 +00:00
Zack Rusin
aabb868920 removing all debugging output from the default build :) 2005-07-01 13:30:29 +00:00
Zack Rusin
0fa9d1fb48 Leave debugging output for only the interested parties. 2005-07-01 12:24:30 +00:00
Zack Rusin
30c019e847 Adding the new acceleration architecture: Exa. It's meant to replace XAA in
the coming months.
2005-07-01 08:56:12 +00:00